5 read -e -n 1 -p "$prompt" reply
18 # diskusage <path>: prints size in MB
21 read size dummy < <( du -sm --apparent-size "$path" )
26 # diskfree <minimum size in MB>
29 echo -n "Checking free diskspace:"
30 (( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` ))
32 if [ "$free" -ge "$size" ]; then
38 WARNING: Possibly not enough free disk space in "$tmp".
40 You need at least $size MB, but only $free MB seems free. Note: You
41 can specify an alternate directory by setting the environment variable
43 Press Ctrl+C to interrupt, or return to try to continue anyway.
53 # extract_bin <file> <expected_min_size> <dest>
56 local expected_min_size="$2"
60 In the next step, the binary file will be extracted. Probably a
61 license agreement will be displayed. Please read this agreement
62 carefully. If you do not agree to the displayed license terms, the
63 package will not be built.
66 read -e -p "Press [Return] to continue: " dummy
68 local extract_dir="$tmp/extract"
74 case "$archive_path" in
76 extract_cmd="tar xf";;
78 extract_cmd="tar --bzip2 -xf";;
80 extract_cmd="tar xfz";;
82 extract_cmd="unzip -q";;
87 if ! $extract_cmd "$archive_path"; then
90 WARNING: The package installation script exited with an error
91 value. Usually, this means, that the installation failed for some
92 reason. But in some cases there is no problem and you can continue
93 creating the Debian package.
95 Please check if there are any error messages. Press [Return] to
96 continue or Ctrl-C to abort.
102 echo -n "Testing extracted archive..."
103 local size="$( diskusage "$extract_dir" )"
104 if [ "$size" -lt "$expected_min_size" ]; then
107 Invalid size ($size MB) of extracted archive. Probably you have not
108 enough free disc space in the temporary directory. Note: You can
109 specify an alternate directory by setting the environment variable
117 if [ "${#files[*]}" -ne 1 ]; then
120 Expected one file, but found the following ${#files[*]} files:
135 echo "Installing unlimited strength cryptography files using $zip_file"
136 for f in {US_export,local}_policy.jar; do
137 unzip -o -j -d "$dest_dir" "$zip_file" "*/$f"
141 read_maintainer_info() {
142 if [ -z "$maintainer_name" ]; then
143 if [ -n "$DEBFULLNAME" ]; then
144 maintainer_name="$DEBFULLNAME"
145 elif [ -n "$DEBNAME" ]; then
146 maintainer_name="$DEBNAME"
148 default_name="$(getent passwd $(id -run) | cut -d: -f5| cut -d, -f1)"
152 Please enter your full name. This value will be used in the maintainer
153 field of the created package.
158 while [ -z "$maintainer_name" ]; do
159 read -e -p "Full name [$default_name]:" maintainer_name
160 if [ -z "$maintainer_name" ] && [ -n "$default_name" ]; then
161 maintainer_name="$default_name"
167 if [ -z "$maintainer_email" ]; then
169 if [ -n "$DEBEMAIL" ]; then
170 maintainer_email="$DEBEMAIL"
172 if [ -r "/etc/mailname" ]; then
173 default_email="$( id -run )@$( cat /etc/mailname )"
175 default_email="$( id -run )@$( hostname --fqdn )"
179 Please enter a valid email address or press return to accept the
180 default value. This address will be used in the maintainer field of
184 read -e -p "Email [$default_email]: " maintainer_email
185 if [ -z "$maintainer_email" ]; then
186 maintainer_email="$default_email"
192 # provide the architecture for evaluation by plugins
196 export DEB_BUILD_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
198 export DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)
200 echo "Detected Debian build architecture: ${DEB_BUILD_ARCH:-N/A}"
202 echo "Detected Debian GNU type: ${DEB_BUILD_GNU_TYPE:-N/A}"
205 # get browser plugin directories
206 get_browser_plugin_dirs() {
207 if dpkg-vendor --derives-from Ubuntu; then
208 export browser_plugin_dirs="xulrunner-addons firefox iceape iceweasel mozilla midbrowser xulrunner"
210 export browser_plugin_dirs=mozilla
215 if [ -n "$distribution" ]; then
216 target_distribution="$distribution"
218 target_distribution="unstable"