wok annotate rpm4/receipt @ rev 18862

Up tzdata(2016a)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jan 28 17:55:47 2016 +0200 (2016-01-28)
parents 9e01bc6321ea
children e96b9982c405
rev   line source
erjo@1432 1 # SliTaz package receipt.
erjo@1432 2
erjo@1432 3 PACKAGE="rpm4"
slaxemulator@13006 4 VERSION="4.10.0"
erjo@1432 5 CATEGORY="system-tools"
erjo@1432 6 SHORT_DESC="RPM Package Manager"
erjo@1432 7 MAINTAINER="erjo@slitaz.org"
pascal@15002 8 LICENSE="GPL2"
erjo@1432 9 SOURCE="rpm"
pascal@7441 10 TARBALL="$SOURCE-$VERSION.tar.bz2"
erjo@1432 11 WEB_SITE="http://www.rpm.org/"
slaxemulator@13006 12 WGET_URL="http://www.rpm.org/releases/rpm-${VERSION:0:4}.x/$TARBALL"
jozee@4972 13 TAGS="package-manager"
erjo@1432 14
pascal@15002 15 DEPENDS="popt beecrypt bzlib expat sqlite zlib gcc-lib-base neon libkrb5 \
pascal@15002 16 libcomerr3 nss nspr db liblzma libmagic"
pascal@15002 17 BUILD_DEPENDS="beecrypt beecrypt-dev popt-dev gettext zlib-dev python-dev \
pascal@15002 18 nss-dev nspr-dev db-dev liblzma liblzma-dev libmagic-dev"
pascal@15002 19
erjo@1432 20 # Rules to configure and make the package.
erjo@1432 21 compile_rules()
erjo@1432 22 {
erjo@1432 23 cd $src
pascal@17670 24 CPPFLAGS="$CPPFLAGS -I/usr/include/nspr -I/usr/include/nss" ./configure \
al@18741 25 --prefix=/usr \
al@18741 26 --infodir=/usr/share/info \
al@18741 27 --with-selinux=no \
al@18741 28 --with-lua=no \
al@18741 29 --with-dmalloc=no \
al@18741 30 --with-efence=no \
al@18741 31 --with-external-db \
al@18741 32 --mandir=/usr/share/man $CONFIGURE_ARGS &&
gokhlayeh@11574 33 make $MAKEFLAGS &&
slaxemulator@13006 34 make DESTDIR=$DESTDIR install
erjo@1432 35 }
erjo@1432 36
erjo@1432 37 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@1432 38 genpkg_rules()
erjo@1432 39 {
al@18741 40 mkdir -p \
al@18741 41 $fs/usr/bin \
erjo@1432 42 $fs/usr/lib \
erjo@1432 43 $fs/var/lib/rpm \
erjo@1432 44 $fs/usr/src/redhat/SOURCES \
erjo@1432 45 $fs/usr/src/redhat/BUILD \
erjo@1432 46 $fs/usr/src/redhat/RPMS \
erjo@1432 47 $fs/usr/src/redhat/SPECS \
erjo@1432 48 $fs/usr/src/redhat/SRPMS
al@18741 49
slaxemulator@13006 50 cp -a $install/usr/bin $fs/usr
slaxemulator@13006 51 cp -a $install/bin/* $fs/usr/bin
slaxemulator@13006 52 cp -a $install/usr/lib/*.so* $fs/usr/lib
slaxemulator@13006 53 cp -a $install/usr/lib/rpm $fs/usr/lib
erjo@1432 54 }
erjo@1432 55
erjo@1432 56 post_install()
erjo@1432 57 {
al@18741 58 cmd=$(readlink $root/bin/rpm)
al@18741 59 if [ "$cmd" != '/usr/bin/rpm' ]; then
al@18741 60 echo ''
al@18741 61 echo "**** Actual RPM link : $cmd"
al@18741 62 echo ''
al@18741 63 echo -n 'Do you want rpm for /bin/rpm (Y/n) ? : '; read -t 30 anser
al@18741 64 if [ "$anser" != 'n' ]; then
al@18741 65 echo ''
al@18741 66 action 'Removing rpm link to make a new one pointing on /usr/bin/rpm...'
al@18741 67 rm $root/bin/rpm && ln -sf $root/usr/bin/rpm $root/bin/rpm
al@18741 68 status
al@18741 69 else
al@18741 70 echo ''
al@18741 71 echo "Leaving /bin/rpm to : $cmd"
al@18741 72 fi
al@18741 73 fi
al@18741 74
al@18741 75 # Building rpm database.
al@18741 76 $1/usr/bin/rpm --initdb --quiet
erjo@1432 77 }
erjo@1432 78
erjo@1432 79 pre_remove()
erjo@1432 80 {
pascal@18730 81 if [ -d "$1/var/lib/rpm" ]; then
pascal@18730 82 rm -f "$1"/var/lib/rpm/*
erjo@1432 83 fi
erjo@1432 84 }
erjo@1432 85
erjo@1432 86 post_remove()
erjo@1432 87 {
pascal@18730 88 cmd=$(readlink "$1/bin/rpm")
al@18741 89 if [ "$cmd" != '/bin/rpm' ]; then
al@18741 90 newline
al@18741 91 action 'Restore applets from busybox...'
pascal@18730 92 ln -sf /bin/busybox "$1/bin/rpm"
pascal@18730 93 ln -sf /bin/busybox "$1/usr/bin/rpm2cpio"
slaxemulator@13006 94 status
slaxemulator@13006 95 fi
erjo@1432 96 }