1 | #!/bin/bash |
---|
2 | |
---|
3 | #DEP:openssl |
---|
4 | #DEP:openldap |
---|
5 | #DEP:apr |
---|
6 | #DEP:apr_util |
---|
7 | #DEP:libpcre |
---|
8 | #DEP:expat |
---|
9 | #DEP:zlib |
---|
10 | #DEP:db48 |
---|
11 | #DEP:cyrus_sasl |
---|
12 | |
---|
13 | |
---|
14 | #######Essential package info. |
---|
15 | #Change these if autodetection fails. |
---|
16 | |
---|
17 | #Name of the Syn-3 package that we are going to create |
---|
18 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
19 | |
---|
20 | #Archive of the sourcefiles to unpack |
---|
21 | SRC_ARC=`ls *.tar.* *.zip 2>/dev/null` |
---|
22 | |
---|
23 | #Version of the sourcefiles |
---|
24 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g' | sed 's/\.zip$//g'` |
---|
25 | |
---|
26 | #Architecture that the created binaries run on. |
---|
27 | #Use noarch for scripts. |
---|
28 | ARCH=`uname -m` |
---|
29 | |
---|
30 | #from this point on, exit on errors: |
---|
31 | set -e |
---|
32 | |
---|
33 | ########Build and create the pacakge. |
---|
34 | #Uncomment the stuff that you dont want or need |
---|
35 | |
---|
36 | #Unpack source |
---|
37 | #(uncomment if not needed) |
---|
38 | syn3_unpack $SRC_ARC |
---|
39 | |
---|
40 | #Directory where the sourcefiles are unpacked. |
---|
41 | #(you might have to adjust this if autodetection fails) |
---|
42 | SRC_DIR=`ls -c|head -1` |
---|
43 | |
---|
44 | #apply patches |
---|
45 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
46 | |
---|
47 | pushd $SRC_DIR |
---|
48 | |
---|
49 | cat ../config.layout.slack >> config.layout |
---|
50 | |
---|
51 | #AUTOMAKE: Configure |
---|
52 | #Some usefull stuff you sometimes need to set: |
---|
53 | #export LDFLAGS="-L/usr/X11/lib/ -L/usr/lib/mysql/" |
---|
54 | #export LD_LIBRARY_PATH=/usr/lib/mysql |
---|
55 | #export VPATH=$LD_LIBRARY_PATH |
---|
56 | #export CFLAGS="-std=c89" |
---|
57 | #export CFLAGS="-fgnu89-inline" #If "multiple definition of `foo'" Also see http://gcc.gnu.org/gcc-4.3/porting_to.html |
---|
58 | export CFLAGS="-DBIG_SECURITY_HOLE" |
---|
59 | MAKE_OPTS="" |
---|
60 | ./configure --prefix=/usr --enable-layout=Slackware --with-mpm=prefork || exit 1 |
---|
61 | |
---|
62 | #AUTOMAKE: Compile |
---|
63 | |
---|
64 | make $MAKE_OPTS || exit 1 |
---|
65 | |
---|
66 | #AUTOMAKE: Test (optional) |
---|
67 | if grep ^test: Makefile; then |
---|
68 | make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 |
---|
69 | make $MAKE_OPTS test || exit 1 |
---|
70 | elif grep ^check: Makefile; then |
---|
71 | make pkgconfigdir=/usr/lib/pkgconfig $MAKE_OPTS install || exit 1 |
---|
72 | make $MAKE_OPTS check || exit 1 |
---|
73 | fi |
---|
74 | |
---|
75 | #AUTOMAKE: Install |
---|
76 | mkdir -p /tmp/pkg &>/dev/null |
---|
77 | make -j1 pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install || exit 1 |
---|
78 | popd |
---|
79 | |
---|
80 | #clean crap |
---|
81 | rm -rf /tmp/pkg/var/www/manual /tmp/pkg/var/www/cgi-bin /tmp/pkg/var/www/htdocs /tmp/pkg/etc |
---|
82 | |
---|
83 | #strip bins and other stuff |
---|
84 | syn3_strip /tmp/pkg || exit 1 |
---|
85 | |
---|
86 | #move development stuff and create seperate development package |
---|
87 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
88 | |
---|
89 | #for apxs stuff |
---|
90 | mkdir -p /tmp/pkgdev/var/www |
---|
91 | mv /tmp/pkg/var/www/build /tmp/pkgdev/var/www |
---|
92 | |
---|
93 | #oops, move back error includes |
---|
94 | mv /tmp/pkgdev/var/www/error/include /tmp/pkg/var/www/error |
---|
95 | |
---|
96 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
97 | |
---|
98 | #make main package |
---|
99 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
100 | |
---|
101 | |
---|
102 | |
---|