Skip to content

Commit 8d83d90

Browse files
authored
Build fix for package jlex (#12572)
1 parent dcbc911 commit 8d83d90

6 files changed

Lines changed: 1489 additions & 44 deletions

File tree

SPECS-EXTENDED/jlex/jlex-1.2.6.build.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
deprecation="${compile.deprecation}"
5555
optimize="${compile.optimize}" />
5656

57-
5857
</target>
5958

6059
<!-- ======================== Build JavaDoc =========================== -->
@@ -69,7 +68,7 @@
6968

7069

7170
<!-- ===================== Distribution Files ========================= -->
72-
<target name="dist" depends="package">
71+
<target name="dist" depends="package,javadoc">
7372
<copy todir="${dist.dir}/docs/api">
7473
<fileset dir="${build.dir}/docs/api"/>
7574
</copy>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"Signatures": {
33
"Main.java": "aeebaece3b3a53972bb0ba0f810540386c267070ee9dca6ffa43c6ff74a54bd7",
4-
"jlex-1.2.6.build.xml": "8681e302734a977b195fd28d44aea70c826ef071f0047e0667b142a8137140d0"
4+
"jlex-1.2.6.build.xml": "7589b45e54152eacb12b7a31e1dbb57818ce665fdcfa47ea949079a14c57fa4f",
5+
"manual.html": "f0c045bc635f054de5a19a876eab58e9118dde8d37cee152572cf7dfd5ab05f9",
6+
"sample.lex": "6613558c248a7d2462aea9718ca53ed5639f095988765ef7ce2665ee06dab6c5"
57
}
6-
}
8+
}

SPECS-EXTENDED/jlex/jlex.spec

Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,107 @@
11
Vendor: Microsoft Corporation
22
Distribution: Azure Linux
3+
# Copyright (c) 2000-2005, JPackage Project
4+
# All rights reserved.
35
#
4-
# spec file for package jlex
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
59
#
6-
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
10+
# 1. Redistributions of source code must retain the above copyright
11+
# notice, this list of conditions and the following disclaimer.
12+
# 2. Redistributions in binary form must reproduce the above copyright
13+
# notice, this list of conditions and the following disclaimer in the
14+
# documentation and/or other materials provided with the
15+
# distribution.
16+
# 3. Neither the name of the JPackage Project nor the names of its
17+
# contributors may be used to endorse or promote products derived
18+
# from this software without specific prior written permission.
719
#
8-
# All modifications and additions to the file contributed by third parties
9-
# remain the property of their copyright owners, unless otherwise agreed
10-
# upon. The license for this file, and modifications and additions to the
11-
# file, is the same license as for the pristine package itself (unless the
12-
# license for the pristine package is not an Open Source License, in which
13-
# case the license is the MIT License). An "Open Source License" is a
14-
# license that conforms to the Open Source Definition (Version 1.9)
15-
# published by the Open Source Initiative.
16-
17-
# Please submit bugfixes or comments via http://bugs.opensuse.org/
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1831
#
1932

20-
21-
%define section free
2233
Name: jlex
2334
Version: 1.2.6
24-
Release: 285%{?dist}
35+
Release: 286%{?dist}
2536
Summary: A Lexical Analyzer Generator for Java
26-
License: MIT
27-
Group: Development/Libraries/Java
28-
Url: http://www.cs.princeton.edu/~appel/modern/java/JLex/
29-
Source0: http://www.cs.princeton.edu/~appel/modern/java/JLex/Archive/1.2.5/Main.java
37+
License: BSD
38+
Group: Development/Libraries
39+
URL: http://www.cs.princeton.edu/~appel/modern/java/JLex
40+
Source0: %{url}/Archive/%{version}/Main.java
3041
Source1: %{name}-%{version}.build.xml
42+
Source2: %{url}/Archive/%{version}/manual.html
43+
Source3: %{url}/Archive/%{version}/sample.lex
3144
Patch0: %{name}-%{version}.static.patch
32-
BuildRequires: ant
33-
BuildRequires: java-devel
34-
BuildRequires: javapackages-tools
35-
BuildRequires: xml-commons-apis-bootstrap
36-
#!BuildIgnore: xerces-j2
37-
#!BuildIgnore: xml-commons
38-
#!BuildIgnore: xml-commons-apis
39-
#!BuildIgnore: xml-commons-jaxp-1.3-apis
40-
#!BuildIgnore: xml-commons-resolver
41-
#!BuildIgnore: xml-commons-resolver12
42-
BuildArch: noarch
45+
46+
BuildRequires: ant
47+
BuildRequires: java-devel
48+
BuildRequires: jpackage-utils
49+
50+
Requires: java
51+
Requires: jpackage-utils
52+
53+
BuildArch: noarch
4354

4455
%description
45-
JLex is a lexical analyzer generator for Java.
56+
JLex is a Lexical Analyzer Generator for Java.
57+
58+
%package javadoc
59+
Group: Documentation
60+
Summary: Javadoc for %{name}
61+
Requires: jpackage-utils
62+
63+
%description javadoc
64+
Javadoc for %{name}.
4665

4766
%prep
48-
%setup -q -c -T
67+
%setup -c -T
4968
cp %{SOURCE0} .
69+
cp %{SOURCE2} .
70+
cp %{SOURCE3} .
5071
%patch 0
5172
cp %{SOURCE1} build.xml
5273

5374
%build
54-
unset CLASSPATH
55-
ant -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6
75+
ant
5676

5777
%install
5878
# jar
59-
install -d -m 755 %{buildroot}%{_javadir}
60-
install -m 644 dist/lib/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
61-
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
79+
install -pD -T dist/lib/%{name}.jar \
80+
%{buildroot}%{_javadir}/%{name}.jar
81+
82+
# javadoc
83+
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
84+
cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}
85+
86+
%pre javadoc
87+
# workaround for rpm bug, can be removed in F-17
88+
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
89+
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
6290

6391
%files
64-
%license Main.java
65-
%{_javadir}/*
92+
%defattr(-,root,root,-)
93+
%{_javadir}/%{name}.jar
94+
%doc manual.html sample.lex
95+
96+
%files javadoc
97+
%defattr(-,root,root,-)
98+
%{_javadocdir}/%{name}
6699

67100
%changelog
101+
* Mon Feb 24 2025 Sumit Jena <v-sumitjena@microsoft.com> - 1.2.6-286
102+
- Build fix for 1.2.6
103+
- License verified
104+
68105
* Tue Apr 12 2022 Pawel Winogrodzki <pawelwi@microsoft.com> - 1.2.6-285
69106
- Adding missing BR on 'javapackages-tools'.
70107

0 commit comments

Comments
 (0)