java_cup/java_cup.spec

225 lines
5.6 KiB
RPMSpec

%define pkgver 10k
%define bootstrap 0
%define with_gcj_support 0
Name: java_cup
Version: 0.11a
Release: 4mamba
Summary: CUP Parser Generator for Java
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
URL: http://www2.cs.tum.edu/projects/cup/
#Source0: http://www.cs.princeton.edu/%7Eappel/modern/java/CUP/java_cup_v%{pkgver}.tar.gz
# svn export https://www2.in.tum.de/repos/cup/develop/ java_cup-0.11a
# tar czf java_cup-0.11a.tar.gz java_cup-0.11a
Source0: java_cup-0.11a.tar.gz
Source1: java_cup-build.xml
Source2: java-cup-generated-files.tar.bz2
Source3: java-cup.script
Source4: java_cup-0.11a-pom.xml
#http://jflex.de/
Patch0: cup-ant-task.patch
Patch1: java_cup-0.11a-javadoc.patch
Patch2: java_cup-0.11a-no-classpath-in-manifest.patch
Patch3: java_cup-0.11a-no-cup-no-jflex.patch
Patch4: java_cup-0.11a-classpath.patch
# missing symbolFactory initialization in lr_parser, causes sinjdoc to crash
Patch5: java_cup-0.11a-lr_parser-constructor.patch
License: BSD, LGPL
Requires: coreutils
BuildRequires: apache-ant
%if "%{stage1}" != "1"
BuildRequires: java_cup
BuildRequires: java-jflex143
%endif
BuildRequires: java-gcj-compat
BuildRequires: jpackage-utils
BuildRequires: sinjdoc
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
%{name} is a LALR Parser Generator for Java.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
%{name} is a LALR Parser Generator for Java
This package contains Javadoc for %{name}.
%package manual
Group: Documentation
Summary: Documentation for %{name}.
%description manual
%{name} is a LALR Parser Generator for Java
This package contains documentation for %{name}.
%if %with_gcj_support
%package gcj
Summary: GCJ %{name} support
Group: System/Libraries/Java
BuildRequires: java-gcj-compat
BuildRequires: libgcj4-devel
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: java-gcj-compat
Requires: jpackage-utils
%description gcj
%{name} - CUP Parser Generator for Java.
This package contains GCJ %{name} support.
%endif
%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%if "%{stage1}" == "1"
%setup -q -T -D -a 2 -n %{name}-%{version}
echo "=========== BOOTSTRAP ============"
%patch3 -p1
%else
echo "========== NO BOOTSTRAP ==========="
for j in $(find -name "*.jar"); do
rm -rf $j
done
for c in $(find -name "*.class"); do
rm -rf $c
done
%patch4 -p1
%endif
%patch5 -p1
perl -pi -e 's/1\.2/1.5/g' build.xml
mkdir -p classes
mkdir -p dist
#%patch0 -p0
#install -m 644 %{S:1} build.xml
%build
export JAVA_HOME=%java_home
%if "%{stage1}" == "1"
export CLASSPATH=
%else
export CLASSPATH=$(build-classpath java-cup jflex/jflex)
%endif
export OPT_JAR_LIST=
ant
find . -name parser.cup -exec rm {} \;
ant javadoc
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -m 644 dist/java-cup-11a.jar \
%{buildroot}%{_javadir}/java-cup-%{version}.jar
install -m 644 dist/java-cup-11a-runtime.jar \
%{buildroot}%{_javadir}/java-cup-runtime-%{version}.jar
mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-java_cup.pom
%add_to_maven_depmap java_cup java_cup %{version} JPP java_cup
(
cd %{buildroot}%{_javadir}
for jar in *-%{version}*; do
ln -sf ${jar} ${jar/-%{version}/}
done
ln -sf java-cup-%{version}.jar %{name}.jar
ln -sf java-cup-runtime-%{version}.jar %{name}-runtime.jar
)
mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr dist/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-%{version} %{name})
mkdir -p %{buildroot}%{_bindir}
install -pm 755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}
%if %with_gcj_support
%{_bindir}/aot-compile-rpm
%endif
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(-,root,root)
%{_bindir}/java_cup
%{_javadir}/java-cup-%{version}.jar
%{_javadir}/java-cup-runtime-%{version}.jar
%{_javadir}/java-cup-runtime.jar
%{_javadir}/java-cup.jar
%{_javadir}/java_cup-runtime.jar
%{_javadir}/java_cup.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc changelog.txt
%if %with_gcj_support
%post gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
%{_bindir}/rebuild-gcj-db
fi
%postun gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
%{_bindir}/rebuild-gcj-db
fi
%files gcj
%defattr(-,root,root)
%{_libdir}/gcj/java_cup/java-cup-%{version}.jar.db
%{_libdir}/gcj/java_cup/java-cup-%{version}.jar.so
%{_libdir}/gcj/java_cup/java_cup-runtime-%{version}.jar.db
%{_libdir}/gcj/java_cup/java_cup-runtime-%{version}.jar.so
%endif
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/java_cup-%{version}
%{_javadocdir}/java_cup
%files manual
%defattr(-,root,root)
%doc manual.html
%changelog
* Fri Feb 25 2011 gil <puntogil@libero.it> 0.11a-4mamba
- rebuilt with java-gcj-compat 1.0.80-20mamba support
* Wed Nov 24 2010 gil <puntogil@libero.it> 0.11a-3mamba
- add maven 2 pom
* Mon Jan 11 2010 gil <puntogil@libero.it> 0.11a-2mamba
- rebuilt
* Mon Mar 23 2009 gil <puntogil@libero.it> 0.11a-1mamba
- update to 0.11a
- bootstrap
* Mon Mar 02 2009 gil <puntogil@libero.it> 0.10k-3mamba
- rebuilt
* Mon Mar 02 2009 gil <puntogil@libero.it> 0.10k-2mamba
- rebuilt
* Thu Feb 19 2009 gil <puntogil@libero.it> 0.10k-1mamba
- package created by autospec