[c5c522c] | 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 | |
---|
[0c5671f] | 6 | #wow..so many dependencies for certbot :( |
---|
| 7 | #maybe use https://github.com/Neilpang/acme.sh instead? |
---|
| 8 | |
---|
[c5c522c] | 9 | #DEP:python |
---|
| 10 | #DEP:python_setuptools |
---|
[0c5671f] | 11 | #DEP:python_mock |
---|
| 12 | #DEP:python_ZopeInterface |
---|
| 13 | #DEP:python_ZopeComponent |
---|
| 14 | #DEP:python_six |
---|
| 15 | #DEP:python_requests |
---|
| 16 | #DEP:python_pytz |
---|
| 17 | #DEP:python_pyrfc3339 |
---|
| 18 | #DEP:python_pyOpenSSL |
---|
| 19 | #DEP:python_cryptography |
---|
| 20 | #DEP:python_funcsigs |
---|
| 21 | #DEP:python_pyasn1 |
---|
| 22 | #DEP:python_ndg_httpsclient |
---|
| 23 | #DEP:python_ipaddress |
---|
| 24 | #DEP:python_enum34 |
---|
| 25 | #DEP:python_idna |
---|
| 26 | #DEP:python_parsedatetime |
---|
| 27 | #DEP:python_configobj |
---|
| 28 | #DEP:python_configargparse |
---|
| 29 | #DEP:python_ZopeEvent |
---|
[c5c522c] | 30 | |
---|
| 31 | #######Essential package info. |
---|
| 32 | #Change these if autodetection fails. |
---|
| 33 | |
---|
| 34 | #Name of the Syn-3 package that we are going to create |
---|
| 35 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | #Archive of the sourcefiles to unpack |
---|
[0c5671f] | 39 | SRC_ARC=`ls *.tar.*` |
---|
[c5c522c] | 40 | |
---|
| 41 | #Version of the sourcefiles |
---|
| 42 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g'` |
---|
| 43 | |
---|
| 44 | #Directory of the sourcefiles to build (after optional unpacking) |
---|
| 45 | SRC_DIR=`echo $SRC_ARC| sed 's/\.tar\..*$//g'` |
---|
| 46 | |
---|
| 47 | #Architecture that the created binaries run on. |
---|
| 48 | #Use noarch for scripts. |
---|
| 49 | ARCH=`uname -m` |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | ########Build and create the pacakge. |
---|
| 53 | #Uncomment the stuff that you dont want or need |
---|
| 54 | |
---|
[0c5671f] | 55 | #prevent automated downloads/installs by python setuptools |
---|
| 56 | rm /etc/resolv.conf |
---|
| 57 | |
---|
[c5c522c] | 58 | #Unpack source |
---|
| 59 | #(uncomment if not needed) |
---|
| 60 | syn3_unpack $SRC_ARC || exit 1 |
---|
| 61 | |
---|
| 62 | #apply patches |
---|
| 63 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
| 64 | |
---|
[0c5671f] | 65 | pushd $SRC_DIR/acme || exit 1 |
---|
[c5c522c] | 66 | python setup.py install --root=/tmp/pkg || exit 1 |
---|
[0c5671f] | 67 | python setup.py install || exit 1 |
---|
| 68 | popd |
---|
[c5c522c] | 69 | |
---|
[0c5671f] | 70 | pushd $SRC_DIR || exit 1 |
---|
[c5c522c] | 71 | python setup.py install --root=/tmp/pkg || exit 1 |
---|
[0c5671f] | 72 | python setup.py install || exit 1 |
---|
[c5c522c] | 73 | popd |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | #strip bins and other stuff |
---|
| 77 | syn3_strip /tmp/pkg || exit 1 |
---|
| 78 | |
---|
| 79 | #move development stuff and create seperate development package |
---|
| 80 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
| 81 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
| 82 | |
---|
| 83 | #make main package |
---|
| 84 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
| 85 | |
---|
| 86 | |
---|