import sources

This commit is contained in:
Adam Samalik 2023-05-16 09:45:27 +02:00
parent 92f9bd9823
commit cf8384166e
4 changed files with 209 additions and 118 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/antlr-2.7.7.tar.gz SOURCES/antlr-2.7.7.tar.gz
/antlr-2.7.7.tar.gz

View File

@ -60,7 +60,8 @@
version="true" version="true"
packagenames="${packagenames}" packagenames="${packagenames}"
splitindex="true" splitindex="true"
use="true"> use="true"
additionalparam="-Xdoclint:none">
<link href="${j2se.apidoc}"/> <link href="${j2se.apidoc}"/>
</javadoc> </javadoc>
</target> </target>

View File

@ -1,36 +1,47 @@
%bcond_without doxygen
%bcond_without python
%global debug_package %{nil} %global debug_package %{nil}
# since we have only a static library # since we have only a static library
Summary: ANother Tool for Language Recognition Summary: ANother Tool for Language Recognition
Name: antlr Name: antlr
Version: 2.7.7 Version: 2.7.7
Release: 30%{?dist} Release: 56%{?dist}
Epoch: 0 Epoch: 0
License: Public Domain License: ANTLR-PD
URL: http://www.antlr.org/ URL: http://www.antlr2.org/
Group: Development/Tools # ./generate-tarball.sh
Source0: http://www.antlr2.org/download/antlr-%{version}.tar.gz Source0: antlr-%{version}.tar.gz
Source1: %{name}-build.xml Source1: %{name}-build.xml
Source2: %{name}-script Source2: %{name}-script
Source3: http://repo2.maven.org/maven2/%{name}/%{name}/%{version}/%{name}-%{version}.pom Source3: http://repo2.maven.org/maven2/antlr/antlr/%{version}/%{name}-%{version}.pom
# Repack the tarball without prebuilt binaries of unknown origin
Source4: generate-tarball.sh
Patch1: %{name}-%{version}-newgcc.patch Patch1: %{name}-%{version}-newgcc.patch
# see BZ#848662 # see BZ#848662
Patch2: antlr-examples-license.patch Patch2: antlr-examples-license.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%ifarch %ix86 x86_64 ia64 armv4l sparcv9 alpha s390x ppc ppc64 %ifarch %{mono_arches}
%if ! 0%{?rhel} >= 6 %if ! 0%{?rhel} >= 6
BuildRequires: mono-core BuildRequires: mono-core
BuildRequires: mono-winforms BuildRequires: mono-winforms
%endif %endif
%endif %endif
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: ant BuildRequires: ant
BuildRequires: java-javadoc
BuildRequires: jpackage-utils
BuildRequires: java-devel >= 1:1.7.0 BuildRequires: java-devel >= 1:1.7.0
BuildRequires: java-javadoc
Requires: jpackage-utils BuildRequires: javapackages-local
Requires: java >= 1:1.7.0 %if %{with doxygen}
BuildRequires: doxygen graphviz
%endif
%if %{with python}
# Do not support Python3
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif
%description %description
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
@ -40,12 +51,11 @@ C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers]. parsers].
%package tool %package tool
Group: Development/Tools
Summary: ANother Tool for Language Recognition Summary: ANother Tool for Language Recognition
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release} # Explicit requires for javapackages-tools since antlr-script
Requires: jpackage-utils # uses /usr/share/java-utils/java-functions
Requires: java >= 1:1.7.0 Requires: javapackages-tools
BuildArch: noarch BuildArch: noarch
%description tool %description tool
@ -56,7 +66,6 @@ C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers]. parsers].
%package manual %package manual
Group: Development/Tools
Summary: Manual for %{name} Summary: Manual for %{name}
BuildArch: noarch BuildArch: noarch
@ -64,7 +73,6 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%package javadoc %package javadoc
Group: Documentation
Summary: Javadoc for %{name} Summary: Javadoc for %{name}
BuildArch: noarch BuildArch: noarch
@ -72,32 +80,36 @@ BuildArch: noarch
Javadoc for %{name}. Javadoc for %{name}.
%package C++ %package C++
Group: Development/Libraries
Summary: C++ bindings for antlr2 generated parsers Summary: C++ bindings for antlr2 generated parsers
Provides: antlr-static = %{version}-%{release} Provides: antlr-static = %{version}-%{release}
%description C++ %description C++
This package provides a static C++ library for parsers generated by ANTLR2. This package provides a static C++ library for parsers generated by ANTLR2.
%if %{with doxygen}
%package C++-doc %package C++-doc
Group: Documentation
Summary: Documentation for C++ bindings for antlr2 generated parsers Summary: Documentation for C++ bindings for antlr2 generated parsers
BuildRequires: doxygen
BuildArch: noarch BuildArch: noarch
%description C++-doc %description C++-doc
This package contains the documentation for the C++ bindings for parsers This package contains the documentation for the C++ bindings for parsers
generated by ANTLR2. generated by ANTLR2.
%endif
%if %{with python}
%package -n python2-%{name}
Summary: Python 2 runtime support for ANTLR-generated parsers
%{?python_provide:%python_provide python2-%{name}}
# This can be removed in Fedora 30
Provides: %{name}-python = %{version}-%{release}
Obsoletes: %{name}-python < 2.7.7-48
%package python
Group: Development/Libraries
Summary: Python runtime support for ANTLR-generated parsers
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
BuildArch: noarch BuildArch: noarch
%description python %description -n python2-%{name}
Python runtime support for ANTLR-generated parsers Python runtime support for ANTLR-generated parsers
%endif
%prep %prep
%setup -q %setup -q
@ -109,112 +121,189 @@ cp -p %{SOURCE1} build.xml
# CRLF->LF # CRLF->LF
sed -i 's/\r//' LICENSE.txt sed -i 's/\r//' LICENSE.txt
# set jar location
%mvn_file %{name}:%{name} %{name}
%build %build
ant -Dj2se.apidoc=%{_javadocdir}/java ant -Dj2se.apidoc=%{_javadocdir}/java
cp work/lib/antlr.jar . # make expects to find it here # make expects to find it here
cp work/lib/antlr.jar .
export CLASSPATH=. export CLASSPATH=.
%configure --without-examples %configure --without-examples
make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1 make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1
rm antlr.jar # no longer needed # no longer needed
rm antlr.jar
# fix doc permissions and remove Makefiles # fix doc permissions and remove Makefiles
rm doc/{Makefile,Makefile.in} rm doc/{Makefile,Makefile.in}
chmod 0644 doc/* chmod 0644 doc/*
%if %{with doxygen}
# generate doxygen docs for C++ bindings # generate doxygen docs for C++ bindings
pushd lib/cpp pushd lib/cpp
doxygen doxygen.cfg doxygen doxygen.cfg
find gen_doc -type f -exec chmod 0644 {} \; find gen_doc -type f -exec chmod 0644 {} \;
popd popd
%endif
%if %{with python}
# build python # build python
cd lib/python cd lib/python
%{__python} setup.py build %py2_build
cd ../../ cd ../../
%endif
%install %install
rm -rf $RPM_BUILD_ROOT # jars, POM and depmap
%mvn_artifact %{SOURCE3} work/lib/%{name}.jar
%mvn_alias %{name}:%{name} %{name}:%{name}all
%mvn_install -J work/api
mkdir -p $RPM_BUILD_ROOT{%{_includedir}/%{name},%{_libdir},%{_bindir}} mkdir -p $RPM_BUILD_ROOT{%{_includedir}/%{name},%{_libdir},%{_bindir}}
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p work/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# script # script
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr
# C++ lib and headers # C++ lib and headers, antlr-config
install -p -m 644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{_includedir}/%{name} install -p -m 644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{_includedir}/%{name}
install -p -m 644 lib/cpp/src/libantlr.a $RPM_BUILD_ROOT%{_libdir} install -p -m 644 lib/cpp/src/libantlr.a $RPM_BUILD_ROOT%{_libdir}
install -p -m 755 scripts/antlr-config $RPM_BUILD_ROOT%{_bindir}
# javadoc %if %{with python}
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr work/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# python # python
cd lib/python cd lib/python
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %py2_install
cd ../.. cd ../..
%endif
# POM and depmap
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap -a antlr:antlrall
%clean %files tool -f .mfiles
rm -rf $RPM_BUILD_ROOT %license LICENSE.txt
%files tool
%defattr(-,root,root,-)
%doc LICENSE.txt
%{_javadir}/%{name}*.jar
%{_bindir}/antlr %{_bindir}/antlr
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
# this is actually a development package for the C++ target # this is actually a development package for the C++ target
# as we ship only a static library, it doesn't make sense # as we ship only a static library, it doesn't make sense
# to have a separate -devel package for the headers # to have a separate -devel package for the headers
%files C++ %files C++
%defattr(-,root,root,-) %license LICENSE.txt
%{_includedir}/%{name} %{_includedir}/%{name}
%{_libdir}/libantlr.a %{_libdir}/libantlr.a
%{_bindir}/antlr-config
%if %{with doxygen}
%files C++-doc %files C++-doc
%defattr(-,root,root,-) %license LICENSE.txt
%doc lib/cpp/gen_doc/html/ %doc lib/cpp/gen_doc/html/
%endif
%files manual %files manual
%defattr(-,root,root,-) %license LICENSE.txt
%doc doc/* %doc doc/*
%files javadoc %files javadoc -f .mfiles-javadoc
%defattr(-,root,root,-) %license LICENSE.txt
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}
%files python %if %{with python}
%defattr(-,root,root,-) %files -n python2-%{name}
%{python_sitelib}/antlr/* %license LICENSE.txt
%{python_sitelib}/antlr-* %{python2_sitelib}/antlr/*
%{python2_sitelib}/antlr-*
%endif
%changelog %changelog
* Fri Mar 14 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-30 * Mon Jul 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 0:2.7.7-56
- Don't install antlr-config script - Add explicit requirement of javapackages-tools.
- Resolves: rhbz#1076406
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 02.7.7-29 * Tue Jul 24 2018 Michael Simacek <msimacek@redhat.com> - 0:2.7.7-55
- Mass rebuild 2014-01-24 - Repack the tarball without binaries
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 02.7.7-28 * Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-54
- Mass rebuild 2013-12-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-27 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-53
- Rebuild to regenerate API documentation - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
- Resolves: CVE-2013-1571
* Tue Nov 7 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-52
- Switch to new license tag: ANTLR-PD
* Sat Sep 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-51
- Conditionally allow building without C++ docs
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-49
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Jul 12 2017 Miro Hrončok <mhroncok@redhat.com> - 0:2.7.7-48
- Proper python2 subpackage name
* Thu Feb 16 2017 Michael Simacek <msimacek@redhat.com> - 0:2.7.7-47
- Add conditional for python
* Wed Feb 15 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-46
- Generalize requires on python2 packages
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-45
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jan 31 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-44
- Add missing build-requires on GCC
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-43
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Tue Mar 01 2016 gil cattaneo <puntogil@libero.it> 0:2.7.7-42
- fix URL field (rhbz#1313275)
* Mon Feb 29 2016 gil cattaneo <puntogil@libero.it> 0:2.7.7-41
- use python macros
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Oct 02 2015 gil cattaneo <puntogil@libero.it> 0:2.7.7-39
- adapt to current guideline
- remove some rpmlint problems
- disable javadoc doclint
- introduce license macro
* Fri Aug 21 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 0:2.7.7-38
- use %%{mono_archs} instead of hardcoding list (rhbz#1255726)
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Apr 24 2015 Orion Poplawski <orion@cora.nwra.com> - 0:2.7.7-36
- Rebuild for gcc 5 C++11 ABI again
* Sun Feb 22 2015 Orion Poplawski <orion@cora.nwra.com> - 0:2.7.7-35
- Rebuild for gcc 5 C++11 ABI
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.7.7-33
- Change python-setuptools-devel BR into python-setuptools.
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 21 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-31
- Use .mfiles generated during build
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:2.7.7-30
- Use Requires: java-headless rebuild (#1067528)
* Mon Nov 11 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:2.7.7-29
- Do not install versioned jar (#1022080)
- Install LICENSE files in each independent subpackage
- Minor spec cleanups
* Fri Nov 08 2013 Marek Goldmann <mgoldman@redhat.com> - 0:2.7.7-28
- Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-26 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

View File

@ -1 +1 @@
SHA1 (antlr-2.7.7.tar.gz) = 802655c343cc7806aaf1ec2177a0e663ff209de1 SHA512 (antlr-2.7.7.tar.gz) = 7e05d440513663dab1960974ac61694552583bdd20d6eac2bff27f5142b118a26022d910b44312cdac9164b087c7cd4d1c8325e1ec914f9704b3cdd5f4b2b166