gentoo-overlay/www-apps/ghostpanel/ghostpanel-0.1_beta.ebuild

101 lines
2.9 KiB
Bash

# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="2"
DESCRIPTION="A web-based control panel for web hosting servers"
HOMEPAGE="http://ghostpanel.org"
SRC_URI="http://registeredhosting.ca/${P}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
#IUSE=""
#RESTRICT="fetch"
inherit eutils ssl-cert
RDEPEND="
>=mail-mta/postfix-2.5.7[postgres,sasl,ssl]
>=dev-lang/php-5.4[cgi,curl,mysql,postgres,unicode]
>=www-servers/apache-2.2.11-r2[suexec,apache2_modules_proxy,apache2_modules_proxy_http]
>=net-dns/pdns-2.9.22-r1[postgres]
>=dev-db/mysql-5.0.60-r1
>=dev-db/postgresql-9.0
>=net-libs/courier-authlib-0.62.2[postgres]
>=net-mail/courier-imap-4.5.0[fam]
>=dev-libs/cyrus-sasl-2.1.22-r2[postgres]
>=app-admin/sudo-1.7.2_p1
>=sys-process/vixie-cron-4.1-r10
>=mail-filter/amavisd-new-2.6.3[spamassassin,postgres]
>=sys-apps/shadow-4.1.4.2-r4
>=app-antivirus/clamav-0.96.1
>=dev-php/atom-1.0
>=www-misc/awstats-7.0_p20101205-r3
>=app-admin/logrotate-3.7.8
mail-client/roundcube[postgres]
dev-db/phpmyadmin
dev-db/phppgadmin
net-firewall/iptables
net-misc/ntp
net-analyzer/fail2ban
"
pkg_preinst() {
useradd -MU ghostpanel
}
src_install() {
dodir /var/www/ghostpanel
fperms 755 /var/www/ghostpanel
fowners ghostpanel:ghostpanel /var/www/ghostpanel
cp -R ${S}/* ${D}/var/www/ghostpanel/
dodir /etc/apache2/ghostpanel
fperms 755 /etc/apache2/ghostpanel
fowners apache /etc/apache2/ghostpanel
cp ${S}/etc/apache/000_ghostpanel.conf ${D}/etc/apache2/ghostpanel/
dodir /etc/apache2/ghostpanel/includes
fperms 755 /etc/apache2/ghostpanel/includes
fowners apache /etc/apache2/ghostpanel/includes
cp ${S}/etc/apache/includes/* ${D}/etc/apache2/ghostpanel/includes
dodir /etc/apache2/modules.d
cp ${S}/etc/apache/99_ghostpanel.conf ${D}/etc/apache2/modules.d/99_ghostpanel.conf
dodir /etc/ssl/ghostpanel
fperms 755 /etc/ssl/ghostpanel
dodir /etc/logrotate.d
cp ${S}/etc/logrotate.d/ghostpanel ${D}/etc/logrotate.d/
dodir /etc/cron.daily
cp ${S}/etc/cron.daily/ghostpanel.cron ${D}/etc/cron.daily
}
pkg_postinst() {
chown -R ghostpanel:ghostpanel /var/www/ghostpanel
find /var/www/ghostpanel -type f -exec chmod 644 '{}' \;
find /var/www/ghostpanel -type d -exec chmod 755 '{}' \;
chmod 755 /var/www/ghostpanel/bin/*
chmod 700 /var/www/ghostpanel/cgi-bin/php
chmod 644 /etc/postfix*/*
chmod 755 /etc/cron.daily/ghostpanel.cron
if [[ ! -e "${ROOT}/etc/ssl/ghostpanel/server.crt" ]]; then
SSL_DAYS="${SSL_DAYS:-730}"
SSL_BITS="${SSL_BITS:-4096}"
SSL_COUNTRY="${SSL_COUNTRY:-CA}"
SSL_STATE="${SSL_STATE:-Alberta}"
SSL_LOCALITY="${SSL_LOCALITY:-Calgary}"
SSL_ORGANIZATION="${SSL_ORGANIZATION:-GHostPanel}"
SSL_UNIT="${SSL_UNIT:-For Testing Purposes Only}"
SSL_COMMONNAME="${SSL_COMMONNAME:-localhost}"
SSL_EMAIL="${SSL_EMAIL:-root@localhost}"
install_cert /etc/ssl/ghostpanel/server
fi;
}