summaryrefslogtreecommitdiff
path: root/createpackage.sh
blob: 3dc9c07c8a8f3eaacef264a2931e19c423f91a84 (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
47
48
49
# $Id: createpackage.sh,v 1.10 2006/10/24 08:10:41 whot Exp $
#
# This script creates a debian package for the MPWM.
#
#

APPNAME=mpwm
VERSION=`cvs log Changelog | grep TAG | head -n 1 | sed -e "s/TAG: MPWM_//" | sed -e "s/_/./g"`

if [ "$1" != "--skip-deb" ]
then
    rm -rf Debian
    mkdir -p Debian/opt/MPX/bin
    mkdir -p Debian/opt/MPX/share/$APPNAME/images
    mkdir -p Debian/DEBIAN/
    chmod 755 Debian/DEBIAN/
    cat ${APPNAME}-control | sed -e "s/VERSION/$VERSION/" > Debian/DEBIAN/control
    cd src
    make dist
    cd ${OLDPWD} 

    cp src/${APPNAME} Debian/opt/MPX/bin/
    cp images/* Debian/opt/MPX/share/$APPNAME/images/

    dpkg-deb --build Debian ${APPNAME}-${VERSION}-i386.deb

    rm -rf Debian
fi

# create source package
if [ "$1" != "--skip-tar" ]
then
    rm *.tar.gz
    EXCLUDE_FILE=/tmp/${APPNAME}_exclude_tarlist  

cat << END > ${EXCLUDE_FILE}
*.deb
*.sh
src/*.o
CVS
${APPNAME}-control
*.tar.gz
END

    tar zcf ${APPNAME}-${VERSION}.tar.gz --exclude-from=${EXCLUDE_FILE} ../MPGWM++

    rm ${EXCLUDE_FILE}
fi