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 ----------------------------------------------------------------------
73 # Exclude libraries that pull in ALSA or OpenGL which are not needed in normal operation
76 --exclude=fxavcodecplugin \\
77 --exclude=libjsoundalsa.so \\
79 for lib in $exlude_libs; do
80 printf '\t--exclude=%s \\\n' "$lib"
89 dh_compress \$(shell find $j2se_name/man/ -type f ! -name '*.gz' -printf '${jvm_base##/}/%p\n')
91 override_dh_shlibdeps:
92 dh_shlibdeps \$(EXCLUDE_LIBS) -l\$(shell find $j2se_name -type f -name '*.so*' -printf '${jvm_base##/}/%h\n' | sort -u | tr '\n' ':' | sed 's/:\$\$//')
94 override_dh_strip_nondeterminism:
95 # Disable dh_strip_nondeterminism to speed up the build
106 override_dh_strip_nondeterminism:
107 # Disable dh_strip_nondeterminism to speed up the build
112 j2se_install_scripts() {
113 cat > "$debian_dir/postinst" << EOF
118 if [ "\$1" = configure ]; then
120 # Common functions for all install scripts
122 # install_alternatives program_base programs
123 install_alternatives() {
126 for program in \$*; do
127 if [[ -f "\$program_base/\$program" ]]; then
128 update-alternatives \\
129 --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
130 --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
135 # install_alternatives_no_man program_base programs
136 install_no_man_alternatives() {
139 for program in \$*; do
140 if [[ -f "\$program_base/\$program" ]]; then
141 update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
146 # install_browser_plugin link_path link_name plugin_name plugin
147 install_browser_plugin() {
148 local link_path="\$1"
149 local link_name="\$2"
150 local plugin_name="\$3"
152 [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
153 if [[ -f "\$plugin" ]]; then
154 update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
158 if [ "$create_cert_softlinks" == "true" ];then
159 cat >> "$debian_dir/postinst" << EOF
160 for subdir in lib/security jre/lib/security;do
161 if [ -f $jvm_base$j2se_name/\$subdir/cacerts ]; then
162 ln -sf /etc/ssl/certs/java/cacerts $jvm_base$j2se_name/\$subdir/cacerts
167 eval "$j2se_install" >> "$debian_dir/postinst"
169 cat >> "$debian_dir/postinst" << EOF
176 chmod 755 "$debian_dir/postinst"
178 cat > "$debian_dir/prerm" << EOF
184 remove | deconfigure)
186 # Common functions for all remove scripts
188 # remove_alternatives program_base programs
189 remove_alternatives() {
192 for program in \$*; do
193 update-alternatives --remove "\$program" "\$program_base/\$program"
197 # remove_browser_plugin plugin_name plugin
198 remove_browser_plugin() {
199 local plugin_name="\$1"
201 update-alternatives --remove "\$plugin_name" "\$plugin"
205 eval "$j2se_remove" >> "$debian_dir/prerm"
207 cat >> "$debian_dir/prerm" << EOF
215 chmod 755 "$debian_dir/prerm"
221 j2se_version="$j2se_version"
222 maintainer_name="$maintainer_name"
223 maintainer_email="$maintainer_email"
224 date="$( date +%Y/%m/%d )"
228 # jinfos prefix program_base programs
233 for program in $*; do
234 echo "$prefix $program $program_base$program"
239 if [ -n "$build_source" ]; then
240 local source_dir=${j2se_package}-${j2se_version}
241 echo " copy ${source_dir} into directory $working_dir/"
242 rm -rf "$working_dir/${source_dir}"
243 cp -r "$package_dir" "$working_dir/${source_dir}"
246 The Debian source package has been created in the current directory.
247 You can build the package with:
250 dpkg-buildpackage -b -uc -us
255 echo "Create debian package:"
257 dpkg-buildpackage -b -uc -us
259 local deb_filename="$( echo "${j2se_package}_"*.deb )"
260 echo " copy $deb_filename into directory $working_dir/"
261 cp "$deb_filename" "$working_dir/"
262 if [ -n "$genchanges" ]; then
263 echo " dpkg-genchanges"
264 local changes_filename="${deb_filename%.deb}.changes"
265 echo " copy $changes_filename into directory $working_dir/"
266 cp "$changes_filename" "$working_dir/"
270 The Debian package has been created in the current directory.
271 You can install the package as root with:
273 dpkg -i $deb_filename
279 # build debian package
282 diskfree "$j2se_required_space"
284 case "${j2se_arch}" in
286 j2se_debian_arch=i386
289 j2se_debian_arch=amd64
292 j2se_name="$j2se_package-$j2se_debian_arch"
293 local target="$package_dir/$j2se_name"
294 install -d -m 755 "$( dirname "$target" )"
295 extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
296 rm -rf "$target/.systemPrefs"
297 echo "9" > "$debian_dir/compat"
298 j2se_readme > "$debian_dir/README.Debian"
299 j2se_changelog > "$debian_dir/changelog"
300 eval "$j2se_control" > "$debian_dir/control"
301 j2se_copyright > "$debian_dir/copyright"
302 j2se_rules > "$debian_dir/rules"
303 chmod +x "$debian_dir/rules"
305 install -d "$target/debian"
306 j2se_info > "$target/debian/info"
307 eval "$j2se_jinfo" > "$package_dir/.$j2se_name.jinfo"
308 echo ".$j2se_name.jinfo $jvm_base" > "$debian_dir/install"
309 echo "$j2se_name $jvm_base" >> "$debian_dir/install"