diff --git a/drupal/Makefile b/drupal/Makefile new file mode 100644 index 0000000..c2a265c --- /dev/null +++ b/drupal/Makefile @@ -0,0 +1,27 @@ +PGVER = 9.0 +DPVER = 7.4 + +inroot := chroot $(CHROOT) +rcdefault := /etc/runlevels/default + +preinstall: make.conf.extra + cat make.conf.extra >> $(CHROOT)/etc/make.conf + +postinstall: firstboot.start + $(inroot) passwd -d postgres + echo 'PG_INITDB_OPTS="--locale=en_US.UTF-8"' >> $(CHROOT)/etc/conf.d/postgresql-$(PGVER) + $(inroot) eselect postgresql set $(PGVER) + yes | $(inroot) $(EMERGE) --config =postgresql-server-$(PGVER)* + $(inroot) ln -sf /etc/init.d/postgresql-$(PGVER) $(rcdefault)/postgresql-$(PGVER) + $(inroot) ln -sf /etc/init.d/apache2 $(rcdefault)/apache2 + $(inroot) eselect php set apache2 1 + grep '^[^#].*PHP5' $(CHROOT)/etc/conf.d/apache2 || \ + echo 'APACHE2_OPTS="$$APACHE2_OPTS -D PHP5"' \ + >> $(CHROOT)/etc/conf.d/apache2 + $(inroot) cp /usr/share/webapps/drupal/$(DPVER)/htdocs/sites/default/default.settings.php /usr/share/webapps/drupal/$(DPVER)/htdocs/sites/default/settings.php + [ -e "$(CHROOT)/var/www/localhost/htdocs/.webapp-drupal-$(DPVER)" ] || \ + $(inroot) webapp-config -I drupal $(DPVER) + cp firstboot.start $(CHROOT)/etc/local.d/ + +clean: + diff --git a/drupal/critical b/drupal/critical new file mode 100644 index 0000000..aaed4f2 --- /dev/null +++ b/drupal/critical @@ -0,0 +1,37 @@ +app-editors/nano +net-misc/openssh +net-misc/rsync +net-misc/wget +sys-kernel/gentoo-sources +sys-kernel/linux-headers +sys-devel/gcc +sys-devel/automake +sys-devel/bison +sys-devel/make +sys-devel/flex +sys-devel/automake-wrapper +sys-devel/autoconf-wrapper +sys-devel/autoconf +sys-devel/m4 +sys-devel/gcc-config +sys-devel/libtool +sys-devel/binutils +sys-devel/binutils-config +sys-devel/patch +sys-devel/gnuconfig +app-admin/python-updater +app-admin/perl-cleaner +sys-apps/man-pages +sys-apps/man +sys-apps/file +sys-apps/less +sys-apps/texinfo +sys-apps/busybox +sys-apps/debianutils +sys-apps/man-pages-posix +sys-apps/sandbox +sys-apps/which +dev-lang/perl +sys-devel/libperl +sys-apps/portage +dev-lang/python diff --git a/drupal/firstboot.start b/drupal/firstboot.start new file mode 100755 index 0000000..6338c5f --- /dev/null +++ b/drupal/firstboot.start @@ -0,0 +1,11 @@ +#!/bin/sh + +DPVER=7.4 + +echo Configuring Postgres for Drupal +createuser --no-adduser --no-createdb --no-createrole -U postgres drupal +createdb --encoding=UNICODE --owner=drupal -U postgres drupal + +chmod a+w /usr/share/webapps/drupal/${DPVER}/htdocs/sites/default/settings.php + +mv /etc/local.d/firstboot.start /root diff --git a/drupal/make.conf.extra b/drupal/make.conf.extra new file mode 100644 index 0000000..f1a1396 --- /dev/null +++ b/drupal/make.conf.extra @@ -0,0 +1,4 @@ + +# Apache config for LodgeIt +APACHE2_MPMS="prefork" +APACHE2_MODULES="authz_host dir mime" diff --git a/drupal/motd.sh b/drupal/motd.sh new file mode 100755 index 0000000..a5fb161 --- /dev/null +++ b/drupal/motd.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +EXTERNAL_KERNEL=$1 +VIRTIO=$2 +DISK_SIZE=$3 +SWAP_SIZE=$4 +UDEV=$5 +DASH=$6 +ARCH=$7 + +DPVER=7.4 + +TZ=$TIMEZONE ; export TZ + +cat << EOF + + Before using this appliance, you must first configure Drupal, point your + browser at http://${HOSTNAME}/ to configure. The database name is "drupal" + and the username is "drupal". The DBMS is on localhost and requires no + password. After configuration, be sure to change the permissions of + /usr/share/webapps/drupal/${DPVER}/htdocs/sites/default/settings.php so + that it is not world-writable. +EOF diff --git a/drupal/package.keywords b/drupal/package.keywords new file mode 100644 index 0000000..c0523b5 --- /dev/null +++ b/drupal/package.keywords @@ -0,0 +1 @@ +www-apps/drupal ~amd64 ~x86 diff --git a/drupal/package.use b/drupal/package.use new file mode 100644 index 0000000..2a0b3a0 --- /dev/null +++ b/drupal/package.use @@ -0,0 +1,8 @@ +app-editors/nano ncurses +dev-lang/php ctype fileinfo filter iconv phar posix simplexml tokenizer apache2 xml pdo gd postgres apache2 zlib cli session hash json +dev-lang/python ssl threads xml +net-misc/dhcp client +sys-kernel/gentoo-sources symlink +sys-libs/ncurses minimal +www-apps/drupal postgres +mail-mta/ssmtp mta ssl diff --git a/drupal/world b/drupal/world new file mode 100644 index 0000000..f005864 --- /dev/null +++ b/drupal/world @@ -0,0 +1,4 @@ +=dev-db/postgresql-server-9.0* +mail-mta/ssmtp +net-misc/dhcp +www-apps/drupal diff --git a/motd.sh b/motd.sh index add5303..8abff84 100755 --- a/motd.sh +++ b/motd.sh @@ -35,4 +35,9 @@ cat << EOF | column -c80 UDEV: ${UDEV} DASH: ${DASH} EOF + +if [ -x "${APPLIANCE}/motd.sh" ] +then + "${APPLIANCE}/motd.sh" $@ +fi echo