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 $jvm_base$j2se_name. Please take a look at this directory for
16 $j2se_package ($j2se_version) unstable; urgency=low
18 * This package was created with java-package ($version).
20 -- $maintainer_name <$maintainer_email> $( date -R )
28 Section: non-free/devel
30 Maintainer: $maintainer_name <$maintainer_email>
31 Build-Depends: debhelper (>= 9)
32 Standards-Version: 3.9.5
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 $jvm_base$j2se_name and its
46 ----------------------------------------------------------------------
50 find * -type f -iname copyright |
56 ----------------------------------------------------------------------
62 ----------------------------------------------------------------------
77 j2se_install_scripts() {
78 cat > "$debian_dir/postinst" << EOF
83 if [ "\$1" = configure ]; then
85 # Common functions for all install scripts
87 # install_alternatives program_base programs
88 install_alternatives() {
91 for program in \$*; do
92 if [[ -f "\$program_base/\$program" ]]; then
93 update-alternatives \\
94 --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
95 --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
100 # install_alternatives_no_man program_base programs
101 install_no_man_alternatives() {
104 for program in \$*; do
105 if [[ -f "\$program_base/\$program" ]]; then
106 update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
111 # install_browser_plugin link_path link_name plugin_name plugin
112 install_browser_plugin() {
113 local link_path="\$1"
114 local link_name="\$2"
115 local plugin_name="\$3"
117 [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
118 if [[ -f "\$plugin" ]]; then
119 update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
124 eval "$j2se_install" >> "$debian_dir/postinst"
126 cat >> "$debian_dir/postinst" << EOF
133 chmod 755 "$debian_dir/postinst"
135 cat > "$debian_dir/prerm" << EOF
141 remove | deconfigure)
143 # Common functions for all remove scripts
145 # remove_alternatives program_base programs
146 remove_alternatives() {
149 for program in \$*; do
150 update-alternatives --remove "\$program" "\$program_base/\$program"
154 # remove_browser_plugin plugin_name plugin
155 remove_browser_plugin() {
156 local plugin_name="\$1"
158 update-alternatives --remove "\$plugin_name" "\$plugin"
162 eval "$j2se_remove" >> "$debian_dir/prerm"
164 cat >> "$debian_dir/prerm" << EOF
172 chmod 755 "$debian_dir/prerm"
178 j2se_version="$j2se_version"
179 maintainer_name="$maintainer_name"
180 maintainer_email="$maintainer_email"
181 date="$( date +%Y/%m/%d )"
185 # jinfos prefix program_base programs
190 for program in $*; do
191 echo "$prefix $program $program_base$program"
197 echo "Create debian package:"
200 export DH_OPTIONS=--tmpdir="$install_dir"
206 echo " dh_installchangelogs"
208 # Problem: dh_installchangelogs thinks this is a native package.
209 echo " dh_installdocs"
213 # Conditionally wrapping this as not all JRE/JDKs have man directories
214 if [ -e "$install_dir/$jvm_base$j2se_name/man" ]; then
216 dh_compress $( find "$install_dir/$jvm_base$j2se_name/man" -type f ! -name "*.gz" )
220 echo " dh_installdeb"
224 for dir in $( find "$install_dir" -type f -name "*.so*" -printf "%h\n" | sort -u ); do
225 if [[ -z "$ldpath" ]]; then
228 ldpath="$ldpath:$dir"
231 # suppress some warnings
232 dh_shlibdeps --exclude=fxavcodecplugin -l"$ldpath" 2>&1 |
233 { grep -v "warning: format of \`NEEDED lib.*\.so' not recognized" >&2 || true; }
234 echo " dh_gencontrol"
239 dh_builddeb --destdir="$tmp"
240 local deb_filename="$( echo "${j2se_package}_"*.deb )"
241 echo " copy $deb_filename into directory $working_dir/"
242 cp "$deb_filename" "$working_dir/"
243 if [ -n "$genchanges" ]; then
244 echo " dpkg-genchanges"
245 local changes_filename="${deb_filename%.deb}.changes"
246 dpkg-genchanges -b -u. > "$changes_filename"
247 echo " copy $changes_filename into directory $working_dir/"
248 cp "$changes_filename" "$working_dir/"
252 The Debian package has been created in the current directory.
253 You can install the package as root with:
255 dpkg -i $deb_filename