1 function j2se_readme() {
3 Package for $j2se_title
6 This package has been automatically created with java-package ($version).
7 All files from the original distribution should have been installed in
8 the directory $j2se_base. Please take a look at this directory for
14 function j2se_changelog() {
16 $j2se_package ($j2se_version) unstable; urgency=low
18 * This package was created with java-package ($version).
20 -- $maintainer_name <$maintainer_email> $( date -R )
25 function j2se_control() {
28 Section: non-free/devel
30 Maintainer: $maintainer_name <$maintainer_email>
31 Build-Depends: debhelper (>= 4.0.0)
32 Standards-Version: 3.7.2
37 function j2se_copyright() {
39 ----------------------------------------------------------------------
41 This file contains a copy of all copyright files found in the original
42 distribution. The original copyright files and further information can
43 be found in the directory $j2se_base and its
46 ----------------------------------------------------------------------
50 find * -type f -iname copyright |
56 ----------------------------------------------------------------------
62 ----------------------------------------------------------------------
68 function j2se_install_scripts() {
69 cat > "$debian_dir/postinst" << EOF
74 if [ "\$1" = configure ]; then
76 cat "$lib_dir/install-common" >> "$debian_dir/postinst"
78 cat "$lib_dir/$j2se_package/install" >> "$debian_dir/postinst"
80 cat >> "$debian_dir/postinst" << EOF
87 chmod 755 "$debian_dir/postinst"
89 cat > "$debian_dir/prerm" << EOF
97 cat "$lib_dir/remove-common" >> "$debian_dir/prerm"
99 cat "$lib_dir/$j2se_package/remove" >> "$debian_dir/prerm"
101 cat >> "$debian_dir/prerm" << EOF
109 chmod 755 "$debian_dir/prerm"
112 function j2se_info() {
115 j2se_version="$j2se_version"
116 maintainer_name="$maintainer_name"
117 maintainer_email="$maintainer_email"
118 date="$( date +%Y/%m/%d )"
122 function j2se_build() {
124 echo "Create debian package:"
128 export DH_OPTIONS=--tmpdir="$install_dir"
134 echo " dh_installchangelogs"
136 # Problem: dh_installchangelogs thinks this is a native package.
137 echo " dh_installdocs"
141 # Conditionally wrapping this as not all JRE/JDKs have man directories
142 if [ -e "$install_dir/$j2se_base/man" ]; then
144 dh_compress $( find "$install_dir/$j2se_base/man" -type f ! -name "*.gz" )
148 echo " dh_installdeb"
152 for dir in $( find "$install_dir" -type f -name "*.so*" -printf "%h\n" | sort -u ); do
153 if [[ -z "$ldpath" ]]; then
156 ldpath="$ldpath:$dir"
159 # suppress some warnings
160 dh_shlibdeps -l"$ldpath" 2>&1 |
161 { grep -v "warning: format of \`NEEDED lib.*\.so' not recognized" >&2 || true; }
162 echo " dh_gencontrol"
167 dh_builddeb --destdir="$tmp"
168 local deb_filename="$( echo "${j2se_package}_"*.deb )"
169 echo " copy $deb_filename into directory $working_dir/"
170 cp "$deb_filename" "$working_dir/"
171 if [ -n "$genchanges" ]; then
172 echo " dpkg-genchanges"
173 local changes_filename="${deb_filename%.deb}.changes"
174 dpkg-genchanges -b -u. > "$changes_filename"
175 echo " copy $changes_filename into directory $working_dir/"
176 cp "$changes_filename" "$working_dir/"
180 The Debian package has been created in the current directory. You can
181 install the package as root (e.g. dpkg -i $deb_filename).