# SliTaz package receipt. PACKAGE="partimage-pam" VERSION="0.6.9" CATEGORY="system-tools" SHORT_DESC="Saves partitions in an image file." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" SOURCE="partimage" TARBALL="$SOURCE-$VERSION.tar.bz2" WEB_SITE="https://www.partimage.org/" WGET_URL="$SF_MIRROR/$SOURCE/$TARBALL" PROVIDE="partimage:pam" DEPENDS="newt bzip2 openssl slitaz-base-files zlib pam gcc-lib-base" BUILD_DEPENDS="newt newt-dev slang-dev bzip2-dev openssl-dev pam pam-dev" # What is the latest version available today? current_version() { wget -O - https://sourceforge.net/projects/partimage/files/stable/ 2>/dev/null | \ sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \ sed '/scope="row/!d;s|.*/stable/||;s|/.*||;q' } # Rules to configure and make the package. compile_rules() { sed -i 's/gzFile \*m_gzImageFile/gzFile m_gzImageFile/' src/client/imagefile.h sed -i 's/(gzFile \*) gzdopen/gzdopen/' src/client/imagefile.cpp ./configure \ --prefix=/usr \ --enable-pam \ --sysconfdir=/etc \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ $CONFIGURE_ARGS && make && make DESTDIR=$DESTDIR install } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr $fs/etc/init.d cp -a $install/usr/sbin $fs/usr cp -a $install/etc $fs/ install -g root -o root -m 0600 ../$SOURCE/stuff/etc/partimaged/partimaged.* $fs/etc/partimaged install -g root -o root -m 0755 ../$SOURCE/stuff/etc/init.d/partimaged $fs/etc/init.d } post_install() { newline echo "Adding user/group partimag..." chroot "$1/" adduser -S -H -D partimag echo "Setting permissions for config files" chmod 0600 "$1"/etc/partimaged/* chroot "$1/" chown partimag.partimag "$1"/etc/partimaged/* echo "Creating image files directory" chroot "$1/" install -g partimag -o partimag -m 0755 -d "$1/var/lib/partimaged" echo "" echo -e "\nTo starts $SOURCE server you can run :\n" echo "/etc/init.d/partimaged start" echo -e "Or add partimaged to RUN_DAEMONS in /etc/rcS.conf\n" } post_remove() { chroot "$1/" deluser partimag chroot "$1/" delgroup partimag if [ -f "$1/etc/paritimaged" ]; then rm -rf "$1/etc/partimaged" fi }