| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-irc/atheme-services/atheme-services-7.0.0_alpha9.ebuild,v 1.5 2012/03/18 15:22:19 armin76 Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit autotools eutils flag-o-matic perl-module
|
| 8 |
|
| 9 |
MY_P=${P/_/-}
|
| 10 |
|
| 11 |
DESCRIPTION="A portable and secure set of open-source and modular IRC services"
|
| 12 |
HOMEPAGE="http://atheme.net/"
|
| 13 |
SRC_URI="http://atheme.net/downloads/${MY_P}.tar.bz2"
|
| 14 |
|
| 15 |
LICENSE="BSD"
|
| 16 |
SLOT="0"
|
| 17 |
KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux"
|
| 18 |
IUSE="cracklib largenet ldap nls +pcre perl profile ssl"
|
| 19 |
|
| 20 |
RDEPEND=">=dev-libs/libmowgli-0.9.95:0
|
| 21 |
cracklib? ( sys-libs/cracklib )
|
| 22 |
ldap? ( net-nds/openldap )
|
| 23 |
nls? ( sys-devel/gettext )
|
| 24 |
perl? ( dev-lang/perl )
|
| 25 |
pcre? ( dev-libs/libpcre )
|
| 26 |
ssl? ( dev-libs/openssl )"
|
| 27 |
DEPEND="${RDEPEND}
|
| 28 |
dev-util/pkgconfig"
|
| 29 |
|
| 30 |
S=${WORKDIR}/${MY_P}
|
| 31 |
|
| 32 |
pkg_setup() {
|
| 33 |
# the dependency calculation puts all of the .c files together and
|
| 34 |
# overwhelms cc1 with this flag :-(
|
| 35 |
filter-flags -combine
|
| 36 |
|
| 37 |
if use profile; then
|
| 38 |
# bug #371119
|
| 39 |
ewarn "USE=\"profile\" is incompatible with the hardened profile's -pie flag."
|
| 40 |
ewarn "Disabling PIE. Please ignore any warning messages about -nopie being invalid."
|
| 41 |
append-flags -nopie
|
| 42 |
fi
|
| 43 |
|
| 44 |
enewgroup ${PN}
|
| 45 |
enewuser ${PN} -1 -1 /var/lib/atheme ${PN}
|
| 46 |
}
|
| 47 |
|
| 48 |
src_prepare() {
|
| 49 |
# The first PKG_CHECK_MODULES call is conditional, causing
|
| 50 |
# PKG_PROG_PKG_CONFIG expansion to fail.
|
| 51 |
epatch "${FILESDIR}"/${P}-pkg-config.patch
|
| 52 |
epatch "${FILESDIR}"/${PN}-7.0.0_alpha11-cracklib-automagic.patch
|
| 53 |
eautoconf
|
| 54 |
|
| 55 |
# fix docdir
|
| 56 |
sed -i -e 's/\(^DOCDIR.*=.\)@DOCDIR@/\1@docdir@/' extra.mk.in || die
|
| 57 |
|
| 58 |
# basic logging config directive fix
|
| 59 |
sed -i -e '/^logfile/s;var/\(.*\.log\);'"${EPREFIX}"'/var/log/atheme/\1;g' dist/* || die
|
| 60 |
|
| 61 |
# QA against bundled libs
|
| 62 |
rm -rf libmowgli libmowgli-2 || die
|
| 63 |
|
| 64 |
# Get useful information into build.log
|
| 65 |
sed -i -e '/^\.SILENT:$/d' buildsys.mk.in || die
|
| 66 |
}
|
| 67 |
|
| 68 |
src_configure() {
|
| 69 |
econf \
|
| 70 |
atheme_cv_c_gcc_w_error_implicit_function_declaration=no \
|
| 71 |
--sysconfdir="${EPREFIX}"/etc/${PN} \
|
| 72 |
--docdir="${EPREFIX}"/usr/share/doc/${PF} \
|
| 73 |
--localstatedir="${EPREFIX}"/var \
|
| 74 |
--enable-fhs-paths \
|
| 75 |
--disable-warnings \
|
| 76 |
--enable-contrib \
|
| 77 |
$(use_enable largenet large-net) \
|
| 78 |
$(use_with cracklib) \
|
| 79 |
$(use_with ldap) \
|
| 80 |
$(use_with nls) \
|
| 81 |
$(use_enable profile) \
|
| 82 |
$(use_with perl) \
|
| 83 |
$(use_with pcre) \
|
| 84 |
$(use_enable ssl)
|
| 85 |
}
|
| 86 |
|
| 87 |
src_install() {
|
| 88 |
emake DESTDIR="${D}" install
|
| 89 |
|
| 90 |
insinto /etc/${PN}
|
| 91 |
for conf in dist/*.example; do
|
| 92 |
# The .cron file isn't meant to live in /etc/${PN}, so only
|
| 93 |
# install a .example version.
|
| 94 |
[[ ${conf} == *cron* ]] && continue
|
| 95 |
|
| 96 |
newins ${conf} $(basename ${conf} .example)
|
| 97 |
done
|
| 98 |
|
| 99 |
fowners -R 0:${PN} /etc/${PN}
|
| 100 |
keepdir /var/{lib,log}/atheme
|
| 101 |
fowners ${PN}:${PN} /var/{lib,log,run}/atheme
|
| 102 |
fperms -R go-w,o-rx /etc/${PN}
|
| 103 |
fperms 750 /etc/${PN} /var/{lib,log,run}/atheme
|
| 104 |
|
| 105 |
newinitd "${FILESDIR}"/${PN}.initd ${PN}
|
| 106 |
|
| 107 |
# contributed scripts and such:
|
| 108 |
insinto /usr/share/doc/${PF}/contrib
|
| 109 |
doins contrib/*.{c,pl,php,py,rb}
|
| 110 |
|
| 111 |
if use perl; then
|
| 112 |
perlinfo
|
| 113 |
insinto "${VENDOR_LIB#${EPREFIX}}"
|
| 114 |
doins -r contrib/Atheme{,.pm}
|
| 115 |
fi
|
| 116 |
}
|