# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/package/mnemoc/runit/runit.conf
|
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
[ "$prefix" = usr ] && sbindir="$root/sbin"
|
|
|
|
. $base/package/mnemoc/runit/djb-config
|
|
|
|
pkg_runit_main() {
|
|
local agettyargs speed
|
|
|
|
hook_eval premake
|
|
./package/compile
|
|
hook_eval inmake
|
|
pkg_djb_installpackage admin $sbindir
|
|
hook_eval postmake
|
|
|
|
# main scripts and virtual consoles
|
|
#if [ ! -f $sysconfdir/1 ]; then
|
|
echo "Creating main scripts and virtual consoles..."
|
|
|
|
mkdir -p $sysconfdir
|
|
cp -vf ./doc/debian/[123] $sysconfdir/
|
|
cp -vf ./doc/debian/ctrlaltdel $sysconfdir/
|
|
chmod 744 $sysconfdir/[123]
|
|
chmod 744 $sysconfdir/ctrlaltdel
|
|
|
|
for i in console 1 2 3 4 5 6; do
|
|
if [ "$i" == "console" ]; then
|
|
echo "Creating getty $i..."
|
|
speed=9600
|
|
else
|
|
echo "Creating getty tty$i..."
|
|
i="vc/$i"
|
|
speed=38400
|
|
fi
|
|
mkdir -p $sysconfdir/getty-${i#vc/}
|
|
if [ "$i" == "console" -o "$i" == "vc/1" ]; then
|
|
agettyargs='-L -i -I '"'"'\012\015\012Maintenance Console:\012'"'"
|
|
else
|
|
agettyargs='-f /etc/issue.ansi'
|
|
fi
|
|
cat << EOT > $sysconfdir/getty-${i#vc/}/run
|
|
#!/bin/sh
|
|
${pkg_djb_commanddir#$root}/utmpset -w $i
|
|
exec /sbin/agetty $agettyargs $speed $i linux
|
|
EOT
|
|
chmod 744 $sysconfdir/getty-${i#vc/}/run
|
|
done
|
|
#fi
|
|
|
|
# getties to svscan
|
|
echo "Make getties available to svscan..."
|
|
for i in 1 2 3 4 5 6; do
|
|
ln -sfv ${sysconfdir#$root}/getty-$i $pkg_djb_servicedir/
|
|
done
|
|
|
|
# and minimal services
|
|
if pkgcheck sysklogd X; then
|
|
echo "Make sysklogd available to svscan..."
|
|
ln -sfv ${sysconfdir#$root}/syslogd $pkg_djb_servicedir/
|
|
ln -sfv ${sysconfdir#$root}/klogd $pkg_djb_servicedir/
|
|
fi
|
|
if pkgcheck cron X; then
|
|
echo "Make cron available to svscan..."
|
|
ln -sfv ${sysconfdir#$root}/cron $pkg_djb_servicedir/
|
|
fi
|
|
|
|
if [ ${pkg_djb_commanddir} != $sbindir ]; then
|
|
echo "Copying init files to /sbin..."
|
|
cp -vf ${pkg_djb_commanddir}/runit* $sbindir/
|
|
fi
|
|
|
|
|
|
}
|
|
|
|
pkg_runit_doc() {
|
|
if [ $createdocs -eq 1 ]; then
|
|
#rm -fv $docdir/debian $docdir/*.bak
|
|
|
|
pkg_djb_installdoc admin
|
|
|
|
gzip -9 ./man/*.8
|
|
echo "Installing man pages ... "
|
|
cp -vf ./man/*.8.gz $mandir/man8/
|
|
#cp -vf ./man/*.8 $mandir/man8/
|
|
fi
|
|
}
|
|
|
|
if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
|
|
hook_add premake 5 "for x in ./doc/debian/*; do \
|
|
if [ -f \$x ]; then \
|
|
echo Fixing \$x... ; \
|
|
sed -e 's,/var/service,/service,g' \$x > \$x.new ; \
|
|
mv -f \$x.new \$x ; \
|
|
fi ; \
|
|
done"
|
|
else
|
|
hook_add premake 5 "for x in ./doc/debian/*; do \
|
|
if [ -f \$x ]; then \
|
|
echo Fixing \$x... ; \
|
|
sed -e 's,/command:,,g' \$x > \$x.new ; \
|
|
mv -f \$x.new \$x ; \
|
|
fi ; \
|
|
done"
|
|
fi
|
|
|
|
sysconfdir="$sysconfdir/runit"
|
|
srcdir="admin/$pkg-$ver"
|
|
|
|
custmain="pkg_runit_main"
|
|
postdoc="pkg_runit_doc"
|
|
|
|
createdocs=1
|