wok-next view sudo-pam/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents 66940c68d29e
children 6fab3264ba87
line source
1 # SliTaz package receipt.
3 PACKAGE="sudo-pam"
4 VERSION="1.8.10p2"
5 CATEGORY="security"
6 SHORT_DESC="Sudo (su \"do\") allows a system administrator to delegate authority using PAM."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="ISC"
9 SOURCE="sudo"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.gratisoft.us/sudo/"
12 WGET_URL="http://www.gratisoft.us/sudo/dist/$TARBALL"
13 PROVIDE="sudo:pam"
15 DEPENDS="pam"
16 BUILD_DEPENDS="pam-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 ./configure \
23 --sysconfdir=/etc \
24 --with-pam \
25 --with-editor=/bin/vi \
26 --libexecdir=/usr/lib \
27 $CONFIGURE_ARGS &&
28 make && make install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/lib
35 mkdir -p $fs/etc/pam.d
36 cp -a $install/usr/bin $fs/usr
37 cp -a $install/usr/sbin $fs/usr
38 cp -a $install/etc/sudoers $fs/etc/
39 cp -a $stuff/sudo $fs/etc/pam.d/
40 cp -a $install/usr/lib $fs/usr
41 }
43 pre_install()
44 {
45 echo "Processing pre-install commands..."
46 if [ -f "$1/etc/sudoers.bak" ]; then
47 cp "$1/etc/sudoers" "$1/etc/sudoers.bak"
48 fi
49 }
51 post_install()
52 {
53 echo "Processing post-install commands..."
54 if [ -f "$1/etc/sudoers.bak" ]; then
55 rm -f "$1/etc/sudoers"
56 mv "$1/etc/sudoers.bak" "$1/etc/sudoers"
57 else
58 chown root.root "$1/etc/sudoers"
59 chmod 0440 "$1/etc/sudoers"
60 fi
61 }
63 pre_remove()
64 {
65 tazpkg get-install ${PACKAGE%-pam}
66 }