SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "mgetty"

# SliTaz package receipt.

PACKAGE="mgetty"
VERSION="1.2.1"
CATEGORY="network"
SHORT_DESC="Reliable and proven fax send and receive solution."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
WEB_SITE="http://mgetty.greenie.net/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="ftp://mgetty.greenie.net/pub/$PACKAGE/source/${VERSION%.*}/$TARBALL"

DEPENDS="slitaz-base-files"

CONFIG_FILES="/etc/mgetty+sendfax"

# What is the latest version available today?
current_version()
{
    wget -O - $WEB_SITE 2>/dev/null | \
    sed '/mgetty-[0-9]/!d;s|.*mgetty-||;s|.tar.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    chmod a+x mkidirs

    [ -f Makefile.dist ] && mv -f Makefile.dist Makefile
    cp Makefile Makefile.dist
    cp Makefile Makefile.install
    cp policy.h-dist policy.h
    sed -i  -e 's|/* #define AUTO_PPP */|#define AUTO_PPP|' \
        policy.h
    sed -i  -e "s|^prefix=/usr/local|prefix=/usr|" \
        -e "s|^spool=/var/spool|spool=/var/spool|" \
        -e "s|^CONFDIR=.*|CONFDIR=/etc/mgetty+sendfax|" \
        -e 's|/man/|/share&|' \
        Makefile
    sed -i  -e "s|^prefix=/usr/local|prefix=$DESTDIR/usr|" \
        -e "s|^spool=/var/spool|spool=$DESTDIR/var/spool|" \
        -e "s|^CONFDIR=.*|CONFDIR=$DESTDIR/etc/mgetty+sendfax|" \
        -e 's|/man/|/share&|' \
        -e 's|^INSTALL=install .*|INSTALL=install -c -o root -g root|' \
        Makefile.install
    make -j 1 bin-all vgetty
    mkdir -p $DESTDIR/var/spool $DESTDIR/usr/share/man/man1
    mkdir -p $DESTDIR/usr/share/man/man8
    mv -f Makefile.install Makefile
    sed -i 's|chown|echo chown|' Makefile fax/Makefile
    make -j 1 -k install.bin vgetty-install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr
    cp -a $install/usr/lib    $fs/usr
    cp -a $install/usr/sbin    $fs/usr
    cp -a $install/etc    $fs
    cp -a $install/var    $fs
    chmod 755        $fs/var/spool/fax
}

# Pre and post install commands for Tazpkg.
post_install()
{
        # adduser fax if needed
    if ! grep -q fax "$1/etc/passwd"
      then
        echo
        echo -n "Adding user fax..."
        chroot "$1/" adduser fax -D -H -S
        status
    fi
    chroot "$1/" chown fax /var/spool/fax
}

post_remove()
{
    chroot "$1/" deluser fax
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)