summaryrefslogtreecommitdiff
path: root/office/openproj/openproj.SlackBuild
blob: 0dcd414c39a61d91f399b6414aa063b54401c11e (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
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
#!/bin/sh

# Slackware build script for openproj

# Written by Chris Abela <chris.abela@maltats.com>
# May 2009

PRGNAM=openproj
VERSION=${VERSION:-1.4} 
ARCH=i686		# Leave this alone
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}	

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

OPENPROJ_BUILD=$TMP/$PRGNAM-$VERSION-src/openproj_build

set -e	# Exit on most errors 

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION-src
tar xvf $CWD/$PRGNAM-$VERSION-src.tar.gz

cd $PRGNAM-$VERSION-src
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

# The following is adopted from $PRGNAM-$VERSION-src/open_build/make_deb.sh
cd openproj_contrib
ant build-contrib build-script build-exchange build-reports
JAVA_OPTS="-Xmx128m"
java $JAVA_OPTS -jar ant-lib/proguard.jar @openproj_contrib.conf
java $JAVA_OPTS -jar ant-lib/proguard.jar @openproj_script.conf
java $JAVA_OPTS -jar ant-lib/proguard.jar @openproj_exchange.conf
java $JAVA_OPTS -jar ant-lib/proguard.jar @openproj_exchange2.conf
java $JAVA_OPTS -jar ant-lib/proguard.jar @openproj_reports.conf
cd ../openproj_build
ant -Dbuild_contrib=false

cd $PKG
mkdir -p usr/{bin,doc/$PRGNAM-$VERSION,share/{$PRGNAM,applications,pixmaps,mime/packages}}
install -m 755 $OPENPROJ_BUILD/resources/openproj.sh usr/bin/openproj
patch -d usr/bin -i $CWD/openproj.diff
cp $OPENPROJ_BUILD/resources/openproj.desktop usr/share/applications/
cp $OPENPROJ_BUILD/resources/openproj.png usr/share/pixmaps/
cp $OPENPROJ_BUILD/resources/openproj.xml usr/share/mime/packages/
cp -r $OPENPROJ_BUILD/{license,resources/samples} usr/doc/$PRGNAM-$VERSION/
cp -r $OPENPROJ_BUILD/dist/* usr/share/$PRGNAM/

chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 700 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;


cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz