/[gentoo-x86]/net-irc/unrealircd/unrealircd-3.2.9.ebuild
Gentoo

Contents of /net-irc/unrealircd/unrealircd-3.2.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Jan 27 07:31:25 2013 UTC (20 months, 3 weeks ago) by binki
Branch: MAIN
Changes since 1.7: +4 -4 lines
Create /var/run/unrealircd in the initscript instead of when installing the package, fixing bug #453598 by Flameeyes (and supporting tmpfs /var/run).

(Portage version: 2.2.0_alpha161-r1/cvs/Linux x86_64, signed Manifest commit with key 743A52E86BA81050)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-irc/unrealircd/unrealircd-3.2.9.ebuild,v 1.7 2012/05/03 06:27:13 jdhore Exp $
4
5 EAPI=4
6
7 inherit eutils ssl-cert versionator multilib
8
9 MY_P=Unreal${PV/_/-}
10
11 DESCRIPTION="An advanced Internet Relay Chat daemon"
12 HOMEPAGE="http://www.unrealircd.com/"
13 SRC_URI="http://www.unrealircd.com/downloads/${MY_P}.tar.gz"
14
15 SLOT="0"
16 LICENSE="GPL-2"
17 KEYWORDS="amd64 ppc x86 ~x86-fbsd ~amd64-linux"
18 IUSE="curl ipv6 +extban-stacking +operoverride +spoof operoverride-verify +prefixaq
19 showlistmodes shunnotices ssl topicisnuhost +usermod zlib"
20
21 RDEPEND="ssl? ( dev-libs/openssl )
22 zlib? ( sys-libs/zlib )
23 curl? ( net-misc/curl[ares] )
24 dev-libs/tre
25 >=net-dns/c-ares-1.7"
26 DEPEND="${RDEPEND}
27 >=sys-apps/sed-4
28 virtual/pkgconfig"
29
30 S=${WORKDIR}/Unreal$(get_version_component_range 1-2)
31
32 pkg_setup() {
33 enewuser unrealircd
34 }
35
36 src_prepare() {
37 epatch "${FILESDIR}"/${P}-disabled-stacked-extbans.patch
38
39 # QA check against bundled pkgs
40 rm extras/*.gz || die
41
42 sed -i \
43 -e "s:ircd\.pid:${EPREFIX}/var/run/unrealircd/ircd.pid:" \
44 -e "s:ircd\.log:${EPREFIX}/var/log/unrealircd/ircd.log:" \
45 -e "s:debug\.log:${EPREFIX}/var/log/unrealircd/debug.log:" \
46 -e "s:ircd\.tune:${EPREFIX}/var/lib/unrealircd/ircd.tune:" \
47 include/config.h \
48 || die "sed failed"
49 }
50
51 src_configure() {
52 econf \
53 --with-listen=5 \
54 --with-dpath="${EPREFIX}"/etc/unrealircd \
55 --with-spath="${EPREFIX}"/usr/bin/unrealircd \
56 --with-nick-history=2000 \
57 --with-sendq=3000000 \
58 --with-bufferpool=18 \
59 --with-permissions=0600 \
60 --with-fd-setsize=1024 \
61 --with-system-cares \
62 --with-system-tre \
63 --enable-dynamic-linking \
64 $(use_enable curl libcurl "${EPREFIX}"/usr) \
65 $(use_enable ipv6 inet6) \
66 $(use_enable prefixaq) \
67 $(use_enable spoof nospoof) \
68 $(use_enable ssl ssl "${EPREFIX}"/usr) \
69 $(use_enable zlib ziplinks "${EPREFIX}"/usr) \
70 $(use_with showlistmodes) \
71 $(use_with topicisnuhost) \
72 $(use_with shunnotices) \
73 $(use_with !operoverride no-operoverride) \
74 $(use_with operoverride-verify) \
75 $(use_with !usermod disableusermod) \
76 $(use_with !extban-stacking disable-extendedban-stacking)
77 }
78
79 src_install() {
80 keepdir /var/{lib,log}/unrealircd
81
82 newbin src/ircd unrealircd
83
84 exeinto /usr/$(get_libdir)/unrealircd/modules
85 doexe src/modules/*.so
86
87 dodir /etc/unrealircd
88 dosym /var/lib/unrealircd /etc/unrealircd/tmp
89
90 insinto /etc/unrealircd
91 doins {badwords.*,help,spamfilter,dccallow}.conf
92 newins doc/example.conf unrealircd.conf
93
94 insinto /etc/unrealircd/aliases
95 doins aliases/*.conf
96 insinto /etc/unrealircd/networks
97 doins networks/*.network
98
99 local so_suffix=so
100 [[ ${CHOST} == -*mingw* ]] && so_suffix=dll
101 sed -i \
102 -e s:src/modules:"${EPREFIX}"/usr/$(get_libdir)/unrealircd/modules: \
103 -e '/loadmodule.*\.'${so_suffix}'/s;^//;;' \
104 -e s:ircd\\.log:"${EPREFIX}"/var/log/unrealircd/ircd.log: \
105 "${ED}"/etc/unrealircd/unrealircd.conf \
106 || die
107
108 dodoc \
109 Changes Donation Unreal.nfo networks/makenet \
110 ircdcron/{ircd.cron,ircdchk} \
111 || die "dodoc failed"
112 dohtml doc/*.html
113
114 newinitd "${FILESDIR}"/unrealircd.initd unrealircd
115 newconfd "${FILESDIR}"/unrealircd.confd-r1 unrealircd
116
117 fperms 700 /etc/unrealircd
118 fowners -R unrealircd /{etc,var/{lib,log}}/unrealircd
119 }
120
121 pkg_postinst() {
122 # Move docert call from scr_install() to install_cert in pkg_postinst for
123 # bug #201682
124 if use ssl ; then
125 if [[ ! -f "${EROOT}"/etc/unrealircd/server.cert.key ]]; then
126 install_cert /etc/unrealircd/server.cert
127 chown unrealircd "${EROOT}"/etc/unrealircd/server.cert.*
128 ln -snf server.cert.key "${EROOT}"/etc/unrealircd/server.key.pem
129 fi
130 fi
131
132 local unrealircd_conf="${EROOT}"/etc/unrealircd/unrealircd.conf
133 # Fix up the default cloak keys.
134 if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
135 ebegin "Generating cloak-keys"
136 local keys=(
137 $(unrealircd -k 2>&1 | tail -n 3)
138 )
139 [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
140 eend $?
141
142 ebegin "Substituting cloak-keys into ${unrealircd_conf}"
143 sed -i \
144 -e '/cloak-keys/ {
145 n
146 s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
147 n
148 s/"and another one";/"'"${keys[1]}"'";/
149 n
150 s/"and another one";/"'"${keys[2]}"'";/
151 }' \
152 "${unrealircd_conf}"
153 eend $?
154 fi
155
156 elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
157 elog
158 elog "You can find example cron scripts here:"
159 elog " /usr/share/doc/${PF}/ircd.cron.gz"
160 elog " /usr/share/doc/${PF}/ircdchk.gz"
161 elog
162 elog "You can also use /etc/init.d/unrealircd to start at boot"
163 }

  ViewVC Help
Powered by ViewVC 1.1.20