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
15 $j2se_package ($j2se_version) unstable; urgency=medium
17 * This package was created with java-package ($version).
19 -- $maintainer_name <$maintainer_email> $( date -R )
24 if test -n "$build_depends"; then
25 build_depends=", $build_depends"
29 Section: non-free/devel
31 Maintainer: $maintainer_name <$maintainer_email>
32 Build-Depends: debhelper (>= 9)${build_depends}
33 Standards-Version: 3.9.7
40 ----------------------------------------------------------------------
42 This file contains a copy of all copyright files found in the original
43 distribution. The original copyright files and further information can
44 be found in the directory $jvm_base$j2se_name and its
47 ----------------------------------------------------------------------
51 find * -type f -iname copyright ! -path debian/copyright |
57 ----------------------------------------------------------------------
60 iconv -f ISO-8859-15 -t UTF-8 "$file" | sed 's/[ \t]*$//'
63 ----------------------------------------------------------------------
77 dh_compress \$(shell find $j2se_name/man/ -type f ! -name '*.gz' -printf '${jvm_base##/}/%p\n')
79 override_dh_shlibdeps:
80 dh_shlibdeps --exclude=fxavcodecplugin --exclude=avplugin -l\$(shell find $j2se_name -type f -name '*.so*' -printf '${jvm_base##/}/%h\n' | sort -u | tr '\n' ':' | sed 's/:\$\$//')
82 override_dh_strip_nondeterminism:
83 # Disable dh_strip_nondeterminism to speed up the build
94 override_dh_strip_nondeterminism:
95 # Disable dh_strip_nondeterminism to speed up the build
100 j2se_install_scripts() {
101 cat > "$debian_dir/postinst" << EOF
106 if [ "\$1" = configure ]; then
108 # Common functions for all install scripts
110 # install_alternatives program_base programs
111 install_alternatives() {
114 for program in \$*; do
115 if [[ -f "\$program_base/\$program" ]]; then
116 update-alternatives \\
117 --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
118 --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
123 # install_alternatives_no_man program_base programs
124 install_no_man_alternatives() {
127 for program in \$*; do
128 if [[ -f "\$program_base/\$program" ]]; then
129 update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
134 # install_browser_plugin link_path link_name plugin_name plugin
135 install_browser_plugin() {
136 local link_path="\$1"
137 local link_name="\$2"
138 local plugin_name="\$3"
140 [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
141 if [[ -f "\$plugin" ]]; then
142 update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
146 if [ "$create_cert_softlinks" == "true" ];then
147 cat >> "$debian_dir/postinst" << EOF
148 for subdir in lib/security jre/lib/security;do
149 if [ -f $jvm_base$j2se_name/\$subdir/cacerts ]; then
150 ln -sf /etc/ssl/certs/java/cacerts $jvm_base$j2se_name/\$subdir/cacerts
155 eval "$j2se_install" >> "$debian_dir/postinst"
157 cat >> "$debian_dir/postinst" << EOF
164 chmod 755 "$debian_dir/postinst"
166 cat > "$debian_dir/prerm" << EOF
172 remove | deconfigure)
174 # Common functions for all remove scripts
176 # remove_alternatives program_base programs
177 remove_alternatives() {
180 for program in \$*; do
181 update-alternatives --remove "\$program" "\$program_base/\$program"
185 # remove_browser_plugin plugin_name plugin
186 remove_browser_plugin() {
187 local plugin_name="\$1"
189 update-alternatives --remove "\$plugin_name" "\$plugin"
193 eval "$j2se_remove" >> "$debian_dir/prerm"
195 cat >> "$debian_dir/prerm" << EOF
203 chmod 755 "$debian_dir/prerm"
209 j2se_version="$j2se_version"
210 maintainer_name="$maintainer_name"
211 maintainer_email="$maintainer_email"
212 date="$( date +%Y/%m/%d )"
216 # jinfos prefix program_base programs
221 for program in $*; do
222 echo "$prefix $program $program_base$program"
227 if [ -n "$build_source" ]; then
228 local source_dir=${j2se_package}-${j2se_version}
229 echo " copy ${source_dir} into directory $working_dir/"
230 rm -rf "$working_dir/${source_dir}"
231 cp -r "$package_dir" "$working_dir/${source_dir}"
234 The Debian source package has been created in the current directory.
235 You can build the package with:
238 dpkg-buildpackage -b -uc -us
243 echo "Create debian package:"
245 dpkg-buildpackage -b -uc -us
247 local deb_filename="$( echo "${j2se_package}_"*.deb )"
248 echo " copy $deb_filename into directory $working_dir/"
249 cp "$deb_filename" "$working_dir/"
250 if [ -n "$genchanges" ]; then
251 echo " dpkg-genchanges"
252 local changes_filename="${deb_filename%.deb}.changes"
253 echo " copy $changes_filename into directory $working_dir/"
254 cp "$changes_filename" "$working_dir/"
258 The Debian package has been created in the current directory.
259 You can install the package as root with:
261 dpkg -i $deb_filename
267 # build debian package
270 diskfree "$j2se_required_space"
272 case "${j2se_arch}" in
274 j2se_debian_arch=i386
277 j2se_debian_arch=amd64
280 j2se_name="$j2se_package-$j2se_debian_arch"
281 local target="$package_dir/$j2se_name"
282 install -d -m 755 "$( dirname "$target" )"
283 extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
284 rm -rf "$target/.systemPrefs"
285 echo "9" > "$debian_dir/compat"
286 j2se_readme > "$debian_dir/README.Debian"
287 j2se_changelog > "$debian_dir/changelog"
288 eval "$j2se_control" > "$debian_dir/control"
289 j2se_copyright > "$debian_dir/copyright"
290 j2se_rules > "$debian_dir/rules"
291 chmod +x "$debian_dir/rules"
293 install -d "$target/debian"
294 j2se_info > "$target/debian/info"
295 eval "$j2se_jinfo" > "$package_dir/.$j2se_name.jinfo"
296 echo ".$j2se_name.jinfo $jvm_base" > "$debian_dir/install"
297 echo "$j2se_name $jvm_base" >> "$debian_dir/install"