forked from guyzmo/polluxnzcity
/
package.sh
75 lines (51 loc) · 1.9 KB
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
DIST=`pwd`
TARGET=$DIST/target
ARCH=armv7a
##### LIGHTTPD-SYSTEMD
REV="r3"
VER=1.4.29
rm -rf $TARGET
mkdir -p $TARGET
install -d $TARGET/lib/systemd/system/
install -D $DIST/lighttpd-systemd/lighttpd.service $TARGET/lib/systemd/system/lighttpd.service
cd $TARGET
tar -cvzf data.tar.gz ./lib
cp $DIST/lighttpd-systemd/debian/* ./
tar -cvzf control.tar.gz control postrm prerm postinst
rm -rf $DIST/lighttpd-systemd_$VER-${REV}_$ARCH.ipk
ar ru $DIST/lighttpd-systemd_$VER-${REV}_$ARCH.ipk debian-binary data.tar.gz control.tar.gz
##### POLLUX-FULL
REV="r0"
VER=0.2.0
rm -rf $TARGET
mkdir -p $TARGET
install -d $TARGET/etc/cron.daily/
install -d $TARGET/etc/cron.hourly/
install -D $DIST/pollux-full/etc/cron.daily/keep_pollux_uptodate $TARGET/etc/cron.daily/keep_pollux_uptodate
install -D $DIST/pollux-full/etc/cron.hourly/keep_time_in_sync $TARGET/etc/cron.hourly/keep_time_in_sync
cd $TARGET
tar -cvzf data.tar.gz ./etc
cp $DIST/pollux-full/debian/* ./
sed -i "s/^Version: .*$/Version: $VER/g" control
VER_GW=`grep 'VERSION' $DIST/../PolluxGateway/include/version.h | awk '{print $3}'`
VER_CF=`grep '__version__' $DIST/../PolluxConfig/pollux/_version.py | sed "s/.*'\(.*\)'.*/\1/"`
sed -i "s/^Depends: .*$/Depends: pollux-gateway >=$VER_GW, pollux-config >=$VER_CF/g" control
tar -cvzf control.tar.gz control
rm -rf $DIST/pollux-full_$VER-${REV}_$ARCH.ipk
ar ru $DIST/pollux-full_$VER-${REV}_$ARCH.ipk debian-binary control.tar.gz data.tar.gz
##### HACKABLEDEVICES-FEED
REV="r0"
VER=1.0.0
rm -rf $TARGET
mkdir -p $TARGET
cd $TARGET
install -d $TARGET/etc/opkg/
install -D $DIST/polluxnzcity-feed/etc/opkg/polluxnzcity-feed.conf $TARGET/etc/opkg/
tar -cvzf data.tar.gz ./etc
cp $DIST/polluxnzcity-feed/debian/* ./
tar -cvzf control.tar.gz control
rm -rf $DIST/polluxnzcity-feed_$VER-${REV}_$ARCH.ipk
ar ru $DIST/polluxnzcity-feed_$VER-${REV}_$ARCH.ipk debian-binary control.tar.gz data.tar.gz
#####
cd $DIST
cp *.ipk ../feed