Here's a real-world example from the servletapi5 spec file. It currently assumes that we should be using `gcj-dbtool -p`. Comments/suggestions welcome. *** servletapi5.spec 2004-11-04 06:41:06.000000000 -0800 --- servletapi5.spec.new 2005-03-22 14:23:54.964489184 -0800 *************** *** 3,9 **** %define name %{base_name}%{major_version} %define full_name jakarta-%{base_name} %define version 5.0.18 ! %define release 1jpp_3fc %define section free Name: %{name} --- 3,9 ---- %define name %{base_name}%{major_version} %define full_name jakarta-%{base_name} %define version 5.0.18 ! %define release 1jpp_4fc %define section free Name: %{name} *************** *** 23,29 **** BuildRequires: xerces-j2, xml-commons-apis BuildRequires: jpackage-utils >= 1.5.30 BuildRequires: java-javadoc - BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot #Obsoletes: servlet4 #Obsoletes: servlet23 --- 23,28 ---- *************** *** 66,79 **** --- 65,91 ---- ant dist -Dservletapi.build=build -Dservletapi.dist=dist popd + # Generate native code. + gcj $RPM_OPT_FLAGS -shared -findirect-dispatch -Wl,-Bsymbolic -o libjspapi-%{version}.jar.so jsr152/dist/lib/jsp-api.jar + gcj-dbtool -n jspapi-%{version}.db + gcj-dbtool -f jspapi-%{version}.db jsr152/dist/lib/jsp-api.jar %{_libdir}/libjspapi-%{version}.jar.so + gcj $RPM_OPT_FLAGS -shared -findirect-dispatch -Wl,-Bsymbolic -o lib%{name}-%{version}.jar.so jsr154/dist/lib/servlet-api.jar + gcj-dbtool -n %{name}-%{version}.db + gcj-dbtool -f %{name}-%{version}.db jsr154/dist/lib/servlet-api.jar %{_libdir}/lib%{name}-%{version}.jar.so %install cd jakarta-tomcat-%{version}-src/jakarta-servletapi-5 # jars install -d -m 755 $RPM_BUILD_ROOT%{_javadir} + install -d -m 755 $RPM_BUILD_ROOT%{_libdir} + install -d -m 755 $RPM_BUILD_ROOT`gcj-dbtool -p`.d install -m 644 jsr152/dist/lib/jsp-api.jar $RPM_BUILD_ROOT%{_javadir}/jspapi-%{version}.jar install -m 644 jsr154/dist/lib/servlet-api.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar + install -m 644 libjspapi-%{version}.jar.so $RPM_BUILD_ROOT%{_libdir}/libjspapi-%{version}.jar.so + install -m 644 lib%{name}-%{version}.jar.so $RPM_BUILD_ROOT%{_libdir}/lib%{name}-%{version}.jar.so + install -m 644 jspapi-%{version}.db $RPM_BUILD_ROOT`gcj-dbtool -p`.d/jspapi-%{version}.db + install -m 644 %{name}-%{version}.db $RPM_BUILD_ROOT`gcj-dbtool -p`.d/%{name}-%{version}.db (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) *************** *** 94,105 **** --- 106,125 ---- %post update-alternatives --install %{_javadir}/servlet.jar servlet %{_javadir}/%{name}-%{version}.jar 50 #update-alternatives --install %{_javadir}/jsp.jar jsp %{_javadir}/jsp-api-%{version}.jar 50 + DB=`gcj-dbtool -p` + rm -f $DB + gcj-dbtool -n $DB + (cd $DB.d; ls . | xargs gcj-dbtool -m $DB) %postun if [ "$1" = "0" ]; then update-alternatives --remove servlet %{_javadir}/%{name}-%{version}.jar # update-alternatives --remove jsp %{_javadir}/jsp-api-%{version}.jar fi + DB=`gcj-dbtool -p` + rm -f $DB + gcj-dbtool -n $DB + (cd $DB.d; ls . | xargs gcj-dbtool -m $DB) %post javadoc rm -f %{_javadocdir}/%{name} *************** *** 110,115 **** --- 130,136 ---- %files %defattr(-,root,root) %doc LICENSE + %{_libdir}/* %{_javadir}/* %files javadoc *************** *** 121,126 **** --- 142,150 ---- %changelog + * Tue Mar 22 2005 Anthony Green <green@xxxxxxxxxx> 0:5.0.18-1jpp_4fc + - Generate native libraries. + * Thu Nov 4 2004 Gary Benson <gbenson@xxxxxxxxxx> 0:5.0.18-1jpp_3fc - Build into Fedora.