Skip to content

Instantly share code, notes, and snippets.

@arnaudsj
Created April 30, 2009 02:37
Show Gist options
  • Save arnaudsj/104208 to your computer and use it in GitHub Desktop.
Save arnaudsj/104208 to your computer and use it in GitHub Desktop.
pkgname=rabbitmq
pkgver=1.5.4
pkgrel=0
pkgdesc="Highly reliable and performant enterprise messaging implementation of AMQP written in Erlang/OTP"
arch=(i686 x86_64)
url="http://rabbitmq.com"
license=('MPL')
depends=(erlang)
source="http://www.rabbitmq.com/releases/${pkgname}-server/v${pkgver}/${pkgname}-server-generic-unix-${pkgver}.tar.gz"
install=rabbitmq.install
md5sums=('fd24a628fbd03b1965f6b33fb02fdcb0')
build(){
cd ${startdir}/src/${pkgname}_server-${pkgver}/sbin
for i in *; do
sed -e 's,/etc/default,/etc/rabbitmq,g' $i | sed -e 's,/etc/rabbitmq/rabbitmq$,/etc/rabbitmq/rabbitmq.config,' > $i.tmp
mv $i.tmp $i
done
for i in usr/lib/erlang/lib usr/bin var/log/rabbitmq var/lib/rabbitmq/mnesia etc/rabbitmq; do
mkdir -p ${startdir}/pkg/${i}
done
cp ${startdir}/rabbitmq.config ${startdir}/pkg/etc/rabbitmq/
mv ${startdir}/src/${pkgname}_server-${pkgver} ${startdir}/pkg/usr/lib/erlang/lib/
for i in rabbitmq-server rabbitmqctl rabbitmq-multi; do
ln -sf ../lib/erlang/lib/${pkgname}_server-${pkgver}/sbin/${i} ${startdir}/pkg/usr/bin/
chmod 755 ${startdir}/pkg/usr/lib/erlang/lib/${pkgname}_server-${pkgver}/sbin/${i}
done
}
NODENAME=rabbit
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672
LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
pre_install() {
/bin/true
}
post_install() {
groupadd rabbitmq
useradd -g rabbitmq -d /var/lib/rabbitmq rabbitmq
chown -R rabbitmq.rabbitmq /var/log/rabbitmq
chown -R rabbitmq.rabbitmq /var/lib/rabbitmq
}
pre_upgrade() {
/bin/true
}
post_upgrade() {
chown -R rabbitmq.rabbitmq /var/log/rabbitmq
chown -R rabbitmq.rabbitmq /var/lib/rabbitmq
}
pre_remove() {
/bin/true
}
post_remove() {
userdel rabbitmq
groupdel rabbitmq
}
op=$1
shift
$op $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment