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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Jan 27 07:31:25 2013 UTC (19 months, 3 weeks ago) by binki
Branch: MAIN
Changes since 1.1: +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.10.ebuild,v 1.1 2012/12/26 18:54:02 jdhore Exp $
4
5 EAPI=4
6
7 inherit eutils ssl-cert versionator multilib user
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 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-3)
31
32 pkg_setup() {
33 enewuser unrealircd
34 }
35
36 src_prepare() {
37 # QA check against bundled pkgs
38 rm extras/*.gz || die
39
40 sed -i \
41 -e "s:ircd\.pid:${EPREFIX}/var/run/unrealircd/ircd.pid:" \
42 -e "s:ircd\.log:${EPREFIX}/var/log/unrealircd/ircd.log:" \
43 -e "s:debug\.log:${EPREFIX}/var/log/unrealircd/debug.log:" \
44 -e "s:ircd\.tune:${EPREFIX}/var/lib/unrealircd/ircd.tune:" \
45 include/config.h \
46 || die "sed failed"
47 }
48
49 src_configure() {
50 econf \
51 --with-listen=5 \
52 --with-dpath="${EPREFIX}"/etc/unrealircd \
53 --with-spath="${EPREFIX}"/usr/bin/unrealircd \
54 --with-nick-history=2000 \
55 --with-sendq=3000000 \
56 --with-bufferpool=18 \
57 --with-permissions=0600 \
58 --with-fd-setsize=1024 \
59 --with-system-cares \
60 --with-system-tre \
61 --enable-dynamic-linking \
62 $(use_enable curl libcurl "${EPREFIX}"/usr) \
63 $(use_enable ipv6 inet6) \
64 $(use_enable prefixaq) \
65 $(use_enable ssl ssl "${EPREFIX}"/usr) \
66 $(use_enable zlib ziplinks "${EPREFIX}"/usr) \
67 $(use_with showlistmodes) \
68 $(use_with topicisnuhost) \
69 $(use_with shunnotices) \
70 $(use_with !operoverride no-operoverride) \
71 $(use_with operoverride-verify) \
72 $(use_with !usermod disableusermod) \
73 $(use_with !extban-stacking disable-extendedban-stacking)
74 }
75
76 src_install() {
77 keepdir /var/{lib,log}/unrealircd
78
79 newbin src/ircd unrealircd
80
81 exeinto /usr/$(get_libdir)/unrealircd/modules
82 doexe src/modules/*.so
83
84 dodir /etc/unrealircd
85 dosym /var/lib/unrealircd /etc/unrealircd/tmp
86
87 insinto /etc/unrealircd
88 doins {badwords.*,help,spamfilter,dccallow}.conf
89 newins doc/example.conf unrealircd.conf
90
91 insinto /etc/unrealircd/aliases
92 doins aliases/*.conf
93
94 local so_suffix=so
95 [[ ${CHOST} == -*mingw* ]] && so_suffix=dll
96 sed -i \
97 -e s:src/modules:"${EPREFIX}"/usr/$(get_libdir)/unrealircd/modules: \
98 -e '/loadmodule.*\.'${so_suffix}'/s;^//;;' \
99 -e s:ircd\\.log:"${EPREFIX}"/var/log/unrealircd/ircd.log: \
100 "${ED}"/etc/unrealircd/unrealircd.conf \
101 || die
102
103 dodoc \
104 Changes Donation Unreal.nfo \
105 ircdcron/{ircd.cron,ircdchk} \
106 || die "dodoc failed"
107 dohtml doc/*.html
108
109 newinitd "${FILESDIR}"/unrealircd.initd unrealircd
110 newconfd "${FILESDIR}"/unrealircd.confd-r1 unrealircd
111
112 fperms 700 /etc/unrealircd
113 fowners -R unrealircd /{etc,var/{lib,log}}/unrealircd
114 }
115
116 pkg_postinst() {
117 # Move docert call from scr_install() to install_cert in pkg_postinst for
118 # bug #201682
119 if use ssl ; then
120 if [[ ! -f "${EROOT}"/etc/unrealircd/server.cert.key ]]; then
121 install_cert /etc/unrealircd/server.cert
122 chown unrealircd "${EROOT}"/etc/unrealircd/server.cert.*
123 ln -snf server.cert.key "${EROOT}"/etc/unrealircd/server.key.pem
124 fi
125 fi
126
127 local unrealircd_conf="${EROOT}"/etc/unrealircd/unrealircd.conf
128 # Fix up the default cloak keys.
129 if grep -qe '"and another one";$' "${unrealircd_conf}" && grep -qe '"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";$' "${unrealircd_conf}"; then
130 ebegin "Generating cloak-keys"
131 local keys=(
132 $(unrealircd -k 2>&1 | tail -n 3)
133 )
134 [[ -n ${keys[0]} || -n ${keys[1]} || -n ${keys[2]} ]]
135 eend $?
136
137 ebegin "Substituting cloak-keys into ${unrealircd_conf}"
138 sed -i \
139 -e '/cloak-keys/ {
140 n
141 s/"aoAr1HnR6gl3sJ7hVz4Zb7x4YwpW";/"'"${keys[0]}"'";/
142 n
143 s/"and another one";/"'"${keys[1]}"'";/
144 n
145 s/"and another one";/"'"${keys[2]}"'";/
146 }' \
147 "${unrealircd_conf}"
148 eend $?
149 fi
150
151 elog "UnrealIRCd will not run until you've set up /etc/unrealircd/unrealircd.conf"
152 elog
153 elog "You can find example cron scripts here:"
154 elog " /usr/share/doc/${PF}/ircd.cron.gz"
155 elog " /usr/share/doc/${PF}/ircdchk.gz"
156 elog
157 elog "You can also use /etc/init.d/unrealircd to start at boot"
158 }

  ViewVC Help
Powered by ViewVC 1.1.20