<?xml version="1.0"?>
<package name="upkg">
	<description>Upkg tools</description>
	<releases>
		<release version="1.4.1" revision="1" tag="watch">
			<deps>
				<dep name="glibc"/>
			</deps>
			<build>
				<script>
					<archive name="upkg-$VERSION">
						<cmd>./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc --localstatedir=/var --disable-upkg --disable-upkg-repo --disable-static</cmd>
						<cmd>make</cmd>
						<!-- work around parallel make install bug -->
						<cmd>install -dv /usr/lib</cmd>
						<cmd>make install</cmd>
					</archive>
				</script>
				<add>
					<file>/usr/lib/libupkg-watch.so</file>
					<file>/usr/lib/libupkg-watch.so.0</file>
					<file>/usr/lib/libupkg-watch.so.0.0.0</file>
					<file>/usr/lib/libupkg-watch.la</file>
					<file>/usr/lib/upkg-watch.so</file>
				</add>
			</build>
			<postinst>
				<cmd>mkdir -p /tmp</cmd>
			</postinst>
		</release>
		<release version="1.4.1" revision="1" tag="stage2">
			<build strip="no">
				<script>
					<archive name="upkg-$VERSION">
						<cmd>./configure --build=$HOST --host=$TARGET --disable-upkg --disable-upkg-repo --disable-static</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
						<cmd>install -d /stage2/sbin</cmd>
						<cmd>install -m 755 scripts/upkg-remove /stage2/sbin</cmd>
					</archive>
				</script>
				<add>
					<file>/stage2/lib/libupkg-watch.so</file>
					<file>/stage2/lib/libupkg-watch.so.0</file>
					<file>/stage2/lib/libupkg-watch.so.0.0.0</file>
					<file>/stage2/lib/libupkg-watch.la</file>
					<file>/stage2/lib/upkg-watch.so</file>
				</add>
			</build>
			<postinst>
				<cmd>mkdir -p /tmp</cmd>

				<cmd>mkdir -p $CHROOTDIR/tmp</cmd>
				<cmd>mkdir -p $CHROOTDIR/usr/lib</cmd>
				<cmd>[ -L $CHROOTDIR/bin ] || ln -sv usr/bin $CHROOTDIR/bin</cmd>
				<cmd check="no">[ -e $CHROOTDIR/usr/lib/libupkg-watch.so ] || ln -sf /stage2/lib/libupkg-watch.so $CHROOTDIR/usr/lib</cmd>
			</postinst>
		</release>
		<release version="1.4.1" revision="1">
			<deps>
				<dep name="mono"/>
				<dep name="bzip2"/>
				<dep name="zstd"/>
			</deps>
			<build strip="no">
				<script>
					<archive name="upkg-$VERSION">
						<cmd>./configure --disable-upkg-watch --enable-upgrade-version-url=https://www.paldo.org/upkg_version --enable-upgrade-script-url=https://www.paldo.org/upkg.php?mode=install\\\&amp;package=upkg\\\&amp;branch=$BRANCH\\\&amp;arch=$ARCH</cmd>
						<cmd>make</cmd>
						<cmd>make install</cmd>
						<cmd>install -D -m 0644 etc/upkg.conf $DOCDIR/upkg.conf</cmd>

						<cmd>rm -vf /etc/init.d/init-upkg-buildd</cmd>
						<install name="upkg-buildd.service-20121027" dest="/lib/systemd/system/upkg-buildd.service"/>
					</archive>
				</script>
			</build>
			<postinst>
				<cmd>[ -e /etc/upkg.conf ] || sed -e 's%@REPOSITORIES@%https://www.paldo.org/paldo/$BRANCH%' -e 's/@BRANCH@/$BRANCH/' -e 's/@ARCH@/$ARCH/' /usr/share/doc/upkg/upkg.conf &gt; /etc/upkg.conf</cmd>
				<cmd>sed -i -e 's%http://www.paldo.org/%https://www.paldo.org/%' /etc/upkg.conf</cmd>
			</postinst>
		</release>
	</releases>
</package>
