#!/bin/bash # network-scripts.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot mkdir -p $PKG/etc/rc.d ( cd $PKG/etc/rc.d for file in rc.inet1.conf rc.inet1 rc.inet2 rc.ip_forward ; do install -pm644 -oroot -groot $CWD/scripts/$file ${file}.new done chmod 755 rc.inet1.new rc.inet2.new chmod 600 rc.inet1.conf.new ) ( cd $PKG/etc for file in HOSTNAME host.conf hosts.allow hosts.deny hosts.equiv hosts networks nntpserver protocols resolv.conf ; do install -pm644 -oroot -groot $CWD/scripts/$file ${file}.new done ) mkdir -p $PKG/sbin install -pm755 -oroot -groot $CWD/scripts/netconfig $PKG/sbin/netconfig mkdir -p $PKG/var/log/setup install -pm755 -oroot -groot $CWD/scripts/setup.netconfig $PKG/var/log/setup # Set the default timeout to be 12 seconds which works for the BananaPi: sed -i -e 's?10 seconds?12 seconds?g' -e 's?\${DHCP_TIMEOUT\[\$i\]:-10\}?\$\{DHCP_TIMEOUT\[\$i\]:-12\}?g' $PKG/etc/rc.d/rc.inet1.new # Stop using zeroconf. On the SheevaPlugs, for some reason the zeroconf IP most usually wins so # the machine continues booting without having NFS mounts working and so on. # The --waitip (wait for an IP before backgrounding) option doesn't help because we *got* an IP from # zeroconf, it's just that it was useless. sed -i 's?/sbin/dhcpcd -t ?/sbin/dhcpcd -Lt ?g' $PKG/etc/rc.d/rc.inet1.new # Add manpages: mkdir -p $PKG/usr/man/man{5,8} install -vpm644 $CWD/manpages/rc.inet1.conf.5 $PKG/usr/man/man5/ install -vpm644 $CWD/manpages/rc.inet1.8 $PKG/usr/man/man8/ # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links