<?xml version="1.0"?>
<package name="systemd">
	<description>systemd System and Session Manager</description>
	<releases>
		<release version="260.3" revision="1">
			<deps>
				<dep name="acl"/>
				<dep name="bzip2"/>
				<dep name="curl"/>
				<dep name="docbook-xml"/>
				<dep name="docbook-xsl"/>
				<dep name="elfutils"/>
				<dep name="gperf"/>
				<dep name="intltool"/>
				<dep name="jinja2"/>
				<dep name="kmod"/>
				<dep name="libaio"/>
				<dep name="libcap"/>
				<dep name="libxslt"/>
				<dep name="Linux-PAM"/>
				<dep name="m4"/>
				<dep name="meson"/>
				<dep name="pciutils"/>
				<dep name="pkgconfig"/>
				<dep name="pyelftools" arch="x86_64"/>
				<dep name="python-pefile"/>
				<dep name="shadow"/>
				<dep name="util-linux"/><!-- blkid -->
				<dep name="xz"/>
				<dep name="zlib"/>
				<dep name="zstd"/>

				<!-- LVM2 -->
				<dep name="readline"/>

				<!-- cryptsetup -->
				<dep name="coreutils"/> <!-- /bin/dd used in check file /usr/lib/cryptsetup/checks/swap -->
				<dep name="e2fsprogs"/> <!-- /sbin/e2label used in check file /usr/lib/cryptsetup/checks/ext2 -->
				<dep name="gettext"/>
				<dep name="json-c"/>
				<dep name="libgcrypt"/>
				<dep name="libssh"/>
				<dep name="nss"/>
				<dep name="openssl"/>
				<dep name="popt"/>
				<dep name="xfsprogs"/> <!-- /usr/sbin/xfs_admin used in check file /usr/lib/cryptsetup/checks/xfs -->

				<!-- libfido2 -->
				<dep name="libcbor"/>
			</deps>
			<build>
				<script>
					<!-- build systemd without cryptsetup to bootstrap LVM2, cryptsetup and libfido2 -->
					<archive name="systemd-$VERSION">
						<cmd>meson --prefix /usr --libexecdir lib --sysconfdir /etc --localstatedir /var --sharedstatedir /var -Dlink-udev-shared=false -Ddbus=false -Dlibcryptsetup=false -Ddbuspolicydir=/etc/dbus-1/system.d -Dcompat-sysv-interfaces=false -Dtty-gid=3 -Ddefault-dnssec=no -Ddefault-kill-user-processes=false -Dp11kit=false -Dacl=true -Ddefault-mdns=no -Dman=true -Dsbat-distro-url=https://www.paldo.org/ build</cmd>
						<cmd>cd build</cmd>
						<cmd>ninja</cmd>
						<cmd>ninja install</cmd>
					</archive>
					<archive name="LVM2.2.03.40">
						<cmd>./configure --with-libexecdir=/usr/lib --disable-selinux --enable-pkgconfig --enable-cmdlib --enable-dmeventd --with-device-gid=17 --with-device-mode=0660 --enable-udev_sync</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
					</archive>
					<archive name="cryptsetup-2.8.6">
						<cmd>./configure --disable-static --disable-selinux --disable-asciidoc</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
					</archive>
					<archive name="libfido2-1.17.0">
						<cmd>mkdir build</cmd>
						<cmd>cd build</cmd>
						<cmd>cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..</cmd>
						<cmd>ninja</cmd>
						<cmd>ninja install</cmd>
					</archive>
					<archive name="systemd-$VERSION">
						<!-- RTC is always in UTC, nothing else is reliable -->
						<cmd>sed -i -e 's/streq(line, "LOCAL")/false/' src/shared/clock-util.c</cmd>

						<!-- no utmp group -->
						<cmd>sed -i -e 's/root utmp/root root/g' tmpfiles.d/{systemd,var}.conf.in</cmd>

						<!-- we don't have adm, kmem, utmp, dialout, or tape groups -->
						<cmd>sed -i -e 's/GROUP="kmem",//' -e 's/GROUP="tape"/GROUP="disk"/' -e 's/GROUP="dialout"/GROUP="uucp"/' rules.d/*.rules{,.in}</cmd>
						<cmd>sed -i -e '/^g adm/d' -e '/^g kmem/d' -e '/^g utmp/d' -e '/^g dialout/d' -e '/^g tape/d' sysusers.d/basic.conf.in</cmd>

						<!-- /run/lock is still used by ppp even though we don't want SysV compatibility -->
						<cmd>sed -i -e "/legacy.conf/s/, \+'ENABLE_COMPAT_SYSV_INTERFACES'//" tmpfiles.d/meson.build</cmd>

						<cmd>meson --prefix /usr --libexecdir lib --sysconfdir /etc --localstatedir /var --sharedstatedir /var -Dlink-udev-shared=false -Ddbus=false -Dlibcryptsetup=true -Ddbuspolicydir=/etc/dbus-1/system.d -Dcompat-sysv-interfaces=false -Dtty-gid=3 -Ddefault-dnssec=no -Ddefault-kill-user-processes=false -Dp11kit=false -Dacl=true -Ddefault-mdns=no -Dman=true -Dntp-servers="0.paldo.pool.ntp.org 1.paldo.pool.ntp.org 2.paldo.pool.ntp.org 3.paldo.pool.ntp.org" -Dsbat-distro-url=https://www.paldo.org/ build</cmd>
						<cmd>cd build</cmd>
						<cmd>ninja</cmd>
						<cmd>ninja install</cmd>
						<cmd>cd ..</cmd>

						<cmd>ln -svf ../lib/systemd/systemd /sbin/init</cmd>
						<cmd>ln -svf systemctl /sbin/reboot</cmd>
						<cmd>ln -svf systemctl /sbin/halt</cmd>
						<cmd>ln -svf systemctl /sbin/poweroff</cmd>
						<cmd>ln -svf systemctl /sbin/shutdown</cmd>

						<!-- don't enable installed services by default -->
						<cmd>echo "disable *" &gt; /usr/lib/systemd/system-preset/99-default-disable.preset</cmd>
						<!-- enable basic systemd services such as networkd and timesyncd -->
						<cmd>systemctl preset-all</cmd>

						<cmd>find /{etc,lib}/systemd/system -name "dev-hugepages.*" -or -name "dev-mqueue.*" | xargs rm -vf</cmd>

						<cmd>for conf in coredump journald journal-upload logind networkd oomd resolved system timesyncd user ; do
cp -v /etc/systemd/$conf.conf $DOCDIR/$conf.conf.paldo
done</cmd>

						<cmd check="no">if [ "$ARCH" = "x86_64" ] ; then</cmd>
						<cmd>mkdir -p /boot/EFI/{systemd,BOOT}</cmd>
						<cmd>install -D -v /usr/lib/systemd/boot/efi/systemd-bootx64.efi /boot/EFI/BOOT/BOOTX64.EFI</cmd>
						<cmd>install -D -v /usr/lib/systemd/boot/efi/systemd-bootx64.efi /boot/EFI/systemd/systemd-bootx64.efi</cmd>
						<cmd check="no">fi</cmd>

						<text dest="$DOCDIR/loader.conf.paldo">
timeout 3
editor yes
</text>
					</archive>
				</script>
			</build>
			<postinst>
				<!-- make sure /etc/machine-id exists -->
				<cmd>systemd-machine-id-setup</cmd>

				<!-- enable persistent logging -->
				<cmd>install -dv /var/log/journal</cmd>
			</postinst>
			<config>
				<configfile default="$DOCDIR/coredump.conf.paldo" dest="/etc/systemd/coredump.conf"/>
				<configfile default="$DOCDIR/journald.conf.paldo" dest="/etc/systemd/journald.conf"/>
				<configfile default="$DOCDIR/journal-upload.conf.paldo" dest="/etc/systemd/journal-upload.conf"/>
				<configfile default="$DOCDIR/logind.conf.paldo" dest="/etc/systemd/logind.conf"/>
				<configfile default="$DOCDIR/networkd.conf.paldo" dest="/etc/systemd/networkd.conf"/>
				<configfile default="$DOCDIR/oomd.conf.paldo" dest="/etc/systemd/oomd.conf"/>
				<configfile default="$DOCDIR/resolved.conf.paldo" dest="/etc/systemd/resolved.conf"/>
				<configfile default="$DOCDIR/system.conf.paldo" dest="/etc/systemd/system.conf"/>
				<configfile default="$DOCDIR/timesyncd.conf.paldo" dest="/etc/systemd/timesyncd.conf"/>
				<configfile default="$DOCDIR/user.conf.paldo" dest="/etc/systemd/user.conf"/>

				<configfile default="$DOCDIR/loader.conf.paldo" dest="/boot/loader/loader.conf"/>
			</config>
		</release>
	</releases>
</package>
