#!/bin/bash # Copyright (C) 2009-2010 Matías A. Fonzo, # # 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . set -e CWD=$(pwd) TMP=${TMP:-/tmp/sources} OUT=${OUT:-/tmp/packages} V=3.0 ARCH=noarch B=1 PKG=${TMP}/package-runit-scheme rm -rf $PKG mkdir -p $PKG $OUT cd $PKG/ # Creation of directories: mkdir -p etc/ # Copy the scheme: cp -r ${CWD}/etc/{rc.d,runit,sv} etc/ # Set permissions: find etc/ -type f | xargs chmod 755 # Handle "daemons": mv etc/rc.d/rc.clock{,.new} mv etc/rc.d/rc.local{,.new} mv etc/rc.d/rc.swap{,.new} # Handle runlevels: mkdir -p etc/runit/runsvdir/{single,default} ( cd etc/runit/runsvdir/single ln -sf /etc/sv/getty-tty1 . ) ( cd etc/runit/runsvdir/default ln -sf /etc/sv/getty-tty1 . ln -sf /etc/sv/getty-tty2 . ln -sf /etc/sv/getty-tty3 . ) ( cd etc/runit/runsvdir ln -sf default current ) ln -sf etc/runit/runsvdir/current service # Make symlink compatibility: ( cd etc/ ; ln -sf rc.d init.d ) # Set sane permissions: chown -R 0:0 . # Copy description files adding the post install script: mkdir -p description install cp ${CWD}/description/?? description/ zcat ${CWD}/post-install.gz > install/post-install makepkg -l ${OUT}/runit-scheme-${V}-${ARCH}-${B}.tlz