diff options
Diffstat (limited to 'build')
-rwxr-xr-x | build/bsd_makefile | 34 | ||||
-rw-r--r-- | build/build2.mk | 30 | ||||
-rw-r--r-- | build/dynlib.mk | 24 | ||||
-rwxr-xr-x | build/fastgen.sh | 80 | ||||
-rw-r--r-- | build/library.mk | 23 | ||||
-rw-r--r-- | build/ltlib.mk | 24 | ||||
-rwxr-xr-x | build/shtool | 283 | ||||
-rwxr-xr-x | build/sysv_makefile | 34 |
8 files changed, 183 insertions, 349 deletions
diff --git a/build/bsd_makefile b/build/bsd_makefile deleted file mode 100755 index cb9ecdca1a..0000000000 --- a/build/bsd_makefile +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -# cwd must be top_srcdir -test -f build/bsd_makefile || exit 2 - -test -f bsd_converted && exit 0 - -tmpfile=`mktemp /tmp/bsd_makefile.XXXXXX 2>/dev/null` || tmpfile="tmp.$$" -for i in build/*.mk; do - sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \ - && cp $tmpfile $i -done -rm -f $tmpfile - -touch bsd_converted -exit 0 diff --git a/build/build2.mk b/build/build2.mk index 4954991c45..8ec12e44ae 100644 --- a/build/build2.mk +++ b/build/build2.mk @@ -30,37 +30,16 @@ config_h_in = main/php_config.h.in acconfig_h_SOURCES = acconfig.h.in $(config_h_files) -targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in) +targets = $(TOUCH_FILES) configure $(config_h_in) -all: Zend/Makefile.am TSRM/Makefile.am $(targets) - -Zend/Makefile.am: - test -d Zend || (test -d ../Zend && ln -s ../Zend Zend) - -TSRM/Makefile.am: - test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM) +all: $(targets) acconfig.h: $(acconfig_h_SOURCES) @echo rebuilding $@ cat $(acconfig_h_SOURCES) > $@ -$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files) - @echo rebuilding Makefile templates - @for i in $(LT_TARGETS); do \ - if test -f "$$i"; then \ - mv $$i $$i.bak; \ - cp $$i.bak $$i; \ - fi; \ - done - @test -f want_dependencies || flag=-i; \ - automake -a $$flag $(AMFLAGS) $(makefile_files) 2>&1 | $(SUPPRESS_WARNINGS) - @for i in $(LT_TARGETS); do mv $$i.bak $$i; done - -aclocal.m4: configure.in acinclude.m4 dynlib.m4 - aclocal 2>&1 | $(SUPPRESS_WARNINGS) - -SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP called before)'||true) +SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before AC_PROG_CC)'||true) $(config_h_in): configure acconfig.h # explicitly remove target since autoheader does not seem to work @@ -72,6 +51,9 @@ $(config_h_in): configure acconfig.h $(TOUCH_FILES): touch $(TOUCH_FILES) +aclocal.m4: configure.in acinclude.m4 + aclocal 2>&1 | $(SUPPRESS_WARNINGS) + configure: aclocal.m4 configure.in $(config_m4_files) @echo rebuilding $@ @autoconf 2>&1 | $(SUPPRESS_WARNINGS) diff --git a/build/dynlib.mk b/build/dynlib.mk deleted file mode 100644 index 91370be65b..0000000000 --- a/build/dynlib.mk +++ /dev/null @@ -1,24 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -all: all-recursive - -include $(builddir)/libs.mk - -include $(top_srcdir)/build/rules.mk diff --git a/build/fastgen.sh b/build/fastgen.sh deleted file mode 100755 index 1961849c92..0000000000 --- a/build/fastgen.sh +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -# -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id: fastgen.sh,v 1.14 2002-02-28 08:25:33 sebastian Exp $ -# - -if test "$#" = "0"; then - echo "Usage: fastgen.sh <srcdir> <mkdir_p> <bsdmakefile_p> <file>" -fi - -srcdir=$1 -shift - -mkdir_p=$1 -shift - -bsd_makefile=$1 -shift - -top_srcdir=`(cd $srcdir; pwd)` -top_builddir=`pwd` - -if test "$mkdir_p" = "yes"; then - mkdir_p="mkdir -p" -else - mkdir_p="$top_srcdir/build/shtool mkdir -p" -fi - -if test "$bsd_makefile" = "yes"; then - (cd $top_srcdir; ./build/bsd_makefile) - - for makefile in $@; do - echo "fastgen.sh: creating $makefile" - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - $mkdir_p "$dir/" - - cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile -top_srcdir = $top_srcdir -top_builddir = $top_builddir -srcdir = $top_srcdir/$dir -builddir = $top_builddir/$dir -VPATH = $top_srcdir/$dir -EOF - - test -z "$dir" && dir=. - touch $dir/.deps - done -else - for makefile in $@; do - echo "fastgen.sh: creating $makefile" - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - $mkdir_p "$dir/" - - cat - $top_srcdir/$makefile.in <<EOF >$makefile -top_srcdir = $top_srcdir -top_builddir = $top_builddir -srcdir = $top_srcdir/$dir -builddir = $top_builddir/$dir -VPATH = $top_srcdir/$dir -EOF - - test -z "$dir" && dir=. - touch $dir/.deps - done -fi diff --git a/build/library.mk b/build/library.mk deleted file mode 100644 index b210a282d7..0000000000 --- a/build/library.mk +++ /dev/null @@ -1,23 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) - -$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES) - $(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD) diff --git a/build/ltlib.mk b/build/ltlib.mk deleted file mode 100644 index 86f04174f7..0000000000 --- a/build/ltlib.mk +++ /dev/null @@ -1,24 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -targets = $(LTLIBRARY_NAME) - -include $(top_srcdir)/build/rules.mk -include $(top_srcdir)/build/library.mk - diff --git a/build/shtool b/build/shtool index 4c1a7396fd..391f5a83c2 100755 --- a/build/shtool +++ b/build/shtool @@ -1,13 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com> +## Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com> ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.9 (16-Apr-2000) -## Ingredients: 3/17 available modules +## Version: 1.5.4 (14-Jun-2001) +## Contents: 3/17 available modules ## ## @@ -26,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall <rse@engelschall.com>. ## -## Notice: Given that you include this file verbatim into your own +## NOTICE: Given that you include this file verbatim into your own ## source tree, you are justified in saying that it remains separate ## from your package, and that this way you are simply just using GNU ## shtool. So, in this situation, there is no requirement that your @@ -55,7 +55,7 @@ ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file +## version Maintain a version information file ## path Deal with program paths ## @@ -65,21 +65,22 @@ if [ $# -eq 0 ]; then exit 1 fi if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)" - echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>" + echo "This is GNU shtool, version 1.5.4 (14-Jun-2001)" + echo "Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com>" echo "Report bugs to <bug-shtool@gnu.org>" echo '' - echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]" + echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]" echo '' echo 'Available global <options>:' echo ' -v, --version display shtool version information' echo ' -h, --help display shtool usage help page (this one)' echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' echo '' echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:' echo ' echo [-n] [-e] [<str> ...]' echo ' install [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]' - echo ' [-e<ext>] <file> <path>' + echo ' [-e<sed-cmd>] <file> [<file> ...] <path>' echo ' mkdir [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]' echo '' echo 'Not available <cmd-name> (because module was not built-in):' @@ -90,21 +91,25 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>' echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>' echo ' fixperm [-v] [-t] <path> [<path> ...]' - echo ' tarball [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u' - echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]' + echo ' tarball [-t] [-v] [-o<tarball>] [-c<prog>] [-d<dir>] [-u<user>]' + echo ' [-g<group>] [-e<pattern>] <path> [<path> ...]' echo ' guessos ' echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]' echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]' echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]' echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]' - echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]' - echo ' [-d<type>] <file>' + echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-e]' + echo ' [-i<knob>] [-d<type>] <file>' echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]' echo '' exit 0 fi if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" + echo "GNU shtool 1.5.4 (14-Jun-2001)" + exit 0 +fi +if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then + shtoolize -ofoo echo install mkdir exit 0 fi if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then @@ -142,15 +147,15 @@ case $tool in ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>" - arg_spec="2=" - opt_spec="v.t.c.C.s.m:o:g:e:" + str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<sed-cmd>] <file> [<file> ...] <path>" + arg_spec="2+" + opt_spec="v.t.c.C.s.m:o:g:e+" opt_v=no opt_t=no opt_c=no opt_C=no opt_s=no - opt_m="" + opt_m="0755" opt_o="" opt_g="" opt_e="" @@ -312,6 +317,7 @@ if [ ".$gen_tmpfile" = .yes ]; then tmpfile="$tmpdir/.shtool.$$" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi ## @@ -323,7 +329,7 @@ case $tool in echo ) ## ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com> + ## Copyright (c) 1998-2001 Ralf S. Engelschall <rse@engelschall.com> ## Originally written for WML as buildinfo ## @@ -347,7 +353,7 @@ echo ) fi # determine terminal bold sequence - term_bold='' + term_bold='' term_norm='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then case $TERM in @@ -398,7 +404,7 @@ echo ) # determine user name username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then username="$LOGNAME" if [ ".$username" = . ]; then username="$USER" @@ -440,8 +446,38 @@ echo ) fi fi - # determine host name + # determine (primary) group id + groupid='' + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then + groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid='?' + fi + fi + fi + + # determine (primary) group name + groupname='' + if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then + groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`(ypcat group) 2>/dev/null | \ + egrep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname='?' + fi + fi + fi + + # determine host and domain name hostname='' + domainname='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then hostname="`(uname -n) 2>/dev/null |\ awk '{ printf("%s", $1); }'`" @@ -459,9 +495,6 @@ echo ) ;; esac fi - - # determine domain name - domainname='' if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then if [ ".$domainname" = . ]; then if [ -f /etc/resolv.conf ]; then @@ -521,6 +554,8 @@ echo ) -e "s/%b/${term_norm}/g" \ -e "s/%u/${username}/g" \ -e "s/%U/${userid}/g" \ + -e "s/%g/${groupname}/g" \ + -e "s/%G/${groupid}/g" \ -e "s/%h/${hostname}/g" \ -e "s/%d/${domainname}/g" \ -e "s/%D/${time_day}/g" \ @@ -546,114 +581,144 @@ echo ) install ) ## ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com> + ## Copyright (c) 1997-2001 Ralf S. Engelschall <rse@engelschall.com> ## Originally written for shtool ## - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 + # consistency check for destination + if [ $argc -gt 2 -a $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 exit 1 fi - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" + fi - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - mv $src $dsttmp || exit $? - fi - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + for e in $opt_e; do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + eval "$sed <$dsttmp.old >$dsttmp" || exit $? + rm -f $dsttmp.old + fi + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 fi + strip $dsttmp || exit $? + fi + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || exit $? + fi + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || exit $? fi - fi - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + + # finally, install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi - rm -f $dst && mv $dsttmp $dst - fi + done ;; mkdir ) ## ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com> + ## Copyright (c) 1996-2001 Ralf S. Engelschall <rse@engelschall.com> ## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu> ## Cleaned up and enhanced for shtool ## @@ -662,7 +727,7 @@ mkdir ) for p in ${1+"$@"}; do # if the directory already exists... if [ -d "$p" ]; then - if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then echo "$msgprefix:Error: directory already exists: $p" 1>&2 errstatus=1 break @@ -676,6 +741,12 @@ mkdir ) echo "mkdir $p" 1>&2 fi mkdir $p || errstatus=$? + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi else # the smart situation set fnord `echo ":$p" |\ diff --git a/build/sysv_makefile b/build/sysv_makefile deleted file mode 100755 index 06b2bd24fc..0000000000 --- a/build/sysv_makefile +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann <sascha@schumann.cx> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -# cwd must be top_srcdir -test -f build/sysv_makefile || exit 2 - -test -f bsd_converted || exit 1 - -tmpfile=`mktemp /tmp/sysv_makefile.XXXXXX` || tmpfile="tmp.$$" -for i in build/*.mk; do - sed 's/^\.include "\(.*\)"/include \1/' $i >$tmpfile \ - && cp $tmpfile $i -done -rm -f $tmpfile - -rm bsd_converted -exit 0 |