Changeset 46

Show
Ignore:
Timestamp:
06/08/05 03:11:54 (4 years ago)
Author:
athomas
Message:
  • Slackware install now auto-detects checkinstall presence.
  • Added --install-with=<cmd> for overriding make install.
  • bpkg will self-package itself if possible.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bpkg/trunk/bpkg

    r45 r46  
    3232DATADIR=/usr/share 
    3333# Where to store built packages 
    34 PKGDIR=/usr/src/build/packages 
     34PKGDIR=$PWD 
    3535# Skip configure phase by default? 
    3636SKIPCONFIGURE=0 
     
    6060DESTROOT=/tmp/$SELF.$PACKAGE.$$.pkg 
    6161TMPFILES="$TMPDIR $DESTROOT $INSTALLLOG" 
    62  
    63 # Make sure some default directories exist 
    64 mkdir -p $TMPDIR $PKGDIR || exit 1 
     62MAKEINSTALL='make install' 
    6563 
    6664colour() 
     
    114112} 
    115113 
    116 # usage: installer <command> [<args>] 
    117 #   eg. installer make install 
     114# usage: installer 
    118115installer() 
    119116{ 
     
    124121                export INSTALLWATCH_BACKUP_PATH=$SRCDIR/backup-`date +%Y%m%d%H%M%S-backup` 
    125122        fi 
    126         installwatch -o $INSTALLLOG "$@" || error "package installation failed" 
     123        installwatch -o $INSTALLLOG $MAKEINSTALL || error "package installation failed" 
    127124        if [ $BACKUP = 1 -a -d $INSTALLWATCH_BACKUP_PATH ]; then 
    128125                notice "Archiving backup to $INSTALLWATCH_BACKUP_PATH.tar.gz" 
     
    144141packager_slackware() 
    145142{ 
    146         installer make install 
     143        installer 
    147144        cd $DESTROOT 
    148145        local out=$PKGDIR/$PACKAGE-$PACKAGEVER-i386-$PACKAGEREL.tgz 
    149146        makepkg -c n -l y $out 
     147        installpkg $out 
    150148        notice "Package is" $out 
    151149} 
     
    168166packager_arch() 
    169167{ 
    170         installer make install 
     168        installer 
    171169        local configs=`(cd $DESTROOT && find etc -type f) 2> /dev/null` 
    172170        local deps=`(cd $DESTROOT && find . -type f | xargs --no-run-if-empty file | grep 'ELF.*executable' | cut -d: -f1 | xargs --no-run-if-empty ldd 2> /dev/null | awk '{print $3}' | grep ^/ | xargs --no-run-if-empty pacman -Qo 2> /dev/null | awk '{print $5}' | sort | uniq) 2> /dev/null` 
     
    205203packager_gentoo() 
    206204{ 
    207         installer make install 
     205        installer 
    208206        #local deps=`(cd $DESTROOT && find . -type f | xargs --no-run-if-empty file | grep 'ELF.*executable' | cut -d: -f1 | xargs --no-run-if-empty ldd 2> /dev/null | awk '{print $3}' | grep ^/ | xargs --no-run-if-empty pacman -Qo 2> /dev/null | awk '{print $5}' | sort | uniq) 2> /dev/null` 
    209207        ls -d /usr/portage/*/$PACKAGE > /dev/null 2>&1 && error "Package '$PACKAGE' already exists in portage." 
     
    268266        fi 
    269267} 
     268 
     269# Make sure some default directories exist 
     270mkdir -p "$TMPDIR" 
     271if [ ! -w $PKGDIR ]; then 
     272        warning "$PKGDIR is not writeable or does not exist, package will be left in $PWD" 
     273        PKGDIR=$PWD 
     274fi 
    270275 
    271276trap "for f in $TMPFILES; do rm -rf \$f; done" EXIT KILL HUP QUIT 
     
    340345    --localstatedir=/var/state/<package> and --datadir=/usr/share/<package>). 
    341346    The base directories are used if this option is not given. 
     347  --install-with=<command> 
     348    Use the given command to install rather than the default 'make install'. 
    342349 
    343350For further information, including examples, visit http://swapoff.org/bpkg 
     
    345352                                exit 0 
    346353                        ;; 
     354                  --install-with=*) 
     355                        MAKEINSTALL=`echo "$1" | cut -d= -f2-` 
     356                  ;; 
    347357                        --skip-configure) 
    348358                                SKIPCONFIGURE=1 
     
    428438 
    429439install: 
    430         python setup.py install --root=\$(DESTDIR) 
     440        python setup.py install -f --root=\$(DESTDIR) 
    431441EOF 
    432442        elif [ -r Makefile.PL ]; then 
  • bpkg/trunk/Makefile

    r44 r46  
    99all: $(OS)-build 
    1010 
    11 install: all $(OS)-install 
     11install: 
     12        @if ! ./bpkg --install-with='make install-raw' --package=bpkg-`./bpkg --version`; then \ 
     13                echo; \ 
     14                echo "BPKG failed to self-package. You can manually install with"; \ 
     15                echo; \ 
     16                echo "  make install-raw"; \ 
     17                echo; \ 
     18                echo "Or rectify the problem and run 'make install' again."; \ 
     19                echo; \ 
     20                exit 1; \ 
     21        fi 
     22 
     23install-raw: all $(OS)-install 
    1224        mkdir -p $(DESTDIR)$(PREFIX)/bin 
    1325        mkdir -p $(DESTDIR)$(PREFIX)/lib 
     
    1628 
    1729$(INSTALLWATCH): $(INSTALLWATCH).tgz 
    18         $(MAKE) 
    1930        rm -rf $(INSTALLWATCH) 
    2031        gzip -dc $(INSTALLWATCH).tgz | tar xf - 
     
    4657gentoo-install: 
    4758        $(MAKE) -C $(INSTALLWATCH) PREFIX=$(PREFIX) BINDIR=$(DESTDIR)$(PREFIX)/bin LIBDIR=$(DESTDIR)$(PREFIX)/lib install 
     59 
     60slackware-build: $(INSTALLWATCH) 
     61        @if ! ls /var/log/packages/checkinstall* > /dev/null 2>&1; then \ 
     62                $(MAKE) -C $(INSTALLWATCH) PREFIX=/usr; \ 
     63                echo; \ 
     64                echo "Installwatch has been compiled and will be installed, however Slackware includes"; \ 
     65                echo "'checkinstall' which bundles installwatch. You can install this package instead,"; \ 
     66                echo "if so desired."; \ 
     67                echo; \ 
     68        fi 
     69 
     70slackware-install: 
     71        @ls /var/log/packages/checkinstall* > /dev/null 2>&1 || $(MAKE) -C $(INSTALLWATCH) PREFIX=$(PREFIX) BINDIR=$(DESTDIR)$(PREFIX)/bin LIBDIR=$(DESTDIR)$(PREFIX)/lib install