1 | #!/bin/bash |
---|
2 | |
---|
3 | #DEP:imagemagick |
---|
4 | #NEED:cmake |
---|
5 | ##DEP:boost |
---|
6 | #NEED:doxygen |
---|
7 | #DEP:gnutls |
---|
8 | #DEP:openssl |
---|
9 | #NEED:linuxdoc_tools |
---|
10 | |
---|
11 | #?BuildRequires: inkscape |
---|
12 | |
---|
13 | set -e |
---|
14 | |
---|
15 | #######Essential package info. |
---|
16 | #Change these if autodetection fails. |
---|
17 | |
---|
18 | #Name of the Syn-3 package that we are going to create |
---|
19 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
20 | |
---|
21 | #Archive of the sourcefiles to unpack |
---|
22 | SRC_ARC=`ls *.tar.*` |
---|
23 | |
---|
24 | #Version of the sourcefiles |
---|
25 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` |
---|
26 | |
---|
27 | #Directory of the sourcefiles to build (after optional unpacking) |
---|
28 | SRC_DIR=`echo $SRC_ARC| sed 's/\.tar\..*$//g'` |
---|
29 | |
---|
30 | #Architecture that the created binaries run on. |
---|
31 | #Use noarch for scripts. |
---|
32 | ARCH=`uname -m` |
---|
33 | |
---|
34 | |
---|
35 | ########Build and create the pacakge. |
---|
36 | #Uncomment the stuff that you dont want or need |
---|
37 | |
---|
38 | #Unpack source |
---|
39 | #(uncomment if not needed) |
---|
40 | syn3_unpack $SRC_ARC || exit 1 |
---|
41 | |
---|
42 | pushd $SRC_DIR |
---|
43 | |
---|
44 | #note, use github version that has cmake files that create actual makefiles, from: https://codeload.github.com/kisli/vmime/tar.gz/v0.9.2 |
---|
45 | |
---|
46 | |
---|
47 | # from https://build.opensuse.org/package/view_file/server:mail:kopano/libvmime/libvmime.spec?expand=1 |
---|
48 | cf="-DVMIME_ALWAYS_GENERATE_7BIT_PARAMETER=1" |
---|
49 | cmake . \ |
---|
50 | -DVMIME_SENDMAIL_PATH:STRING="/usr/sbin/sendmail" \ |
---|
51 | -DVMIME_BUILD_SAMPLES:BOOL=OFF \ |
---|
52 | -DVMIME_HAVE_SASL_SUPPORT:BOOL=OFF \ |
---|
53 | -DVMIME_HAVE_TLS_SUPPORT:BOOL=ON \ |
---|
54 | -DVMIME_BUILD_STATIC_LIBRARY:BOOL=OFF \ |
---|
55 | -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" \ |
---|
56 | -DCMAKE_INSTALL_PREFIX:PATH="/usr" \ |
---|
57 | -DCMAKE_CXX_FLAGS_DEBUG:STRING="-g" \ |
---|
58 | -DCMAKE_CXX_FLAGS:STRING="$cf -std=gnu++11" \ |
---|
59 | -DCMAKE_C_FLAGS:STRING="$cf" |
---|
60 | make -j10 VERBOSE=1 |
---|
61 | make install DESTDIR=/tmp/pkg |
---|
62 | |
---|
63 | popd |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | mkdir -p /tmp/pkg/etc/postinst.d |
---|
71 | cp post.libvmime /tmp/pkg/etc/postinst.d |
---|
72 | chmod +x /tmp/pkg/etc/postinst.d/post.libvmime || exit 1 |
---|
73 | |
---|
74 | #strip bins and other stuff |
---|
75 | syn3_strip /tmp/pkg || exit 1 |
---|
76 | |
---|
77 | #move development stuff and create seperate development package |
---|
78 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
79 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
80 | |
---|
81 | #make main package |
---|
82 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
83 | |
---|
84 | |
---|