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 | #NEED:git |
---|
30 | #DEP:popt |
---|
31 | #DEP:jsoncpp |
---|
32 | |
---|
33 | #DEP:libhx |
---|
34 | #DEP:python_setuptools |
---|
35 | |
---|
36 | #######Essential package info. |
---|
37 | #Change these if autodetection fails. |
---|
38 | |
---|
39 | #Name of the Syn-3 package that we are going to create |
---|
40 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
41 | |
---|
42 | #Archive of the sourcefiles to unpack |
---|
43 | #SRC_ARC=`ls *.tar.* *.zip` |
---|
44 | #SRC_ARC="zarafa-6.20.6" |
---|
45 | |
---|
46 | #Version of the sourcefiles |
---|
47 | #VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | #Architecture that the created binaries run on. |
---|
52 | #Use noarch for scripts. |
---|
53 | ARCH=`uname -m` |
---|
54 | |
---|
55 | CWD=`pwd` |
---|
56 | |
---|
57 | |
---|
58 | |
---|
59 | ########Build and create the pacakge. |
---|
60 | #Uncomment the stuff that you dont want or need |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | #Unpack source |
---|
65 | #(uncomment if not needed) |
---|
66 | #syn3_unpack $SRC_ARC || exit 1 |
---|
67 | #git clone https://stash.kopano.io/scm/~jengelhardt/kc.git -b ibw |
---|
68 | |
---|
69 | #unzip $SRC_ARC -d kc |
---|
70 | #SRC_DIR=kc |
---|
71 | |
---|
72 | #tar -xf kopano*xz |
---|
73 | |
---|
74 | #Directory of the sourcefiles to build (after optional unpacking) |
---|
75 | #SRC_DIR=`ls -rtch|tail -1` |
---|
76 | SRC_DIR=kopano-core |
---|
77 | VER=`cd $SRC_DIR && grep AC_INIT configure.ac|egrep -w -o '[0-9.]+'|head -1` || exit 1 |
---|
78 | # VER=`cd $SRC_DIR && git describe|sed 's/kopanocore-//'|tr - _` |
---|
79 | |
---|
80 | #build and install sourcefiles |
---|
81 | #./configure optiones: |
---|
82 | #options for all make commands: |
---|
83 | #export MAKE_OPTS=" -j10" |
---|
84 | #skip testing: |
---|
85 | export NOTEST=1 |
---|
86 | #extra optiones for the make install command, use with INSTALL_BASE for example: |
---|
87 | export INSTALL_OPTS="" |
---|
88 | export PATH=$PATH:/usr/php5/bin |
---|
89 | |
---|
90 | #AUTOMAKE: Configure |
---|
91 | #Some usefull stuff you sometimes need to set: |
---|
92 | #export LDFLAGS="-L/usr/lib/mysql/" |
---|
93 | #export LD_LIBRARY_PATH=/usr/lib/mysql |
---|
94 | #export VPATH=$LD_LIBRARY_PATH |
---|
95 | pushd $SRC_DIR |
---|
96 | MAKE_OPTS="" |
---|
97 | #export CFLAGS="-Wno-error" |
---|
98 | |
---|
99 | #./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 |
---|
100 | |
---|
101 | #AUTOMAKE: Compile |
---|
102 | #make $MAKE_OPTS || exit 1 |
---|
103 | |
---|
104 | #make check || exit 1 |
---|
105 | |
---|
106 | #used as example: https://build.opensuse.org/package/view_file/server:mail:kopano/kopano/build.collax?expand=1 |
---|
107 | |
---|
108 | ./bootstrap.sh || exit 1 |
---|
109 | ./configure --enable-epoll \ |
---|
110 | --enable-unicode \ |
---|
111 | --enable-release \ |
---|
112 | --enable-tcmalloc \ |
---|
113 | --disable-static \ |
---|
114 | --disable-debug \ |
---|
115 | --sbindir=/usr/bin \ |
---|
116 | --prefix=/usr \ |
---|
117 | --with-userscript-prefix=/etc/kopano/userscripts \ |
---|
118 | --with-quotatemplate-prefix=/etc/kopano/quotamail || exit 1 |
---|
119 | --disable-tcmalloc \ |
---|
120 | |
---|
121 | |
---|
122 | make -j10 || exit 1 |
---|
123 | make -j10 check || exit 1 |
---|
124 | #make install |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | #AUTOMAKE: Install |
---|
129 | mkdir -p /tmp/pkg &>/dev/null |
---|
130 | |
---|
131 | #make $MAKE_OPTS install || exit 1 |
---|
132 | make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg -j1 install >/dev/null || exit 1 |
---|
133 | |
---|
134 | popd |
---|
135 | |
---|
136 | |
---|
137 | |
---|
138 | #this endsup there somehow.. |
---|
139 | rm -r /tmp/pkg/tmp 2>/dev/null |
---|
140 | |
---|
141 | #we provide our own preconfigured etc stuff in a kopano_conf |
---|
142 | mv /tmp/pkg/usr/etc /tmp/usr_etc |
---|
143 | mv /tmp/pkg/etc /tmp |
---|
144 | |
---|
145 | # postinstaller |
---|
146 | mkdir -p /tmp/pkg/etc/postinst.d |
---|
147 | cp post.kopano /tmp/pkg/etc/postinst.d || exit 1 |
---|
148 | chmod +x /tmp/pkg/etc/postinst.d/* |
---|
149 | |
---|
150 | #fix a php compile error: |
---|
151 | #find /tmp/pkg/usr/share/php/mapi -name '*.php' -exec sed 's/<?php?/<?php /' -i "{}" \; || exit 1 |
---|
152 | |
---|
153 | #strip bins and other stuff |
---|
154 | syn3_strip /tmp/pkg || exit 1 |
---|
155 | |
---|
156 | |
---|
157 | #move development stuff and create seperate development package |
---|
158 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
159 | #move some extra files for the dev package, special for zarafa_spam |
---|
160 | for FILE in `find .\ |
---|
161 | -name '*.a' -o\ |
---|
162 | -name '*.la' -o\ |
---|
163 | -name '*.h' -o\ |
---|
164 | -name '*.cpp' -o\ |
---|
165 | -type d -name include -o\ |
---|
166 | -type d -name pkgconfig`; |
---|
167 | do |
---|
168 | if [ -e $FILE ]; then |
---|
169 | echo $FILE |
---|
170 | cp $FILE /tmp/pkgdev/usr/include/zarafa |
---|
171 | #rm -r $FILE || exit 1 |
---|
172 | fi |
---|
173 | done |
---|
174 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
175 | |
---|
176 | #make main package |
---|
177 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|