[icedtea-web] RFC: support configure's --program-suffix option
Deepak Bhole
dbhole at redhat.com
Thu Apr 28 08:29:41 PDT 2011
* Omair Majid <omajid at redhat.com> [2011-04-28 11:05]:
> Hi,
>
> The attached patch makes icedtea-web support configure's
> --program-suffix option.
>
> A number of distributions use alternatives to manage
> /usr/bin/javaws. Using a prefix of /usr makes IcedTea-Web's javaws
> conflict with the alternatives-managed /usr/bin/javaws. Using a
> --program-suffix is one way to work around this problem and the
> patch makes this option work.
>
> This patch does not modify the names of desktop files, but does fix
> the binary names they point to.
>
> I would like to add this to HEAD and 1.1. Does anyone have any
> thoughts or comments?
>
Changes look fine to me. However I am not sure if itweb-settings needs
to be changed too. It is IcedTea-Web specific and quite unlikely to have
alternatives at any point in the future.
Cheers,
Deepak
> ChangeLog
> 2011-04-28 Omair Majid <omajid at redhat.com>
>
> * Makefile.am (javaws, itweb_settings): New variables.
> (edit_launcher_script, all-local, install-exe-local)
> (uninstall-local, clean-launchers, javaws.desktop)
> (itweb-settings.desktop): Replace all uses of javaws and
> itweb-settings with the new varaibles.
> (launcher.build/javaws): Replace with ...
> (launcher.build/$(javaws)): New target.
> (launcher.build/itweb-settings): Replace with...
> (launcher.build/$(itweb-settings)): New target.
>
> Thanks,
> Omair
> diff -r 6abf7a788f4e Makefile.am
> --- a/Makefile.am Wed Apr 20 16:33:18 2011 -0400
> +++ b/Makefile.am Thu Apr 28 11:03:39 2011 -0400
> @@ -109,20 +109,24 @@
> EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in extra launcher \
> itweb-settings.desktop.in $(top_srcdir)/tests
>
> +# binary names
> +javaws:= $(shell echo javaws | sed '@program_transform_name@')
> +itweb_settings:= $(shell echo itweb-settings | sed '@program_transform_name@')
> +
> # the launcher needs to know $(bindir) and $(datadir) which can be different at
> # make-time from configure-time
> edit_launcher_script = sed \
> -e 's|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g' \
> - -e 's|[@]JAVAWS_BIN_LOCATION[@]|$(bindir)/javaws|g' \
> - -e 's|[@]ITWEB_SETTINGS_BIN_LOCATION[@]|$(bindir)/itweb-settings|g' \
> + -e 's|[@]JAVAWS_BIN_LOCATION[@]|$(bindir)/$(javaws)|g' \
> + -e 's|[@]ITWEB_SETTINGS_BIN_LOCATION[@]|$(bindir)/$(itweb_settings)|g' \
> -e 's|[@]JAVA[@]|$(JAVA)|g' \
> -e 's|[@]JRE[@]|$(JRE)|g'
>
> # Top-Level Targets
> # =================
>
> -all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/javaws \
> - javaws.desktop stamps/docs.stamp launcher.build/itweb-settings itweb-settings.desktop
> +all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/$(javaws) \
> + javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop
>
> check-local: $(RHINO_TESTS) $(JUNIT_TESTS)
>
> @@ -144,9 +148,9 @@
> ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
> endif
> ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
> - ${INSTALL_PROGRAM} launcher.build/javaws $(DESTDIR)$(bindir)
> + ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
> ${INSTALL_DATA} extra-lib/about.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jar
> - ${INSTALL_PROGRAM} launcher.build/itweb-settings $(DESTDIR)$(bindir)
> + ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir)
>
> install-data-local:
> ${mkinstalldirs} -d $(DESTDIR)$(mandir)/man1
> @@ -175,8 +179,8 @@
> rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jnlp
> rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/about.jar
> rm -f $(DESTDIR)$(mandir)/man1/javaws.1
> - rm -f $(DESTDIR)$(bindir)/javaws
> - rm -f $(DESTDIR)$(bindir)/itweb-settings
> + rm -f $(DESTDIR)$(bindir)/$(javaws)
> + rm -f $(DESTDIR)$(bindir)/$(itweb_settings)
> rm -rf $(DESTDIR)$(htmldir)
>
> # Plugin
> @@ -352,26 +356,26 @@
> extra-lib/about.jar: stamps/extra-class-files.stamp
> $(BOOT_DIR)/bin/jar cf $@ -C extra-lib net ;
>
> -launcher.build/javaws: launcher/javaws.in
> +launcher.build/$(javaws): launcher/javaws.in
> mkdir -p launcher.build
> $(edit_launcher_script) < $< > $@
>
> -launcher.build/itweb-settings: launcher/itweb-settings.in
> +launcher.build/$(itweb_settings): launcher/itweb-settings.in
> mkdir -p launcher.build
> $(edit_launcher_script) < $< > $@
>
> clean-launchers:
> - rm -f launcher.build/javaws
> - rm -f launcher.build/itweb-settings
> + rm -f launcher.build/$(javaws)
> + rm -f launcher.build/$(itweb_settings)
> if [ -e launcher.build ] ; then \
> rmdir launcher.build ; \
> fi
>
> javaws.desktop: javaws.desktop.in
> - sed "s#PATH_TO_JAVAWS#$(bindir)/javaws#" < $(srcdir)/javaws.desktop.in > javaws.desktop
> + sed "s#PATH_TO_JAVAWS#$(bindir)/$(javaws)#" < $(srcdir)/javaws.desktop.in > javaws.desktop
>
> itweb-settings.desktop: $(srcdir)/itweb-settings.desktop.in
> - sed "s#PATH_TO_ITWEB_SETTINGS#$(bindir)/itweb-settings#" \
> + sed "s#PATH_TO_ITWEB_SETTINGS#$(bindir)/$(itweb_settings)#" \
> < $(srcdir)/itweb-settings.desktop.in > itweb-settings.desktop
>
> # documentation
More information about the distro-pkg-dev
mailing list