# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="The Zero Install system makes software installation not merely easy, but unnecessary." HOMEPAGE="http://zero-install.sourceforge.net/" SRC_URI="mirror://sourceforge/zero-install/${P}.tar.gz" LICENSE="Academic" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="app-arch/bzip2 >=sys-apps/dbus-0.20 dev-libs/expat app-crypt/gnupg virtual/linux-sources" pkg_setup() { # create group and user zeroinst if [ -z "$(getent group zeroinst)" ]; then groupadd -g 260 zeroinst || groupadd zeroinst || die "problem adding group zeroinst" fi if [ -z "$(getent passwd zeroinst)" ]; then useradd -d /uri -s /bin/false -g zeroinst -u 260 zeroinst || useradd -d /uri -s /bin/false -g zeroinst -u 260 zeroinst || die "problem adding user zeroinst" fi } src_unpack() { unpack ${P}.tar.gz cd ${S} #Apply patch patch -b -p0 < ${FILESDIR}/${P}-bv.diff || die } src_compile() { econf --with-user=zeroinst || die emake || die } src_install () { # dobin 0run make DESTDIR=${D} install || die rm -f ${D}/etc/init.d/0install insopts -m 0750 -g root -o root insinto /etc/init.d newins ${FILESDIR}/0install.bv 0install grep -v "^lazyfs[[:space:]]*/uri" /etc/fstab > ${D}/etc/fstab lazyfsVERSION=$(echo ${PV}|sed 's|\.|d|g') echo "lazyfs /uri/0install lazyfs${lazyfsVERSION} /var/cache/zero-inst 0 0" >> ${D}/etc/fstab dodoc COPYING NEWS README Technical } pkg_preinst () { # Stopping existing daemon... [ -x /etc/init.d/0install ] && /etc/init.d/0install stop [ ! -L /uri/0install/.lazyfs-cache ] || umount -l /uri/0install } pkg_postinst () { depmod -a /sbin/depscan.sh mkdir -p -m 755 /uri/0install mkdir -p -m 755 /var/cache/zero-inst chown zeroinst /var/cache/zero-inst lsmod | grep '^lazyfs' | awk '{print $1}' | xargs rmmod || einfo "*** Old LazyFS module is still in use. You should remove it later." mount /uri/0install einfo "Start the zero-install helper with: /etc/init.d/0install start" einfo "Add it to your default init scripts with: rc-update add 0install default" einfo "You can check that it works with: cat /uri/0install/zero-install.sourceforge.net/demo/test.txt" }