# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit webapp eutils DESCRIPTION="Open WebMail is a webmail system based on the Neomail version 1.14" HOMEPAGE="http://openwebmail.com/" SRC_URI="http://openwebmail.com/openwebmail/download/release/${P}.tar.gz" LICENSE="GPL-2" SLOT="${PV}" KEYWORDS="~x86" IUSE="spell zlib ssl pam apache2" # BUG: # installation proccess requires no dependency # rather, these packages are runtime-dependency # should i use RDEPEND, instead of DEPEND? DEPEND="dev-lang/perl perl-core/CGI perl-core/MIME-Base64 dev-perl/libnet perl-core/digest-base perl-core/Digest-MD5 dev-perl/Text-Iconv >=dev-libs/libiconv-1.9.1 spell? ( app-text/ispell ) zlib? ( >=dev-perl/Compress-Zlib-1.33 ) ssl? ( >=dev-libs/openssl-0.9.7d >=dev-perl/Net-SSLeay-1.25 >=dev-perl/IO-Socket-SSL-0.96 ) pam? ( dev-perl/Authen-PAM )" # BUG: # no httpd other than apache2 on my dev box # other httpd, such as lighttpd should work, too RDEPEND="${DEPEND} virtual/mta apache2? ( >=net-www/apache-2 ) !apache2? ( =net-www/apache-1* ) " # TODO # http://bugs.gentoo.org/show_bug.cgi?id=19378 # clamav support # quota support # SA support # ImageMagick support # ewarn security risk # fastcgi support # CANNOTFIX # maildir support (in the upstream's TODO list) # vhost support (not designed to be installed in vhost environment) S="${WORKDIR}" pkg_setup() { webapp_pkg_setup # BUG: # the webapp has vhost capability built-in and uses suidperl, # it's a bad idea to install it with webapp.eclass # consider to die when vhost USE flag is enabled if ! built_with_use dev-lang/perl perlsuid ;then ewarn "dev-lang/perl needs to be compiled with perlsuid USE flag enabled" ewarn "# echo dev-lang/perl perlsuid >> /etc/portage/package.use" ewarn "# emerge dev-lang/perl" die "re-emerge dev-lang/perl with perlsuid" fi } src_install() { webapp_src_preinst # BUG: # readme.txt is too long for webapp_postinst_txt webapp_postinst_txt en data/openwebmail/doc/readme.txt dodoc data/openwebmail/doc/* #-------------------------------------------------- # mv cgi-bin/openwebmail/etc/openwebmail.conf \ # cgi-bin/openwebmail/etc/openwebmail.conf.dist #-------------------------------------------------- cp -R data/* "${D}${MY_HTDOCSDIR}" cp -R cgi-bin/* "${D}${MY_CGIBINDIR}" # files under cgi-bin/${PN}/etc are conf files and templates for # site-specific customization, they are considered as conf files # BUG: # when the upstream modifies all or most of these files, # upgrading will be a pain in the neck. it's far easier to merge manually # no conf file is modified, too many scenarios to consider, let users decide #-------------------------------------------------- # webapp_configfile ${MY_CGIBINDIR}/openwebmail/etc/openwebmail.conf.dist #-------------------------------------------------- webapp_configfile ${MY_CGIBINDIR}/openwebmail/etc/openwebmail.conf local MY_FILES local MY_FILE MY_FILES=`find cgi-bin/openwebmail/etc -type f -printf '%h/%f\n' | \ sed -e 's#^cgi-bin/##'` for MY_FILE in $MY_FILES ; do webapp_configfile ${MY_CGIBINDIR}/${MY_FILE} done # webapp_hook_script # webapp_serverowned webapp_src_install } pkg_postinst() { webapp_pkg_postinst }