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 update-alternatives \\
84 --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
85 --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
89 # install_alternatives_no_man program_base programs
90 install_no_man_alternatives() {
93 for program in \$*; do
94 update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
98 # install_browser_plugin link_path link_name plugin_name plugin
99 install_browser_plugin() {
100 local link_path="\$1"
101 local link_name="\$2"
102 local plugin_name="\$3"
104 [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
105 update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
109 eval "$j2se_install" >> "$debian_dir/postinst"
111 cat >> "$debian_dir/postinst" << EOF
118 chmod 755 "$debian_dir/postinst"
120 cat > "$debian_dir/prerm" << EOF
126 remove | deconfigure)
128 # Common functions for all remove scripts
130 # remove_alternatives program_base programs
131 remove_alternatives() {
134 for program in \$*; do
135 update-alternatives --remove "\$program" "\$program_base/\$program"
139 # remove_browser_plugin plugin_name plugin
140 remove_browser_plugin() {
141 local plugin_name="\$1"
143 update-alternatives --remove "\$plugin_name" "\$plugin"
147 eval "$j2se_remove" >> "$debian_dir/prerm"
149 cat >> "$debian_dir/prerm" << EOF
157 chmod 755 "$debian_dir/prerm"
163 j2se_version="$j2se_version"
164 maintainer_name="$maintainer_name"
165 maintainer_email="$maintainer_email"
166 date="$( date +%Y/%m/%d )"
170 # jinfos prefix program_base programs
175 for program in $*; do
176 echo "$prefix $program $program_base$program"
182 echo "Create debian package:"
186 export DH_OPTIONS=--tmpdir="$install_dir"
192 echo " dh_installchangelogs"
194 # Problem: dh_installchangelogs thinks this is a native package.
195 echo " dh_installdocs"
199 # Conditionally wrapping this as not all JRE/JDKs have man directories
200 if [ -e "$install_dir/$jvm_base$j2se_name/man" ]; then
202 dh_compress $( find "$install_dir/$jvm_base$j2se_name/man" -type f ! -name "*.gz" )
206 echo " dh_installdeb"
210 for dir in $( find "$install_dir" -type f -name "*.so*" -printf "%h\n" | sort -u ); do
211 if [[ -z "$ldpath" ]]; then
214 ldpath="$ldpath:$dir"
217 # suppress some warnings
218 dh_shlibdeps -l"$ldpath" 2>&1 |
219 { grep -v "warning: format of \`NEEDED lib.*\.so' not recognized" >&2 || true; }
220 echo " dh_gencontrol"
225 dh_builddeb --destdir="$tmp"
226 local deb_filename="$( echo "${j2se_package}_"*.deb )"
227 echo " copy $deb_filename into directory $working_dir/"
228 cp "$deb_filename" "$working_dir/"
229 if [ -n "$genchanges" ]; then
230 echo " dpkg-genchanges"
231 local changes_filename="${deb_filename%.deb}.changes"
232 dpkg-genchanges -b -u. > "$changes_filename"
233 echo " copy $changes_filename into directory $working_dir/"
234 cp "$changes_filename" "$working_dir/"
238 The Debian package has been created in the current directory. You can
239 install the package as root (e.g. dpkg -i $deb_filename).