<?xml version="1.0"?>
<package name="shadow">
	<description>Shadow passwords support</description>
	<releases>
		<release version="4.18.0" revision="1" tag="stage2">
			<deps>
				<dep name="libxcrypt" tag="stage2"/>
			</deps>
			<build>
				<script>
					<archive name="shadow-$VERSION">
						<!-- cannot check setpgrp when cross compiling -->
						<cmd>echo "ac_cv_func_setpgrp_void=yes" &gt; config.cache</cmd>

						<cmd>./configure --build=$HOST --host=$TARGET --disable-nls --cache-file=config.cache --without-libbsd --without-selinux --disable-subordinate-ids</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
					</archive>
				</script>
			</build>
			<postinst>
				<cmd>mkdir -p $CHROOTDIR/etc</cmd>
				<!-- login.defs required by filesystem-hierarchy preinst commands -->
				<cmd>[ -e $CHROOTDIR/etc/login.defs ] || ln -svf ../stage2/etc/login.defs $CHROOTDIR/etc/login.defs</cmd>
			</postinst>
		</release>
		<release version="4.18.0" revision="1">
			<deps>
				<dep name="libxcrypt"/>
				<dep name="Linux-PAM"/>
			</deps>
			<preinst>
				<!-- remove stage2 link -->
				<cmd>[ ! -h /etc/login.defs ] || rm -f /etc/login.defs</cmd>
			</preinst>
			<build>
				<script>
					<archive name="shadow-$VERSION">
						<!-- fix pam configuration files -->
						<!-- use SHA-512 instead of DES for passwords -->
						<cmd>sed -i -e 's/#ENCRYPT_METHOD DES/ENCRYPT_METHOD SHA512/' etc/login.defs</cmd>
						<!-- we do not have pam_console.so, pam_selinux.so, or pam_loginuid.so, so delete these entries -->
						<cmd>sed -i -e '/pam_console.so/d' -e '/pam_selinux.so/d' -e '/pam_loginuid.so/d' etc/pam.d/*</cmd>
						<!-- allow any user to use su -->
						<cmd>sed -i -e 's/^auth.*pam_wheel.so/#&amp;/' etc/pam.d/su</cmd>
						<!-- support gnome-keyring -->
						<text dest="etc/pam.d/passwd" append="yes">password optional pam_gnome_keyring.so</text>

						<!-- don't install man pages already installed by other packages -->
						<cmd>sed -i -e 's|man3/getspnam.3 ||' -e 's|man5/passwd.5 ||' man/Makefile.in</cmd>

						<cmd>./configure --without-libbsd --without-selinux --disable-account-tools-setuid</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
						<cmd>make -C man install-man</cmd>
						<cmd>mkdir -p $DOCDIR</cmd>
						<cmd>cp etc/limits $DOCDIR/limits.paldo</cmd>
						<cmd>cp etc/login.access $DOCDIR/login.access.paldo</cmd>
						<cmd>cp etc/login.defs $DOCDIR/login.defs.paldo</cmd>
						<cmd>mkdir -p /etc/default</cmd>

						<!-- set useradd defaults -->
						<cmd>useradd -D -s /bin/bash -b /home -g 100</cmd>

						<cmd>rm -f /etc/{passwd,shadow}-</cmd>
						<cmd>rm -f /etc/default/useradd-</cmd>
					</archive>
				</script>
				<ignore>
					<file>/etc/passwd</file>
					<file>/etc/shadow</file>
				</ignore>
			</build>
			<postinst>
				<cmd>/usr/sbin/pwconv</cmd>
				<cmd check="no">grep -q ^root:.: /etc/shadow &amp;&amp; ( echo "root:paldo" | chpasswd )</cmd>
			</postinst>
			<config>
				<configfile default="$DOCDIR/limits.paldo" dest="/etc/limits"/>
				<configfile default="$DOCDIR/login.defs.paldo" dest="/etc/login.defs"/>
			</config>
		</release>
	</releases>
</package>
