-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathactivemq2deb.sh
executable file
·75 lines (56 loc) · 1.88 KB
/
activemq2deb.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
75
#!/bin/bash
VERSION=$1
ITERATION=$2
[ -z $VERSION ] || [ -z $ITERATION ] && echo Usage: $0 X.Y.Z ITERATION && exit 1
TGZ=`pwd`/apache-activemq-$VERSION-bin.tar.gz
BN=`basename $TGZ -bin.tar.gz`
if [ ! -e $TGZ ]
then
wget "http://www.eu.apache.org/dist/activemq/${VERSION}/apache-activemq-${VERSION}-bin.tar.gz"
fi
pushd . > /dev/null
TMPDIR=`mktemp -d`
cd $TMPDIR
tar -xzf ${TGZ}
mkdir -p etc \
usr/share/doc \
var/run/activemq/ \
var/lib/activemq/ \
var/lib/activemq/activemq-data \
var/log \
usr/bin \
var/log/activemq \
etc/init.d
mv apache-activemq-$VERSION usr/share/activemq
mv usr/share/activemq/data var/lib/activemq/data
ln -s /var/lib/activemq/data usr/share/activemq/data
# For Kaha database
ln -s /var/lib/activemq/activemq-data usr/share/activemq/activemq-data
ln -s /var/log/activemq usr/share/activemq/log
mv usr/share/activemq/docs usr/share/doc/activemq
ln -s /usr/share/doc/activemq usr/share/activemq/docs
mv usr/share/activemq/webapps var/lib/activemq/webapps
ln -s /var/lib/activemq/webapps usr/share/activemq/webapps
mv usr/share/activemq/lib var/lib/activemq/lib
ln -s /var/lib/activemq/lib usr/share/activemq/lib
mv usr/share/activemq/conf etc/activemq
ln -s /etc/activemq usr/share/activemq/conf
ln -s /usr/share/activemq/bin/activemq-admin usr/bin/activemq-admin
echo "This deb was generated from ${BN}" > usr/share/doc/activemq/README.Debian
popd >/dev/null
cp init $TMPDIR/etc/init.d/activemq
chmod 755 $TMPDIR/etc/init.d/activemq
fpm -s dir -t deb \
-n activemq -v $VERSION --iteration $ITERATION -a all \
-C $TMPDIR \
-d java6-sdk \
-m 'Rudy Gevaert <[email protected]>' \
--description "Activemq $VERSION" \
--url 'http://activemq.apache.org/' \
--after-install postinst \
--before-remove prerm \
--after-remove postrm \
--config-files etc/activemq/activemq.xml \
--config-files etc/activemq/log4j.properties \
.
rm -fr $TMPDIR