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
/antlr-2.7.7.tar.gz

View File

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

View File

@ -1,36 +1,47 @@
%bcond_without doxygen
%bcond_without python
%global debug_package %{nil}
# since we have only a static library
Summary: ANother Tool for Language Recognition
Name: antlr
Version: 2.7.7
Release: 30%{?dist}
Epoch: 0
License: Public Domain
URL: http://www.antlr.org/
Group: Development/Tools
Source0: http://www.antlr2.org/download/antlr-%{version}.tar.gz
Source1: %{name}-build.xml
Source2: %{name}-script
Source3: http://repo2.maven.org/maven2/%{name}/%{name}/%{version}/%{name}-%{version}.pom
Patch1: %{name}-%{version}-newgcc.patch
Summary: ANother Tool for Language Recognition
Name: antlr
Version: 2.7.7
Release: 56%{?dist}
Epoch: 0
License: ANTLR-PD
URL: http://www.antlr2.org/
# ./generate-tarball.sh
Source0: antlr-%{version}.tar.gz
Source1: %{name}-build.xml
Source2: %{name}-script
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
# see BZ#848662
Patch2: antlr-examples-license.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Patch2: antlr-examples-license.patch
%ifarch %ix86 x86_64 ia64 armv4l sparcv9 alpha s390x ppc ppc64
%ifarch %{mono_arches}
%if ! 0%{?rhel} >= 6
BuildRequires: mono-core
BuildRequires: mono-winforms
BuildRequires: mono-core
BuildRequires: mono-winforms
%endif
%endif
BuildRequires: ant
BuildRequires: java-javadoc
BuildRequires: jpackage-utils
BuildRequires: java-devel >= 1:1.7.0
Requires: jpackage-utils
Requires: java >= 1:1.7.0
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: ant
BuildRequires: java-devel >= 1:1.7.0
BuildRequires: java-javadoc
BuildRequires: javapackages-local
%if %{with doxygen}
BuildRequires: doxygen graphviz
%endif
%if %{with python}
# Do not support Python3
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif
%description
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
@ -39,65 +50,66 @@ compilers, and translators from grammatical descriptions containing
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers].
%package tool
Group: Development/Tools
Summary: ANother Tool for Language Recognition
Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release}
Requires: jpackage-utils
Requires: java >= 1:1.7.0
BuildArch: noarch
%package tool
Summary: ANother Tool for Language Recognition
Provides: %{name} = %{version}-%{release}
# Explicit requires for javapackages-tools since antlr-script
# uses /usr/share/java-utils/java-functions
Requires: javapackages-tools
BuildArch: noarch
%description tool
%description tool
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
language tool that provides a framework for constructing recognizers,
compilers, and translators from grammatical descriptions containing
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
parsers].
%package manual
Group: Development/Tools
Summary: Manual for %{name}
BuildArch: noarch
%package manual
Summary: Manual for %{name}
BuildArch: noarch
%description manual
%description manual
Documentation for %{name}.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
BuildArch: noarch
%package javadoc
Summary: Javadoc for %{name}
BuildArch: noarch
%description javadoc
%description javadoc
Javadoc for %{name}.
%package C++
Group: Development/Libraries
Summary: C++ bindings for antlr2 generated parsers
Provides: antlr-static = %{version}-%{release}
%package C++
Summary: C++ bindings for antlr2 generated parsers
Provides: antlr-static = %{version}-%{release}
%description C++
%description C++
This package provides a static C++ library for parsers generated by ANTLR2.
%package C++-doc
Group: Documentation
Summary: Documentation for C++ bindings for antlr2 generated parsers
BuildRequires: doxygen
BuildArch: noarch
%if %{with doxygen}
%package C++-doc
Summary: Documentation for C++ bindings for antlr2 generated parsers
BuildArch: noarch
%description C++-doc
%description C++-doc
This package contains the documentation for the C++ bindings for parsers
generated by ANTLR2.
%endif
%package python
Group: Development/Libraries
Summary: Python runtime support for ANTLR-generated parsers
BuildRequires: python2-devel
BuildRequires: python-setuptools-devel
BuildArch: noarch
%if %{with python}
%package -n python2-%{name}
Summary: Python 2 runtime support for ANTLR-generated parsers
%{?python_provide:%python_provide python2-%{name}}
%description python
# This can be removed in Fedora 30
Provides: %{name}-python = %{version}-%{release}
Obsoletes: %{name}-python < 2.7.7-48
BuildArch: noarch
%description -n python2-%{name}
Python runtime support for ANTLR-generated parsers
%endif
%prep
%setup -q
@ -109,112 +121,189 @@ cp -p %{SOURCE1} build.xml
# CRLF->LF
sed -i 's/\r//' LICENSE.txt
# set jar location
%mvn_file %{name}:%{name} %{name}
%build
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=.
%configure --without-examples
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
rm doc/{Makefile,Makefile.in}
chmod 0644 doc/*
%if %{with doxygen}
# generate doxygen docs for C++ bindings
pushd lib/cpp
doxygen doxygen.cfg
find gen_doc -type f -exec chmod 0644 {} \;
doxygen doxygen.cfg
find gen_doc -type f -exec chmod 0644 {} \;
popd
%endif
%if %{with python}
# build python
cd lib/python
%{__python} setup.py build
%py2_build
cd ../../
%endif
%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}}
# 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
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/src/libantlr.a $RPM_BUILD_ROOT%{_libdir}
install -p -m 755 scripts/antlr-config $RPM_BUILD_ROOT%{_bindir}
# javadoc
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}
%if %{with python}
# python
cd lib/python
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%py2_install
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
rm -rf $RPM_BUILD_ROOT
%files tool
%defattr(-,root,root,-)
%doc LICENSE.txt
%{_javadir}/%{name}*.jar
%files tool -f .mfiles
%license LICENSE.txt
%{_bindir}/antlr
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
# this is actually a development package for the C++ target
# as we ship only a static library, it doesn't make sense
# to have a separate -devel package for the headers
%files C++
%defattr(-,root,root,-)
%license LICENSE.txt
%{_includedir}/%{name}
%{_libdir}/libantlr.a
%{_bindir}/antlr-config
%if %{with doxygen}
%files C++-doc
%defattr(-,root,root,-)
%license LICENSE.txt
%doc lib/cpp/gen_doc/html/
%endif
%files manual
%defattr(-,root,root,-)
%license LICENSE.txt
%doc doc/*
%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%files python
%defattr(-,root,root,-)
%{python_sitelib}/antlr/*
%{python_sitelib}/antlr-*
%if %{with python}
%files -n python2-%{name}
%license LICENSE.txt
%{python2_sitelib}/antlr/*
%{python2_sitelib}/antlr-*
%endif
%changelog
* Fri Mar 14 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-30
- Don't install antlr-config script
- Resolves: rhbz#1076406
* Mon Jul 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 0:2.7.7-56
- Add explicit requirement of javapackages-tools.
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 02.7.7-29
- Mass rebuild 2014-01-24
* Tue Jul 24 2018 Michael Simacek <msimacek@redhat.com> - 0:2.7.7-55
- Repack the tarball without binaries
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 02.7.7-28
- Mass rebuild 2013-12-27
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-54
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-27
- Rebuild to regenerate API documentation
- Resolves: CVE-2013-1571
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.7-53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* 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
- 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