# $Id$ PNAME="libutempter" PVER="1.1.5" PBUILD="r2" PCATEGORIE="sys-libs" STATE="unstable" DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access." HOMEPAGE="http://ftp.altlinux.org/pub/people/ldv/utempter/" DEPEND=">= virtual/glibc" SDEPEND=">= app-arch/rpm2targz-9" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mbuild mtools SRC_URI=( http://ftp.altlinux.org/pub/people/ldv/utempter/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd ${HOMEPAGE}'?M=A' | lasttarball" src_compile() { cd ${SRCDIR} # 'utempter' will be added to libexecdir path automatically mmake \ RPM_OPT_FLAGS="${CFLAGS}" \ libdir=/usr/$(mlibdir) \ libexecdir=/usr/$(mlibdir) \ || die } src_install() { cd ${SRCDIR} mmake \ DESTDIR=${BINDIR} \ RPM_OPT_FLAGS="${CFLAGS}" \ libdir=/usr/$(mlibdir) \ libexecdir=/usr/$(mlibdir) \ install \ || die # fix permissions mchown root:utmp /usr/$(mlibdir)/utempter/utempter || die mchmod 2755 /usr/$(mlibdir)/utempter/utempter || die # missing symlink minstalldir /usr/sbin || die mlink ../$(mlibdir)/utempter/utempter /usr/sbin/utempter || die minstalldocs COPYING README || die } preinstall() { if [[ ! -z $(magequery -n utempter) ]] then echo -e ${COLRED} echo -e "Error: sys-apps/utempter is installed!!" echo -e "utempter is superseded by libutempter and must be removed from the system." echo -e "Please uninstall sys-apps/mktemp first!" echo -e ${COLDEFAULT} die "sys-apps/utempter found!" fi ${MLIBDIR}/mgroupadd -o "-g 406" utmp } postinstall() { if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] then if [ -f /var/log/wtmp ] then chown root:utmp /var/log/wtmp chmod 664 /var/log/wtmp fi if [ -f /var/run/utmp ] then chown root:utmp /var/run/utmp chmod 664 /var/run/utmp fi fi }