diff --git a/macros.d/macros.jpackage b/macros.d/macros.jpackage index 35b288de..cf773ed8 100644 --- a/macros.d/macros.jpackage +++ b/macros.d/macros.jpackage @@ -27,29 +27,33 @@ # %3 options # %4 jars (separated by ':') # %5 the name of script you wish to create +# [-h] +# do not set default JAVA_HOME +# [-c ] +# name of the configuration file # -%jpackage_script() \ +%jpackage_script(c:h) \ install -d -m 755 %{buildroot}%{_bindir} \ cat > %{buildroot}%{_bindir}/%5 << EOF \ #!/bin/bash\ #\ -# %{name} script\ +# %5 script\ # JPackage Project \ -%{?java_home:\ +%{!-h:%{?java_home:\ # Set default JAVA_HOME\ JAVA_HOME="\\${JAVA_HOME:-%{java_home}}"\ -}\ +}}\ # Source functions library\ . @{javadir}-utils/java-functions\ \ # Source system prefs\ -if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then\ - . %{_sysconfdir}/java/%{name}.conf\ +if [ -f %{_sysconfdir}/java/%{-c*}%{!-c:%{name}}.conf ] ; then\ + . %{_sysconfdir}/java/%{-c*}%{!-c:%{name}}.conf\ fi\ \ # Source user prefs\ -if [ -f \\$HOME/.%{name}rc ] ; then\ - . \\$HOME/.%{name}rc\ +if [ -f \\$HOME/.%{-c*}%{!-c:%{name}}rc ] ; then\ + . \\$HOME/.%{-c*}%{!-c:%{name}}rc\ fi\ \ # Configuration\