- Use original upstream tarball, prebuilt jars are anyway removed in %%prep

- Don't overuse macros
- Added explanation about headers in the C++ subpackage
- Remove unnecessary Makefile and Makefile.in from %%docs, permissions
    fixed
- Added doxygen docs for C++ as a -C++-doc subpackage
- antlr-config moved into the C++ subpackage
- Removed %%post and %%postun javadoc relicts from JPackage
This commit is contained in:
Miloš Jakubíček 2010-04-29 20:48:03 +00:00
parent 128afbd32e
commit 07b0a4f6c7
3 changed files with 45 additions and 22 deletions

View File

@ -1 +1 @@
antlr-2.7.7-RHCLEAN.tar.gz
antlr-2.7.7.tar.gz

View File

@ -4,13 +4,12 @@
Summary: ANother Tool for Language Recognition
Name: antlr
Version: 2.7.7
Release: 9%{?dist}
Release: 10%{?dist}
Epoch: 0
License: Public Domain
URL: http://www.antlr.org/
Group: Development/Tools
#http://www.antlr.org/download/antlr-%{version}.tar.gz
Source0: antlr-%{version}-RHCLEAN.tar.gz
Source0: http://www.antlr2.org/download/antlr-%{version}.tar.gz
Source1: %{name}-build.xml
Source2: %{name}-script
Patch1: %{name}-%{version}-newgcc.patch
@ -72,13 +71,24 @@ Provides: antlr-static = %{version}-%{release}
%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
%description C++-doc
This package contains the documentation for the C++ bindings for parsers
generated by ANTLR2.
%prep
%setup -q
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
cp -p %{SOURCE1} build.xml
%patch1
# CRLF->LF
sed -i 's/\r//' LICENSE.txt
%build
ant -Dj2se.apidoc=%{_javadocdir}/java
@ -86,15 +96,21 @@ cp work/lib/antlr.jar . # make expects to find it here
export CLASSPATH=.
%configure --without-examples
make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1
find . -type f > /tmp/antlr.filelist
rm antlr.jar # no longer needed
# fix doc permissions and remove Makefiles
rm doc/{Makefile,Makefile.in}
chmod 0644 doc/*
# generate doxygen docs for C++ bindings
pushd lib/cpp
doxygen doxygen.cfg
find gen_doc -type f -exec chmod 0644 {} \;
popd
%install
rm -rf $RPM_BUILD_ROOT
%global headers %{_includedir}/%{name}
mkdir -p $RPM_BUILD_ROOT{%{headers},%{_libdir},%{_bindir}}
mkdir -p $RPM_BUILD_ROOT{%{_includedir}/%{name},%{_libdir},%{_bindir}}
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
@ -106,7 +122,7 @@ install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr
# C++ lib and headers, antlr-config
install -p -m 644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{headers}
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}
@ -118,26 +134,24 @@ ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%postun javadoc
if [ $1 -eq 0 ]; then
%{__rm} -f %{_javadocdir}/%{name}
fi
%files tool
%defattr(-,root,root,-)
%doc INSTALL.txt LICENSE.txt
%{_javadir}/%{name}*.jar
%{_bindir}/antlr-config
%{_bindir}/antlr
# 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,-)
%{headers}
%{_includedir}/%{name}
%{_libdir}/libantlr.a
%{_bindir}/antlr-config
%files C++-doc
%defattr(-,root,root,-)
%doc lib/cpp/gen_doc/html/
%files manual
%defattr(-,root,root,-)
@ -149,6 +163,15 @@ fi
%doc %{_javadocdir}/%{name}
%changelog
* Thu Apr 29 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-10
- Use original upstream tarball, prebuilt jars are anyway removed in %%prep
- Don't overuse macros
- Added explanation about headers in the C++ subpackage
- Remove unnecessary Makefile and Makefile.in from %%docs, permissions fixed
- Added doxygen docs for C++ as a -C++-doc subpackage
- antlr-config moved into the C++ subpackage
- Removed %%post and %%postun javadoc relicts from JPackage
* Tue Apr 27 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-9
- Drop native build, alternatives, jedit, gcj bits and other jpackage crap
- Disable debuginfo since we have only a static library.

View File

@ -1 +1 @@
d8052d9409b5f3e9c8e1c41648ae13d1 antlr-2.7.7-RHCLEAN.tar.gz
01cc9a2a454dd33dcd8c856ec89af090 antlr-2.7.7.tar.gz