Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2017 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
|
7 |
inherit toolchain-funcs user |
8 |
|
9 |
DESCRIPTION="Inspire IRCd - The Stable, High-Performance Modular IRCd" |
10 |
HOMEPAGE="https://inspircd.github.com/" |
11 |
SRC_URI="https://github.com/inspircd/inspircd/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
12 |
|
13 |
LICENSE="GPL-2" |
14 |
SLOT="0" |
15 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
16 |
IUSE="geoip gnutls ipv6 ldap mysql pcre posix postgres sqlite ssl tre" |
17 |
|
18 |
RDEPEND=" |
19 |
dev-lang/perl |
20 |
ssl? ( dev-libs/openssl:= ) |
21 |
geoip? ( dev-libs/geoip ) |
22 |
gnutls? ( net-libs/gnutls dev-libs/libgcrypt:0 ) |
23 |
ldap? ( net-nds/openldap ) |
24 |
mysql? ( virtual/mysql ) |
25 |
postgres? ( dev-db/postgresql:= ) |
26 |
pcre? ( dev-libs/libpcre ) |
27 |
sqlite? ( >=dev-db/sqlite-3.0 ) |
28 |
tre? ( dev-libs/tre )" |
29 |
DEPEND="${RDEPEND}" |
30 |
|
31 |
PATCHES=( "${FILESDIR}"/${P}-fix-path-builds.patch ) |
32 |
|
33 |
pkg_setup() { |
34 |
enewgroup ${PN} |
35 |
enewuser ${PN} -1 -1 -1 ${PN} |
36 |
} |
37 |
|
38 |
src_prepare() { |
39 |
# Patch the inspircd launcher with the inspircd user |
40 |
sed -i -e "s/@UID@/${PN}/" "${S}/make/template/${PN}" || die |
41 |
|
42 |
default_src_prepare |
43 |
} |
44 |
|
45 |
src_configure() { |
46 |
local extras="" |
47 |
|
48 |
use geoip && extras="${extras}m_geoip.cpp," |
49 |
use gnutls && extras="${extras}m_ssl_gnutls.cpp," |
50 |
use ldap && extras="${extras}m_ldapauth.cpp,m_ldapoper.cpp," |
51 |
use mysql && extras="${extras}m_mysql.cpp," |
52 |
use pcre && extras="${extras}m_regex_pcre.cpp," |
53 |
use posix && extras="${extras}m_regex_posix.cpp," |
54 |
use postgres && extras="${extras}m_pgsql.cpp," |
55 |
use sqlite && extras="${extras}m_sqlite3.cpp," |
56 |
use ssl && extras="${extras}m_ssl_openssl.cpp," |
57 |
use tre && extras="${extras}m_regex_tre.cpp," |
58 |
|
59 |
if [ -n "${extras}" ]; then |
60 |
econf --disable-interactive --enable-extras=${extras} |
61 |
fi |
62 |
|
63 |
econf \ |
64 |
--with-cc="$(tc-getCXX)" \ |
65 |
--disable-interactive \ |
66 |
--prefix="/usr/$(get_libdir)/${PN}" \ |
67 |
--config-dir="/etc/${PN}" \ |
68 |
--data-dir="/var/lib/${PN}/data" \ |
69 |
--log-dir="/var/log/${PN}" \ |
70 |
--binary-dir="/usr/bin" \ |
71 |
--module-dir="/usr/$(get_libdir)/${PN}/modules" \ |
72 |
$(use_enable ipv6) \ |
73 |
$(use_enable gnutls) \ |
74 |
$(use_enable ssl openssl) |
75 |
} |
76 |
|
77 |
src_compile() { |
78 |
emake V=1 LDFLAGS="${LDFLAGS}" CXXFLAGS="${CXXFLAGS}" |
79 |
} |
80 |
|
81 |
src_install() { |
82 |
emake INSTUID=${PN} DESTDIR="${D}" install |
83 |
|
84 |
insinto "/usr/include/${PN}" |
85 |
doins include/* |
86 |
|
87 |
diropts -o"${PN}" -g"${PN}" -m0700 |
88 |
dodir "/var/lib/${PN}" |
89 |
dodir "/var/lib/${PN}/data" |
90 |
|
91 |
newinitd "${FILESDIR}/${P}-init" "${PN}" |
92 |
keepdir "/var/log/${PN}"/ |
93 |
} |
94 |
|
95 |
pkg_postinst() { |
96 |
elog "Before starting ${PN} the first time, you should create" |
97 |
elog "the /etc/${PN}/${PN}.conf file." |
98 |
elog "You can find example configuration files under /etc/${PN}" |
99 |
elog "Read the ${PN}.conf.example file carefully before " |
100 |
elog "(re)starting the service." |
101 |
elog |
102 |
} |