summaryrefslogtreecommitdiff
path: root/dist.sh
blob: 77b73d311f16d95b024d089eb68ccccd3bc73a30 (plain)
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
#!/scratchbox/tools/bin/bash

DBUS_VERSION_MAJOR=$(pkg-config dbus-1 --modversion | awk '{split($0,t,/\./) ; print t[1]}')
DBUS_VERSION_MINOR=$(pkg-config dbus-1 --modversion | awk '{split($0,t,/\./) ; print t[2]}')

HILDON_VERSION_MAJOR=$(pkg-config hildon-1 --modversion | awk '{split($0,t,/\./) ; print t[1]}')
HILDON_VERSION_MINOR=$(pkg-config hildon-1 --modversion | awk '{split($0,t,/\./) ; print t[2]}')

MAEMO_VERSION="1"
if [ $DBUS_VERSION_MINOR -gt 23 ]; then
  MAEMO_VERSION="2"
fi

if [ $HILDON_VERSION_MAJOR -eq 1 ]; then
MAEMO_VERSION="4"
fi

if [ $HILDON_VERSION_MAJOR -eq 2 ]; then
MAEMO_VERSION="4"
fi

echo "Maemo version: $MAEMO_VERSION Hildon version: $HILDON_VERSION_MAJOR.$HILDON_VERSION_MINOR"
rm -rf *~

# Build binary package
make clean
rm -rf debian/nethack
rm -f debian
ln -s debian-maemo${MAEMO_VERSION} debian
dpkg-buildpackage -rfakeroot -b

# Build source package
make clean
rm *stamp
rm -rf debian/nethack
rm -f debian
rm -rf nethack-3.4.3
rm -rf nethack_maemo
mkdir nethack_maemo
cp -r * nethack_maemo
rm -rf nethack_maemo/nethack-343-src.tgz
rm -rf nethack_maemo/nethack_maemo
rm -rf nethack_maemo/debian/nethack
tar czvf nethack_maemo.tar.gz nethack_maemo 
mv -f nethack_maemo.tar.gz ..
rm -rf nethack_maemo