# 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.org/" SRC_URI="http://openwebmail.org/openwebmail/download/release/${P}.tar.gz" LICENSE="GPL-2" SLOT="${PV}" KEYWORDS="~x86" IUSE="spell zlib ssl pam apache2 spamassassin clamav webdisk zlib" DEPEND="" # BUG: # no httpd other than apache2 on my dev box # other httpd, such as lighttpd should work, too RDEPEND="${DEPEND} dev-lang/perl perl-core/CGI perl-core/MIME-Base64 virtual/perl-libnet perl-core/digest-base perl-core/Digest-MD5 dev-perl/Text-Iconv 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 ) virtual/mta apache2? ( >=net-www/apache-2 ) !apache2? ( =net-www/apache-1* ) clamav? ( app-antivirus/clamav ) spamassassin? ( mail-filter/spamassassin ) webdisk? ( sys-apps/coreutils app-arch/bzip2 app-arch/tar app-arch/zip app-arch/unrar app-arch/unarj app-arch/lha media-gfx/imagemagick ) zlib? ( dev-perl/Compress-Zlib ) " # TODO # http://bugs.gentoo.org/show_bug.cgi?id=19378 # quota support # ewarn security risk # fastcgi support # non-glibc depends on dev-libs/libiconv? # 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 # AFAIK (no, i haven't tested this throughly, i'm a happy squirrelmail # user :), this webapp has capabilities to add, remove users(thus, requires # suidperl). multiple installation is something i want to avoid. exactly for # that reason, the upstream implemented vhost capability in it, I beleive. # besides, vhost configuration, for example Postfix, varies depending on # your/sites requirement. # correct me if i'm wrong. # 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 # BUG: # cannot think of better idea, suggestion? # VAR=`command_that_will_fail || die` is what i need? # 'find' might fail on Gentoo/FreeBSD, native (BSD version) find doesn't # support '-printf' option, GNU-find does. find cgi-bin/openwebmail/etc -type f -printf '%h/%f\n' | \ sed -e 's#^cgi-bin/##' || die "sed failed" 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() { if use clamd ; then einfo "" einfo "clamav USE flag do nothing but install" einfo "app-antivirus/clamav" einfo "see openwebmail.conf.help for more info." einfo "" fi if use spamassassin ; then einfo "" einfo "spamassassin USE flag do nothing but install" einfo "mail-filter/spamassassin" einfo "see openwebmail.conf.help for more info." einfo "" fi webapp_pkg_postinst }