From ca8b5d176518ea838461b92229d2fbebb3731de8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Pineau?= Date: Tue, 10 Jan 2012 18:57:52 +0100 Subject: [PATCH] Initial rework of (svn) java-package 0.42 --- .gitignore | 1 + Makefile | 29 +++ TODO | 11 + debian/README.Debian | 25 +++ debian/changelog | 437 ++++++++++++++++++++++++++++++++++++ debian/compat | 1 + debian/control | 20 ++ debian/copyright | 29 +++ debian/dirs | 2 + debian/java-package.docs | 1 + debian/rules | 68 ++++++ lib/common.sh | 194 ++++++++++++++++ lib/install-common | 22 ++ lib/j2re.sh | 66 ++++++ lib/j2sdk-doc.sh | 81 +++++++ lib/j2sdk.sh | 68 ++++++ lib/j2se.sh | 184 +++++++++++++++ lib/oracle-j2re.sh | 54 +++++ lib/oracle-j2sdk-doc.sh | 35 +++ lib/oracle-j2sdk.sh | 54 +++++ lib/remove-common | 20 ++ make-jpkg | 231 +++++++++++++++++++ make-jpkg.1 | 82 +++++++ oracle-j2re1.6/install | 56 +++++ oracle-j2re1.6/remove | 41 ++++ oracle-j2re1.7/install | 56 +++++ oracle-j2re1.7/remove | 41 ++++ oracle-j2sdk1.6-doc/install | 16 ++ oracle-j2sdk1.6-doc/remove | 7 + oracle-j2sdk1.6/install | 87 +++++++ oracle-j2sdk1.6/remove | 63 ++++++ oracle-j2sdk1.7-doc/install | 16 ++ oracle-j2sdk1.7-doc/remove | 7 + oracle-j2sdk1.7/install | 88 ++++++++ oracle-j2sdk1.7/remove | 63 ++++++ 35 files changed, 2256 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 TODO create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/java-package.docs create mode 100755 debian/rules create mode 100644 lib/common.sh create mode 100644 lib/install-common create mode 100644 lib/j2re.sh create mode 100644 lib/j2sdk-doc.sh create mode 100644 lib/j2sdk.sh create mode 100644 lib/j2se.sh create mode 100644 lib/oracle-j2re.sh create mode 100644 lib/oracle-j2sdk-doc.sh create mode 100644 lib/oracle-j2sdk.sh create mode 100644 lib/remove-common create mode 100755 make-jpkg create mode 100644 make-jpkg.1 create mode 100644 oracle-j2re1.6/install create mode 100644 oracle-j2re1.6/remove create mode 100644 oracle-j2re1.7/install create mode 100644 oracle-j2re1.7/remove create mode 100644 oracle-j2sdk1.6-doc/install create mode 100644 oracle-j2sdk1.6-doc/remove create mode 100644 oracle-j2sdk1.6/install create mode 100644 oracle-j2sdk1.6/remove create mode 100644 oracle-j2sdk1.7-doc/install create mode 100644 oracle-j2sdk1.7-doc/remove create mode 100644 oracle-j2sdk1.7/install create mode 100644 oracle-j2sdk1.7/remove diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e0afbfc --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +DESTDIR= + +.PHONY: default +default: build + +.PHONY: build +build: + echo "java-package currently supports the following binary packages:" \ + > SUPPORTED + echo >> SUPPORTED + echo "(This list is automatically generated, do not edit)" >> SUPPORTED + echo >> SUPPORTED + grep -h "SUPPORTED$$" $(wildcard lib/*-*.sh) | sed 's/"//g;s/).*//' \ + >> SUPPORTED + +.PHONY: clean +clean: + rm -f SUPPORTED + +.PHONY: install +install: + install -d -m 755 $(DESTDIR)/usr/bin + install -m 755 make-jpkg.out $(DESTDIR)/usr/bin/make-jpkg + install -d -m 755 $(DESTDIR)/usr/share/man/man1 + install -m 644 make-jpkg.1 $(DESTDIR)/usr/share/man/man1/ + install -d -m 755 $(DESTDIR)/usr/share/java-package + for file in lib/*.sh; do \ + install -m 644 $$file $(DESTDIR)/usr/share/java-package/ ; \ + done diff --git a/TODO b/TODO new file mode 100644 index 0000000..121db83 --- /dev/null +++ b/TODO @@ -0,0 +1,11 @@ + +From old java-pakage : +Move repeated code in install/remove scripts to a single point; apply the DRY (don't repeat yourself) principle. +Change handling of alternatives to allow for multiple directories, i.e. when you have executables in both bin and jre/bin in a JDK. +Remove use of dpkg --print-architecture from plugin alternatives installation in install/remove scripts. + +From Matthias Klose : + +Support the .jinfo files (update-java-alternatives) +Install into a multiarch location to allow installing the i386 client vm on amd64 and ia64. + diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..74551da --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,25 @@ +java-package +------------ + +This package can be used to install various non-free external Java packages +under Debian. + +It includes the 'make-jpkg' command to do this, see 'man make-jpkg' for more +information about generating java packages. + +Supported packages currently include: + + * Oracle : + - The J2SE Development Kit (JDK), version 6 (update >= 10), 7 + - The J2SE Runtime Environment (JRE), version 6 (update >= 10), 7 + - The J2SE API Javadoc, version 6 (update >= 10), 7 + + Download: + http://www.oracle.com/technetwork/java/javase/downloads + + (Choose tar.gz archives, i586 or amd64, do _not_ choose the RPM!) + +All other previously supported jvm (Blackdown, IBM, ..) have been removed and +will only be added back on users demand + + -- Cédric Pineau Thu, 22 Dec 2011 11:42:13 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2ad6cdb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,437 @@ +java-package (0.50) UNRELEASED; urgency=low + + * Java-package reset for reintroduction in debian (removal of all + previously supported jvm). + * Add support for Oracle Java 6 (update >= 10) + * Add support for Oracle Java 7 + + -- Cédric Pineau Thu, 22 Dec 2011 11:42:13 +0100 + +java-package (0.43) UNRELEASED; urgency=low + + * Remove Java plugins for all browsers (Closes: #367887). + * Add support for Sun Java 6 Update XX (Closes: #514364). + + -- Michael Koch Thu, 17 Sep 2009 13:15:55 +0200 + +java-package (0.42) unstable; urgency=low + + * Provide java*-runtime-headless and java*-sdk names for generated + packages. + * Recommend dpkg-dev and gcc. Closes: #281766, #405814. + + -- Matthias Klose Sat, 02 Aug 2008 12:10:52 +0200 + +java-package (0.41) unstable; urgency=low + + * Added support for new SUN JDK/JRE for amd64 downloads. Thanks to + Artyom Gavrichenkov for the initial patch. + + -- Michael Koch Fri, 21 Mar 2008 17:20:35 +0100 + +java-package (0.40) unstable; urgency=low + + * Add support for ibm-java2-sdk-5.0-6.0-linux-$arch.tgz. Closes: #462399 + Thanks to Evgeni Dobrev for the patch. + * Fixed spelling error in long description: debian -> Debian. + + -- Michael Koch Thu, 24 Jan 2008 22:48:46 +0100 + +java-package (0.39) unstable; urgency=low + + * Added support for IBM JDK 6.0 final release. + * Updated Standard-Version to 3.7.3. + * Updated debhelper level to 5. + + -- Michael Koch Tue, 18 Dec 2007 07:38:34 +0100 + +java-package (0.38) unstable; urgency=low + + * Mention SUN JDK 6 in REAME.Debian. Closes: #448258. + * Fixed typo when creating version number for SUN JDK 6. Closes: #451935. + * Fix handling of symlinks for ControlPanel, HtmlConverter and java-rmi.cgi + from SUN JDK 6. Closes: #448351. + + -- Michael Koch Fri, 30 Nov 2007 00:03:50 +0100 + +java-package (0.37) unstable; urgency=low + + * Added libstdc++5 to Recommends of generated package. Closes: #446334. + + -- Michael Koch Thu, 25 Oct 2007 22:45:42 +0200 + +java-package (0.36) unstable; urgency=low + + * Fixed package description to include more supported JDKs. + Closes: #447615, #447617. + + -- Michael Koch Wed, 24 Oct 2007 09:56:52 +0200 + +java-package (0.35) unstable; urgency=low + + * Use 'date -R' instead of the deprecated '822-date'. Closes: #441229. + * Fix generation of .changes file. Closes: #332643. + Thanks to Christoph Goehre for the patch. + * Add possibility to add a configured revision to the version. + Closes: #442246. Thanks to Christoph Goehre again for the patch. + + -- Michael Koch Fri, 14 Sep 2007 17:28:13 +0200 + +java-package (0.34) unstable; urgency=low + + * Fixed SUN JDK on amd64. Closes: #439221. + + -- Michael Koch Fri, 24 Aug 2007 00:41:54 +0200 + +java-package (0.33) unstable; urgency=low + + * Fixed postinst scripts for SUN JDK 1.4, 5 and 6. Closes: #435632. + + -- Michael Koch Thu, 02 Aug 2007 18:43:40 +0200 + +java-package (0.32) unstable; urgency=low + + * Added support for iceweasel. Closes: #433445. + * Fix dangling links for SUN Java 5. Closes: #305053. + * Depend on libx11-6 and libasound2. Closes: #289004. + * Fix building on ia64. Closes: #355465. + + -- Michael Koch Thu, 19 Jul 2007 22:51:31 +0200 + +java-package (0.31) unstable; urgency=low + + * Reapplied changes from 0.28 to 0.29. Closes: 322843. + + -- Michael Koch Tue, 10 Jul 2007 08:16:14 +0200 + +java-package (0.30) unstable; urgency=low + + * Added support for SUN JDK 6u2 (and following updates). + * Added support for ibm-java2-jre-5.0-5.0-linux-ppc.tgz. + Thanks to B. Zhang. + + -- Michael Koch Sun, 08 Jul 2007 09:33:29 +0200 + +java-package (0.29) unstable; urgency=low + + * Added support for SUN Java 6 and IBM Java 6. + Closes: #322843, #402642, #418592, #425508, #430026. + * Added myself to Uploaders. + + -- Michael Koch Tue, 26 Jun 2007 17:40:04 -0100 + +java-package (0.28) unstable; urgency=low + + * Modified to reflect migration to Subversion + * Bumped standards to version 3.7.2, no changes + * Corrected test for AMD64 architecture during plug-in detection + * Corrected detected version for IBM Java 5 JDK on AMD64 (Closes: #345775) + * Repaired alternatives handling for IBM Java 5 JREs and JDKs + (Closes: #338569) + * Corrected pathing for alternatives installation for Mozilla and + Firefox plugins (Closes: #341751) + * Relaxed architectural restrictions on plugin alternative + installation for IBM Java 5 JREs and JDKs (Closes: #343837) + * Added plugin installation for the new packaging of Firefox 1.5 and + later (Closes: #341749) + * Modified warning suppression for dh_shlibdeps to accommodate + changes in dpkg-dev (Closes: #354427) + * Added quotes to variable tests for maintainer name and email + (Closes: #342623) + * Refactored architecture evaluation to eliminate repetition and + evaluate DEB_BUILD_GNU_TYPE correctly for i486-linux-gnu + * Removed dependency on 'coreutils | stat' from control file, as + the dependency is satisfied within essential (Closes: #370002) + + -- Barry Hawkins Mon, 26 Jun 2006 11:19:08 -0400 + +java-package (0.27) unstable; urgency=low + + * Added support for IBM Java2 5.0 JREs and JDKs (Closes: #337129) + * Corrected missing alternatives links for all JREs and JDKs + (Closes: #317492) + * Added conditional wrapping around dh_compress to account for + JRE/JDKs that do not ship manpages (Closes: 301738) + * Removed java-common from Provides: for JRE and JDK packages. + + -- Barry Hawkins Tue, 08 Nov 2005 12:16:24 -0500 + +java-package (0.26) unstable; urgency=low + + * Update standards version to 3.6.2 + * Resolve issues with powerpc-linux support detection (Closes: #317671) + * Added support for Blackdown 1.4.2+02 release (Closes: #316831) + * Added support for packaging Sun JDK documentation (Closes: #272971) + * Modified make-jpkg behavior to default the generated packages' + name and email address for the maintainer to Debian Java Maintainers + (Closes: #325554) + + -- Barry Hawkins Thu, 18 Aug 2005 00:43:17 -0400 + +java-package (0.25) unstable; urgency=low + + * Cope with dpkg's new way of expressing architectures (Closes: #313555) + * Re-exec with fakeroot if needed (Closes: #310132) + + -- Jeroen van Wolffelaar Sun, 10 Jul 2005 18:50:40 +0200 + +java-package (0.24) unstable; urgency=low + + * Added plugin alternatives support for i386 IBM JREs and JDKs + * Corrected pathing for plugin alternatives to reflect difference in + layout between JREs and JDKs for Sun and Blackdown (Closes: #305219, + #301806) + + -- Barry Hawkins Wed, 21 Apr 2005 01:02:03 -0400 + +java-package (0.23.1) experimental; urgency=low + + * Added architecture-specific pathing for plugin alternatives for + Blackdown 1.3 and 1.4 JREs and JDKs + + -- Barry Hawkins Wed, 06 Apr 2005 00:03:40 -0500 + +java-package (0.23) unstable; urgency=low + + * Further expanded 1.3.1 Blackdown JRE/JDK support for i386 + * Added architecture-specific pathing for plugin alternatives for + Sun 1.4 and 1.5 JREs and JDKs (Closes: #301806) + * Added recommends for system elements required by applets and + graphical user interface elements (Closes: #300817) + * Jeroen van Wolffelaar: + + Fixed packages description to not have too long lines, and make the 3 + items an enumeration + + -- Barry Hawkins Fri, 01 Apr 2005 00:36:40 -0500 + +java-package (0.22.1) experimental; urgency=low + + * Corrected IBM and Blackdown JRE/JDK file size specifications + * Added support for additional 1.3.1 Blackdown JREs and JDKs for i386, + powerpc (Closes: #301092) + * Added installation of javaws alternative for Sun 1.5 JREs and JDKs + (Closes: #300303) + + -- Barry Hawkins Thu, 24 Mar 2005 13:20:18 -0500 + +java-package (0.22) unstable; urgency=low + + * Corrected IBM JRE/JDK scripts to accurately reflect the supported + IBM JDKs and JREs in the generated SUPPORTED file + + -- Barry Hawkins Fri, 18 Mar 2005 10:21:53 -0500 + +java-package (0.21) unstable; urgency=low + + * Enable support for IBM JDKs and JREs for x86, amd64, powerpc, + powerpc64, and s390 architectures, based upon a patch by Rico + Schiekel (Closes: #264137) + * Enable suppport for Blackdown 1.3.1 JDK and JRE for PowerPC + architecture. (Closes: #296205) + * Update documentation and to reflect current supported JDKs and JREs + + -- Barry Hawkins Mon, 14 Mar 2005 03:18:39 -0500 + +java-package (0.20) unstable; urgency=low + + * Make the postinst & rm for generated packages #!/bin/bash, as we use + bash-specific features (Closes: #292179) + * Drop the df output parsing, use '/usr/bin/stat' instead (Closes: #293487, + #289006, #293350) + * Drop the now obsolete peer stuff from the source package + * Change priorities, 313 for 1.3, 314 for 1.4, etc (Closes: #292451) + * Don't dh_strip, fiddling with upstream's binaries apparantly breaks stuff + (Closes: #291238) + + -- Jeroen van Wolffelaar Tue, 08 Feb 2005 15:04:51 +0100 + +java-package (0.19) unstable; urgency=low + + The "Joshua Kwan rocks!" release. + + Joshua Kwan: + * Unclutter Debian build system and rework package slightly so that + *debian packages are not needed anymore. The necessary files will be + included in the generated packages. (Closes: #291145, #289245, #284779) + * Add support for Blackdown 1.4.2+01 build. (Closes: #285405) + * Fix support for Sun 1.5.0 amd64 builds due to typo. (Closes: #290879) + * Mozilla browser plugin name changed in 1.4.2 versions. Detect and correct. + (Closes: #273730) + * Use --block-size=1M instead of -BM. (Closes: #289005, #291161) + * Disable support for Sun JDK 1.3 due to its dependencies on libraries + that are simply not available anymore. (Closes: #272972) + * Fix up short description a little bit. + * Bump Standards-Version to 3.6.1 (no changes) + * Be a bit more conservative with the real-root test. + * Remove last j2se-package references. + * Change Suggests on fakeroot to a Depends because it is worthless both + as real root and as a normal user without fakeroot. + + Jeroen van Wolffelaar: + * Use DEBFULLNAME, DEBNAME and DEBEMAIL if available, and don't ask for + those values in that case. (Closes: #279653) + * Updated documentation regarding dropped Sun 1.3 support + * Work around multiline df output caused by long device names + (Closes: #289006) + * Add Replaces: for the generated packages on their *debian counterparts + + -- Jeroen van Wolffelaar Tue, 25 Jan 2005 00:05:06 +0100 + +java-package (0.18) unstable; urgency=low + + * Added myself to Uploaders + * Fix security hole (inscure temp file creation) plus lots of needless I/O + in free disk checking function + * Added support for Sun's JDK/JRE 1.5 patch levels, based on a patch by + Peter Marschall (Closes: #286718, #287857) + * Bail out if running as real root (works around the evil parts of Sun's + install script that unconditionally writes to /etc, see #266273, #280707) + * Fix typo in j2re.sh that apparantly with some versions of + bash/dpkg/whatever cause package build failure (Closes: #281780, #282902) + * Reduce minimum expected size a bit Sun's 1.5.0 amd64 package, it was set + too high (Closes: #284033) + * Substitute package version number at build time in the make-jpkg + executable (Closes: #282221) + * Added a README.Debian explaining the existance of make-jpkg and what + binary packages are supported and where to get them. Thanks Thijs + Kinkhorst for the draft (Closes: #283362) + * Added automatically-generated file SUPPORTED that lists all binary + filenames that are supported, thanks Alex Owen for the + idea (Closes: #275296) + + -- Jeroen van Wolffelaar Mon, 3 Jan 2005 18:47:47 +0100 + +java-package (0.17) unstable; urgency=low + + * added a patch for detecting the architecture (Closes: #274844, + #270949, #271846). This patch should also close this one (Closes: + #280685). + + -- Arnaud Vandyck Fri, 12 Nov 2004 17:28:38 +0100 + +java-package (0.16) unstable; urgency=low + + * added myself as an uploader. + * Carlos already closed the support for 1.5 request but it seems he did + not upload the package (Closes: #277088). + + -- Arnaud Vandyck Wed, 10 Nov 2004 16:38:44 +0100 + +java-package (0.15) unstable; urgency=low + + * lib/sun-j2re.sh: Added support for JRE 1.5.0 (aka "Java 5.0"). + * lib/sun-j2sdk.sh: Added support for Java SDK 1.5.0. + + -- Carlos Laviola Mon, 11 Oct 2004 21:08:59 -0300 + +java-package (0.14) unstable; urgency=low + + * debian/control: Commented out the lines that generate the Debian-specific + packages, thus making alternatives available. + - Also made all of the generated packages depend on their Debian-specific + counterparts by default. (Closes: #266671) + + -- Carlos Laviola Mon, 13 Sep 2004 03:38:31 -0300 + +java-package (0.13) unstable; urgency=low + + * References to j2se-package are gone. (Closes: #267642) + * Added support for Blackdown Java 1.4.2 RC1 JRE/SDK. (Closes: #267643) + + -- Carlos Laviola Mon, 13 Sep 2004 03:17:54 -0300 + +java-package (0.12) unstable; urgency=low + + * remove to contrib because this package depend on non-free J2SE. + + -- Takashi Okamoto Tue, 3 Aug 2004 00:37:13 +0900 + +java-package (0.11) unstable; urgency=low + + * change package name java-package and the command build package is + make-jpkg. + + -- Takashi Okamoto Sat, 31 Jul 2004 15:07:36 +0900 + +java-package (0.10) unstable; urgency=low + + * change package name mpkg-j2se. + * not use *-j2[re|sdk]debian package. Instead of this, add package + dependency to generated package. This reduce the installation for + such extra package. + * SUN's jdk1.5 beta2 support. + + -- Takashi Okamoto Sun, 18 Jul 2004 13:53:36 +0900 + +java-package (0.9) unstable; urgency=low + + * more generic support for j2re1.3.1/j2sdk1.3.1 from SUN. + + * add alternative for jarsigner (in j2sdk1.4 and j2sdk1.5 from SUN). + + -- Hubert Schmid Sun, 23 May 2004 23:35:14 +0200 + +java-package (0.8) unstable; urgency=low + + * java plugin: support for mozilla-firefox. + + -- Hubert Schmid Tue, 4 May 2004 22:39:39 +0200 + +java-package (0.7) unstable; urgency=low + + * Optionally create .changes file. + + * Add command line options: --help, --version, --full-name, + --email, --changes. + + * Add environment variables: J2SE_PACKAGE_FULL_NAME, + J2SE_PACKAGE_EMAIL. + + -- Hubert Schmid Sat, 27 Mar 2004 23:01:08 +0100 + +java-package (0.6) unstable; urgency=low + + * More generic support for Java2 1.4.2 from SUN. + + -- Hubert Schmid Thu, 11 Mar 2004 20:39:51 +0100 + +java-package (0.5) unstable; urgency=low + + * NEW: build Blackdown J2RE 1.4.1 (gcc-2.95) and J2SDK 1.4.1 (gcc-2.95). + + * NEW: support for SUN J2RE 1.5.0 beta, SUN J2SDK 1.5.0 beta. + + -- Hubert Schmid Sat, 7 Feb 2004 21:57:09 +0100 + +java-package (0.4) unstable; urgency=low + + * Added support for: SUN J2RE 1.4.2_03, SUN J2SDK 1.4.2_03 + + -- Hubert Schmid Thu, 15 Jan 2004 22:27:52 +0100 + +java-package (0.3) unstable; urgency=low + + * Added support for: Blackdown J2RE 1.3, 1.4, J2SDK 1.3, 1.4 + + * Removed usage of "du --apparent-size". This should fix a problem + with old fileutils. + + -- Hubert Schmid Sun, 9 Nov 2003 21:13:38 +0100 + +java-package (0.2) unstable; urgency=low + + * Added support for: Sun J2RE 1.3, Sun J2SDK 1.3, Sun J2SDK 1.4 + + * Moved peer packages into this source package. + + -- Hubert Schmid Thu, 30 Oct 2003 00:10:01 +0100 + +java-package (0.1) unstable; urgency=low + + * Initial Release. + + -- Hubert Schmid Sun, 26 Oct 2003 20:06:57 +0100 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..1831fb7 --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: java-package +Section: contrib/misc +Priority: optional +Maintainer: Debian Java Maintainers +Uploaders: Carlos Laviola , Arnaud Vandyck , Jeroen van Wolffelaar , Barry Hawkins , Michael Koch +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.3 + +Package: java-package +Architecture: all +Depends: debhelper, fakeroot, unzip, libx11-6, libasound2 +Recommends: dpkg-dev, gcc +Description: utility for building Java(TM) 2 related Debian packages + This package provides the capability to create a Debian package from + a Java(TM) 2 distribution by just running make-jpkg . + . + This program currently works with the following Java(TM) 2 Runtime + Environments and Development Kits: + . + * Oracle(TM) 7 Standard Edition diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..3021fbb --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +This is java-package, maintained by Jeroen van Wolffelaar + and Barry Hawkins . +It is based upon the j2se-package application originally +written by Hubert Schmid. + +The original source can always be found at: +http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/java-package/?cvsroot=pkg-java + +Copyright (C) 2005 Barry Hawkins +Copyright (C) 2004-2005 Jeroen van Wolffelaar +Copyright (C) 2003 Hubert Schmid + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA. + +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL'. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..083cb35 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +/usr/bin +/usr/share/java-package diff --git a/debian/java-package.docs b/debian/java-package.docs new file mode 100644 index 0000000..366b3a5 --- /dev/null +++ b/debian/java-package.docs @@ -0,0 +1 @@ +SUPPORTED diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..c6f6e22 --- /dev/null +++ b/debian/rules @@ -0,0 +1,68 @@ +#!/usr/bin/make -f +# debian/rules for java-package + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Extract source package version number from changelog +VERSION := $(shell head -n 1 $(CURDIR)/debian/changelog | sed 's/.*(//;s/).*//') +B := $(CURDIR)/debian/java-package + +build: build-stamp + +build-stamp: + dh_testdir + # Add here commands to compile the indep part of the package. + sed s/@VERSION@/$(VERSION)/ make-jpkg > make-jpkg.out + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp SUPPORTED make-jpkg.out debian/semantic.cache + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + install -m 755 make-jpkg.out $(B)/usr/bin/make-jpkg + cp lib/*.sh lib/*-common $(B)/usr/share/java-package/ + for dir in $(wildcard oracle-j2*); do \ + cp -a $$dir $(B)/usr/share/java-package/; \ + done + find $(B) -type d -name .svn | xargs -r rm -r + +# Generate SUPPORTED + echo "java-package currently supports the following binary packages:" > SUPPORTED + echo >> SUPPORTED + echo "(This list is automatically generated, do not edit)" >> SUPPORTED + echo >> SUPPORTED + grep -h "SUPPORTED$$" $(wildcard $(CURDIR)/lib/*-*.sh) | sed 's/"//g;s/).*//' >> SUPPORTED + + dh_install + +binary: binary-indep + +binary-arch: + +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman make-jpkg.1 + dh_link +# dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: build clean binary-indep binary install diff --git a/lib/common.sh b/lib/common.sh new file mode 100644 index 0000000..60c2852 --- /dev/null +++ b/lib/common.sh @@ -0,0 +1,194 @@ +# read_yn +function read_yn() { + local prompt="$1" + while true; do + read -e -n 1 -p "$prompt" reply + case "$reply" in + "" | "y" | "Y") + return 0 + ;; + "N" | "n") + return 1 + ;; + esac + done +} + + +# diskusage : prints size in MB +function diskusage() { + local path="$1" + read size dummy < <( du -sm "$path" ) + echo "$size" +} + + +# diskfree +function diskfree() { + local size="$1" + echo -n "Checking free diskspace:" + (( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` )) + + if [ "$free" -ge "$size" ]; then + echo " done." + else + cat >&2 << EOF + + +WARNING: Possibly not enough free disk space in "$tmp". + +You need at least $size MB, but only $free MB seems free. Note: You +can specify an alternate directory by setting the environment variable + +Press Ctrl+C to interrupt, or return to try to continue anyway. + +TMPDIR. + +EOF + read + fi +} + + +# extract_bin +function extract_bin() { + local file="$1" + local expected_min_size="$2" + local dest="$3" + cat << EOF + +In the next step, the binary file will be extracted. Probably a +license agreement will be displayed. Please read this agreement +carefully. If you do not agree to the displayed license terms, the +package will not be built. + +EOF + read -e -p "Press [Return] to continue: " dummy + echo + local extract_dir="$tmp/extract" + mkdir "$extract_dir" + cd "$extract_dir" + echo + + local extract_cmd + case "$archive_path" in + *.tar) + extract_cmd="tar xf";; + *.tar.bz2) + extract_cmd="tar --bzip2 -xf";; + *.tgz|*.tar.gz) + extract_cmd="tar xfz";; + *.zip) + extract_cmd="unzip -q";; + *) + extract_cmd=sh + esac + + if ! $extract_cmd "$archive_path"; then + cat << EOF + +WARNING: The package installation script exited with an error +value. Usually, this means, that the installation failed for some +reason. But in some cases there is no problem and you can continue +creating the Debian package. + +Please check if there are any error messages. Press [Return] to +continue or Ctrl-C to abort. + +EOF + read + fi + echo + echo -n "Testing extracted archive..." + local size="$( diskusage "$extract_dir" )" + if [ "$size" -lt "$expected_min_size" ]; then + cat << EOF + +Invalid size ($size MB) of extracted archive. Probably you have not +enough free disc space in the temporary directory. Note: You can +specify an alternate directory by setting the environment variable +TMPDIR. + +EOF + error_exit + else + cd "$extract_dir" + files=(*) + if [ "${#files[*]}" -ne 1 ]; then + cat << EOF + +Expected one file, but found the following ${#files[*]} files: + ${files[*]} + +EOF + error_exit + fi + mv "$files" "$dest" + echo -e " okay.\n" + fi +} + + +function read_maintainer_info() { + if [ -z "$maintainer_name" ]; then + if [ -n "$DEBFULLNAME" ]; then + maintainer_name="$DEBFULLNAME" + elif [ -n "$DEBNAME" ]; then + maintainer_name="$DEBNAME" + else + default_name="$(getent passwd $(id -run) | cut -d: -f5| cut -d, -f1)" + + cat << EOF + +Please enter your full name. This value will be used in the maintainer +field of the created package. + +EOF + + # gecos can be null + while [ -z "$maintainer_name" ]; do + read -e -p "Full name [$default_name]:" maintainer_name + if [ -z "$maintainer_name" ] && [ -n "$default_name" ]; then + maintainer_name="$default_name" + fi + done + fi + fi + + if [ -z "$maintainer_email" ]; then + local default_email= + if [ -n "$DEBEMAIL" ]; then + maintainer_email="$DEBEMAIL" + else + if [ -r "/etc/mailname" ]; then + default_email="$( id -run )@$( cat /etc/mailname )" + else + default_email="$( id -run )@$( hostname --fqdn )" + fi + cat << EOF + +Please enter a valid email address or press return to accept the +default value. This address will be used in the maintainer field of +the created package. + +EOF + read -e -p "Email [$default_email]: " maintainer_email + if [ -z "$maintainer_email" ]; then + maintainer_email="$default_email" + fi + fi + fi +} + +# provide the architecture for evaluation by plugins +function get_architecture() { + echo + + export DEB_BUILD_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH) + + export DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + echo "Detected Debian build architecture: ${DEB_BUILD_ARCH:-N/A}" + + echo "Detected Debian GNU type: ${DEB_BUILD_GNU_TYPE:-N/A}" +} diff --git a/lib/install-common b/lib/install-common new file mode 100644 index 0000000..5819844 --- /dev/null +++ b/lib/install-common @@ -0,0 +1,22 @@ + # Common functions for all install scripts + + # install_alternative -- add an alternative + # + # install_alternative program + function install_alternative() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" \ + --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \ + "$j2se_base/man/man1/$program.1.gz" + } + + # install_java_plugin -- add an alternative for a browser plugin + # + # install_java_plugin browser_plugin_path java_plugin_path priority + function install_java_plugin() { + [ -d "$1" ] || install -d -m 755 "$1" + update-alternatives \ + --install "$1/$2" "$3" "$4" "$5" + } diff --git a/lib/j2re.sh b/lib/j2re.sh new file mode 100644 index 0000000..bbeb10d --- /dev/null +++ b/lib/j2re.sh @@ -0,0 +1,66 @@ +function j2re_readme() { + j2se_readme +} + +function j2re_changelog() { + j2se_changelog +} + +function j2re_control() { + j2se_control + cat << EOF +Package: $j2se_package +Architecture: any +Depends: \${shlibs:Depends} +Recommends: netbase, libx11-6 | xlibs, libasound2, libgtk1.2 +Provides: java-virtual-machine, java-runtime, java2-runtime, java-runtime-headless, java2-runtime-headless, java-browser-plugin, j2re${j2se_release} +Replaces: ${j2se_package}debian +Description: $j2se_title + The Java(TM) 2 Runtime Environment contains the Java virtual machine, + runtime class libraries, and Java application launcher that are + necessary to run programs written in the Java progamming language + (this includes the Java 2 Plug-In for Netscape and Mozilla + browsers). It is not a development environment and doesn't contain + development tools such as compilers or debuggers. For development + tools, see the Java 2 SDK, Standard Edition. + . + This package has been automatically created with java-package ($version). +EOF +} + +function j2re_copyright() { + j2se_copyright +} + +function j2re_install_scripts() { + j2se_install_scripts +} + +function j2re_info() { + j2se_info +} + +function j2re_build() { + j2se_build +} + +# build debian package +function j2re_run() { + echo + diskfree "$j2se_required_space" + read_maintainer_info + j2se_package="$j2se_vendor-j2re$j2se_release" + j2se_base="/usr/lib/jvm/j2re$j2se_release-$j2se_vendor" + local target="$install_dir$j2se_base" + install -d -m 755 "$( dirname "$target" )" + extract_bin "$archive_path" "$j2se_expected_min_size" "$target" + rm -rf "$target/.systemPrefs" + j2re_readme > "$debian_dir/README.Debian" + j2re_changelog > "$debian_dir/changelog" + j2re_control > "$debian_dir/control" + j2re_copyright > "$debian_dir/copyright" + j2re_install_scripts + install -d "$target/debian" + j2re_info > "$target/debian/info" + j2re_build +} diff --git a/lib/j2sdk-doc.sh b/lib/j2sdk-doc.sh new file mode 100644 index 0000000..42b723b --- /dev/null +++ b/lib/j2sdk-doc.sh @@ -0,0 +1,81 @@ +function j2sdk_doc_readme() { + j2se_readme +} + +function j2sdk_doc_changelog() { + j2se_changelog +} + +function j2sdk_doc_control() { + j2se_control + cat << EOF +Package: $j2se_package +Architecture: any +Depends: +Recommends: +Provides: +Replaces: +Description: $j2se_title + The Java(TM) 2 SDK is a development environment for building + applications, applets, and components that can be deployed on the + Java(TM) platform. + . + This package provides the official API documentation published + by Sun Microsystems. + . + This package has been automatically created with java-package ($version). +EOF +} + +function j2sdk_doc_copyright() { + j2se_copyright +} + +function j2sdk_doc_install_scripts() { + j2se_install_scripts +} + +function j2sdk_doc_info() { + j2se_info +} + +function j2sdk_doc_doc-base() { + cat << EOF +Document: $j2se_package +Title: $j2se_title +Author: $maintainer_name +Abstract: This is the API Javadoc provided by the vendor +Section: Programming + +Format: HTML +Index: /usr/share/doc/j2sdk$j2se_release-$j2se_vendor-doc/index.html +Files: /usr/share/doc/j2sdk$j2se_release-$j2se_vendor-doc/*.html + +EOF +} + +function j2sdk_doc_build() { + j2se_build +} + +# build debian package +function j2sdk_doc_run() { + echo + diskfree "$j2se_required_space" + read_maintainer_info + j2se_package="$j2se_vendor-j2sdk$j2se_release-doc" + j2se_base="/usr/share/doc/j2sdk$j2se_release-$j2se_vendor-doc" + local target="$install_dir$j2se_base" + install -d -m 755 "$( dirname "$target" )" + extract_bin "$archive_path" "$j2se_expected_min_size" "$target" + rm -rf "$target/.systemPrefs" + j2sdk_doc_readme > "$debian_dir/README.Debian" + j2sdk_doc_changelog > "$debian_dir/changelog" + j2sdk_doc_control > "$debian_dir/control" + j2sdk_doc_copyright > "$debian_dir/copyright" + j2sdk_doc_doc-base > "$debian_dir/$j2se_package.doc-base" + j2sdk_doc_install_scripts + install -d "$target/debian" + j2sdk_doc_info > "$target/debian/info" + j2sdk_doc_build +} diff --git a/lib/j2sdk.sh b/lib/j2sdk.sh new file mode 100644 index 0000000..0947c25 --- /dev/null +++ b/lib/j2sdk.sh @@ -0,0 +1,68 @@ +function j2sdk_readme() { + j2se_readme +} + +function j2sdk_changelog() { + j2se_changelog +} + +function j2sdk_control() { + j2se_control + cat << EOF +Package: $j2se_package +Architecture: any +Depends: \${shlibs:Depends} +Recommends: netbase, libx11-6 | xlibs, libasound2, libgtk1.2, libstdc++5 +Provides: java-virtual-machine, java-runtime, java2-runtime, java-browser-plugin, java-compiler, java2-compiler, java-runtime-headless, java2-runtime-headless, java-sdk, java2-sdk, j2sdk$j2se_release, j2re$j2se_release +Replaces: ${j2se_package}debian +Description: $j2se_title + The Java(TM) 2 SDK is a development environment for building + applications, applets, and components that can be deployed on the + Java(TM) platform. + . + The Java(TM) 2 SDK software includes tools useful for developing and + testing programs written in the Java programming language and running + on the Java platform. These tools are designed to be used from the + command line. Except for appletviewer, these tools do not provide a + graphical user interface. + . + This package has been automatically created with java-package ($version). +EOF +} + +function j2sdk_copyright() { + j2se_copyright +} + +function j2sdk_install_scripts() { + j2se_install_scripts +} + +function j2sdk_info() { + j2se_info +} + +function j2sdk_build() { + j2se_build +} + +# build debian package +function j2sdk_run() { + echo + diskfree "$j2se_required_space" + read_maintainer_info + j2se_package="$j2se_vendor-j2sdk$j2se_release" + j2se_base="/usr/lib/jvm/j2sdk$j2se_release-$j2se_vendor" + local target="$install_dir$j2se_base" + install -d -m 755 "$( dirname "$target" )" + extract_bin "$archive_path" "$j2se_expected_min_size" "$target" + rm -rf "$target/.systemPrefs" + j2sdk_readme > "$debian_dir/README.Debian" + j2sdk_changelog > "$debian_dir/changelog" + j2sdk_control > "$debian_dir/control" + j2sdk_copyright > "$debian_dir/copyright" + j2sdk_install_scripts + install -d "$target/debian" + j2sdk_info > "$target/debian/info" + j2sdk_build +} diff --git a/lib/j2se.sh b/lib/j2se.sh new file mode 100644 index 0000000..a02a117 --- /dev/null +++ b/lib/j2se.sh @@ -0,0 +1,184 @@ +function j2se_readme() { + cat << EOF +Package for $j2se_title +--- + +This package has been automatically created with java-package ($version). +All files from the original distribution should have been installed in +the directory $j2se_base. Please take a look at this directory for +further information. + +EOF +} + +function j2se_changelog() { + cat << EOF +$j2se_package ($j2se_version) unstable; urgency=low + + * This package was created with java-package ($version). + + -- $maintainer_name <$maintainer_email> $( date -R ) + +EOF +} + +function j2se_control() { + cat << EOF +Source: $j2se_package +Section: non-free/devel +Priority: optional +Maintainer: $maintainer_name <$maintainer_email> +Build-Depends: debhelper (>= 4.0.0) +Standards-Version: 3.7.2 + +EOF +} + +function j2se_copyright() { + cat << EOF +---------------------------------------------------------------------- + +This file contains a copy of all copyright files found in the original +distribution. The original copyright files and further information can +be found in the directory $j2se_base and its +subdirectories. + +---------------------------------------------------------------------- +EOF + ( + cd "$install_dir" + find * -type f -iname copyright | + while read file; do + cat << EOF + +File: /$file + +---------------------------------------------------------------------- + +EOF + cat "$file" + cat << EOF + +---------------------------------------------------------------------- +EOF + done + ) +} + +function j2se_install_scripts() { + cat > "$debian_dir/postinst" << EOF +#!/bin/bash + +set -e + +if [ "\$1" = configure ]; then +EOF + cat "$lib_dir/install-common" >> "$debian_dir/postinst" + + cat "$lib_dir/$j2se_package/install" >> "$debian_dir/postinst" + + cat >> "$debian_dir/postinst" << EOF +fi + +#DEBHELPER# + +exit 0 +EOF + chmod 755 "$debian_dir/postinst" + + cat > "$debian_dir/prerm" << EOF +#!/bin/bash + +set -e + +case "\$1" in + remove | deconfigure) +EOF + cat "$lib_dir/remove-common" >> "$debian_dir/prerm" + + cat "$lib_dir/$j2se_package/remove" >> "$debian_dir/prerm" + + cat >> "$debian_dir/prerm" << EOF + ;; +esac + +#DEBHELPER# + +exit 0 +EOF + chmod 755 "$debian_dir/prerm" +} + +function j2se_info() { + cat << EOF +version="$version" +j2se_version="$j2se_version" +maintainer_name="$maintainer_name" +maintainer_email="$maintainer_email" +date="$( date +%Y/%m/%d )" +EOF +} + +function j2se_build() { + cd "$tmp" + echo "Create debian package:" + + #export DH_VERBOSE=1 + export DH_COMPAT=4 + export DH_OPTIONS=--tmpdir="$install_dir" + + echo " dh_testdir" + dh_testdir + echo " dh_testroot" + dh_testroot + echo " dh_installchangelogs" + dh_installchangelogs + # Problem: dh_installchangelogs thinks this is a native package. + echo " dh_installdocs" + dh_installdocs + # dh_install + # dh_link + # Conditionally wrapping this as not all JRE/JDKs have man directories + if [ -e "$install_dir/$j2se_base/man" ]; then + echo " dh_compress" + dh_compress $( find "$install_dir/$j2se_base/man" -type f ! -name "*.gz" ) + fi + echo " dh_fixperms" + dh_fixperms + echo " dh_installdeb" + dh_installdeb + echo " dh_shlibdeps" + ldpath= + for dir in $( find "$install_dir" -type f -name "*.so*" -printf "%h\n" | sort -u ); do + if [[ -z "$ldpath" ]]; then + ldpath="$dir" + else + ldpath="$ldpath:$dir" + fi + done + # suppress some warnings + dh_shlibdeps -l"$ldpath" 2>&1 | + { grep -v "warning: format of \`NEEDED lib.*\.so' not recognized" >&2 || true; } + echo " dh_gencontrol" + dh_gencontrol + echo " dh_md5sums" + dh_md5sums + echo " dh_builddeb" + dh_builddeb --destdir="$tmp" + local deb_filename="$( echo "${j2se_package}_"*.deb )" + echo " copy $deb_filename into directory $working_dir/" + cp "$deb_filename" "$working_dir/" + if [ -n "$genchanges" ]; then + echo " dpkg-genchanges" + local changes_filename="${deb_filename%.deb}.changes" + dpkg-genchanges -b -u. > "$changes_filename" + echo " copy $changes_filename into directory $working_dir/" + cp "$changes_filename" "$working_dir/" + fi + cat << EOF + +The Debian package has been created in the current directory. You can +install the package as root (e.g. dpkg -i $deb_filename). + +EOF +} diff --git a/lib/oracle-j2re.sh b/lib/oracle-j2re.sh new file mode 100644 index 0000000..5b4480e --- /dev/null +++ b/lib/oracle-j2re.sh @@ -0,0 +1,54 @@ +# Detect product +function oracle_j2re_detect() { + local found= + + case "${DEB_BUILD_ARCH:-$DEB_BUILD_GNU_TYPE}" in + i386|i486-linux-gnu) + case "$archive_name" in + "jre-6u"[0-9][0-9]"-linux-i586.bin") # SUPPORTED + j2se_version=1.6.0+update${archive_name:6:2}${revision} + j2se_expected_min_size=16 #Mb + found=true + ;; + "jre-7u"[0-9]"-linux-i586.tar.gz") # SUPPORTED + j2se_version=1.7.0+update${archive_name:6:1}${revision} + j2se_expected_min_size=94 #Mb + found=true + ;; + esac + ;; + amd64|x86_64-linux-gnu) + case "$archive_name" in + "jre-6u"[0-9][0-9]"-linux-x64.bin") # SUPPORTED + j2se_version=1.6.0+update${archive_name:6:2}${revision} + j2se_expected_min_size=16 #Mb + found=true + ;; + "jre-7u"[0-9]"-linux-x64.tar.gz") # SUPPORTED + j2se_version=1.7.0+update${archive_name:6:1}${revision} + j2se_expected_min_size=88 #Mb + found=true + ;; + esac + ;; + esac + if [[ -n "$found" ]]; then + cat << EOF + +Detected product: + Java(TM) Runtime Environment (JRE) + Standard Edition, Version $j2se_version + Oracle Microsystems(TM), Inc. +EOF + if read_yn "Is this correct [Y/n]: "; then + j2se_found=true + j2se_release="${j2se_version:0:3}" + j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 )) + j2se_vendor="oracle" + j2se_title="Java(TM) JRE, Standard Edition, Oracle Microsystems(TM)" + j2re_run + fi + fi +} + +j2se_detect_oracle_j2re=oracle_j2re_detect diff --git a/lib/oracle-j2sdk-doc.sh b/lib/oracle-j2sdk-doc.sh new file mode 100644 index 0000000..5fa8026 --- /dev/null +++ b/lib/oracle-j2sdk-doc.sh @@ -0,0 +1,35 @@ +# Detect product +function oracle_j2sdk_doc_detect() { + local found= + case "$archive_name" in + "jdk-6u"[0-9][0-9]"-apidocs.zip") # SUPPORTED + j2se_version=1.6.0+update${archive_name:6:2}${revision} + j2se_expected_min_size=44 #Mb + found=true + ;; + "jdk-7u"[0-9]"-apidocs.zip") # SUPPORTED + j2se_version=1.7.0+update${archive_name:6:1}${revision} + j2se_expected_min_size=290 #Mb + found=true + ;; + esac + if [[ -n "$found" ]]; then + cat << EOF + +Detected product: + Java(TM) Development Kit (JDK) Documentation + Standard Edition, Version $j2se_version + Oracle(TM), Inc. +EOF + if read_yn "Is this correct [Y/n]: "; then + j2se_found=true + j2se_release="${j2se_version:0:3}" + j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 )) + j2se_vendor="oracle" + j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM) Documentation" + j2sdk_doc_run + fi + fi +} + +j2se_detect_j2sdk_doc_oracle=oracle_j2sdk_doc_detect diff --git a/lib/oracle-j2sdk.sh b/lib/oracle-j2sdk.sh new file mode 100644 index 0000000..1e525e3 --- /dev/null +++ b/lib/oracle-j2sdk.sh @@ -0,0 +1,54 @@ +# Detect product +function oracle_j2sdk_detect() { + local found= + + case "${DEB_BUILD_ARCH:-$DEB_BUILD_GNU_TYPE}" in + i386|i486-linux-gnu) + case "$archive_name" in + "jdk-6u"[0-9][0-9]"-linux-i586.bin") # SUPPORTED + j2se_version=1.6.0+update${archive_name:6:2}${revision} + j2se_expected_min_size=130 #Mb + found=true + ;; + "jdk-7u"[0-9]"-linux-i586.tar.gz") # SUPPORTED + j2se_version=1.7.0+update${archive_name:6:1}${revision} + j2se_expected_min_size=190 #Mb + found=true + ;; + esac + ;; + amd64|x86_64-linux-gnu) + case "$archive_name" in + "jdk-6u"[0-9][0-9]"-linux-x64.bin") # SUPPORTED + j2se_version=1.6.0+update${archive_name:6:2}${revision} + j2se_expected_min_size=130 #Mb + found=true + ;; + "jdk-7u"[0-9]"-linux-x64.tar.gz") # SUPPORTED + j2se_version=1.7.0+update${archive_name:6:1}${revision} + j2se_expected_min_size=180 #Mb + found=true + ;; + esac + ;; + esac + if [[ -n "$found" ]]; then + cat << EOF + +Detected product: + Java(TM) Development Kit (JDK) + Standard Edition, Version $j2se_version + Oracle(TM), Inc. +EOF + if read_yn "Is this correct [Y/n]: "; then + j2se_found=true + j2se_release="${j2se_version:0:3}" + j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 )) + j2se_vendor="oracle" + j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM)" + j2sdk_run + fi + fi +} + +j2se_detect_oracle_j2sdk=oracle_j2sdk_detect diff --git a/lib/remove-common b/lib/remove-common new file mode 100644 index 0000000..f775324 --- /dev/null +++ b/lib/remove-common @@ -0,0 +1,20 @@ + # Common functions for all install scripts + + # remove_alternative -- remove an alternative + # + # remove_alternative program + function remove_alternative() { + local program="$1" + update-alternatives \ + --remove "$program" "/usr/bin/$program-$suffix" + rm "/usr/bin/$program-$suffix" + } + + # remove_java_plugin -- add an alternative for a browser plugin + # + # remove_java_plugin plugins_path + function remove_java_plugin() { + local program="$1" + update-alternatives \ + --remove "$program" "$plugin_dir/libjavaplugin_oji.so" + } diff --git a/make-jpkg b/make-jpkg new file mode 100755 index 0000000..2c82962 --- /dev/null +++ b/make-jpkg @@ -0,0 +1,231 @@ +#! /bin/bash -e + +shopt -s nullglob + +### global variables + +# version of this package +version="@VERSION@" + +working_dir="$( pwd )" +program_name="$( basename "$0" )" +program_dir="$( cd "$( dirname "$( type -p "$0" )" )" ; pwd )" + +lib_dir="/usr/share/java-package" +[ "$J2SE_PACKAGE_LIBDIR" ] && lib_dir="$J2SE_PACKAGE_LIBDIR" + +# If a default has been set for either of the +# environment variables, use it; otherwise, +# default to the name and email used by the +# Debian Java Maintainers project. +if [ -z "$J2SE_PACKAGE_FULL_NAME" ]; then + maintainer_name="Debian Java Maintainers" +else + maintainer_name="$J2SE_PACKAGE_FULL_NAME" +fi + +if [ -z "$J2SE_PACKAGE_EMAIL" ]; then + maintainer_email="pkg-java-maintainers@lists.alioth.debian.org" +else + maintainer_email="$J2SE_PACKAGE_EMAIL" +fi + +genchanges="" + +### check for run in fakeroot + +# are we running as fakeroot +if ! dh_testroot >/dev/null 2>&1; then + if [ -n "$FAKEROOTKEY" ]; then + echo "Internal error, fakeroot seems to fail faking root" >&2 + exit 1 + fi + exec fakeroot "$0" "$@" +fi + +# check whether I'm real root, and bail out if so... ugly, but needed +if touch /lib/.test 2>/dev/null; then + rm -f /lib/.test + echo "You are real root -- unfortunately, some Java distributions have" >&2 + echo "install scripts that directly manipulate /etc, and may cause some" >&2 + echo "inconsistencies on your system. Instead, you should become a" >&2 + echo "non-root user and run:" >&2 + echo >&2 + echo "fakeroot make-jpkg $@" >&2 + echo >&2 + echo "which will allow no damage to be done to your system files and" >&2 + echo "still permit the Java distribution to successfully extract." >&2 + echo >&2 + echo "Aborting." >&2 + exit 1 +fi + + +### Parse options + +function print_usage() { + cat << EOF +Usage: $program_name [OPTION]... FILE + +$program_name builds Debian packages from Java(TM) 2 binary distributions. + + --full-name NAME full name used in the maintainer field of the package + --email EMAIL email address used in the maintainer field of the package + --changes create a .changes file + --revision add debian revision + + --help display this help and exit + --version output version information and exit + +EOF +} + +function unrecognized_option() { + cat >&2 << EOF +$program_name: unrecognized option \`$1' +Try \`$program_name --help' for more information. +EOF + exit 1 +} + +function missing_argument() { + cat >&2 << EOF +$program_name: missing argument for option \`$1' +Try \`$program_name --help' for more information. +EOF + exit 1 +} + +# options +while [[ $# -gt 0 && "x$1" == x--* ]]; do + if [[ "x$1" == x--version ]]; then + echo "make-jpkg $version" + exit 0 + elif [[ "x$1" == x--help ]]; then + print_usage + exit 0 + elif [[ "x$1" == x--full-name ]]; then + [ $# -le 1 ] && missing_argument "$1" + shift + maintainer_name="$1" + elif [[ "x$1" == x--email ]]; then + [ $# -le 1 ] && missing_argument "$1" + shift + maintainer_email="$1" + elif [[ "x$1" == x--revision ]]; then + [ $# -le 1 ] && missing_argument "$1" + shift + revision="-${1}" + elif [[ "x$1" == x--changes ]]; then + genchanges="true" + else + unrecognized_option "$1" + fi + shift +done + +# last argument +if [[ $# -ne 1 ]]; then + cat >&2 << EOF +$program_name: missing pathname +Try \`$program_name --help' for more information. +EOF + exit 1 +fi +archive="$1" + +if [[ ! -e "$archive" ]]; then + echo "Error: The file \"$archive\" does not exist." + exit 1 +elif [[ ! -r "$archive" ]]; then + echo "Error: The file \"$archive\" is not readable." + exit 1 +fi + +archive_name="$( basename "$archive" )" +archive_dir="$( cd "$( dirname "$archive" )" ; pwd )" +archive_path="$archive_dir/$archive_name" + + +# error handling + +success= +failed= +tmp= + +# function is called when script terminates +function on_exit() { + lastcmd="$_" + if [[ -z "$success" && -z "$failed" ]]; then + cat >&2 << EOF + +Aborted ($lastcmd). + +EOF + fi + # remove temporary directory + if [ -n "$tmp" -a -d "$tmp" ]; then + echo -n "Removing temporary directory: " + rm -rf "$tmp" + echo "done" + fi +} +trap on_exit EXIT + +# print error message and terminate +function error_exit() { + cat >&2 << EOF + +Aborted. + +EOF + failed=true + exit 1 +} + + + +# The environment variable tmp points to a secure temporary directory. +# There should be enough free disk space. +echo -n "Creating temporary directory: " +tmp="$( mktemp -d -t "$program_name.XXXXXXXXXX" )" +echo "$tmp" + +debian_dir="$tmp/debian" +install -d -m 755 "$debian_dir" + +install_dir="$tmp/install" +install -d -m 755 "$install_dir" + +# load and execute plugins +echo -n "Loading plugins:" +cd "$lib_dir" +files=(*.sh) +for file in "${files[@]}"; do + echo -n " $file" + source "$lib_dir/$file" +done + +echo + +# get architecture information +get_architecture + +j2se_found= +for var in ${!j2se_detect_*}; do + eval "\$$var" + if [[ "$j2se_found" == "true" ]]; then + break; + fi +done +echo + +if [[ -z "$j2se_found" ]]; then + echo "No matching plugin was found." +fi + + + +### exit +success=true +exit 0 diff --git a/make-jpkg.1 b/make-jpkg.1 new file mode 100644 index 0000000..dee5358 --- /dev/null +++ b/make-jpkg.1 @@ -0,0 +1,82 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MAKE-JPKG 1 "November 04, 2005" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +make-jpkg \- build Debian packages from Java(TM) 2 binary distributions +.SH SYNOPSIS +.B make-jpkg +[\fIOPTION\fR]... [\fIFILE\fR] +.SH DESCRIPTION +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +.PP +\fBmake-jpkg\fP creates a Debian package from a Java(TM) 2 +distribution. This program works currently with the following Java(TM) 2 REs, SDKs and APIs: + Oracle(TM) 1.6 Standard Edition (starting with update 10) + Oracle(TM) 1.7 Standard Edition +.PP +The following options are recognized: +.TP +.B --full-name \fINAME\fR +full name used in the maintainer field of the package +.TP +.B --email \fIEMAIL\fR +email address used in the maintainer field of the package +.TP +.B --changes +create a .changes file +.TP +.B --revision +add debian revision +.TP +.B --help +display help text and exit +.TP +.B --version +output version information and exit +.PP +Download a supported Java(TM) 2 RE or SDK or API tar.gz or self-extracting archive from +.B http://www.oracle.com/technetwork/java/javase/downloads +and execute +.B make-jpkg +.I file +with the downloaded file. The program asks the user for additional +information and creates a Debian binary package in the current +directory. +.PP +The program requires about 200 MB free disk space in a temporary +directory. The temporary directory defaults to +.I /tmp +but you can specify an alternate directory by setting the environment +variable \fITMPDIR\fR. +.SH ENVIRONMENT +.TP +.SM TMPDIR +base directory used for temporary files (defaults to /tmp) +.TP +.SM J2SE_PACKAGE_FULL_NAME +full name used in the maintainer field of the package; if none is supplied +then the default of "Debian Java Maintainers" is used. +.TP +.SM J2SE_PACKAGE_EMAIL +email address used in the maintainer field of the package; if none is supplied +the default of "pkg-java-maintainers@lists.alioth.debian.org" is used. +.SH AUTHOR +This manual page was written by Hubert Schmid . + +It is now maintained by the Debian Java Maintainers . diff --git a/oracle-j2re1.6/install b/oracle-j2re1.6/install new file mode 100644 index 0000000..fa9151e --- /dev/null +++ b/oracle-j2re1.6/install @@ -0,0 +1,56 @@ +suffix=j2re1.6-oracle +j2se_base="/usr/lib/jvm/$suffix" +priority=316 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" \ + --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \ + "$j2se_base/man/man1/$program.1.gz" +} + +# kinit, klist, and ktab not installed at this +# time; handling of /etc/krb5.conf not addressed +program_alternative ControlPanel +program_alternative java +program_alternative javaws +program_alternative keytool +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmid +program_alternative rmiregistry +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/lib/$arch_dir" + +# iceweasel +iceweasel_dir="/usr/lib/iceweasel/plugins" +[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir" +update-alternatives \ + --install "$iceweasel_dir/libjavaplugin.so" \ + "iceweasel-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + +# chromium +chromium_dir="/usr/lib/chromium/plugins" +[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir" +update-alternatives \ + --install "$chromium_dir/libjavaplugin.so" \ + "chromium-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + diff --git a/oracle-j2re1.6/remove b/oracle-j2re1.6/remove new file mode 100644 index 0000000..889ce94 --- /dev/null +++ b/oracle-j2re1.6/remove @@ -0,0 +1,41 @@ +suffix=j2re1.6-oracle +j2se_base="/usr/lib/jre/$suffix" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --remove "$program" "$j2se_base/bin/$program" +} + +program_alternative ControlPanel +program_alternative java +program_alternative javaws +program_alternative keytool +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmid +program_alternative rmiregistry +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/lib/$arch_dir" + +# iceweasel +update-alternatives \ + --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so" + +# chromium +update-alternatives \ + --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so" diff --git a/oracle-j2re1.7/install b/oracle-j2re1.7/install new file mode 100644 index 0000000..8f31b56 --- /dev/null +++ b/oracle-j2re1.7/install @@ -0,0 +1,56 @@ +suffix=j2re1.7-oracle +j2se_base="/usr/lib/jvm/$suffix" +priority=316 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" \ + --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \ + "$j2se_base/man/man1/$program.1.gz" +} + +# kinit, klist, and ktab not installed at this +# time; handling of /etc/krb5.conf not addressed +program_alternative ControlPanel +program_alternative java +program_alternative javaws +program_alternative keytool +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmid +program_alternative rmiregistry +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/lib/$arch_dir" + +# iceweasel +iceweasel_dir="/usr/lib/iceweasel/plugins" +[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir" +update-alternatives \ + --install "$iceweasel_dir/libjavaplugin.so" \ + "iceweasel-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + +# chromium +chromium_dir="/usr/lib/chromium/plugins" +[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir" +update-alternatives \ + --install "$chromium_dir/libjavaplugin.so" \ + "chromium-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + diff --git a/oracle-j2re1.7/remove b/oracle-j2re1.7/remove new file mode 100644 index 0000000..d0526c8 --- /dev/null +++ b/oracle-j2re1.7/remove @@ -0,0 +1,41 @@ +suffix=j2re1.7-oracle +j2se_base="/usr/lib/jre/$suffix" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --remove "$program" "$j2se_base/bin/$program" +} + +program_alternative ControlPanel +program_alternative java +program_alternative javaws +program_alternative keytool +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmid +program_alternative rmiregistry +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/lib/$arch_dir" + +# iceweasel +update-alternatives \ + --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so" + +# chromium +update-alternatives \ + --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so" diff --git a/oracle-j2sdk1.6-doc/install b/oracle-j2sdk1.6-doc/install new file mode 100644 index 0000000..f4d1134 --- /dev/null +++ b/oracle-j2sdk1.6-doc/install @@ -0,0 +1,16 @@ +j2se_base="/usr/share/doc/j2sdk1.6-oracle-doc" +priority=316 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# Register the documentation with the various +# documentation systems, i.e. dhelp and dwww. + +if [ "$1" = configure ] ; then + if which install-docs >/dev/null 2>&1; then + install-docs -i /usr/share/doc-base/oracle-j2sdk1.6-doc + fi +fi + diff --git a/oracle-j2sdk1.6-doc/remove b/oracle-j2sdk1.6-doc/remove new file mode 100644 index 0000000..a1e2e9d --- /dev/null +++ b/oracle-j2sdk1.6-doc/remove @@ -0,0 +1,7 @@ +j2se_base="/usr/share/doc/j2sdk1.6-oracle-doc" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + + diff --git a/oracle-j2sdk1.6/install b/oracle-j2sdk1.6/install new file mode 100644 index 0000000..8cf335f --- /dev/null +++ b/oracle-j2sdk1.6/install @@ -0,0 +1,87 @@ +suffix=j2sdk1.6-oracle +j2se_base="/usr/lib/jvm/$suffix" +priority=315 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" \ + --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \ + "$j2se_base/man/man1/$program.1.gz" +} + +# alternative without man page +function program_alternative_no_man() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" +} + +# kinit, klist, and ktab not installed at this +# time; handling of /etc/krb5.conf not addressed +# JRE-specific alternatives with JDKs cannot be +# handled by our current approach +program_alternative appletviewer +program_alternative_no_man ControlPanel +program_alternative extcheck +program_alternative idlj +program_alternative jar +program_alternative jarsigner +program_alternative java +program_alternative javac +program_alternative javadoc +program_alternative javah +program_alternative javap +program_alternative javaws +program_alternative jconsole +program_alternative jdb +program_alternative jinfo +program_alternative jmap +program_alternative jps +program_alternative jsadebugd +program_alternative jstack +program_alternative jstat +program_alternative jstatd +program_alternative keytool +program_alternative native2ascii +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmic +program_alternative rmid +program_alternative rmiregistry +program_alternative serialver +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/jre/lib/$arch_dir" + +# iceweasel +iceweasel_dir="/usr/lib/iceweasel/plugins" +[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir" +update-alternatives \ + --install "$iceweasel_dir/libjavaplugin.so" \ + "iceweasel-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + +# chromium +chromium_dir="/usr/lib/chromium/plugins" +[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir" +update-alternatives \ + --install "$chromium_dir/libjavaplugin.so" \ + "chromium-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + diff --git a/oracle-j2sdk1.6/remove b/oracle-j2sdk1.6/remove new file mode 100644 index 0000000..02badc3 --- /dev/null +++ b/oracle-j2sdk1.6/remove @@ -0,0 +1,63 @@ +suffix=j2sdk1.6-oracle +j2se_base="/usr/lib/jvm/$suffix" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --remove "$program" "$j2se_base/bin/$program" +} + +program_alternative appletviewer +program_alternative ControlPanel +program_alternative extcheck +program_alternative idlj +program_alternative jar +program_alternative jarsigner +program_alternative java +program_alternative javac +program_alternative javadoc +program_alternative javah +program_alternative javap +program_alternative java-rmi.cgi +program_alternative javaws +program_alternative jconsole +program_alternative jdb +program_alternative jinfo +program_alternative jmap +program_alternative jps +program_alternative jsadebugd +program_alternative jstack +program_alternative jstat +program_alternative jstatd +program_alternative keytool +program_alternative native2ascii +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmic +program_alternative rmid +program_alternative rmiregistry +program_alternative serialver +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/jre/lib/$arch_dir" + +# iceweasel +update-alternatives \ + --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so" + +# chromium +update-alternatives \ + --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so" diff --git a/oracle-j2sdk1.7-doc/install b/oracle-j2sdk1.7-doc/install new file mode 100644 index 0000000..3813af3 --- /dev/null +++ b/oracle-j2sdk1.7-doc/install @@ -0,0 +1,16 @@ +j2se_base="/usr/share/doc/j2sdk1.7-oracle-doc" +priority=316 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# Register the documentation with the various +# documentation systems, i.e. dhelp and dwww. + +if [ "$1" = configure ] ; then + if which install-docs >/dev/null 2>&1; then + install-docs -i /usr/share/doc-base/oracle-j2sdk1.7-doc + fi +fi + diff --git a/oracle-j2sdk1.7-doc/remove b/oracle-j2sdk1.7-doc/remove new file mode 100644 index 0000000..0119a79 --- /dev/null +++ b/oracle-j2sdk1.7-doc/remove @@ -0,0 +1,7 @@ +j2se_base="/usr/share/doc/j2sdk1.7-oracle-doc" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + + diff --git a/oracle-j2sdk1.7/install b/oracle-j2sdk1.7/install new file mode 100644 index 0000000..42d44d7 --- /dev/null +++ b/oracle-j2sdk1.7/install @@ -0,0 +1,88 @@ +suffix=j2sdk1.7-oracle +j2se_base="/usr/lib/jvm/$suffix" +priority=315 + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" \ + --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \ + "$j2se_base/man/man1/$program.1.gz" +} + +# alternative without man page +function program_alternative_no_man() { + local program="$1" + update-alternatives \ + --install "/usr/bin/$program" "$program" \ + "$j2se_base/bin/$program" "$priority" +} + +# kinit, klist, and ktab not installed at this +# time; handling of /etc/krb5.conf not addressed +# JRE-specific alternatives with JDKs cannot be +# handled by our current approach +program_alternative appletviewer +program_alternative_no_man ControlPanel +program_alternative extcheck +program_alternative idlj +program_alternative jar +program_alternative jarsigner +program_alternative java +program_alternative javac +program_alternative javadoc +program_alternative javah +program_alternative javap +program_alternative_no_man java-rmi.cgi +program_alternative javaws +program_alternative jconsole +program_alternative jdb +program_alternative jinfo +program_alternative jmap +program_alternative jps +program_alternative jsadebugd +program_alternative jstack +program_alternative jstat +program_alternative jstatd +program_alternative keytool +program_alternative native2ascii +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmic +program_alternative rmid +program_alternative rmiregistry +program_alternative serialver +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/jre/lib/$arch_dir" + +# iceweasel +iceweasel_dir="/usr/lib/iceweasel/plugins" +[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir" +update-alternatives \ + --install "$iceweasel_dir/libjavaplugin.so" \ + "iceweasel-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + +# chromium +chromium_dir="/usr/lib/chromium/plugins" +[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir" +update-alternatives \ + --install "$chromium_dir/libjavaplugin.so" \ + "chromium-javaplugin.so" \ + "$plugin_dir/libnpjp2.so" "$priority" + diff --git a/oracle-j2sdk1.7/remove b/oracle-j2sdk1.7/remove new file mode 100644 index 0000000..5e23e7c --- /dev/null +++ b/oracle-j2sdk1.7/remove @@ -0,0 +1,63 @@ +suffix=j2sdk1.7-oracle +j2se_base="/usr/lib/jvm/$suffix" + +if [ ! -e "$j2se_base/debian/info" ]; then + exit 0 +fi + +# alternative +function program_alternative() { + local program="$1" + update-alternatives \ + --remove "$program" "$j2se_base/bin/$program" +} + +program_alternative appletviewer +program_alternative ControlPanel +program_alternative extcheck +program_alternative idlj +program_alternative jar +program_alternative jarsigner +program_alternative java +program_alternative javac +program_alternative javadoc +program_alternative javah +program_alternative javap +program_alternative java-rmi.cgi +program_alternative javaws +program_alternative jconsole +program_alternative jdb +program_alternative jinfo +program_alternative jmap +program_alternative jps +program_alternative jsadebugd +program_alternative jstack +program_alternative jstat +program_alternative jstatd +program_alternative keytool +program_alternative native2ascii +program_alternative orbd +program_alternative pack200 +program_alternative policytool +program_alternative rmic +program_alternative rmid +program_alternative rmiregistry +program_alternative serialver +program_alternative servertool +program_alternative tnameserv +program_alternative unpack200 + +# derive the architecture-specific +# directory for the plugin +arch_dir="$(dpkg --print-architecture)" + +# assemble the plugin path +plugin_dir="$j2se_base/jre/lib/$arch_dir" + +# iceweasel +update-alternatives \ + --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so" + +# chromium +update-alternatives \ + --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so" -- 2.39.5