# Description: Shadow password file utilities
# URL:         http://shadow.pld.org.pl/
# Maintainer:  Per Lidén <per@fukt.bth.se>

pkgname=shadow
pkgver=4.0.14
pkgrel=1
source=(http://www.mirrors.wiretapped.net/security/host-security/shadow/$pkgname-$pkgver.tar.bz2 \
	login.defs shadow-4.0.14-uClibc-1.patch adduser)
depends=('uclibc')
groups=('core')
md5sums=('903f55cf05bbe082617d3337743792fb' 'd52af1b47b7a382bff9d0be6865f05ea'\
         '89246fa779f9cb7cb7ab34c0a590b077' 'eda0626e377ac12d05027dfae5b0d3d8')
	 

build() {
    cd $pkgname-$pkgver
    patch -Np1 -i ../shadow-4.0.14-uClibc-1.patch
   ./configure --prefix=/usr \
               --libdir=/lib \
               --disable-static --without-selinux \
	       --mandir=/usr/man
	       
  # Disable the installation of the groups program and its man pages, as Coreutils provides a better version:	       
  sed -e 's/groups$(EXEEXT) //' -i src/Makefile
  find man -name Makefile -exec sed -i '/groups/d' {} \;

  

    make
    make DESTDIR=$startdir/pkg install
    install -D -m 644 ../login.defs $startdir/pkg/etc/login.defs
    install -D -m 755 ../adduser $startdir/pkg/usr/sbin/adduser
    
#    rm -rf $PKG/usr/bin/gpasswd \
#	   $PKG/usr/man/man1/gpasswd.1 \
#	   $PKG/usr/sbin/{grpconv,grpunconv,logoutd} \
#	   $PKG/usr/sbin/{mkpasswd,newusers,pwconv,pwunconv} \
#	   $PKG/usr/man/man8/{grpconv.8,grpunconv.8,logoutd.8} \
#	   $PKG/usr/man/man8/{mkpasswd.8,newusers.8,pwconv.8,pwunconv.8} \
#	   $PKG/usr/man/{man3,cs,de,es,fi,tr,fr,hu,id,it,ja,ko,pl,pt_BR,ru,zh_CN,zh_TW} \
#	   $PKG/lib
}
