# shadow, ftp://ftp.pld.org.pl/software/shadow/

name=shadow
version=4.0.3
source=($name-$version.tar.gz $name-$version.patch login.defs nopam.tar)

build() {
    cd $name-$version
    patch -p1 < ../$name-$version.patch
LDFLAGS="-lpam -lshadow -lpam_misc"  ./configure --prefix=/usr \
		--mandir=/usr/man \
		--enable-shared \
		--with-libpam \
                --build=i386-root-linux
    make
    make DESTDIR=$PKG install
    mv $PKG/bin/su $PKG/usr/bin
    mkdir $PKG/etc
    cp ../login.defs $PKG/etc
    chmod 644 $PKG/etc/login.defs
    rm -rf $PKG/usr/man/pl $PKG/usr/man/ja \
    $PKG/usr/man/hu $PKG/usr/man/pt_BR $PKG/usr/man/it \
    $PKG/usr/man/ko
    strip $PKG/bin/*
    strip $PKG/usr/bin/*
    strip $PKG/usr/sbin/*
    gzip -9 $PKG/usr/man/man?/*
    rm -f $PKG/usr/info/dir
    gzip -9 $PKG/usr/info/*
    tar xvf ../nopam.tar -C $PKG/usr/sbin
    chown root.root $PKG/usr/sbin/*
    chmod 755 $PKG/usr/sbin/*
}
