[ "$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
+# 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"
fi
genchanges=""
+build_source=""
+jce_archive=""
### check for run in fakeroot
echo "Internal error, fakeroot seems to fail faking root" >&2
exit 1
fi
- exec fakeroot "$0" "$@"
+ 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
+ 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
print_usage() {
- cat << EOF
+ cat << EOF
Usage: $program_name [OPTION]... FILE
-$program_name builds Debian packages from Java(TM) 2 binary distributions.
+$program_name builds a Debian package from the given Java binary distribution FILE
+
+Supported java binary distributions currently include:
+ * Oracle (http://www.oracle.com/technetwork/java/javase/downloads) :
+ - The Java Development Kit (JDK), version 6, 7 and 8
+ - The Java Runtime Environment (JRE), version 6, 7 and 8
+ - The Java API Javadoc, version 6, 7 and 8
+ (Choose tar.gz archives or self-extracting archives, do _not_ choose the RPM!)
- --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
+The following options are recognized:
- --help display this help and exit
- --version output version information and exit
+ --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
+ --distribution DIST Define the distribution to use in the changelog
+ --priority PRIORITY Override default package priority
+ --changes create a .changes file
+ --revision add debian revision
+ --source build a source package instead of a binary deb package
+ --with-system-certs integrate with the system's keystore
+ --jce-policy FILE Replace cryptography files with versions from FILE
+
+ --help display this help and exit
+ --version output version information and exit
EOF
}
# options
while [[ $# -gt 0 && "x$1" == x--* ]]; do
if [[ "x$1" == x--version ]]; then
- echo "make-jpkg $version"
- exit 0
+ echo "make-jpkg $version"
+ exit 0
elif [[ "x$1" == x--help ]]; then
- print_usage
- exit 0
+ print_usage
+ exit 0
+ elif [[ "x$1" == x--jce-policy ]]; then
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ jce_archive="$1"
elif [[ "x$1" == x--full-name ]]; then
- [ $# -le 1 ] && missing_argument "$1"
- shift
- maintainer_name="$1"
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ maintainer_name="$1"
elif [[ "x$1" == x--email ]]; then
- [ $# -le 1 ] && missing_argument "$1"
- shift
- maintainer_email="$1"
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ maintainer_email="$1"
+ elif [[ "x$1" == x--distribution ]]; then
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ distribution="$1"
+ elif [[ "x$1" == x--priority ]]; then
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ priority_override="$1"
elif [[ "x$1" == x--revision ]]; then
- [ $# -le 1 ] && missing_argument "$1"
- shift
- revision="-${1}"
+ [ $# -le 1 ] && missing_argument "$1"
+ shift
+ revision="-${1}"
elif [[ "x$1" == x--changes ]]; then
- genchanges="true"
+ genchanges="true"
+ elif [[ "x$1" == x--source ]]; then
+ build_source="true"
+ elif [[ "x$1" == x--with-system-certs ]]; then
+ create_cert_softlinks="true"
else
- unrecognized_option "$1"
+ unrecognized_option "$1"
fi
shift
done
archive_dir="$( cd "$( dirname "$archive" )" ; pwd )"
archive_path="$archive_dir/$archive_name"
+jce_name="$( basename "$jce_archive" )"
+jce_dir="$( cd "$( dirname "$jce_archive" )" ; pwd )"
+jce_path="$jce_dir/$jce_name"
# error handling
on_exit() {
lastcmd="$_"
if [[ -z "$success" && -z "$failed" ]]; then
- cat >&2 << EOF
+ cat >&2 << EOF
Aborted ($lastcmd).
fi
# remove temporary directory
if [ -n "$tmp" -a -d "$tmp" ]; then
- echo -n "Removing temporary directory: "
- rm -rf "$tmp"
- echo "done"
+ echo -n "Removing temporary directory: "
+ rm -rf "$tmp"
+ echo "done"
fi
}
trap on_exit EXIT
tmp="$( mktemp -d -t "$program_name.XXXXXXXXXX" )"
echo "$tmp"
-debian_dir="$tmp/debian"
-install -d -m 755 "$debian_dir"
+package_dir="$tmp/package"
+install -d -m 755 "$package_dir"
-install_dir="$tmp/install"
-install -d -m 755 "$install_dir"
+debian_dir="$package_dir/debian"
+install -d -m 755 "$debian_dir"
# load and execute plugins
echo -n "Loading plugins:"
-cd "$lib_dir"
-files=(*.sh)
+files=($lib_dir/*.sh)
for file in "${files[@]}"; do
echo -n " $file"
- source "$lib_dir/$file"
+ source "$file"
done
echo
# get architecture information
get_architecture
+# get browser plugin directories
+get_browser_plugin_dirs
+
jvm_base="/usr/lib/jvm/"
javadoc_base="/usr/share/doc/"
j2se_found=
-for var in ${!j2se_detect_*}; do
+for var in ${!j2se_detect_*}; do
eval "\$$var"
if [[ "$j2se_found" == "true" ]]; then
- break;
+ break;
fi
done
echo
if [[ -z "$j2se_found" ]]; then
- echo "No matching plugin was found."
+ echo "No matching packaging method was found for $archive_name."
+ echo "Please make sure you are using a tar.gz or a self-extracting archive"
fi