1 | #!/bin/bash |
---|
2 | # Generic python build script. (C)DatuX |
---|
3 | # Put in in a builddirectory with a python tarfile that contains a setup.py. |
---|
4 | # Please python_modulename for python modules. |
---|
5 | |
---|
6 | #DEP:python |
---|
7 | #DEP:python_setuptools |
---|
8 | #DEP:python_cffi |
---|
9 | #DEP:python_pycparser |
---|
10 | |
---|
11 | #######Essential package info. |
---|
12 | #Change these if autodetection fails. |
---|
13 | |
---|
14 | #Name of the Syn-3 package that we are going to create |
---|
15 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
16 | |
---|
17 | if ! echo $NAME | grep "^python_"; then |
---|
18 | echo "python modules should have a packagename that starts with python_ !" |
---|
19 | exit 1 |
---|
20 | fi |
---|
21 | |
---|
22 | #Archive of the sourcefiles to unpack |
---|
23 | SRC_ARC=`ls *.tar.*` |
---|
24 | |
---|
25 | #Version of the sourcefiles |
---|
26 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` |
---|
27 | |
---|
28 | #Directory of the sourcefiles to build (after optional unpacking) |
---|
29 | SRC_DIR=`echo $SRC_ARC| sed 's/\.tar\..*$//g'` |
---|
30 | |
---|
31 | #Architecture that the created binaries run on. |
---|
32 | #Use noarch for scripts. |
---|
33 | ARCH=`uname -m` |
---|
34 | |
---|
35 | |
---|
36 | ########Build and create the pacakge. |
---|
37 | #Uncomment the stuff that you dont want or need |
---|
38 | |
---|
39 | #Unpack source |
---|
40 | #(uncomment if not needed) |
---|
41 | syn3_unpack $SRC_ARC || exit 1 |
---|
42 | |
---|
43 | #apply patches |
---|
44 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
45 | |
---|
46 | pushd $SRC_DIR || exit 1 |
---|
47 | python setup.py install --root=/tmp/pkg || exit 1 |
---|
48 | popd |
---|
49 | |
---|
50 | #strip bins and other stuff |
---|
51 | syn3_strip /tmp/pkg || exit 1 |
---|
52 | |
---|
53 | #move development stuff and create seperate development package |
---|
54 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
55 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
56 | |
---|
57 | #make main package |
---|
58 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
59 | |
---|
60 | |
---|