1 | #!/bin/sh |
---|
2 | #DEP:libtimesaver |
---|
3 | #DEP:slackpackage |
---|
4 | ## Include the slackware-pkg conf file |
---|
5 | if [ -a /etc/slack-package.conf ]; then |
---|
6 | . /etc/slack-package.conf |
---|
7 | else |
---|
8 | echo "Sorry you need to have the slack-package.conf file to run these" |
---|
9 | echo "please install the slackbuilds package from LinuxPackages.net" |
---|
10 | exit 1 |
---|
11 | fi |
---|
12 | |
---|
13 | # Set initial variables: |
---|
14 | NAME=daemontools |
---|
15 | VERSION=0.76 |
---|
16 | BUILD=$MYIN |
---|
17 | |
---|
18 | |
---|
19 | ## Location to download the sources |
---|
20 | SRC_LOC="http://cr.yp.to/daemontools/$NAME-$VERSION.tar.gz" |
---|
21 | |
---|
22 | PKG=$TMP/package-$NAME |
---|
23 | |
---|
24 | ## Lets Grab the Source if needed |
---|
25 | if [ -a $CWD/$NAME-$VERSION.tar.gz ]; then |
---|
26 | echo "Source present not downloading" |
---|
27 | else |
---|
28 | $WGET $SRC_LOC || true |
---|
29 | fi |
---|
30 | |
---|
31 | if [ ! -d $TMP ]; then |
---|
32 | mkdir -p $TMP # location to build the source |
---|
33 | fi |
---|
34 | |
---|
35 | rm -rf $PKG |
---|
36 | mkdir -p $PKG |
---|
37 | |
---|
38 | cd $TMP |
---|
39 | rm -rf admin |
---|
40 | tar xzvf $CWD/$NAME-$VERSION.tar.gz || exit 1 |
---|
41 | #################### timesaver patches erin boppen |
---|
42 | #EDWIN: uitgeschakeld, te krikky en niet handig voor profi gebruik. |
---|
43 | #patch -p0 <$CWD/supervise.patch || exit 1 |
---|
44 | #patch -p0 <$CWD/makefile.patch || exit 1 |
---|
45 | |
---|
46 | |
---|
47 | compile() { |
---|
48 | cd admin |
---|
49 | patch -p0 < $CWD/$NAME-$VERSION.errno.patch || exit 1 |
---|
50 | cd ../ |
---|
51 | mkdir /package |
---|
52 | cp -R admin /package |
---|
53 | cd /package/admin/daemontools-$VERSION/ |
---|
54 | cp /usr/lib/libtimesaver.a src/ |
---|
55 | cp $CWD/Makefile /package/admin/daemontools-0.76/src/ |
---|
56 | ./package/install |
---|
57 | } |
---|
58 | |
---|
59 | prepare() { |
---|
60 | mkdir -p $PKG/usr/bin |
---|
61 | mkdir -p $PKG/service |
---|
62 | cp /package/admin/daemontools-$VERSION/command/* $PKG/usr/bin |
---|
63 | } |
---|
64 | |
---|
65 | description() { |
---|
66 | mkdir -p $PKG/install |
---|
67 | cat > $PKG/install/slack-desc << END |
---|
68 | |-----handy-ruler------------------------------------------------------| |
---|
69 | daemontools: daemontools $VERSION |
---|
70 | daemontools: |
---|
71 | daemontools: daemontools is an extensive collection of tools for managing |
---|
72 | daemontools: UNIX services. It includes tools for starting, restarting, |
---|
73 | daemontools: stopping, monitoring and logging any services that you might |
---|
74 | daemontools: wish to run on a UNIX machine. |
---|
75 | daemontools: |
---|
76 | daemontools: |
---|
77 | daemontools: |
---|
78 | daemontools: |
---|
79 | daemontools: |
---|
80 | END |
---|
81 | } |
---|
82 | |
---|
83 | runscript() { |
---|
84 | |
---|
85 | |
---|
86 | #syn-3 wrapper scripts |
---|
87 | cp $CWD/svc* $PKG/usr/bin || exit 1 |
---|
88 | chmod +x $PKG/usr/bin/svc* || exit 1 |
---|
89 | |
---|
90 | #supervise compatibility hax0r |
---|
91 | #unwanted by new key system , look at timesaver |
---|
92 | #mv $PKG/usr/bin/{supervise,supervise.new} || exit 1 |
---|
93 | #mkdir -p $PKG/install |
---|
94 | #cat > $PKG/install/doinst.sh << END |
---|
95 | #if ! [ -e usr/bin/supervise ]; then |
---|
96 | # mv usr/bin/supervise.new usr/bin/supervise |
---|
97 | #fi |
---|
98 | #END |
---|
99 | #chmod +x $PKG/install/doinst.sh |
---|
100 | |
---|
101 | |
---|
102 | } |
---|
103 | |
---|
104 | build() { |
---|
105 | # Build the package: |
---|
106 | cd $PKG |
---|
107 | makepkg -l y -c n $CWD/$NAME.pkg || exit 1 |
---|
108 | echo $VERSION > $CWD/$NAME.version |
---|
109 | echo $ARCH > $CWD/$NAME.arch |
---|
110 | echo "Your $NAME package is complete, make sure you open it up before installing it." |
---|
111 | echo "It is located in /tmp thanks for your support The Linuxpackages.net Folks" |
---|
112 | } |
---|
113 | |
---|
114 | cleanup() { |
---|
115 | rm -rf $CWD/tmp |
---|
116 | } |
---|
117 | |
---|
118 | compile || exit 1 |
---|
119 | prepare || exit 1 |
---|
120 | description |
---|
121 | runscript |
---|
122 | build || exit 1 |
---|
123 | cleanup |
---|