#!/bin/bash ## src2pkg script for: sysvinit ## Auto-generated by src2pkg-2.0 ## src2pkg - Copyright 2005-2009 Gilbert Ashley # This build script is based on the sysvinit.SlackBuild and sysvinit-scripts Slack.Build # Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA # See the end of this file for the full and original COpyright and license info SOURCE_NAME='sysvinit-2.86.tar.gz' NAME='sysvinit' # Use ALT_NAME to override guessed value VERSION='2.86' # Use ALT_VERSION to override guessed value # ARCH='' # BUILD='1' # SIG=_dash # PRE_FIX='usr' # Any extra options go here: # EXTRA_CONFIGS="" PATCHLIST='sysvinit-patches/sysvinit.diff.gz sysvinit-patches/sysvinit.pidof.rhforkseverything.diff.gz' if [[ "$ARCH" = "x86_64" ]] ; then # Don't overwrite ut_addr_v6 in utmp records on 64-bit platforms PATCHLIST="$PATCHLIST sysvinit-patches/sysvinit-2.86-timeval.patch.gz" fi CONFIG_COMMAND='make clobber' EXTRA_DOCS="doc/sysvinit-$VERSION.lsm doc/bootlogd.README" # ADD_DEPS='sysvinit-scripts-dash | sysvinit-scripts' #SYSVINITSCRIPTS=$(ls /var/lib/tpkg/packages/sysvinit-scripts*_*) #ADD_REQS=${SYSVINITSCRIPTS##*/} ADD_REQS='sysvinit-scripts-dash | sysvinit-scripts' # This might be used if the doinst.sh needs to be regenerated # AUTO_DOT_NEW=NO # Optional function replaces configure_source, compile_source, fake_install # To use, uncomment and write/paste CODE between the {} brackets. # build() { CODE } # Get the functions and configs . /usr/libexec/src2pkg/FUNCTIONS ; # Execute the named packaging steps: pre_process find_source make_dirs unpack_source fix_source_perms if [[ "$ARCH" = "x86_64" ]] ; then # static 'init' segfaults, so your computer never reaches command prompt: ( cd $SRC_DIR/src ; sed -i -e "s/-static//" Makefile ) fi configure_source # compile_source # If used, the 'build' function replaces these 3 #fake_install # mkdir -p $PKG_DIR/sbin $PKG_DIR/usr/bin ( cd $SRC_DIR/src for program in bootlogd halt init killall5 shutdown runlevel ; do cat $program > $PKG_DIR/sbin/$program done ( cd $PKG_DIR/sbin ; ln -sf init telinit ) ( cd $PKG_DIR/sbin ; ln -sf halt reboot ) ( cd $PKG_DIR/sbin ; ln -sf killall5 pidof ) ( cd $PKG_DIR/sbin ; ln -sf halt poweroff ) for program in last mountpoint ; do cat $program > $PKG_DIR/usr/bin/$program done ( cd $PKG_DIR/usr/bin ; ln -sf last lastb ) mv $PKG_DIR/sbin/init $PKG_DIR/sbin/init.new # cp initscript.sample $PKG_DIR/sbin/initscript.sample ) mkdir -p $MAN_DIR/man{1,5,8} ( cd $SRC_DIR/man cp last.1 mountpoint.1 $MAN_DIR/man1 ( cd $MAN_DIR/man1 ; ln -sf last.1 lastb.1 ) cp inittab.5 initscript.5 $MAN_DIR/man5 for page in halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8 \ shutdown.8 telinit.8 bootlogd.8 ; do cp $page $MAN_DIR/man8 done ) mkdir -p $PKG_DIR/etc/rc.d # the init scripts themselves are packaged separately # in the sysvinit-scripts package fix_pkg_perms strip_bins create_docs compress_man_pages make_description make_doinst make_package post_process ##### Note about rc.local.new and rc.sysvinit.new ##### # because src2pkg has a routine which automatically adds entries to rc.local # when /etc/*.new file are installed, we use a fixed doinst.sh for this package # but a new one can be generated from the doinst.prepend(.template) in the patches # in case any files are added or removed from this package # Original Coyright and license: # Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.