#!/bin/bash #Gebruik deze file als voorbeeld. Plaats de source tar.gz file in de zelfde directory als deze slackbuild #Met de NEED en DEP opties is het mogelijk om build dependencies aan te geven. #Voor de meeste packages hoeft er verder niks aan de variabellen veranderd te worden. ##################################### Build dependency info: #Strict build-dependencies #Our package will be automaticly rebuilded if there is a major change in a DEP package. #(this is recommended for most dependencys) ##DEP:linux ##DEP:linux_src ##DEP:openldap #DEP:libusb1_dev #DEP:libusb1 #Loose build-dependencies #The package will be installed in the buildroot during buidling, but no automatic rebuild will occur. #(not recommended) ##NEED:doxygen #######Essential package info. #Change these if autodetection fails. #Name of the Syn-3 package that we are going to create NAME=`basename $0|sed 's/.SlackBuild//'` #Archive of the sourcefiles to unpack SRC_ARC="usbutils-004.tar.gz" #Version of the sourcefiles VER=4 #Architecture that the created binaries run on. #Use noarch for scripts. ARCH=`uname -m` #from this point on, exit on errors: set -e ########Build and create the pacakge. #Uncomment the stuff that you dont want or need CWD=`pwd` #Unpack source #(uncomment if not needed) syn3_unpack $SRC_ARC #Directory where the sourcefiles are unpacked. #(you might have to adjust this if autodetection fails) SRC_DIR=`ls -c|head -1` #apply patches #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 pushd $SRC_DIR #nieuwe usbID's opvragen, zodat package initieel nieuwe ID's heeft ./update-usbids.sh.in #AUTOMAKE: Configure #Some usefull stuff you sometimes need to set: #export LDFLAGS="-L/usr/X11/lib/ -L/usr/lib/mysql/" #export LD_LIBRARY_PATH=/usr/lib/mysql #export VPATH=$LD_LIBRARY_PATH #export CFLAGS="-std=c89" #export CFLAGS="-fgnu89-inline" #If "multiple definition of `foo'" Also see http://gcc.gnu.org/gcc-4.3/porting_to.html MAKE_OPTS="" ./configure --prefix=/usr --libdir=/usr/lib || exit 1 #AUTOMAKE: Compile make $MAKE_OPTS || exit 1 #AUTOMAKE: Test (optional) if grep ^test: Makefile; then make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 make $MAKE_OPTS test || exit 1 elif grep ^check: Makefile; then make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 make $MAKE_OPTS check || exit 1 fi #AUTOMAKE: Install mkdir -p /tmp/pkg &>/dev/null make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install || exit 1 # En uiteraard mag de vette postinstall niet ontbreken. mkdir -p /tmp/pkg/etc/postinst.d/ cp $CWD/post.usbutils /tmp/pkg/etc/postinst.d/post.usbutils chmod +x /tmp/pkg/etc/postinst.d/post.usbutils #cron job om maandelijks de usb id database te updaten mkdir -p /tmp/pkg/etc/cron.monthly cp $CWD/usbutils.cron /tmp/pkg/etc/cron.monthly chmod 550 /tmp/pkg/etc/cron.monthly/usbutils.cron popd #strip bins and other stuff syn3_strip /tmp/pkg || exit 1 #move development stuff and create seperate development package syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 #make main package syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1