File: buildpackages

package info (click to toggle)
webcit 7.37-dfsg-7
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,972 kB
  • ctags: 2,344
  • sloc: ansic: 23,301; sh: 3,618; makefile: 239
file content (68 lines) | stat: -rwxr-xr-x 1,816 bytes parent folder | download
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
#!/bin/bash
if test -x Makefile; then
    make clean
fi
./bootstrap
export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;WEBCIT;"`

PACKAGE_VERSION=`cat packageversion`
DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
ACTUAL_DIR=`pwd`


rm -rf debian/citadel-webcit debian/tmp/
if echo "$ACTUAL_DIR" |grep -q "$WEBCIT_VERSION"; then
	echo "directory ($ACTUAL_DIR) naming scheme seems right. nothing done."
else
	done=false
	if test -L "$ACTUAL_DIR"; then 
		SYMLINK_=`pwd`
		SYMLINK=`ls -l $SYMLINK_|sed "s;.*-> ;;"`
		if ls -l $SYMLINK_|grep -q "$WEBCIT_VERSION"; then
			done=true
		fi
	else
		SYMLINK=`pwd|sed "s;.*/;;"`
	fi
	if test "$done" = "false"; then 
		cd ..
		mv -- $SYMLINK "webcit-$WEBCIT_VERSION"
		ln -sf "webcit-$WEBCIT_VERSION" webcit
		cd "webcit-$WEBCIT_VERSION"
	else
		cd "../webcit-$WEBCIT_VERSION"
	fi
	
fi

case $1 in
    debian)
	if grep -q "($WEBCIT_VERSION" debian/changelog; then
	    echo rebuilding package.
	else
	    echo "Upstream Version higher than local."	    
	fi
	if test "$2" == "src"; then
	    cd ..
	    rm -rf tmp
	    mkdir tmp
	    cp -rL webcit-$WEBCIT_VERSION tmp
	    cd tmp/webcit-$WEBCIT_VERSION
	    rm -rf `find -name .svn ` svn*tmp* build-stamp configure-stamp *~ config.guess  config.log config.status autom4te.cache
	    find -type f -exec chmod a-x {} \;
	    chmod a+x configure debian/rules po/create-pot.sh
	    cd ..
	    tar -chzf webcit_${WEBCIT_VERSION}.orig.tar.gz webcit-${WEBCIT_VERSION}/ --exclude "debian/*"
	    pwd
	    cd  webcit-${WEBCIT_VERSION}; debuild -S -sa -kw.goesgens@outgesourced.org
	else
	    fakeroot dpkg-buildpackage
	fi
	;;
    sourcedist)
	cd ..; tar --exclude .svn --exclude "debian/*" -cvhzf webcit-${WEBCIT_VERSION}.tar.gz webcit-${WEBCIT_VERSION}/
	;;
    *)
	echo "Not yet implemented. we have: debian "
	;;
esac