#!/bin/sh # UCD-SNMP SlackBuild by Robert Stan PN=ucd-snmp PV=4.2.5 ARCH=i386 BUILD=1rob DOCS="AGENT.txt COPYING ChangeLog FAQ INSTALL NEWS \ README README.agentx README.cmu README.snmpv3 README.thread TODO" CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-$PN if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_$PN.tar.gz cd $TMP tar xvfz $CWD/$PN-$PV.tar.gz cd $PN-$PV echo "Building $PN-$PV ..." # Configure CFLAGS=-O2 LDFLAGS=-s \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --datadir=/etc \ --disable-debugging \ --enable-shared \ --with-openssl=/usr \ --with-libwrap \ --with-defaults \ i386-slackware-linux || exit 1 CFLAGS=-O2 LDFLAGS=-s make || exit 1 CFLAGS=-O2 LDFLAGS=-s make prefix=$PKG/usr \ exec_prefix=$PKG/usr \ datadir=/$PKG/etc \ install # Compress manpages gzip -9 $PKG/usr/man/man{1,3,5,8}/* chmod 644 $PKG/usr/man/man{1,3,5,8}/* # Set other file modes find $PKG/etc -type f -exec chmod 644 {} \; 1>/dev/null 2>/dev/null find $PKG/etc -type d -exec chmod 755 {} \; 1>/dev/null 2>/dev/null find $PKG/usr/include -type f -exec chmod 644 {} \; 1>/dev/null 2>/dev/null find $PKG/usr/include -type d -exec chmod 755 {} \; 1>/dev/null 2>/dev/null # Copy the example config file cat EXAMPLE.conf > $PKG/etc/snmp/snmpd.conf.example # Copy the docs mkdir -p $PKG/usr/doc/$PN-$PV cp -a $DOCS $PKG/usr/doc/$PN-$PV chmod 644 $PKG/usr/doc/$PN-$PV/* # add the description - edit it first cat $CWD/$PN.txt > $TMP/${PN}-${PV}-${ARCH}-${BUILD}.txt cat $CWD/$PN.txt > $PKG/install/slack-desc # Build the package: chown -R root.root $PKG cd $PKG echo "y y" | makepkg $TMP/${PN}-${PV}-${ARCH}-${BUILD}.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PN-$PV rm -rf $PKG fi