virtual-appliance/lodgeit/postinstall

25 lines
950 B
Plaintext
Raw Normal View History

2010-07-28 14:48:09 +02:00
#!/bin/sh -e
set -v
CHROOT="$1"
HOSTNAME="$2"
APPLIANCE="`dirname $0`"
chroot ${CHROOT} emerge -1n --usepkg mercurial
chroot ${CHROOT} emerge -1n --usepkg dev-python/virtualenv
chroot ${CHROOT} getent group lodgeit || chroot ${CHROOT} groupadd lodgeit
chroot ${CHROOT} getent passwd lodgeit || \
chroot ${CHROOT} useradd -c "Lodgeit Pastebin" -m -g lodgeit lodgeit
cp ${APPLIANCE}/lodgeit.sh ${CHROOT}/tmp
chroot ${CHROOT} su -c /tmp/lodgeit.sh lodgeit
cp ${APPLIANCE}/10_lodgeit.conf ${CHROOT}/etc/apache2/vhosts.d
cp ${APPLIANCE}/apache2.conf ${CHROOT}/etc/conf.d/apache2
python ${APPLIANCE}/genkey.py ${CHROOT}
cp ${APPLIANCE}/lodgeit.wsgi ${CHROOT}/home/lodgeit/lodgeitproject/lodgeit
sed -i 's/Gentoo Virtual Machine/LODGEIT CONSOLE/' ${CHROOT}/etc/issue
chroot ${CHROOT} rc-update add apache2 default
chroot ${CHROOT} emerge -C mercurial
chroot ${CHROOT} emerge -C dev-python/virtualenv
chroot ${CHROOT} emerge --depclean --with-bdeps=n