version 1.1.1.2, 2012/05/29 12:26:49
|
version 1.1.1.4, 2013/07/22 10:46:11
|
Line 1
|
Line 1
|
#!/bin/sh |
#!/bin/sh |
# Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED |
# Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED |
pp_revision="355" | pp_revision="371" |
# Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED. |
# Copyright 2012 Quest Software, Inc. ALL RIGHTS RESERVED. |
# |
# |
# Redistribution and use in source and binary forms, with or without |
# Redistribution and use in source and binary forms, with or without |
Line 2288 pp_sd_write_files () {
|
Line 2288 pp_sd_write_files () {
|
# current working (source) directory, not the destination; |
# current working (source) directory, not the destination; |
# we need to qualify them to prevent this. |
# we need to qualify them to prevent this. |
case "$st" in |
case "$st" in |
/*) echo "$line $st $p";; | [!/]*) st="`dirname \"$p\"`/$st";; |
*) echo "$line `dirname $p`/$st $p";; | |
esac |
esac |
|
echo "$line -o $o -g $g -m $m $st $p" |
;; |
;; |
*) |
*) |
echo "$line -o $o -g $g -m $m $pp_destdir$p $p" |
echo "$line -o $o -g $g -m $m $pp_destdir$p $p" |
Line 3847 pp_backend_deb_init () {
|
Line 3847 pp_backend_deb_init () {
|
pp_deb_release= |
pp_deb_release= |
pp_deb_arch= |
pp_deb_arch= |
pp_deb_arch_std= |
pp_deb_arch_std= |
pp_deb_maintainer=support@quest.com | pp_deb_maintainer="Quest Software, Inc <support@quest.com>" |
pp_deb_copyright= |
pp_deb_copyright= |
pp_deb_distro= |
pp_deb_distro= |
pp_deb_control_description= |
pp_deb_control_description= |
Line 3863 pp_backend_deb_init () {
|
Line 3863 pp_backend_deb_init () {
|
|
|
# Make sure any programs we require are installed |
# Make sure any programs we require are installed |
pp_deb_check_required_programs |
pp_deb_check_required_programs |
|
|
# Set generated/interrogated platforms variables |
|
pp_deb_munge_description |
|
} |
} |
|
|
pp_deb_check_required_programs () { |
pp_deb_check_required_programs () { |
Line 3896 pp_deb_check_required_programs () {
|
Line 3893 pp_deb_check_required_programs () {
|
pp_deb_munge_description () { |
pp_deb_munge_description () { |
# Insert a leading space on each line, replace blank lines with a |
# Insert a leading space on each line, replace blank lines with a |
#space followed by a full-stop. |
#space followed by a full-stop. |
pp_deb_control_description=`echo ${pp_deb_description:-$description} | \ | pp_deb_control_description="`echo ${pp_deb_description:-$description} | \ |
sed "s,^\(.*\)$, \1, " \ | sed 's,^\(.*\)$, \1, ' | sed 's,^[ \t]*$, .,g' | fmt -w 80`" |
| sed "s,^[ \t]*$, .,g"` | |
| |
} |
} |
|
|
pp_deb_detect_arch () { |
pp_deb_detect_arch () { |
Line 3934 pp_deb_conflict () {
|
Line 3929 pp_deb_conflict () {
|
} |
} |
|
|
pp_deb_make_control() { |
pp_deb_make_control() { |
package_name=`pp_deb_cmp_full_name "$1"` | local cmp="$1" |
| local installed_size |
| |
| # compute the installed size |
| installed_size=`pp_deb_files_size < $pp_wrkdir/%files.$cmp` |
| |
| package_name=`pp_deb_cmp_full_name "$cmp"` |
cat <<-. |
cat <<-. |
Package: ${package_name} |
Package: ${package_name} |
Version: `pp_deb_version_final`-${pp_deb_release:-1} |
Version: `pp_deb_version_final`-${pp_deb_release:-1} |
Line 3944 pp_deb_make_control() {
|
Line 3945 pp_deb_make_control() {
|
Maintainer: ${pp_deb_maintainer:-$maintainer} |
Maintainer: ${pp_deb_maintainer:-$maintainer} |
Description: ${pp_deb_summary:-$summary} |
Description: ${pp_deb_summary:-$summary} |
${pp_deb_control_description} |
${pp_deb_control_description} |
|
Installed-Size: ${installed_size} |
. |
. |
if test -s $pp_wrkdir/%depend."$1"; then | if test -s $pp_wrkdir/%depend."$cmp"; then |
sed -ne '/^[ ]*$/!s/^[ ]*/Depends: /p' \ |
sed -ne '/^[ ]*$/!s/^[ ]*/Depends: /p' \ |
< $pp_wrkdir/%depend."$1" | < $pp_wrkdir/%depend."$cmp" |
fi |
fi |
if test -s $pp_wrkdir/%conflict."$1"; then | if test -s $pp_wrkdir/%conflict."$cmp"; then |
pp_deb_conflict < $pp_wrkdir/%conflict."$1" | pp_deb_conflict < $pp_wrkdir/%conflict."$cmp" |
fi |
fi |
} |
} |
|
|
Line 4002 pp_deb_handle_services() {
|
Line 4004 pp_deb_handle_services() {
|
#-- append %post code to install the svc |
#-- append %post code to install the svc |
test x"yes" = x"$enable" && |
test x"yes" = x"$enable" && |
cat<<-. >> $pp_wrkdir/%post.run |
cat<<-. >> $pp_wrkdir/%post.run |
# Install the service links | case "\$1" in |
/usr/sbin/update-rc.d $svc defaults | configure) |
| # Install the service links |
| update-rc.d $svc defaults |
| ;; |
| esac |
. |
. |
|
|
#-- prepend %preun code to stop svc |
#-- prepend %preun code to stop svc |
cat<<-. | pp_prepend $pp_wrkdir/%preun.run |
cat<<-. | pp_prepend $pp_wrkdir/%preun.run |
# Stop the $svc service | case "\$1" in |
if test -x /usr/sbin/invoke-rc.d; then | remove|deconfigure|upgrade) |
/usr/sbin/invoke-rc.d $svc stop | # Stop the $svc service |
else | invoke-rc.d $svc stop |
/etc/init.d/$svc stop | ;; |
fi | esac |
# Remove the service links | |
/usr/sbin/update-rc.d -f $svc remove | |
. |
. |
|
|
|
#-- prepend %postun code to remove service |
|
cat<<-. | pp_prepend $pp_wrkdir/%postun.run |
|
case "\$1" in |
|
purge) |
|
# Remove the service links |
|
update-rc.d $svc remove |
|
;; |
|
esac |
|
. |
done |
done |
#pp_deb_service_remove_common | pp_prepend $pp_wrkdir/%preun.run |
#pp_deb_service_remove_common | pp_prepend $pp_wrkdir/%preun.run |
fi |
fi |
Line 4030 pp_deb_fakeroot () {
|
Line 4044 pp_deb_fakeroot () {
|
fi |
fi |
} |
} |
|
|
|
pp_deb_files_size () { |
|
local t m o g f p st |
|
while read t m o g f p st; do |
|
case $t in |
|
f|s) du -k "${pp_destdir}$p";; |
|
d) echo 4;; |
|
esac |
|
done | awk '{n+=$1} END {print n}' |
|
} |
|
|
pp_deb_make_DEBIAN() { |
pp_deb_make_DEBIAN() { |
local cmp="${1:-run}" |
local cmp="${1:-run}" |
local data cmp_full_name |
local data cmp_full_name |
Line 4051 pp_deb_make_DEBIAN() {
|
Line 4075 pp_deb_make_DEBIAN() {
|
cp $pp_wrkdir/%conffiles.$cmp $data/DEBIAN/conffiles |
cp $pp_wrkdir/%conffiles.$cmp $data/DEBIAN/conffiles |
fi |
fi |
|
|
|
# Create preinst |
|
pp_deb_make_package_maintainer_script "$data/DEBIAN/preinst" \ |
|
"$pp_wrkdir/%pre.$cmp" "Pre-install script for $cmp_full_name"\ |
|
|| exit $? |
|
|
# Create postinst |
# Create postinst |
pp_deb_make_package_maintainer_script "$data/DEBIAN/postinst" \ |
pp_deb_make_package_maintainer_script "$data/DEBIAN/postinst" \ |
"$pp_wrkdir/%post.$cmp" "Post install script for $cmp_full_name"\ | "$pp_wrkdir/%post.$cmp" "Post-install script for $cmp_full_name"\ |
|| exit $? |
|| exit $? |
|
|
# Create prerm |
# Create prerm |
Line 4141 pp_deb_makedeb () {
|
Line 4170 pp_deb_makedeb () {
|
|
|
# Create md5sums |
# Create md5sums |
pp_deb_make_md5sums $cmp `(cd $package_build_dir; |
pp_deb_make_md5sums $cmp `(cd $package_build_dir; |
find . -type f -a -not -name DEBIAN | sed "s,^\./,,")` || | find . -name DEBIAN -prune -o -type f -print | sed "s,^\./,,")` || |
pp_die "Could not make DEBIAN md5sums for $cmp" |
pp_die "Could not make DEBIAN md5sums for $cmp" |
} |
} |
|
|
pp_backend_deb () { |
pp_backend_deb () { |
local debname |
local debname |
|
|
|
# Munge description for control file inclusion |
|
pp_deb_munge_description |
|
|
# Handle services |
# Handle services |
pp_deb_handle_services $cmp |
pp_deb_handle_services $cmp |
|
|
Line 4363 pp_backend_deb_init_svc_vars () {
|
Line 4395 pp_backend_deb_init_svc_vars () {
|
|
|
lsb_required_start='$local_fs $network' |
lsb_required_start='$local_fs $network' |
lsb_should_start= |
lsb_should_start= |
lsb_required_stop= | lsb_required_stop='$local_fs' |
lsb_description= |
lsb_description= |
|
|
start_priority=50 |
start_priority=50 |
Line 4376 pp_deb_service_make_init_script () {
|
Line 4408 pp_deb_service_make_init_script () {
|
local out=$pp_destdir$script |
local out=$pp_destdir$script |
local _process _cmd |
local _process _cmd |
|
|
pp_add_file_if_missing $script run 755 || return 0 | pp_add_file_if_missing $script run 755 v || return 0 |
|
|
#-- start out as an empty shell script |
#-- start out as an empty shell script |
cat <<-'.' >$out |
cat <<-'.' >$out |
Line 4461 do_start()
|
Line 4493 do_start()
|
then |
then |
group_opt="--group $GROUP" |
group_opt="--group $GROUP" |
fi |
fi |
if [ "$VERBOSE" = no ] |
|
then |
|
quiet_opt="--quiet" |
|
else |
|
quiet_opt="--verbose" |
|
fi |
|
|
|
start-stop-daemon --start $quiet_opt $pidfile_opt $user_opt --exec $DAEMON --test > /dev/null \ | start-stop-daemon --start --quiet $pidfile_opt $user_opt --exec $DAEMON --test > /dev/null \ |
|| return 1 |
|| return 1 |
|
|
# Note: there seems to be no way to tell whether the daemon will fork itself or not, so pass |
# Note: there seems to be no way to tell whether the daemon will fork itself or not, so pass |
# --background for now |
# --background for now |
start-stop-daemon --start $quiet_opt $pidfile_opt $user_opt --exec $DAEMON -- \ | start-stop-daemon --start --quiet $pidfile_opt $user_opt --exec $DAEMON -- \ |
$DAEMON_ARGS \ |
$DAEMON_ARGS \ |
|| return 2 |
|| return 2 |
} |
} |
Line 4499 do_stop()
|
Line 4525 do_stop()
|
then |
then |
signal_opt="--signal $STOP_SIGNAL" |
signal_opt="--signal $STOP_SIGNAL" |
fi |
fi |
if [ "$VERBOSE" = "no" ] | start-stop-daemon --stop --quiet $signal_opt --retry=TERM/30/KILL/5 $pidfile_opt --name $NAME |
then | |
quiet_opt="--quiet" | |
else | |
quiet_opt="--verbose" | |
fi | |
start-stop-daemon --stop $quiet_opt $signal_opt --retry=TERM/30/KILL/5 $pidfile_opt --name $NAME | |
RETVAL="$?" |
RETVAL="$?" |
[ "$RETVAL" = 2 ] && return 2 |
[ "$RETVAL" = 2 ] && return 2 |
# Wait for children to finish too if this is a daemon that forks |
# Wait for children to finish too if this is a daemon that forks |
Line 4514 do_stop()
|
Line 4534 do_stop()
|
# that waits for the process to drop all resources that could be |
# that waits for the process to drop all resources that could be |
# needed by services started subsequently. A last resort is to |
# needed by services started subsequently. A last resort is to |
# sleep for some time. |
# sleep for some time. |
start-stop-daemon --stop $quiet_opt --oknodo --retry=0/30/KILL/5 --exec $DAEMON | start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON |
[ "$?" = 2 ] && return 2 |
[ "$?" = 2 ] && return 2 |
# Many daemons don't delete their pidfiles when they exit. |
# Many daemons don't delete their pidfiles when they exit. |
test -z $PIDFILE || rm -f $PIDFILE |
test -z $PIDFILE || rm -f $PIDFILE |
Line 4535 do_reload() {
|
Line 4555 do_reload() {
|
fi |
fi |
if [ -n "$RELOAD_SIGNAL" ] |
if [ -n "$RELOAD_SIGNAL" ] |
then |
then |
start-stop-daemon --stop --signal $RELOAD_SIGNAL $quiet_opt $pidfile_opt --name $NAME | start-stop-daemon --stop --signal $RELOAD_SIGNAL --quiet $pidfile_opt --name $NAME |
fi |
fi |
return 0 |
return 0 |
} |
} |
Line 6580 pp_backend_macos_init () {
|
Line 6600 pp_backend_macos_init () {
|
pp_macos_pkg_readme= |
pp_macos_pkg_readme= |
pp_macos_pkg_welcome= |
pp_macos_pkg_welcome= |
pp_macos_sudo=sudo |
pp_macos_sudo=sudo |
|
pp_macos_installer_plugin= |
# OS X puts the library version *before* the .dylib extension |
# OS X puts the library version *before* the .dylib extension |
pp_shlib_suffix='*.dylib' |
pp_shlib_suffix='*.dylib' |
} |
} |
Line 6800 pp_macos_bom_fix_parents () {
|
Line 6821 pp_macos_bom_fix_parents () {
|
sub chk { my $d=shift; |
sub chk { my $d=shift; |
&chk(&dirname($d)) if $d =~ m,/,; |
&chk(&dirname($d)) if $d =~ m,/,; |
unless ($seen{$d}++) { |
unless ($seen{$d}++) { |
|
# Make sure we do not override system directories |
|
if ($d =~ m:^\./(etc|var)$:) { |
|
my $tgt = "private/$1"; |
|
my ($sum, $len) = split(/\s+/, `/usr/bin/printf "$tgt" | /usr/bin/cksum /dev/stdin`); |
|
print "$d\t120755\t0/0\t$len\t$sum\t$tgt\n"; |
|
} elsif ($d eq "." || $d eq "./Library") { |
|
print "$d\t41775\t0/80\n"; |
|
} elsif ($d eq "./Applications" || $d eq "./Developer") { |
|
print "$d\t40775\t0/80\n"; |
|
} else { |
print "$d\t40755\t0/0\n"; |
print "$d\t40755\t0/0\n"; |
|
} |
} |
} |
} |
} |
m/^(\S+)\s+(\d+)/; |
m/^(\S+)\s+(\d+)/; |
Line 7086 CompressedSize 0
|
Line 7118 CompressedSize 0
|
awk '{ print "." $6 }' $filelists | sed 's:/$::' | sort | /usr/bin/cpio -o | pp_macos_rewrite_cpio $filelists | gzip -9f -c > $Contents/Archive.pax.gz |
awk '{ print "." $6 }' $filelists | sed 's:/$::' | sort | /usr/bin/cpio -o | pp_macos_rewrite_cpio $filelists | gzip -9f -c > $Contents/Archive.pax.gz |
) |
) |
|
|
|
# Copy installer plugins if any |
|
if test -n "$pp_macos_installer_plugin"; then |
|
if test ! -f "$pp_macos_installer_plugin/InstallerSections.plist"; then |
|
pp_error "Missing InstallerSections.plist file in $pp_macos_installer_plugin" |
|
fi |
|
mkdir -p $pkgdir/Plugins |
|
cp -R "$pp_macos_installer_plugin"/* $pkgdir/Plugins |
|
fi |
|
|
test -d $pp_wrkdir/bom_stage && $pp_macos_sudo rm -rf $pp_wrkdir/bom_stage |
test -d $pp_wrkdir/bom_stage && $pp_macos_sudo rm -rf $pp_wrkdir/bom_stage |
|
|
rm -f ${name}-${version}.dmg |
rm -f ${name}-${version}.dmg |
Line 7254 pp_backend_macos_flat () {
|
Line 7295 pp_backend_macos_flat () {
|
cd $pp_destdir || pp_error "Can't cd to $pp_destdir" |
cd $pp_destdir || pp_error "Can't cd to $pp_destdir" |
awk '{ print "." $6 }' $filelists | sed 's:/$::' | sort | /usr/bin/cpio -o | pp_macos_rewrite_cpio $filelists | gzip -9f -c > $bundledir/Payload |
awk '{ print "." $6 }' $filelists | sed 's:/$::' | sort | /usr/bin/cpio -o | pp_macos_rewrite_cpio $filelists | gzip -9f -c > $bundledir/Payload |
) |
) |
|
|
|
# Copy installer plugins if any |
|
if test -n "$pp_macos_installer_plugin"; then |
|
if test ! -f "$pp_macos_installer_plugin/InstallerSections.plist"; then |
|
pp_error "Missing InstallerSections.plist file in $pp_macos_installer_plugin" |
|
fi |
|
mkdir -p $pkgdir/Plugins |
|
cp -R "$pp_macos_installer_plugin"/* $pkgdir/Plugins |
|
fi |
|
|
test -d $pp_wrkdir/bom_stage && $pp_macos_sudo rm -rf $pp_wrkdir/bom_stage |
test -d $pp_wrkdir/bom_stage && $pp_macos_sudo rm -rf $pp_wrkdir/bom_stage |
|
|