diff security/shadow/shadow.sh @ 1222:325631424c65

misc: bring back build function
author David Demelier <markand@malikania.fr>
date Wed, 27 Oct 2021 11:32:16 +0200
parents a47aaf9743a0
children 5e4b7e6fe8ed
line wrap: on
line diff
--- a/security/shadow/shadow.sh	Fri Oct 15 16:07:30 2021 +0200
+++ b/security/shadow/shadow.sh	Wed Oct 27 11:32:16 2021 +0200
@@ -87,46 +87,49 @@
 	with_selinux="--without-selinux"
 fi
 
-rm -rf $PKGNAME-$PKGVERSION
-tar xvf $PKGNAME-$PKGVERSION.tar.xz
-cd $PKGNAME-$PKGVERSION
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvf $PKGNAME-$PKGVERSION.tar.xz
+	cd $PKGNAME-$PKGVERSION
 
-#
-# Disable groups, it's provided by busybox/coreutils and documentation
-# by man-pages.
-#
-sed -i 's/groups$(EXEEXT) //' src/Makefile.in
-find man -name Makefile.in -exec sed -i 's/groups\.1 / /'   {} \;
-find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
-find man -name Makefile.in -exec sed -i 's/passwd\.5 / /'   {} \;
+	#
+	# Disable groups, it's provided by busybox/coreutils and documentation
+	# by man-pages.
+	#
+	sed -i 's/groups$(EXEEXT) //' src/Makefile.in
+	find man -name Makefile.in -exec sed -i 's/groups\.1 / /'   {} \;
+	find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
+	find man -name Makefile.in -exec sed -i 's/passwd\.5 / /'   {} \;
 
-CC="$CC" \
-CFLAGS="$CFLAGS" \
-LDFLAGS="$LDFLAGS" \
-LIBS="$LIBS" \
-./configure \
-	--build=$CBUILD \
-	--host=$CHOST \
-	--prefix=/usr \
-	--bindir=/bin \
-	--sbindir=/bin \
-	--enable-shared \
-	$with_acl \
-	$with_attr \
-	$with_nls \
-	$with_pam \
-	$with_selinux
-make ubindir=/bin usbindir=/bin
-make DESTDIR=$DESTDIR ubindir=/bin usbindir=/bin install
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix= \
+		--bindir=/bin \
+		--sbindir=/bin \
+		--enable-shared \
+		$with_acl \
+		$with_attr \
+		$with_nls \
+		$with_pam \
+		$with_selinux
+	make ubindir=/bin usbindir=/bin
+	make DESTDIR=$DESTDIR ubindir=/bin usbindir=/bin install
 
-if [ "$PAM" = "yes" ]; then
-	for i in \
-	    chage chfn chgpasswd chpasswd chsh groupadd groupdel \
-	    groupmems groupmod login newusers passwd su useradd \
-	    userdel usermod; do
-		install -Dm0600 ../$i $DESTDIR/etc/pam.d/$i
-	done
-fi
+	if [ "$PAM" = "yes" ]; then
+		for i in \
+		    chage chfn chgpasswd chpasswd chsh groupadd groupdel \
+		    groupmems groupmod login newusers passwd su useradd \
+		    userdel usermod; do
+			install -Dm0600 ../$i $DESTDIR/etc/pam.d/$i
+		done
+	fi
 
-cd ..
-rm -rf $PKGNAME-$PKGVERSION
+	cd ..
+	rm -rf $PKGNAME-$PKGVERSION
+}