On Wed, 06 Jul 2005 16:40:56 +0100, Gary Benson wrote:
Over the past couple of days I've been writing a replacement for aot-compile and find-and-aot-compile.
Good stuff, looking forward to using it! I've attached a matching rebuild-gcj-db2 script and a sample Hello World .spec so that others can more easily try it out. Is it worth merging the .db files into one .db file per package, to reduce the number of files that have to be merged at RPM install time? -- Robin
#!/bin/bash # rebuild-gcj-db2 : ${1?" $0: Re-build the gcj classmap .db Usage: $0 LIBDIR LIBDIR - the target library location "} dbLocation=`/usr/bin/gcj-dbtool -p $1` dbDir=`dirname $dbLocation` dbComponentDirs="$1/gcj $dbLocation.d" mkdir -p $dbDir $dbComponentDirs find $dbComponentDirs -type f -name '*.db' -print0 \ | /usr/bin/gcj-dbtool -0 -m $dbLocation
%define name jhello %define version 1.0.0 %define release 3rdg Name: %name Summary: Hello World in Java Version: %version Release: %release License: Public Domain Group: Productivity Epoch: 0 Source: http://www.greenrd.org/sw/jhello/jhello.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} Prefix: %{_prefix} Requires: java Requires: jpackage-utils Requires(post): java-1.4.2-gcj-compat Requires(postun): java-1.4.2-gcj-compat #BuildRequires: java-1.4.2-gcj-compat >= 1.4.2.0-Xjpp BuildRequires: java-gcj AutoReqProv: no %description jhello is the classic Hello World program in Java %prep %setup -q -n %{name}-%{version} %build gcj -g -C HelloWorld.java jar cvf %{name}.jar HelloWorld.class %install %__rm -rf $RPM_BUILD_ROOT %__mkdir_p %{buildroot}{%{_bindir},%{_javadir}} %__cp -a %{name}.jar $RPM_BUILD_ROOT/%{_javadir} # script %__cat > %{buildroot}/%{_bindir}/%{name} << EOF #!/bin/sh # # %{name} script # JPackage Project <http://www.jpackage.org/> # Source functions library . %{_datadir}/java-utils/java-functions # Source system prefs if [ -f %{_sysconfdir}/%{name}.conf ] ; then . %{_sysconfdir}/%{name}.conf fi # Source user prefs if [ -f \$HOME/.%{name}rc ] ; then . \$HOME/.%{name}rc fi # Configuration MAIN_CLASS="HelloWorld" BASE_JARS="%{name}" # Set parameters set_jvm set_classpath \$BASE_JARS set_flags "" # Let's start run "\$@" EOF # Set optimization level to 0 # Not necessary - just demonstrates how it can be done RPM_OPT_FLAGS="-O0 `echo $RPM_OPT_FLAGS|sed -e 's|-O2||g'`" aot-compile-rpm %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post rebuild-gcj-db2 %{_libdir} %postun rebuild-gcj-db2 %{_libdir} %files %defattr(0644,root,root,0755) %attr(0755,root,root) %{_bindir}/%{name} %{_javadir}/* %{_libdir}/gcj/%{name} %changelog * Wed Jul 06 2005 Robin Green <greenrd@xxxxxxxxxxx> - Changed to use proposed new aot-compile-rpm script * Tue Jul 05 2005 Robin Green <greenrd@xxxxxxxxxxx> - Changed to use proposed new find-and-aot-compile script * Sun Jun 26 2005 Robin Green <greenrd@xxxxxxxxxxx> - Initial release