1 | #!/bin/bash |
---|
2 | |
---|
3 | |
---|
4 | #DEP:php5 |
---|
5 | #DEP:libvmime |
---|
6 | #DEP:libical |
---|
7 | ##DEP:clucene |
---|
8 | ##DEP:google_perftools |
---|
9 | #DEP:util_linux |
---|
10 | #DEP:e2fsprogs |
---|
11 | #DEP:boost |
---|
12 | ##DEP:kyotocabinet |
---|
13 | #DEP:icu4c |
---|
14 | #DEP:python |
---|
15 | #DEP:mysql56 |
---|
16 | #DEP:gsoap |
---|
17 | #DEP:swig |
---|
18 | #DEP:openssl |
---|
19 | #DEP:mit_kerberos |
---|
20 | #NEED:linuxdoc_tools |
---|
21 | #NEED:libxslt |
---|
22 | #DEP:openldap |
---|
23 | #DEP:ncurses |
---|
24 | #DEP:zlib |
---|
25 | #DEP:libxml2 |
---|
26 | #DEP:curl |
---|
27 | #DEP:Linux_PAM |
---|
28 | #DEP:cyrus_sasl |
---|
29 | |
---|
30 | #Download from: |
---|
31 | #http://download.zarafa.com/community/final/7.1/7.1.7-42779/sourcecode/zcp-7.1.7.tar.gz |
---|
32 | |
---|
33 | #######Essential package info. |
---|
34 | #Change these if autodetection fails. |
---|
35 | |
---|
36 | #Name of the Syn-3 package that we are going to create |
---|
37 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
38 | |
---|
39 | #Archive of the sourcefiles to unpack |
---|
40 | SRC_ARC=`ls *.tar.*` |
---|
41 | #SRC_ARC="zarafa-6.20.6" |
---|
42 | |
---|
43 | #Version of the sourcefiles |
---|
44 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` |
---|
45 | |
---|
46 | #Directory of the sourcefiles to build (after optional unpacking) |
---|
47 | SRC_DIR=`echo zcp-$VER| sed 's/\.tar\..*$//g'` |
---|
48 | |
---|
49 | #Architecture that the created binaries run on. |
---|
50 | #Use noarch for scripts. |
---|
51 | ARCH=`uname -m` |
---|
52 | |
---|
53 | CWD=`pwd` |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | ########Build and create the pacakge. |
---|
58 | #Uncomment the stuff that you dont want or need |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | #Unpack source |
---|
63 | #(uncomment if not needed) |
---|
64 | syn3_unpack $SRC_ARC || exit 1 |
---|
65 | |
---|
66 | #fix webaccess |
---|
67 | |
---|
68 | #mkdir -p /tmp/pkg/var/www/htdocs/syn3 |
---|
69 | #mv $SRC_DIR/php-webclient-ajax /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1 |
---|
70 | |
---|
71 | #mv $SRC_DIR/php-mobile-webaccess /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1 |
---|
72 | |
---|
73 | #remove configs, if they are there. (they should be in the zarafa_conf package) |
---|
74 | #rm /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/config.php || true |
---|
75 | #rm /tmp/pkg/var/www/htdocs/syn3/zarafa/config.php || true |
---|
76 | |
---|
77 | |
---|
78 | #remove debug shizzle |
---|
79 | #rm /tmp/pkg/var/www/htdocs/syn3/zarafa*/debug.php || exit 1 |
---|
80 | |
---|
81 | #change permissions of stuff |
---|
82 | #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp |
---|
83 | #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa/tmp || exit 1 |
---|
84 | |
---|
85 | #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp |
---|
86 | #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/tmp || exit 1 |
---|
87 | |
---|
88 | #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c |
---|
89 | #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/templates_c || exit 1 |
---|
90 | |
---|
91 | #mkdir /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache |
---|
92 | #chown nobody:nogroup /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile/cache || exit 1 |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | #webportal files er in |
---|
97 | #cp $CWD/zarafa/* /tmp/pkg/var/www/htdocs/syn3/zarafa || exit 1 |
---|
98 | #cp $CWD/zarafa-mobile/* /tmp/pkg/var/www/htdocs/syn3/zarafa-mobile || exit 1 |
---|
99 | |
---|
100 | #branding |
---|
101 | #cp $CWD/zarafa_top_logo.gif /tmp/pkg/var/www/htdocs/syn3/zarafa/client/layout/img/ || exit 1 |
---|
102 | |
---|
103 | #compile language files |
---|
104 | for PO in `find /tmp/pkg -name '*.po'`; do |
---|
105 | MO=`echo "$PO" | sed 's/.po$/.mo/'` |
---|
106 | msgfmt "$PO" -o "$MO" || exit 1 |
---|
107 | #we dont need the 'sources' in our 'binary' package ;) |
---|
108 | rm "$PO" |
---|
109 | done |
---|
110 | |
---|
111 | #end webaccess |
---|
112 | |
---|
113 | |
---|
114 | |
---|
115 | #apply patches |
---|
116 | #patch -F3 -p1 -d $SRC_DIR < Datux-spamhook.patch || exit 1 |
---|
117 | #patch -p1 -d $SRC_DIR < Datux-sendas.patch || exit 1 |
---|
118 | |
---|
119 | #a hack to allow mysql>=5.0 to function: |
---|
120 | #DONT DO THIS IN ZARAFA 6.30.x+! |
---|
121 | #sed 's/.*SET max_allowed_packet.*//' -i $SRC_DIR/provider/libserver/ECDatabaseMySQL.cpp || exit 1 |
---|
122 | |
---|
123 | #build and install sourcefiles |
---|
124 | #./configure optiones: |
---|
125 | #options for all make commands: |
---|
126 | export MAKE_OPTS=" -j10" |
---|
127 | #skip testing: |
---|
128 | export NOTEST=1 |
---|
129 | #extra optiones for the make install command, use with INSTALL_BASE for example: |
---|
130 | export INSTALL_OPTS="" |
---|
131 | export PATH=$PATH:/usr/php5/bin |
---|
132 | |
---|
133 | #AUTOMAKE: Configure |
---|
134 | #Some usefull stuff you sometimes need to set: |
---|
135 | #export LDFLAGS="-L/usr/lib/mysql/" |
---|
136 | #export LD_LIBRARY_PATH=/usr/lib/mysql |
---|
137 | #export VPATH=$LD_LIBRARY_PATH |
---|
138 | pushd $SRC_DIR |
---|
139 | MAKE_OPTS="" |
---|
140 | export CFLAGS="-Wno-error" |
---|
141 | |
---|
142 | ./configure --with-mapi-configdir=/etc/mapi --sbindir=/usr/bin --enable-swig --prefix=/usr --disable-testtools --enable-release --disable-static --enable-unicode --disable-perl --with-userscript-prefix=/etc/zarafa/userscripts --with-quotatemplate-prefix=/etc/zarafa/quotamail --enable-python || exit 1 |
---|
143 | |
---|
144 | #AUTOMAKE: Compile |
---|
145 | make $MAKE_OPTS || exit 1 |
---|
146 | |
---|
147 | make check || exit 1 |
---|
148 | |
---|
149 | |
---|
150 | #install bug workaround |
---|
151 | mkdir -p /tmp/pkg//usr/share/doc/zarafa/example-config |
---|
152 | cp ./installer/linux/archiver.cfg /tmp/pkg//usr/share/doc/zarafa/example-config |
---|
153 | |
---|
154 | #AUTOMAKE: Install |
---|
155 | mkdir -p /tmp/pkg &>/dev/null |
---|
156 | #somehow these are missing in 7.1.9? |
---|
157 | touch doc/zarafa-ws.cfg.5 doc/zarafa-ws.1 doc/zarafa-ws.5 |
---|
158 | |
---|
159 | make $MAKE_OPTS install || exit 1 |
---|
160 | make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install >/dev/null || exit 1 |
---|
161 | |
---|
162 | popd |
---|
163 | |
---|
164 | # postinstaller |
---|
165 | mkdir -p /tmp/pkg/etc/postinst.d |
---|
166 | cp post.zarafa /tmp/pkg/etc/postinst.d || exit 1 |
---|
167 | chmod +x /tmp/pkg/etc/postinst.d/* |
---|
168 | |
---|
169 | #this endsup there somehow.. |
---|
170 | rm -r /tmp/pkg/tmp 2>/dev/null |
---|
171 | |
---|
172 | #we provide our own preconfigured etc stuff in a seperate package |
---|
173 | mv /tmp/pkg/usr/etc /tmp |
---|
174 | |
---|
175 | #fix a php compile error: |
---|
176 | find /tmp/pkg/usr/share/php/mapi -name '*.php' -exec sed 's/<?php?/<?php /' -i "{}" \; || exit 1 |
---|
177 | |
---|
178 | #strip bins and other stuff |
---|
179 | syn3_strip /tmp/pkg || exit 1 |
---|
180 | |
---|
181 | #zarafa_conf contains this file already |
---|
182 | rm -r /tmp/pkg/etc/php5 || exit 1 |
---|
183 | |
---|
184 | #move development stuff and create seperate development package |
---|
185 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
186 | #move some extra files for the dev package, special for zarafa_spam |
---|
187 | for FILE in `find .\ |
---|
188 | -name '*.a' -o\ |
---|
189 | -name '*.la' -o\ |
---|
190 | -name '*.h' -o\ |
---|
191 | -name '*.cpp' -o\ |
---|
192 | -type d -name include -o\ |
---|
193 | -type d -name pkgconfig`; |
---|
194 | do |
---|
195 | if [ -e $FILE ]; then |
---|
196 | echo $FILE |
---|
197 | cp $FILE /tmp/pkgdev/usr/include/zarafa |
---|
198 | #rm -r $FILE || exit 1 |
---|
199 | fi |
---|
200 | done |
---|
201 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
202 | |
---|
203 | #make main package |
---|
204 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
205 | |
---|
206 | |
---|