wok-next rev 1432

Add: rpm4
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Oct 01 00:00:56 2008 +0200 (2008-10-01)
parents cf789d7f5389
children 2aa439578fcc
files rpm4/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rpm4/receipt	Wed Oct 01 00:00:56 2008 +0200
     1.3 @@ -0,0 +1,89 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="rpm4"
     1.7 +VERSION="4.4.2.3"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="RPM Package Manager"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS=""
    1.12 +BUILD_DEPENDS="beecrypt beecrypt-dev"
    1.13 +SOURCE="rpm"
    1.14 +TARBALL="$SOURCE-$VERSION.tar.gz"
    1.15 +WEB_SITE="http://www.rpm.org/"
    1.16 +WGET_URL="http://www.rpm.org/releases/rpm-4.4.x/$TARBALL"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	cd $src
    1.22 +	./configure --prefix=/usr  \
    1.23 +	 --infodir=/usr/share/info \
    1.24 +	 --with-selinux=no \
    1.25 +	 --with-lua=no \
    1.26 +	 --with-dmalloc=no \
    1.27 +	 --with-efence=no \
    1.28 +	 --mandir=/usr/share/man $CONFIGURE_ARGS
    1.29 +	make
    1.30 +	make DESTDIR=$PWD/_pkg install
    1.31 +}
    1.32 +
    1.33 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.34 +genpkg_rules()
    1.35 +{
    1.36 +	mkdir -p $fs/usr/bin \
    1.37 +		$fs/usr/lib \
    1.38 +		$fs/var/lib/rpm \
    1.39 +		$fs/usr/src/redhat/SOURCES \
    1.40 +		$fs/usr/src/redhat/BUILD \
    1.41 +		$fs/usr/src/redhat/RPMS \
    1.42 +		$fs/usr/src/redhat/SPECS \
    1.43 +		$fs/usr/src/redhat/SRPMS
    1.44 +		
    1.45 +	cp -a $_pkg/usr/bin $fs/usr
    1.46 +	cp -a $_pkg/bin/* $fs/usr/bin
    1.47 +	cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
    1.48 +	cp -a $_pkg/usr/lib/rpm $fs/usr/lib
    1.49 +}
    1.50 +
    1.51 +post_install()
    1.52 +{
    1.53 +	echo "Processing post install commands..."
    1.54 +	cmd=`readlink $root/bin/rpm`
    1.55 +    if [ ! "$cmd" = "/usr/bin/rpm" ]; then
    1.56 +        echo ""
    1.57 +        echo "**** Actual RPM link : $cmd"
    1.58 +        echo ""
    1.59 +        echo -n "Do you want rpm  for /bin/rpm (y/N) ? : "; read anser
    1.60 +        if [ "$anser" == "y" ]; then
    1.61 +            echo ""
    1.62 +            echo -n "Removing rpm link to make a new one pointing on /usr/bin/rpm..."
    1.63 +            rm $root/bin/rpm && ln -sf $root/usr/bin/rpm $root/bin/rpm
    1.64 +            status
    1.65 +        else
    1.66 +            echo ""
    1.67 +            echo "Leaving /bin/vi to : $cmd"
    1.68 +        fi
    1.69 +    fi
    1.70 +                
    1.71 +    # Building rpm database.
    1.72 +	$root/usr/bin/rpm --initdb --quiet
    1.73 +}
    1.74 +
    1.75 +pre_remove()
    1.76 +{
    1.77 +	if [ -d /var/lib/rpm ]; then
    1.78 +		rm -f /var/lib/rpm/*
    1.79 +	fi
    1.80 +}
    1.81 +
    1.82 +post_remove()
    1.83 +{
    1.84 +	echo "Processing post remove commands..."
    1.85 +	cmd=`readlink $root/bin/rpm`
    1.86 +    if [ ! "$cmd" = "/bin/rpm" ]; then
    1.87 +    	echo -n "Restore applets from busybox..."
    1.88 +        ln -sf $root/bin/busybox $root/bin/rpm
    1.89 +        ln -sf $root/bin/busybox $root/usr/bin/rpm2cpio
    1.90 +        status
    1.91 +    fi
    1.92 +}