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 | ##DEP:doxygen |
---|
18 | |
---|
19 | |
---|
20 | #######Essential package info. |
---|
21 | #Change these if autodetection fails. |
---|
22 | |
---|
23 | #Name of the Syn-3 package that we are going to create |
---|
24 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
25 | |
---|
26 | #Archive of the sourcefiles to unpack |
---|
27 | SRC_ARC=`ls *.tar.* *.zip 2>/dev/null` |
---|
28 | |
---|
29 | #Version of the sourcefiles |
---|
30 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g' | sed 's/\.zip$//g'` |
---|
31 | |
---|
32 | #Architecture that the created binaries run on. |
---|
33 | #Use noarch for scripts. |
---|
34 | ARCH=`uname -m` |
---|
35 | |
---|
36 | CWD=`pwd` |
---|
37 | |
---|
38 | mkdir /tmp/pkg |
---|
39 | PKG=/tmp/pkg |
---|
40 | #Unpack source |
---|
41 | #(uncomment if not needed) |
---|
42 | syn3_unpack $SRC_ARC || exit 1 |
---|
43 | |
---|
44 | #Directory where the sourcefiles are unpacked. |
---|
45 | #(you might have to adjust this if autodetection fails) |
---|
46 | SRC_DIR=`ls -c|head -1` |
---|
47 | |
---|
48 | cd $SRC_DIR |
---|
49 | chown -R root:root . |
---|
50 | find . -perm 666 -exec chmod 644 {} \; |
---|
51 | find . -perm 664 -exec chmod 644 {} \; |
---|
52 | find . -perm 600 -exec chmod 644 {} \; |
---|
53 | find . -perm 444 -exec chmod 644 {} \; |
---|
54 | find . -perm 400 -exec chmod 644 {} \; |
---|
55 | find . -perm 440 -exec chmod 644 {} \; |
---|
56 | find . -perm 777 -exec chmod 755 {} \; |
---|
57 | find . -perm 775 -exec chmod 755 {} \; |
---|
58 | find . -perm 511 -exec chmod 755 {} \; |
---|
59 | find . -perm 711 -exec chmod 755 {} \; |
---|
60 | find . -perm 555 -exec chmod 755 {} \; |
---|
61 | |
---|
62 | zcat $CWD/net-tools_1.60-19.diff.gz | patch -p1 --backup --verbose || exit 1 |
---|
63 | zcat $CWD/net-tools.diff.gz | patch -p1 --backup --verbose || exit 1 |
---|
64 | |
---|
65 | mkdir -p $PKG/usr/doc/net-tools-1.60 || exit 1 |
---|
66 | cp -a README README.ipv6 $PKG/usr/doc/net-tools-1.60 || exit 1 |
---|
67 | chmod 644 $PKG/usr/doc/net-tools-1.60/* || exit 1 |
---|
68 | chown root:root $PKG/usr/doc/net-tools-1.60/* || exit 1 |
---|
69 | HAVE_IP_TOOLS=1 HAVE_MII=1 make || exit 1 |
---|
70 | HAVE_IP_TOOLS=1 HAVE_MII=1 make hostname || exit 1 |
---|
71 | strip --strip-unneeded ipmaddr iptunnel hostname arp ifconfig nameif rarp route netstat plipconfig slattach mii-tool || exit 1 |
---|
72 | mkdir -p $PKG/sbin $PKG/bin $PKG/usr/sbin || exit 1 |
---|
73 | cat arp > $PKG/sbin/arp || exit 1 |
---|
74 | cat ifconfig > $PKG/sbin/ifconfig || exit 1 |
---|
75 | cat rarp > $PKG/sbin/rarp || exit 1 |
---|
76 | cat route > $PKG/sbin/route || exit 1 |
---|
77 | cat hostname > $PKG/bin/hostname || exit 1 |
---|
78 | cat mii-tool > $PKG/sbin/mii-tool || exit 1 |
---|
79 | cat nameif > $PKG/sbin/nameif || exit 1 |
---|
80 | cat netstat > $PKG/bin/netstat || exit 1 |
---|
81 | cat plipconfig > $PKG/sbin/plipconfig || exit 1 |
---|
82 | cat slattach > $PKG/usr/sbin/slattach || exit 1 |
---|
83 | cat ipmaddr > $PKG/sbin/ipmaddr || exit 1 |
---|
84 | cat iptunnel > $PKG/sbin/iptunnel || exit 1 |
---|
85 | chmod 755 $PKG/sbin/* $PKG/bin/* $PKG/usr/sbin/* || exit 1 |
---|
86 | cd man/en_US || exit 1 |
---|
87 | mkdir -p $PKG/usr/man/man{1,5,8} || exit 1 |
---|
88 | for page in dnsdomainname.1 domainname.1 hostname.1 nisdomainname.1 \ |
---|
89 | ypdomainname.1 ; do |
---|
90 | cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz |
---|
91 | done |
---|
92 | cat ethers.5 | gzip -9c > $PKG/usr/man/man5/ethers.5.gz || exit 1 |
---|
93 | for page in arp.8 ifconfig.8 mii-tool.8 nameif.8 netstat.8 rarp.8 route.8 \ |
---|
94 | slattach.8 plipconfig.8 ; do |
---|
95 | cat $page | gzip -9c > $PKG/usr/man/man8/$page.gz || exit 1 |
---|
96 | done |
---|
97 | ( cd $PKG/bin |
---|
98 | ln -sf hostname dnsdomainname |
---|
99 | ln -sf hostname nisdomainname |
---|
100 | ln -sf hostname ypdomainname |
---|
101 | ) |
---|
102 | |
---|
103 | cd /tmp/build |
---|
104 | #make main package |
---|
105 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|