wok annotate slim-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 d0948455b365
children 5b76fac69996
rev   line source
pascal@2223 1 # SliTaz package receipt.
pascal@2223 2
pascal@2223 3 PACKAGE="slim-pam"
al@14601 4 VERSION="1.3.5"
pascal@2223 5 CATEGORY="x-window"
al@14601 6 SHORT_DESC="Desktop-independent graphical login manager for X11 (PAM enabled)."
pascal@2223 7 MAINTAINER="pascal.bellard@slitaz.org"
al@14601 8 LICENSE="GPL2"
al@14601 9 WEB_SITE="http://slim.berlios.de/"
pascal@2223 10 SOURCE="slim"
pascal@2223 11 TARBALL="$SOURCE-$VERSION.tar.gz"
pascal@2223 12 WGET_URL="http://download.berlios.de/slim/$TARBALL"
pascal@2223 13 CONFIG_FILES="/etc/slim.conf"
al@14601 14
pascal@2223 15 PROVIDE="slim:pam"
al@14601 16 DEPENDS="gcc-lib-base libjpeg libpng pam xorg-libXft xorg-libXmu"
al@14601 17 SUGGESTED="slim-theme-default slitaz-configs"
al@14601 18 BUILD_DEPENDS="cmake freetype-dev jpeg-dev libpng-dev xorg-libXft-dev \
al@14601 19 xorg-libXmu-dev pam-dev"
al@14601 20 RELATED="slim slim-theme-default"
pascal@10452 21
pascal@2223 22 # Rules to configure and make the package.
pascal@2223 23 compile_rules()
pascal@2223 24 {
al@14601 25 patch -p1 < $WOK/$SOURCE/stuff/$SOURCE-$VERSION.patch || return 1
al@14601 26 mkdir build; cd build
pankso@13364 27 cmake \
pankso@13364 28 -DCMAKE_INSTALL_PREFIX=/usr \
al@14601 29 -DX11_Xmu_LIB=-lXmu \
al@14601 30 -DUSE_PAM=yes \
al@14601 31 .. &&
al@14601 32 make &&
al@14601 33 make DESTDIR=$DESTDIR install
pascal@2223 34 }
pascal@2223 35
pascal@2223 36 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@2223 37 genpkg_rules()
pascal@2223 38 {
rcx@6055 39 mkdir -p $fs/usr/share/slim
al@14601 40 cp -a $install/etc $fs
pankso@13364 41 cp -a $install/usr/bin $fs/usr
al@14601 42 cp -a $WOK/$SOURCE/stuff/themes $fs/usr/share/slim
pankso@13364 43
rcx@6055 44 # Config file and rc script.
al@14601 45 cp -a $WOK/$SOURCE/stuff/etc $fs
pascal@2223 46 chown -R root.root $fs
pascal@2223 47
al@14601 48 # slim-theme manager
al@14601 49 install -m755 $WOK/$SOURCE/stuff/slim-theme $fs/usr/bin/slim-theme
pascal@2223 50 }
pascal@2223 51
pascal@2223 52 post_install()
pascal@2223 53 {
pascal@2223 54 local USER
pascal@18730 55 USER=$(awk -F: '/:1000:1000:/ { print $1 }' < "$1/etc/passwd")
pascal@2223 56 [ -n "$USER" ] &&
pascal@18730 57 sed -i s/"default_user .*"/"default_user $USER"/ "$1/etc/slim.conf"
al@14601 58
al@14601 59 # In order to update the SLiM, we need to restart it.
al@14601 60 # We can't just "/etc/init.d/slim restart" because it momentarily interrupts
al@14601 61 # X session and the user will get a terrible console with strange letters.
al@14601 62 printf '%40s\n' | tr ' ' '='
al@14601 63 echo "In order to update the SLiM,"
al@14601 64 echo "please, reboot your system!"
pascal@2223 65 }
pascal@7632 66
pascal@7632 67 pre_remove()
pascal@7632 68 {
pascal@7632 69 tazpkg get-install ${PACKAGE%-pam}
pascal@7632 70 }