[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | #Gebruik deze file als voorbeeld. Plaats de source tar.gz file in de zelfde directory als deze slackbuild |
---|
| 3 | #Met de NEED en DEP opties is het mogelijk om build dependencies aan te geven. |
---|
| 4 | #Voor de meeste packages hoeft er verder niks aan de variabellen veranderd te worden. |
---|
| 5 | ##################################### Build dependency info: |
---|
| 6 | |
---|
| 7 | #NEED:git |
---|
| 8 | #DEP:libaio |
---|
| 9 | |
---|
| 10 | #######Essential package info. |
---|
| 11 | #Change these if autodetection fails. |
---|
| 12 | |
---|
| 13 | #Name of the Syn-3 package that we are going to create |
---|
| 14 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #Version of the sourcefiles |
---|
| 20 | VER=2.1.14 |
---|
| 21 | |
---|
| 22 | #Architecture that the created binaries run on. |
---|
| 23 | #Use noarch for scripts. |
---|
| 24 | ARCH=`uname -m` |
---|
| 25 | |
---|
| 26 | #from this point on, exit on errors: |
---|
| 27 | set -e |
---|
| 28 | |
---|
| 29 | ########Build and create the pacakge. |
---|
| 30 | #Uncomment the stuff that you dont want or need |
---|
| 31 | |
---|
| 32 | SRC_DIR=fio |
---|
| 33 | git clone 'git://git.kernel.dk/fio' $SRC_DIR |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | #apply patches |
---|
| 37 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
| 38 | |
---|
| 39 | pushd $SRC_DIR |
---|
| 40 | |
---|
| 41 | git checkout fio-$VER |
---|
| 42 | |
---|
| 43 | #AUTOMAKE: Configure |
---|
| 44 | #Some usefull stuff you sometimes need to set: |
---|
| 45 | #export LDFLAGS="-L/usr/X11/lib/ -L/usr/lib/mysql/" |
---|
| 46 | #export LD_LIBRARY_PATH=/usr/lib/mysql |
---|
| 47 | #export VPATH=$LD_LIBRARY_PATH |
---|
| 48 | #export CFLAGS="-std=c89" |
---|
| 49 | #export CFLAGS="-fgnu89-inline" #If "multiple definition of `foo'" Also see http://gcc.gnu.org/gcc-4.3/porting_to.html |
---|
| 50 | MAKE_OPTS="" |
---|
| 51 | #./configure --extra-cflags="-std=c89" || exit 1 |
---|
| 52 | ./configure --extra-cflags="-fgnu89-inline" || exit 1 |
---|
| 53 | |
---|
| 54 | #AUTOMAKE: Compile |
---|
| 55 | make $MAKE_OPTS || exit 1 |
---|
| 56 | |
---|
| 57 | #AUTOMAKE: Test (optional) |
---|
| 58 | if grep ^test: Makefile; then |
---|
| 59 | make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 |
---|
| 60 | make $MAKE_OPTS test || exit 1 |
---|
| 61 | elif grep ^check: Makefile; then |
---|
| 62 | make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 |
---|
| 63 | make $MAKE_OPTS check || exit 1 |
---|
| 64 | fi |
---|
| 65 | |
---|
| 66 | #AUTOMAKE: Install |
---|
| 67 | mkdir -p /tmp/pkg &>/dev/null |
---|
| 68 | make prefix=/usr pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install || exit 1 |
---|
| 69 | popd |
---|
| 70 | |
---|
| 71 | #strip bins and other stuff |
---|
| 72 | syn3_strip /tmp/pkg || exit 1 |
---|
| 73 | |
---|
| 74 | #move development stuff and create seperate development package |
---|
| 75 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
| 76 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
| 77 | |
---|
| 78 | #make main package |
---|
| 79 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | |
---|