# $Id$ PNAME="initscripts" PVER="0.5.3" PBUILD="r1" PCATEGORIE="sys-apps" STATE="unstable" DESCRIPTION="Magellan Initscripts for sysVinit." HOMEPAGE="http://magellan-linux.net" # the pkgs "coreutils, findutils, sed, gawk, bzip2, tar, rsync, wget" # are needed to fix the /etc/profile issue DEPEND=">= sys-apps/coreutils-5 >= sys-apps/findutils-4 >= sys-apps/grep-2 >= sys-apps/sed-4 >= sys-apps/gawk-3 >= app-arch/bzip2-1 >= sys-apps/tar-1 >= net-misc/rsync-2 >= net-misc/wget-1 >= sys-apps/sysvinit-2.85 >= sys-apps/which-2.16" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude cvs rsync # available options are source/rsync METHOD=source # fixes mageversion; # the makefile uses the date as version number # but for release we want to use the release version RELEASE_MAGEVERSION= case ${METHOD} in cvs) SDEPEND=">= dev-util/cvs-1.11" ;; rsync) SDEPEND=">= net-misc/rsync-2.6.9" ;; source) SDEPEND="" ;; esac [[ ${METHOD} = source ]] && SRC_URI=( mirror://${PNAME}/${SRCFILE} ) src_prepare() { [[ ${METHOD} = source ]] && { munpack ${SRCFILE} || die; } if [[ ${METHOD} = rsync ]] then RSYNC_URI="rsync://magellan-linux.de/${PNAME}-${PVER}-${PBUILD}" rsync_fetch_source || die fi if [[ ${METHOD} = cvs ]] then MY_CVS_MODULE="magellan-src/magellan-initscripts" # $PVER must be eg 0_3_3 MY_CVS_OPTS="-r init-$(echo ${PVER}| sed -e "s|\.|\_|g")-${PBUILD}" export CVSROOT=:pserver:anonymous:@magellan-linux.de:/magellan-cvs cvs_fetch_source || die fi } src_compile() { cd ${SRCDIR} mmake || die } src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # CONFIG_PROTECT_MASK for /etc/rc.d/init.d install -d ${BINDIR}/etc/env.d || die echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die # always overwrite /etc/mageversion echo 'CONFIG_PROTECT_MASK="/etc/mageversion"' >> ${BINDIR}/etc/env.d/01initscripts || die # always keep this files even if the user edited them local config_protect_ignore config_protect_ignore="/etc/fstab" config_protect_ignore+=" /etc/group" config_protect_ignore+=" /etc/hostname" config_protect_ignore+=" /etc/hosts" config_protect_ignore+=" /etc/inittab" config_protect_ignore+=" /etc/passwd" config_protect_ignore+=" /etc/conf.d/net.eth0" config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4" config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6" echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die # fix mageversion if any release version is given if [[ ! -z ${RELEASE_MAGEVERSION} ]] then echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die fi } postinstall() { # emulate seq; its needed to run rc-config # this fixes some annyoing warning when building # livecd or bootstrapping a system. # this hack will be removed when the toolchain is fixed if [ ! -f /usr/bin/seq ] then echo "Using fake 'seq' command ..." seq() { start=$1 end=$2 for ((i=start; i < end+1; i++)) do echo $i done } export -f seq fi # create service state dir mountpoint # needed by >=initscripts-0.3.2-r1 [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d # mark this dir as undeletable touch ${MROOT}/var/lib/init.d/.keep echo "Creating Runlevels ..." local i for i in checkfs cleanfs halt \ loadkeys localnet modules mountfs \ network reboot sendsignals \ setclock swap sysctl consolefont do echo -e "\tAdded ${i} ..." ${MROOT}/sbin/rc-config del ${i} > /dev/null ${MROOT}/sbin/rc-config add ${i} > /dev/null done # initscripts >= 0.5.0: rc file moved to /etc/conf.d/rc if [[ -f ${MROOT}/etc/conf.d/rc ]] && [[ -f ${MROOT}/etc/sysconfig/rc ]] then rm -f ${MROOT}/etc/sysconfig/rc fi # aliases and i368 got renamed to *.conf local i for i in aliases i386 do if [[ -f ${MROOT}/etc/modules.d/${i} ]] then rm ${MROOT}/etc/modules.d/${i} fi done }