SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "ppp"

# SliTaz package receipt.

PACKAGE="ppp"
VERSION="2.4.5"
CATEGORY="network"
SHORT_DESC="Implements the Point-to-Point Protocol (PPP)."
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://ppp.samba.org/"
WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL"
CONFIG_FILES="/etc/ppp"

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    if ! grep -qs pppol2tpv3_addr include/linux/if_pppol2tp.h ; then
        sed -i /#endif/d include/linux/if_pppol2tp.h
        cat >> include/linux/if_pppol2tp.h <<EOT
/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
 * bits. So we need a different sockaddr structure.
 */
struct pppol2tpv3_addr {
    pid_t    pid;            /* pid that owns the fd. 0 => current */
    int    fd;            /* FD of UDP or IP socket to use */
    struct sockaddr_in addr;    /* IP address and port to send to */
    __u32 s_tunnel, s_session;    /* For matching incoming packets */
    __u32 d_tunnel, d_session;    /* For sending outgoing packets */
};
#endif
EOT
    fi
    ./configure --prefix=/usr --mandir=/usr/share/man \
    $CONFIGURE_ARGS &&
    make &&
    make DESTDIR=$DESTDIR/usr install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr
    cp -a $_pkg/usr/sbin $fs/usr
    cp -a $_pkg/usr/lib $fs/usr
    # Config files.
    mkdir -p $fs/etc/ppp/scripts
    cp $stuff/README.scripts $fs/etc/ppp
    cp -a $src/etc.ppp/* $fs/etc/ppp

    # PPP scripts.
    cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
    cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
    sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' $fs/etc/ppp/scripts/ppp-on
    
    cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
    cp -a $src/scripts/callback $fs/etc/ppp/scripts
    cp -a $src/scripts/redialer $fs/etc/ppp/scripts
    cat >> $fs/etc/ppp/ip-up <<EOT
if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
    rm -f /etc/ppp/resolv.prev
    if [ -f /etc/resolv.conf ]; then
        cp /etc/resolv.conf /etc/ppp/resolv.prev
        grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
        grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
        cat /etc/ppp/resolv.conf >> /etc/resolv.conf
        chmod 644 /etc/resolv.conf
    else
        cp /etc/ppp/resolv.conf /etc
        chmod 644 /etc/resolv.conf
    fi
fi
EOT
    cat >> $fs/etc/ppp/ip-down <<EOT
if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
    if [ -f /etc/ppp/resolv.prev ]; then
        cp -f /etc/ppp/resolv.prev /etc/resolv.conf
        chmod 644 /etc/resolv.conf
    else
        rm -f /etc/resolv.conf
    fi
fi
EOT
    # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
    # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
    chmod 711 $fs/etc/ppp/ip*

    # insert #!/bin/sh  on top line in ip* scripts
    sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*    
    # add empty peers dir
    mkdir -p $fs/etc/ppp/peers
    # hide login/pass from regular users
    chmod go-rwx $fs/etc/ppp/*secrets
    chmod go-rwx $fs/etc/ppp/options
    chmod 711 $fs/etc/ppp/scripts/*
}
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)