[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | #Gebruik deze file als voorbeeld. Plaats de source tar.gz file in de zelfde directory als deze slackbuild |
---|
| 3 | #Met de NEED en DEP opties is het mogelijk om build dependencies aan te geven. |
---|
| 4 | #Voor de meeste packages hoeft er verder niks aan de variabellen veranderd te worden. |
---|
| 5 | ##################################### Build dependency info: |
---|
| 6 | |
---|
| 7 | #Strict build-dependencies |
---|
| 8 | #Our package will be automaticly rebuilded if there is a major change in a DEP package. |
---|
| 9 | #(this is recommended for most dependencys) |
---|
| 10 | ##DEP:linux |
---|
| 11 | ##DEP:linux_src |
---|
| 12 | ##DEP:openldap |
---|
| 13 | |
---|
| 14 | #Loose build-dependencies |
---|
| 15 | #The package will be installed in the buildroot during buidling, but no automatic rebuild will occur. |
---|
| 16 | #(not recommended) |
---|
| 17 | ##NEED:doxygen |
---|
| 18 | |
---|
| 19 | #NEED:perlmod_Net_SSLeay |
---|
| 20 | |
---|
| 21 | #######Essential package info. |
---|
| 22 | #Change these if autodetection fails. |
---|
| 23 | |
---|
| 24 | #Name of the Syn-3 package that we are going to create |
---|
| 25 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
| 26 | |
---|
| 27 | #Archive of the sourcefiles to unpack |
---|
| 28 | SRC_ARC=`ls *.tar.* *.zip 2>/dev/null` |
---|
| 29 | |
---|
| 30 | #Version of the sourcefiles |
---|
| 31 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g' | sed 's/\.zip$//g'` |
---|
| 32 | |
---|
| 33 | #Architecture that the created binaries run on. |
---|
| 34 | #Use noarch for scripts. |
---|
| 35 | ARCH=noarch |
---|
| 36 | |
---|
| 37 | #from this point on, exit on errors: |
---|
| 38 | set -e |
---|
| 39 | |
---|
| 40 | ########Build and create the pacakge. |
---|
| 41 | #Uncomment the stuff that you dont want or need |
---|
| 42 | |
---|
| 43 | #Unpack source |
---|
| 44 | #(uncomment if not needed) |
---|
| 45 | syn3_unpack $SRC_ARC |
---|
| 46 | |
---|
| 47 | #Directory where the sourcefiles are unpacked. |
---|
| 48 | #(you might have to adjust this if autodetection fails) |
---|
| 49 | SRC_DIR=`ls -c|head -1` |
---|
| 50 | |
---|
| 51 | #apply patches |
---|
| 52 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | #install webmin |
---|
| 56 | pushd $SRC_DIR |
---|
| 57 | mkdir -p /home/system/webmin /usr/webmin /var/log/webmin /etc |
---|
| 58 | ssl=1 nostart=1 atboot=0 password=syn3 login=admin port=10001 perl=/usr/bin/perl var_dir=/var/log/webmin config_dir=/home/system/webmin ./setup.sh /usr/webmin |
---|
| 59 | popd |
---|
| 60 | |
---|
| 61 | #move to package dir |
---|
| 62 | mkdir -p /tmp/pkg/home/system /tmp/pkg/usr /tmp/pkg/var/log /tmp/pkg/etc |
---|
| 63 | ln -s /home/system/webmin /tmp/pkg/etc/webmin |
---|
| 64 | mv /home/system/webmin /tmp/pkg/home/system |
---|
| 65 | mv /usr/webmin /tmp/pkg/usr |
---|
| 66 | mv /var/log/webmin /tmp/pkg/var/log |
---|
| 67 | |
---|
| 68 | #our tuned config |
---|
| 69 | cp miniserv.conf /tmp/pkg/home/system/webmin/miniserv.conf |
---|
| 70 | |
---|
| 71 | #firewall service |
---|
| 72 | mkdir -p /tmp/pkg/etc/firewall |
---|
| 73 | cp services.webmin.new /tmp/pkg/etc/firewall |
---|
| 74 | |
---|
| 75 | #remove ssl keys, we use syn3's webint ssl keys |
---|
| 76 | rm /tmp/pkg/home/system/webmin/miniserv.pem |
---|
| 77 | |
---|
| 78 | #daemon tools runscript |
---|
| 79 | mkdir -p /tmp/pkg/service/webmin |
---|
| 80 | cp run /tmp/pkg/service/webmin |
---|
| 81 | chmod +x /tmp/pkg/service/webmin/run |
---|
| 82 | |
---|
| 83 | #webportal stuff |
---|
| 84 | mkdir -p /tmp/pkg/var/www/htdocs/syn3/webmin/ |
---|
| 85 | cp webportal/* /tmp/pkg/var/www/htdocs/syn3/webmin/ || exit 1 |
---|
| 86 | |
---|
| 87 | #strip bins and other stuff |
---|
| 88 | syn3_strip /tmp/pkg || exit 1 |
---|
| 89 | |
---|
| 90 | #move development stuff and create seperate development package |
---|
| 91 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
| 92 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
| 93 | |
---|
| 94 | #make main package |
---|
| 95 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|