# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # TODO: # 2- when upgrading the package all the new crypt keys are regenerated. this make # password stored into /etc/vhcs2/vhcs2.conf not valide. to fix the problem # the ebuild must able to take previous crypt keys and save over the new one. # 3- add into pkg_config() a check for the right php.ini include_path (/usr/share/php/ and /usr/share/php/smarty?) # 5- force the vhosts USE flag # 6- if the dir /etc/vhcs2/ exists skip the creation of new configuration files. # 9- add patch for amd64 compilation # 10- CODE_PHP=/usr/sbin/encode-file ?????? # TODO: FIX and backup of /etc/vhcs/vhcs2.conf # TODO: fix etc/init.d/vhcs2_daemon creation. inherit eutils webapp webapp-apache depend.php depend.apache DESCRIPTION="VHCS is a Professional Control Panel Software for server management" HOMEPAGE="http://www.vhcs.net/" SRC_URI="mirror://sourceforge/${PN}/${PN}2-${PV}.tar.bz2 mirror://sourceforge/${PN}/${PN}_patch_2006-02-09.tar.bz2" ROOT_PATH="/usr/share/webapps/${PN}/${PV}-${PR}/htdocs" WEBAPP_MANUAL_SLOT="yes" LICENSE="GPL-2" KEYWORDS="~x86 ~amd64" IUSE="mysql postgres" need_php5 need_apache2 DEPEND=">=sys-apps/sed-4 sys-apps/gawk >=dev-lang/perl-5.8.2" RDEPEND=" dev-perl/MIME-tools virtual/perl-MIME-Base64 virtual/perl-Digest-MD5 dev-perl/crypt-cbc dev-perl/Crypt-Blowfish dev-perl/DBI dev-perl/Crypt-PasswdMD5 dev-perl/Date-Calc dev-perl/DateManip dev-perl/IO-stringy dev-perl/Mail-Sendmail dev-perl/MailTools dev-perl/Net-DNS dev-perl/Net-Netmask perl-core/libnet dev-perl/SNMP_Session dev-perl/TermReadKey dev-perl/Term-ReadPassword dev-perl/TimeDate mail-mta/postfix dev-libs/cyrus-sasl net-mail/courier-imap mail-filter/maildrop net-dns/bind net-ftp/proftpd net-firewall/iptables net-www/apache virtual/php dev-php/adodb dev-php/smarty crypt? ( dev-libs/libmcrypt ) mysql? ( >=dev-db/mysql-4.0.1 dev-perl/DBD-mysql ) postgres? ( >=dev-db/postgresql-8.0 >=dev-perl/DBD-Pg-1.31 )" S="${WORKDIR}/${PN}2-${PV}" pkg_setup() { overlay_pkg_setup # checking for right PHP use flags local PHP_USE_FLAGS="wddx gd $(use crypt && echo crypt) $(use mysql && echo mysqli mysql) $(use postgres && echo postgres)" if ! PHPCHECKNODIE="yes" require_php_with_use ${PHP_USE_FLAGS} ; then echo eerror "Please re-install ${PHP_PKG} with these required USE enabled:" eerror "${PHP_USE_FLAGS}" ebeep 3 die fi # checking for right Postfix use flags local POSTFIX_USE_FLAGS="ssl sasl hardened $(use mysql && echo mysql) $(use postgres && echo postgres)" if ! built_with_use mail-mta/postfix ${POSTFIX_USE_FLAGS}; then echo eerror "Please re-install mail-mta/postfix with these required USE enabled:" eerror "${POSTFIX_USE_FLAGS}" ebeep 3 die fi # checking for right ProFTPd use flags local PROFTPD_USE_FLAGS="ssl hardened softquota $(use mysql && echo mysql) $(use postgres && echo postgres)" if ! built_with_use net-ftp/proftpd ${PROFTPD_USE_FLAGS}; then echo eerror "Please re-install net-ftp/proftpd with these required USE enabled:" eerror "${PROFTPD_USE_FLAGS}" ebeep 3 die fi # checking for right Courier Authlib use flags local COURIERAUTHLIB_USE_FLAGS="$(use crypt && echo crypt) $(use mysql && echo mysql) $(use postgres && echo postgres)" if ! built_with_use net-libs/courier-authlib ${COURIERAUTHLIB_USE_FLAGS}; then echo eerror "Please re-install net-libs/courier-authlib with these required USE enabled:" eerror "${COURIERAUTHLIB_USE_FLAGS}" ebeep 3 die fi # checking for right Libnet use flags if ! built_with_use perl-core/libnet sasl; then echo eerror "Please re-install perl-core/libnet with the required USE \"sasl\" enabled" ebeep 3 die fi # checking for right Cyrus SASL use flags local CYRUSSASL_USE_FLAGS="ssl $(use crypt && echo crypt) $(use mysql && echo mysql) $(use postgres && echo postgres)" if ! built_with_use dev-libs/cyrus-sasl ${CYRUSSASL_USE_FLAGS}; then echo eerror "Please re-install dev-libs/cyrus-sasl with these required USE enabled:" eerror "${CYRUSSASL_USE_FLAGS}" ebeep 3 die fi # this is really necessary? enewgroup vhcs enewuser vhcs -1 -1 /var/lib/vhcs vhcs } src_unpack() { unpack ${A} cd ${S} # Install security patches. # for infos see: http://vhcs.net/new/modules/news/article.php?storyid=25 ebegin "Installing security patch" cp ../${PN}_patch_2006-02-09/gui/include/login.php gui/include/login.php eend $? # FIX: Crypt::CBC key lenght error, default setup is 56 but 32 is required by VHCS. epatch ${FILESDIR}/${PN}-${PV}-common_code.patch || die "failed to patch vhcs2_common_code.pl" # various fixes for PHP code: # - enable PHP Error Reporting (E_ALL) # - fix wrong 'call by reference' usage # - fix uebimiau webmail files with short PHP tags: