From: Tomas Zeman <tzeman@volny.cz>
Date: Fri, 26 Oct 2007 23:15:37 +0200
diet-daemontools
diff -r f0bdfccbdd22 source/dietlibc/diet-daemontools/FrugalBuild
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/dietlibc/diet-daemontools/FrugalBuild Wed Feb 15 14:49:05 2012 +0100
@@ -0,0 +1,42 @@
+# Maintainer: Tomas Zeman <tzeman@volny.cz>
+
+branch=diet
+pkgorig=daemontools
+pkgname=$branch-$pkgorig
+pkgver=0.76
+pkgrel=2
+pkgdesc="A collection of tools for managing UNIX services."
+makedepends=(dietlibc)
+license="public domain"
+backup=(etc/inittab)
+url="http://cr.yp.to/daemontools.html"
+archs=(i686)
+up2date='lynx -dump -nolist http://cr.yp.to/daemontools/install.html|grep $pkgorig|grep tar.gz|head -1|sed -e "s/.*$pkgorig-\(.*\)\.tar.gz.*$/\1/"'
+source=(http://cr.yp.to/daemontools/daemontools-$pkgver.tar.gz \
+ daemontools.install)
+sha1sums=('70a1be67e7dbe0192a887905846acc99ad5ce5b7' \
+ '44a7617ed5dbbcbf1f962d6523eeec232504ef00')
+install="daemontools.install"
+provides=(daemontools)
+
+build() {
+ mkdir -p $Fdestdir/package/admin
+ mv $Fsrcdir/admin/daemontools-$pkgver $Fdestdir/package/admin
+ cd $Fdestdir/package/admin/daemontools-$pkgver
+
+ echo "diet gcc $CFLAGS" > src/conf-cc
+ echo "diet gcc -s -static" > src/conf-ld
+ ./package/compile || Fdie
+
+ rm -rf compile
+ chown -R root.root $Fdestdir/package/ || Fdie
+ mkdir -p $Fdestdir/service || Fdie
+ mkdir -p $Fdestdir/usr/bin || Fdie
+ mkdir -p $Fdestdir/command || Fdie
+ for BIN in `cat package/commands`; do
+ ln -sf /package/admin/daemontools/command/$BIN $Fdestdir/command/$BIN
+ ln -sf /command/$BIN $Fdestdir/usr/bin/$BIN
+ done
+ cd $Fdestdir/package/admin && ln -sf $pkgorig-$pkgver $pkgorig || Fdie
+}
+# vim: ft=sh
diff -r f0bdfccbdd22 source/dietlibc/diet-daemontools/daemontools.install
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/dietlibc/diet-daemontools/daemontools.install Wed Feb 15 14:49:05 2012 +0100
@@ -0,0 +1,37 @@
+# arg 1: the new package version
+post_install() {
+ if [ ! "`grep ^SV:345:respawn:/command/svscanboot etc/inittab`" ]; then
+ if [ ! "`grep ^'# End of file' etc/inittab`" ]; then
+ # The 'End of file' sentinel is missing, just append it to the end
+ echo "SV:345:respawn:/command/svscanboot /service" >> etc/inittab
+ else
+ # prepend it before 'End of file' sentinel
+ sed -i "/# End of file/i\
+SV:345:respawn:/command/svscanboot /service" etc/inittab
+ fi
+ telinit q
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+# arg 1: the old package version
+pre_remove() {
+ if [ "`grep ^SV:345:respawn:/command/svscanboot etc/inittab`" ]; then
+ sed -i "/SV:345:respawn:\/command\/svscanboot \/service/d" etc/inittab
+ telinit q
+ fi
+}
+
+# arg 1: the old package version
+post_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+
+$op $*
+# vim: ts=2 sw=2 et ft=sh