wok annotate rpm4/receipt @ rev 4972

add/improve TAGS r* receipts
author Rohit Joshi <jozee@slitaz.org>
date Wed Feb 24 11:44:49 2010 +0000 (2010-02-24)
parents 9f963a3c2aa3
children 1707e54fb4cf
rev   line source
erjo@1432 1 # SliTaz package receipt.
erjo@1432 2
erjo@1432 3 PACKAGE="rpm4"
erjo@1432 4 VERSION="4.4.2.3"
erjo@1432 5 CATEGORY="system-tools"
erjo@1432 6 SHORT_DESC="RPM Package Manager"
erjo@1432 7 MAINTAINER="erjo@slitaz.org"
pascal@4670 8 DEPENDS="popt beecrypt bzlib expat sqlite zlib gcc-lib-base"
pascal@4670 9 BUILD_DEPENDS="beecrypt beecrypt-dev popt-dev gettext zlib-dev python-dev"
erjo@1432 10 SOURCE="rpm"
erjo@1432 11 TARBALL="$SOURCE-$VERSION.tar.gz"
erjo@1432 12 WEB_SITE="http://www.rpm.org/"
erjo@1432 13 WGET_URL="http://www.rpm.org/releases/rpm-4.4.x/$TARBALL"
jozee@4972 14 TAGS="package-manager"
erjo@1432 15
erjo@1432 16 # Rules to configure and make the package.
erjo@1432 17 compile_rules()
erjo@1432 18 {
erjo@1432 19 cd $src
erjo@1432 20 ./configure --prefix=/usr \
erjo@1432 21 --infodir=/usr/share/info \
erjo@1432 22 --with-selinux=no \
erjo@1432 23 --with-lua=no \
erjo@1432 24 --with-dmalloc=no \
erjo@1432 25 --with-efence=no \
pascal@2433 26 --mandir=/usr/share/man $CONFIGURE_ARGS &&
pascal@2433 27 make &&
erjo@1432 28 make DESTDIR=$PWD/_pkg install
erjo@1432 29 }
erjo@1432 30
erjo@1432 31 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@1432 32 genpkg_rules()
erjo@1432 33 {
erjo@1432 34 mkdir -p $fs/usr/bin \
erjo@1432 35 $fs/usr/lib \
erjo@1432 36 $fs/var/lib/rpm \
erjo@1432 37 $fs/usr/src/redhat/SOURCES \
erjo@1432 38 $fs/usr/src/redhat/BUILD \
erjo@1432 39 $fs/usr/src/redhat/RPMS \
erjo@1432 40 $fs/usr/src/redhat/SPECS \
erjo@1432 41 $fs/usr/src/redhat/SRPMS
erjo@1432 42
erjo@1432 43 cp -a $_pkg/usr/bin $fs/usr
erjo@1432 44 cp -a $_pkg/bin/* $fs/usr/bin
erjo@1432 45 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
erjo@1432 46 cp -a $_pkg/usr/lib/rpm $fs/usr/lib
pascal@2433 47 rm $fs/usr/lib/libpopt.so.0*
erjo@1432 48 }
erjo@1432 49
erjo@1432 50 post_install()
erjo@1432 51 {
erjo@1432 52 echo "Processing post install commands..."
erjo@1432 53 cmd=`readlink $root/bin/rpm`
erjo@1432 54 if [ ! "$cmd" = "/usr/bin/rpm" ]; then
erjo@1432 55 echo ""
erjo@1432 56 echo "**** Actual RPM link : $cmd"
erjo@1432 57 echo ""
erjo@1432 58 echo -n "Do you want rpm for /bin/rpm (y/N) ? : "; read anser
erjo@1432 59 if [ "$anser" == "y" ]; then
erjo@1432 60 echo ""
erjo@1432 61 echo -n "Removing rpm link to make a new one pointing on /usr/bin/rpm..."
erjo@1432 62 rm $root/bin/rpm && ln -sf $root/usr/bin/rpm $root/bin/rpm
erjo@1432 63 status
erjo@1432 64 else
erjo@1432 65 echo ""
erjo@1432 66 echo "Leaving /bin/vi to : $cmd"
erjo@1432 67 fi
erjo@1432 68 fi
erjo@1432 69
erjo@1432 70 # Building rpm database.
erjo@1432 71 $root/usr/bin/rpm --initdb --quiet
erjo@1432 72 }
erjo@1432 73
erjo@1432 74 pre_remove()
erjo@1432 75 {
erjo@1432 76 if [ -d /var/lib/rpm ]; then
erjo@1432 77 rm -f /var/lib/rpm/*
erjo@1432 78 fi
erjo@1432 79 }
erjo@1432 80
erjo@1432 81 post_remove()
erjo@1432 82 {
erjo@1432 83 echo "Processing post remove commands..."
erjo@1432 84 cmd=`readlink $root/bin/rpm`
erjo@1432 85 if [ ! "$cmd" = "/bin/rpm" ]; then
erjo@1432 86 echo -n "Restore applets from busybox..."
erjo@1432 87 ln -sf $root/bin/busybox $root/bin/rpm
erjo@1432 88 ln -sf $root/bin/busybox $root/usr/bin/rpm2cpio
erjo@1432 89 status
erjo@1432 90 fi
erjo@1432 91 }