Package: java-package
Architecture: all
-Depends: ${misc:Depends}, debhelper (>= 9), fakeroot, unzip, libx11-6, libasound2,
+Depends: ${misc:Depends}, debhelper (>= 9), dpkg-dev, fakeroot, unzip, libx11-6, libasound2,
lsb-release
-Recommends: dpkg-dev, gcc
+Recommends: gcc
Suggests: openjdk-7-jre
Description: Utility for creating Java Debian packages
This package provides the capability to build a Debian package from
----------------------------------------------------------------------
EOF
(
- cd "$install_dir"
- find * -type f -iname copyright |
+ cd "$package_dir"
+ find * -type f -iname copyright ! -path debian/copyright |
while read file; do
cat << EOF
-File: /$file
+File: $jvm_base$file
----------------------------------------------------------------------
%:
dh \$@
+
+override_dh_compress:
+ dh_compress \$(shell find $j2se_name/man/ -type f ! -name '*.gz' -printf '${jvm_base##/}/%p\n')
+
+override_dh_shlibdeps:
+ dh_shlibdeps --exclude=fxavcodecplugin -l\$(shell find $j2se_name -type f -name '*.so*' -printf '${jvm_base##/}/%h\n' | sort -u | tr '\n' ':' | sed 's/:\$\$//')
EOF
}
}
j2se_build() {
- cd "$tmp"
+ cd "$package_dir"
echo "Create debian package:"
- #export DH_VERBOSE=1
- 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/$jvm_base$j2se_name/man" ]; then
- echo " dh_compress"
- dh_compress $( find "$install_dir/$jvm_base$j2se_name/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 --exclude=fxavcodecplugin -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"
+ dpkg-buildpackage -b -uc -us
+ cd "$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
read_maintainer_info
j2se_package="$j2se_vendor-java$j2se_release-doc"
j2se_name="jdk$j2se_release-$j2se_vendor-doc"
- local target="$install_dir$javadoc_base$j2se_name"
+ local target="$package_dir/$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
j2se_changelog > "$debian_dir/changelog"
j2sdk_doc_control > "$debian_dir/control"
j2se_copyright > "$debian_dir/copyright"
+ echo "$j2se_name $javadoc_base" > "$debian_dir/install"
j2sdk_doc_doc-base > "$debian_dir/$j2se_package.doc-base"
j2se_rules > "$debian_dir/rules"
chmod +x "$debian_dir/rules"
read_maintainer_info
j2se_package="$j2se_vendor-java$j2se_release-jdk"
j2se_name="jdk-$j2se_release-$j2se_vendor-$j2se_arch"
- local target="$install_dir$jvm_base$j2se_name"
+ local target="$package_dir/$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
j2se_changelog > "$debian_dir/changelog"
j2sdk_control > "$debian_dir/control"
j2se_copyright > "$debian_dir/copyright"
+ echo "$j2se_name $jvm_base" > "$debian_dir/install"
j2se_rules > "$debian_dir/rules"
chmod +x "$debian_dir/rules"
j2se_install_scripts
install -d "$target/debian"
j2se_info > "$target/debian/info"
- eval "$j2se_jinfo" > "$install_dir$jvm_base.$j2se_name.jinfo"
+ eval "$j2se_jinfo" > "$package_dir/.$j2se_name.jinfo"
+ echo ".$j2se_name.jinfo $jvm_base" >> "$debian_dir/install"
j2se_build
}
read_maintainer_info
j2se_package="$j2se_vendor-java$j2se_release-jre"
j2se_name="jre-$j2se_release-$j2se_vendor-$j2se_arch"
- local target="$install_dir$jvm_base$j2se_name"
+ local target="$package_dir/$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
j2se_changelog > "$debian_dir/changelog"
j2re_control > "$debian_dir/control"
j2se_copyright > "$debian_dir/copyright"
+ echo "$j2se_name $jvm_base" > "$debian_dir/install"
j2se_rules > "$debian_dir/rules"
chmod +x "$debian_dir/rules"
j2se_install_scripts
install -d "$target/debian"
j2se_info > "$target/debian/info"
- eval "$j2se_jinfo" > "$install_dir$jvm_base.$j2se_name.jinfo"
+ eval "$j2se_jinfo" > "$package_dir/.$j2se_name.jinfo"
+ echo ".$j2se_name.jinfo $jvm_base" >> "$debian_dir/install"
j2se_build
}
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:"