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 (>= 4.0.0)
32 Standards-Version: 3.7.2
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 ----------------------------------------------------------------------
68 j2se_install_scripts() {
69 cat > "$debian_dir/postinst" << EOF
74 if [ "\$1" = configure ]; then
76 # Common functions for all install scripts
78 # install_alternatives program_base programs
79 install_alternatives() {
82 for program in \$*; do
83 if [[ -f "\$program_base/\$program" ]]; then
84 update-alternatives \\
85 --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
86 --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
91 # install_alternatives_no_man program_base programs
92 install_no_man_alternatives() {
95 for program in \$*; do
96 if [[ -f "\$program_base/\$program" ]]; then
97 update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
102 # install_browser_plugin link_path link_name plugin_name plugin
103 install_browser_plugin() {
104 local link_path="\$1"
105 local link_name="\$2"
106 local plugin_name="\$3"
108 [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
109 if [[ -f "\$plugin" ]]; then
110 update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
115 eval "$j2se_install" >> "$debian_dir/postinst"
117 cat >> "$debian_dir/postinst" << EOF
124 chmod 755 "$debian_dir/postinst"
126 cat > "$debian_dir/prerm" << EOF
132 remove | deconfigure)
134 # Common functions for all remove scripts
136 # remove_alternatives program_base programs
137 remove_alternatives() {
140 for program in \$*; do
141 update-alternatives --remove "\$program" "\$program_base/\$program"
145 # remove_browser_plugin plugin_name plugin
146 remove_browser_plugin() {
147 local plugin_name="\$1"
149 update-alternatives --remove "\$plugin_name" "\$plugin"
153 eval "$j2se_remove" >> "$debian_dir/prerm"
155 cat >> "$debian_dir/prerm" << EOF
163 chmod 755 "$debian_dir/prerm"
169 j2se_version="$j2se_version"
170 maintainer_name="$maintainer_name"
171 maintainer_email="$maintainer_email"
172 date="$( date +%Y/%m/%d )"
176 # jinfos prefix program_base programs
181 for program in $*; do
182 echo "$prefix $program $program_base$program"
188 echo "Create debian package:"
192 export DH_OPTIONS=--tmpdir="$install_dir"
198 echo " dh_installchangelogs"
200 # Problem: dh_installchangelogs thinks this is a native package.
201 echo " dh_installdocs"
205 # Conditionally wrapping this as not all JRE/JDKs have man directories
206 if [ -e "$install_dir/$jvm_base$j2se_name/man" ]; then
208 dh_compress $( find "$install_dir/$jvm_base$j2se_name/man" -type f ! -name "*.gz" )
212 echo " dh_installdeb"
216 for dir in $( find "$install_dir" -type f -name "*.so*" -printf "%h\n" | sort -u ); do
217 if [[ -z "$ldpath" ]]; then
220 ldpath="$ldpath:$dir"
223 # suppress some warnings
224 dh_shlibdeps -l"$ldpath" 2>&1 |
225 { grep -v "warning: format of \`NEEDED lib.*\.so' not recognized" >&2 || true; }
226 echo " dh_gencontrol"
231 dh_builddeb --destdir="$tmp"
232 local deb_filename="$( echo "${j2se_package}_"*.deb )"
233 echo " copy $deb_filename into directory $working_dir/"
234 cp "$deb_filename" "$working_dir/"
235 if [ -n "$genchanges" ]; then
236 echo " dpkg-genchanges"
237 local changes_filename="${deb_filename%.deb}.changes"
238 dpkg-genchanges -b -u. > "$changes_filename"
239 echo " copy $changes_filename into directory $working_dir/"
240 cp "$changes_filename" "$working_dir/"
244 The Debian package has been created in the current directory. You can
245 install the package as root (e.g. dpkg -i $deb_filename).