pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Rather than work around an automake braindeadness, par...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1a9d6c47c0e9
branches:  trunk
changeset: 473686:1a9d6c47c0e9
user:      tv <tv%pkgsrc.org@localhost>
date:      Fri Apr 23 02:03:18 2004 +0000

description:
Rather than work around an automake braindeadness, parameterize install-sh
so that Interix can set the default mode to 0775.  Then add "install_sh"
to CONFIGURE_ENV so it uses ${INSTALL}, not the package-supplied
install script (as is done for autoconf $INSTALL).

diffstat:

 bootstrap/bootstrap           |   19 +-
 bootstrap/files/install-sh    |  281 ------------------------------------------
 bootstrap/files/install-sh.in |  281 ++++++++++++++++++++++++++++++++++++++++++
 mk/bsd.pkg.mk                 |    4 +-
 4 files changed, 296 insertions(+), 289 deletions(-)

diffs (truncated from 667 to 300 lines):

diff -r 54024e621ca3 -r 1a9d6c47c0e9 bootstrap/bootstrap
--- a/bootstrap/bootstrap       Fri Apr 23 01:25:09 2004 +0000
+++ b/bootstrap/bootstrap       Fri Apr 23 02:03:18 2004 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.14 2004/04/21 20:35:18 tv Exp $
+# $NetBSD: bootstrap,v 1.15 2004/04/23 02:03:18 tv Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -167,7 +167,7 @@
 mkdir_p()
 {
        for dir in $@; do
-               run_cmd "($shprog ./files/install-sh -d -o $user -g $group $dir)"
+               run_cmd "$shprog $wrkdir/install-sh -d -o $user -g $group $dir"
        done
 }
 
@@ -297,6 +297,7 @@
        mkdir_p () {
                mkdir -p "$@" # allows umask to take effect
        }
+       default_install_mode=0775
        root_user=`id -un`
        root_group=+Administrators
        need_pax=yes
@@ -346,6 +347,7 @@
 fi
 
 check_prog awkprog awk
+check_prog chmodprog chmod
 check_prog cpprog cp
 check_prog idprog id
 check_prog groupsprog groups
@@ -388,6 +390,11 @@
 fi
 echo "Working directory is: ${wrkdir}"
 
+if [ ! -x ${wrkdir}/install-sh ]; then
+       run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' files/install-sh.in > $wrkdir/install-sh"
+       run_cmd "$chmodprog +x $wrkdir/install-sh"
+fi
+
 is_root
 if [ $? = 1 ]; then
        user=$root_user
@@ -512,18 +519,18 @@
 
 if [ "$need_bsd_install" = "yes" ]; then
        echo_msg "Installing BSD compatible install script"
-       run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 install-sh $prefix/bin/install-sh)"
+       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 $wrkdir/install-sh $prefix/bin/install-sh"
        BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV"
 fi
 
 if [ "$need_fixed_strip" = "yes" ] ; then
        echo_msg "Installing fixed strip script"
-       run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 strip-sh $prefix/bin/strip)"
+       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 files/strip-sh $prefix/bin/strip"
 fi
 
 if [ "$need_mkdir" = "yes" ]; then
        echo_msg "Installing fixed mkdir script \"mkdir-sh\""
-       run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 mkdir-sh $prefix/sbin/mkdir-sh)"
+       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 files/mkdir-sh $prefix/sbin/mkdir-sh"
 fi
 
 echo_msg "Installing bmake"
@@ -606,7 +613,7 @@
 
 # all's ready, install the man page
 echo_msg "Installing packages(7) man page"
-(cd files; run_cmd "$shprog ./install-sh -c -m 444 packages.cat7 $prefix/man/cat7/packages.0")
+run_cmd "$shprog $wrkdir/install-sh -c -m 444 files/packages.cat7 $prefix/man/cat7/packages.0"
 
 # opsys specific fiddling
 opsys_finish
diff -r 54024e621ca3 -r 1a9d6c47c0e9 bootstrap/files/install-sh
--- a/bootstrap/files/install-sh        Fri Apr 23 01:25:09 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: install-sh,v 1.1.1.1 2004/03/11 13:03:59 grant Exp $
-# This script now also installs multiple files, but might choke on installing
-# multiple files with spaces in the file names.
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-msrc=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-       -c) instcmd="$cpprog"
-           shift
-           continue;;
-
-       -d) dir_arg=true
-           shift
-           continue;;
-
-       -m) chmodcmd="$chmodprog $2"
-           shift
-           shift
-           continue;;
-
-       -o) chowncmd="$chownprog $2"
-           shift
-           shift
-           continue;;
-
-       -g) chgrpcmd="$chgrpprog $2"
-           shift
-           shift
-           continue;;
-
-       -s) stripcmd="$stripprog"
-           shift
-           continue;;
-
-       -t=*) transformarg=`echo "$1" | sed 's/-t=//'`
-           shift
-           continue;;
-
-       -b=*) transformbasename=`echo "$1" | sed 's/-b=//'`
-           shift
-           continue;;
-
-       *)  if [ x"$src" = x ]
-           then
-               src=$1
-               msrc=$1
-           else
-               # this colon is to work around a 386BSD /bin/sh bug
-               :
-               msrc="$msrc $1"
-               dst=$1
-           fi
-           shift
-           continue;;
-    esac
-done
-
-if [ x"$dir_arg" = x -a x"$msrc" != x"$src $dst" ]
-then
-       if [ ! -d "$dst" ]; then
-               echo "install: destination is not a directory"
-               exit 1
-       fi
-else
-       msrc=$src
-fi
-
-
-if [ x"$src" = x ]
-then
-       echo "install:  no input file specified"
-       exit 1
-else
-       true
-fi
-
-if [ x"$dir_arg" != x ]; then
-       dst=$src
-       src=""
-       
-       if [ -d "$dst" ]; then
-               instcmd=:
-               chmodcmd=""
-       else
-               instcmd=mkdir
-       fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-       if [ -f "$src" ]
-       then
-               true
-       elif [ -d "$src" ]
-       then
-               echo "install: $src: not a regular file"
-               exit 1
-       else
-               echo "install:  $src does not exist"
-               exit 1
-       fi
-       
-       if [ x"$dst" = x ]
-       then
-               echo "install:  no destination specified"
-               exit 1
-       else
-               true
-       fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-       if [ -d "$dst" ]
-       then
-               dst="$dst"/`basename "$src"`
-       else
-               true
-       fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='   
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-       pathcomp="${pathcomp}${1}"
-       shift
-
-       if [ ! -d "${pathcomp}" ] ;
-        then
-               $mkdirprog "${pathcomp}"
-       else
-               true
-       fi
-
-       pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-       $doit $instcmd "$dst" &&
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else true ; fi &&



Home | Main Index | Thread Index | Old Index