RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jason Corley Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 05-Jun-2007 21:08:48 Branch: rpm-4_5 Handle: 2007060520084800 Added files: (Branch: rpm-4_5) rpm/jpackage macros.jpackage macros.jpackage.rhel Log: macros from jpackage-utils 1.7.3 (macros.jpackage.rhel has an additional gcj option defined and is included only for completeness) Summary: Revision Changes Path 1.1.2.1 +335 -0 rpm/jpackage/macros.jpackage 1.1.2.1 +339 -0 rpm/jpackage/macros.jpackage.rhel ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/jpackage/macros.jpackage ============================================================================ $ cvs diff -u -r0 -r1.1.2.1 macros.jpackage --- /dev/null 2007-06-05 21:00:05 +0200 +++ macros.jpackage 2007-06-05 21:08:48 +0200 @@ -0,0 +1,335 @@ +# +# RPM macros for Java applications. +# +# JPackage Project <http://www.jpackage.org/> +# David Walluck <[EMAIL PROTECTED]> +# Ville Skyttä <scop at jpackage.org> +# Nicolas Mailhot <[EMAIL PROTECTED]> +# + +#============================================================================== +# ---- default Java directories + +# +# Root directory where all Java VMs/SDK/JREs are installed. +# +%_jvmdir %{_prefix}/lib/jvm + +# +# Root directory where all Java VMs/SDK/JREs expose their jars +# +%_jvmjardir %{_prefix}/lib/jvm-exports + +# +# Root directory for all Java VM/SDK/JRE's private things. +# +%_jvmprivdir %{_prefix}/lib/jvm-private + +# +# Root directory for all architecture dependent parts of Java VM/SDK/JRE's +# +%_jvmlibdir %{_prefix}/lib/jvm + +# +# Root directory for all architecture independent parts of Java VM/SDK/JRE's +# +%_jvmdatadir %{_datadir}/jvm + +# +# Root directory for all configurations parts of Java VM/SDK/JRE's +# +%_jvmsysconfdir %{_sysconfdir}/jvm + +# +# Root directory for all common architecture dependent parts of Java VM/SDK/JRE's +# +%_jvmcommonlibdir %{_prefix}/lib/jvm-commmon + +# +# Root directory for all common architecture independent parts of Java VM/SDK/JRE's +# +%_jvmcommondatadir %{_datadir}/jvm-commmon + +# +# Root directory for all common configurations parts of Java VM/SDK/JRE's +# +%_jvmcommonsysconfdir %{_sysconfdir}/jvm-commmon + +# +# Directory where arch and version independent jars are installed. +# This has already been integrated in RH macros following our request. +# +# By extension: +# %{_javadir}-ext: +# - version dependent jars +# %{_javadir}-x.y.z: +# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext) +# %{_javadir}-utils: +# - Java-related scripts +# +# To simplify things only %{_javadir} is defined. +# +%_javadir %{_datadir}/java + +# +# Directory where arch-specific (JNI) version-independent jars are installed. +# +# By extension: +# %{_jnidir}-ext: +# - version dependent jars +# %{_jnidir}-x.y.z: +# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext) +# To simplify things only %{_jnidir} is defined. +# +%_jnidir %{_prefix}/lib/java + +# +# Root directory where all javadoc is installed. Also already in RH macros. +# +%_javadocdir %{_datadir}/javadoc + +# +# Directory for maven depmaps +# +%_mavendepmapdir /etc/maven +%_mavendepmapfragdir /etc/maven/fragments + +# +# Current default JVM home. +# +%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME) + +#============================================================================== +# ---- default Java commands + +%ant JAVA_HOME=%{java_home} ant +%jar %{java_home}/bin/jar +%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD) +%javac %{java_home}/bin/javac +%javadoc %{java_home}/bin/javadoc + +#============================================================================== +# ---- Java extension handling macros + +# +# add_jvm_extension should be used in %install by extension packages to declare +# what extension jars they provide. +# +# For example a package that provides foo.jar which is the bar extension +# under java 1.2 and 1.3 should do a: +# +# %install +# ... # create foo.jar in %{javadir}-ext +# %add_jvm_extension foo bar 1.2 1.3 +# +# %files +# %{javadir}-ext/foo.jar +# %{javadir}-*/bar.jar +# +%add_jvm_extension JAVA_LIBDIR=%{buildroot}/%{_javadir} %{_bindir}/jvmjar -l + +#============================================================================== +# +# add_to_depmap adds an entry to the depmap. The arguments are: +# +# %1 the original groupid +# %2 the original artifact id +# %3 the version +# %4 the new groupid +# %5 the new artifactid +# + +%add_to_maven_depmap() \ +install -dm 755 $RPM_BUILD_ROOT/%{_mavendepmapfragdir}\ +cat >>$RPM_BUILD_ROOT/%{_mavendepmapfragdir}/%{name}<< EOF\ +<dependency>\ + <maven>\ + <groupId>%1</groupId>\ + <artifactId>%2</artifactId>\ + <version>%3</version>\ + </maven>\ + <jpp>\ + <groupId>%4</groupId>\ + <artifactId>%5</artifactId>\ + <version>%3</version>\ + </jpp>\ +</dependency>\ +\ +EOF\ +%{nil} + +#============================================================================== +# +# update_maven_depmap updates the main maven depmap +# +%update_maven_depmap() \ +echo -e "<dependencies>\\n" > %{_mavendepmapdir}/maven2-depmap.xml\ +if [ -d %{_mavendepmapfragdir} ] && [ -n "`find %{_mavendepmapfragdir} -type f`" ]; then\ +cat %{_mavendepmapfragdir}/* >> %{_mavendepmapdir}/maven2-depmap.xml\ +fi\ +echo -e "</dependencies>\\n" >> %{_mavendepmapdir}/maven2-depmap.xml + +#============================================================================== +# ---- default icons directories as per the icon theme freedesktop spec + +%_iconstheme hicolor +%_iconsbasedir %{_datadir}/icons/%{_iconstheme} + +# +# The following is a bit heavy and will be removed +# +%_icons16dir %{_iconsbasedir}/16x16/apps +%_icons22dir %{_iconsbasedir}/22x22/apps +%_icons48dir %{_iconsbasedir}/48x48/apps +%_icons64dir %{_iconsbasedir}/64x64/apps +%_icons96dir %{_iconsbasedir}/96x96/apps +%_icons192dir %{_iconsbasedir}/192x192/apps +%_iconsscaldir %{_iconsbasedir}/scalable/apps + +# +# Mandriva macros for non-Mandriva systems. +# +%_miconsdir %{_datadir}/icons/mini +%_iconsdir %{_datadir}/icons +%_liconsdir %{_datadir}/icons/large + + +# +# Mandriva icons +# +# %1 the name of the icon (typically the name of the package). Mandriva +# requires 3 icons sizes (48, 32, 16), all should be present. +# +%mdkicons() \ +install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_liconsdir}/%1.png\ +install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_iconsdir}/%1.png\ +install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_miconsdir}/%1.png + + +# +# Red Hat icons +# +# %1 the name of the icon (typically the name of the package). RedHat +# requires 3 icons sizes (48, 32, 16), all should be present. +%rhicons() \ +install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png\ +install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png\ +install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png + + +#============================================================================== +# ---- default .desktop directories per the desktop-entry freedesktop.org spec + +%_desktopdir %{_datadir}/applications + +# +# Mandriva menu dir +# +%_menudir %{_prefix}/lib/menu + +# +# Mandriva menu +# +# %1 the name of the menu (ex: %{name}) +# %2 the command to run (ex: %{_bindir}/%{name}) +# %3 needs (ex: X11) +# %4 menu section (ex: Applications/Editors) +# %5 mime types (ex: text/html;text/plain) +# %6 menu title (ex: %{name}) +# %7 comment or summary (ex: %{Summary}) +# %8 icon (ex: %{name}.png) +# %9 unused +# +%mdkmenu() \ +install -d -m 755 $RPM_BUILD_ROOT%{_menudir}\ +cat >$RPM_BUILD_ROOT%{_menudir}/%1 <<EOF\ +\?package(%1):\\ + command="%2"\\ + needs="%3"\\ + section="%4"\\ + mimetypes="%5"\\ + title="%6"\\ + longtitle="%7"\\ + icon="%8"\\ +EOF + +%post_mdkmenu\ +%post mdkmenu\ +%{update_menus} + +%postun_mdkmenu\ +%postun mdkmenu\ +%{clean_menus} + +# +# Legacy menu +# +# %1 the name of the menu (ex: %{name}) +# %2 the command to run (ex: %{_bindir}/%{name}) +# %3 needs (ex: 1) +# %4 menu section (ex: Development) +# %5 unused +# %6 menu title (ex: %{name}) +# %7 comment or summary (ex: %{Summary}) +# %8 icon (ex: %{name}.png) +# %9 type (ex: Application) +# +%rhmenu() \ +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/%4\ +cat >$RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/%4/%1.desktop <<EOF\ +[Desktop Entry]\ +Name=%6\ +Comment=%7\ +Exec=%2\ +Terminal=%3\ +Type=%9\ +Icon=%8\ +EOF + +# +# Standard JPackage script +# +# This is kind of tasteless and should be moved to an external template +# +# %1 main class +# %2 flags +# %3 options +# %4 jars (separated by ':') +# %5 the name of script you wish to create +# +%jpackage_script() \ +install -d -m 755 $RPM_BUILD_ROOT%{_bindir}\ +cat > $RPM_BUILD_ROOT%{_bindir}/%5 << EOF \ +#!/bin/sh\ +#\ +# %{name} script\ +# JPackage Project <http://www.jpackage.org/>\ +\ +# Source functions library\ +. %{_javadir}-utils/java-functions\ +\ +# Source system prefs\ +if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then\ + . %{_sysconfdir}/java/%{name}.conf\ +fi\ +\ +# Source user prefs\ +if [ -f \\$HOME/.%{name}rc ] ; then\ + . \\$HOME/.%{name}rc\ +fi\ +\ +# Configuration\ +MAIN_CLASS=%1\ +BASE_FLAGS=%2\ +BASE_OPTIONS=%3\ +BASE_JARS="%(echo %4 | sed -e 's,:, ,g')"\ +\ +# Set parameters\ +set_jvm\ +set_classpath \\$BASE_JARS\ +set_flags \\$BASE_FLAGS\ +set_options \\$BASE_OPTIONS\ +\ +# Let's start\ +run "\\$@"\ +EOF @@ . patch -p0 <<'@@ .' Index: rpm/jpackage/macros.jpackage.rhel ============================================================================ $ cvs diff -u -r0 -r1.1.2.1 macros.jpackage.rhel --- /dev/null 2007-06-05 21:00:05 +0200 +++ macros.jpackage.rhel 2007-06-05 21:08:48 +0200 @@ -0,0 +1,339 @@ +# +# RPM macros for Java applications. +# +# JPackage Project <http://www.jpackage.org/> +# David Walluck <[EMAIL PROTECTED]> +# Ville Skyttä <scop at jpackage.org> +# Nicolas Mailhot <[EMAIL PROTECTED]> +# + +#============================================================================== +# ---- default Java directories + +# +# Root directory where all Java VMs/SDK/JREs are installed. +# +%_jvmdir %{_prefix}/lib/jvm + +# +# Root directory where all Java VMs/SDK/JREs expose their jars +# +%_jvmjardir %{_prefix}/lib/jvm-exports + +# +# Root directory for all Java VM/SDK/JRE's private things. +# +%_jvmprivdir %{_prefix}/lib/jvm-private + +# +# Root directory for all architecture dependent parts of Java VM/SDK/JRE's +# +%_jvmlibdir %{_prefix}/lib/jvm + +# +# Root directory for all architecture independent parts of Java VM/SDK/JRE's +# +%_jvmdatadir %{_datadir}/jvm + +# +# Root directory for all configurations parts of Java VM/SDK/JRE's +# +%_jvmsysconfdir %{_sysconfdir}/jvm + +# +# Root directory for all common architecture dependent parts of Java VM/SDK/JRE's +# +%_jvmcommonlibdir %{_prefix}/lib/jvm-commmon + +# +# Root directory for all common architecture independent parts of Java VM/SDK/JRE's +# +%_jvmcommondatadir %{_datadir}/jvm-commmon + +# +# Root directory for all common configurations parts of Java VM/SDK/JRE's +# +%_jvmcommonsysconfdir %{_sysconfdir}/jvm-commmon + +# +# Directory where arch and version independent jars are installed. +# This has already been integrated in RH macros following our request. +# +# By extension: +# %{_javadir}-ext: +# - version dependent jars +# %{_javadir}-x.y.z: +# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext) +# %{_javadir}-utils: +# - Java-related scripts +# +# To simplify things only %{_javadir} is defined. +# +%_javadir %{_datadir}/java + +# +# Directory where arch-specific (JNI) version-independent jars are installed. +# +# By extension: +# %{_jnidir}-ext: +# - version dependent jars +# %{_jnidir}-x.y.z: +# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext) +# To simplify things only %{_jnidir} is defined. +# +%_jnidir %{_prefix}/lib/java + +# +# Root directory where all javadoc is installed. Also already in RH macros. +# +%_javadocdir %{_datadir}/javadoc + +# +# Directory for maven depmaps +# +%_mavendepmapdir /etc/maven +%_mavendepmapfragdir /etc/maven/fragments + +# +# Current default JVM home. +# +%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME) + +#============================================================================== +# ---- default Java commands + +%ant JAVA_HOME=%{java_home} ant +%jar %{java_home}/bin/jar +%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD) +%javac %{java_home}/bin/javac +%javadoc %{java_home}/bin/javadoc + +#============================================================================== +# ---- Java extension handling macros + +# +# add_jvm_extension should be used in %install by extension packages to declare +# what extension jars they provide. +# +# For example a package that provides foo.jar which is the bar extension +# under java 1.2 and 1.3 should do a: +# +# %install +# ... # create foo.jar in %{javadir}-ext +# %add_jvm_extension foo bar 1.2 1.3 +# +# %files +# %{javadir}-ext/foo.jar +# %{javadir}-*/bar.jar +# +%add_jvm_extension JAVA_LIBDIR=%{buildroot}/%{_javadir} %{_bindir}/jvmjar -l + +#============================================================================== +# +# add_to_depmap adds an entry to the depmap. The arguments are: +# +# %1 the original groupid +# %2 the original artifact id +# %3 the version +# %4 the new groupid +# %5 the new artifactid +# + +%add_to_maven_depmap() \ +install -dm 755 $RPM_BUILD_ROOT/%{_mavendepmapfragdir}\ +cat >>$RPM_BUILD_ROOT/%{_mavendepmapfragdir}/%{name}<< EOF\ +<dependency>\ + <maven>\ + <groupId>%1</groupId>\ + <artifactId>%2</artifactId>\ + <version>%3</version>\ + </maven>\ + <jpp>\ + <groupId>%4</groupId>\ + <artifactId>%5</artifactId>\ + <version>%3</version>\ + </jpp>\ +</dependency>\ +\ +EOF\ +%{nil} + +#============================================================================== +# +# update_maven_depmap updates the main maven depmap +# +%update_maven_depmap() \ +echo -e "<dependencies>\\n" > %{_mavendepmapdir}/maven2-depmap.xml\ +if [ -d %{_mavendepmapfragdir} ] && [ -n "`find %{_mavendepmapfragdir} -type f`" ]; then\ +cat %{_mavendepmapfragdir}/* >> %{_mavendepmapdir}/maven2-depmap.xml\ +fi\ +echo -e "</dependencies>\\n" >> %{_mavendepmapdir}/maven2-depmap.xml + +#============================================================================== +# ---- GCJ support +%_gcj_support 1 + +#============================================================================== +# ---- default icons directories as per the icon theme freedesktop spec + +%_iconstheme hicolor +%_iconsbasedir %{_datadir}/icons/%{_iconstheme} + +# +# The following is a bit heavy and will be removed +# +%_icons16dir %{_iconsbasedir}/16x16/apps +%_icons22dir %{_iconsbasedir}/22x22/apps +%_icons48dir %{_iconsbasedir}/48x48/apps +%_icons64dir %{_iconsbasedir}/64x64/apps +%_icons96dir %{_iconsbasedir}/96x96/apps +%_icons192dir %{_iconsbasedir}/192x192/apps +%_iconsscaldir %{_iconsbasedir}/scalable/apps + +# +# Mandriva macros for non-Mandriva systems. +# +%_miconsdir %{_datadir}/icons/mini +%_iconsdir %{_datadir}/icons +%_liconsdir %{_datadir}/icons/large + + +# +# Mandriva icons +# +# %1 the name of the icon (typically the name of the package). Mandriva +# requires 3 icons sizes (48, 32, 16), all should be present. +# +%mdkicons() \ +install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_liconsdir}/%1.png\ +install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_iconsdir}/%1.png\ +install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_miconsdir}/%1.png + + +# +# Red Hat icons +# +# %1 the name of the icon (typically the name of the package). RedHat +# requires 3 icons sizes (48, 32, 16), all should be present. +%rhicons() \ +install -D -m 644 %1-48.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png\ +install -D -m 644 %1-32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png\ +install -D -m 644 %1-16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png + + +#============================================================================== +# ---- default .desktop directories per the desktop-entry freedesktop.org spec + +%_desktopdir %{_datadir}/applications + +# +# Mandriva menu dir +# +%_menudir %{_prefix}/lib/menu + +# +# Mandriva menu +# +# %1 the name of the menu (ex: %{name}) +# %2 the command to run (ex: %{_bindir}/%{name}) +# %3 needs (ex: X11) +# %4 menu section (ex: Applications/Editors) +# %5 mime types (ex: text/html;text/plain) +# %6 menu title (ex: %{name}) +# %7 comment or summary (ex: %{Summary}) +# %8 icon (ex: %{name}.png) +# %9 unused +# +%mdkmenu() \ +install -d -m 755 $RPM_BUILD_ROOT%{_menudir}\ +cat >$RPM_BUILD_ROOT%{_menudir}/%1 <<EOF\ +\?package(%1):\\ + command="%2"\\ + needs="%3"\\ + section="%4"\\ + mimetypes="%5"\\ + title="%6"\\ + longtitle="%7"\\ + icon="%8"\\ +EOF + +%post_mdkmenu\ +%post mdkmenu\ +%{update_menus} + +%postun_mdkmenu\ +%postun mdkmenu\ +%{clean_menus} + +# +# Legacy menu +# +# %1 the name of the menu (ex: %{name}) +# %2 the command to run (ex: %{_bindir}/%{name}) +# %3 needs (ex: 1) +# %4 menu section (ex: Development) +# %5 unused +# %6 menu title (ex: %{name}) +# %7 comment or summary (ex: %{Summary}) +# %8 icon (ex: %{name}.png) +# %9 type (ex: Application) +# +%rhmenu() \ +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/%4\ +cat >$RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/%4/%1.desktop <<EOF\ +[Desktop Entry]\ +Name=%6\ +Comment=%7\ +Exec=%2\ +Terminal=%3\ +Type=%9\ +Icon=%8\ +EOF + +# +# Standard JPackage script +# +# This is kind of tasteless and should be moved to an external template +# +# %1 main class +# %2 flags +# %3 options +# %4 jars (separated by ':') +# %5 the name of script you wish to create +# +%jpackage_script() \ +install -d -m 755 $RPM_BUILD_ROOT%{_bindir}\ +cat > $RPM_BUILD_ROOT%{_bindir}/%5 << EOF \ +#!/bin/sh\ +#\ +# %{name} script\ +# JPackage Project <http://www.jpackage.org/>\ +\ +# Source functions library\ +. %{_javadir}-utils/java-functions\ +\ +# Source system prefs\ +if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then\ + . %{_sysconfdir}/java/%{name}.conf\ +fi\ +\ +# Source user prefs\ +if [ -f \\$HOME/.%{name}rc ] ; then\ + . \\$HOME/.%{name}rc\ +fi\ +\ +# Configuration\ +MAIN_CLASS=%1\ +BASE_FLAGS=%2\ +BASE_OPTIONS=%3\ +BASE_JARS="%(echo %4 | sed -e 's,:, ,g')"\ +\ +# Set parameters\ +set_jvm\ +set_classpath \\$BASE_JARS\ +set_flags \\$BASE_FLAGS\ +set_options \\$BASE_OPTIONS\ +\ +# Let's start\ +run "\\$@"\ +EOF @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org