| 1 |
# Copyright 1999-2010 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.8.1-r1.ebuild,v 1.1 2010/06/12 16:34:41 ssuominen Exp $ |
| 4 |
|
| 5 |
EAPI="2" |
| 6 |
|
| 7 |
inherit eutils autotools ssl-cert versionator multilib |
| 8 |
|
| 9 |
MY_P=Unreal${PV} |
| 10 |
|
| 11 |
DESCRIPTION="aimed to be an advanced (not easy) IRCd" |
| 12 |
HOMEPAGE="http://www.unrealircd.com/" |
| 13 |
SRC_URI="http://dev.gentoo.org/~ssuominen/${MY_P}-notrojan.tar.gz" |
| 14 |
#SRC_URI="http://unrealircd.icedslash.com/${MY_P}.tar.gz |
| 15 |
# http://unreal.brueggisite.de/${MY_P}.tar.gz |
| 16 |
# http://www.blurryfox.com/unreal/${MY_P}.tar.gz" |
| 17 |
|
| 18 |
SLOT="0" |
| 19 |
LICENSE="GPL-2" |
| 20 |
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x86-fbsd" |
| 21 |
IUSE="curl +hub ipv6 +operoverride +spoof operoverride-verify +prefixaq |
| 22 |
showlistmodes shunnotices ssl topicisnuhost +usermod zlib" |
| 23 |
|
| 24 |
RDEPEND="ssl? ( dev-libs/openssl ) |
| 25 |
zlib? ( sys-libs/zlib ) |
| 26 |
curl? ( net-misc/curl ) |
| 27 |
dev-libs/tre |
| 28 |
>=net-dns/c-ares-1.5.3" |
| 29 |
DEPEND="${RDEPEND} |
| 30 |
>=sys-apps/sed-4" |
| 31 |
|
| 32 |
S="${WORKDIR}/Unreal$(get_version_component_range 1-2)" |
| 33 |
|
| 34 |
pkg_setup() { |
| 35 |
enewuser unrealircd |
| 36 |
} |
| 37 |
|
| 38 |
src_prepare() { |
| 39 |
#QA check against bundled pkgs |
| 40 |
rm extras/*.gz |
| 41 |
|
| 42 |
sed -i \ |
| 43 |
-e "s:ircd\.pid:/var/run/unrealircd/ircd.pid:" \ |
| 44 |
-e "s:ircd\.log:/var/log/unrealircd/ircd.log:" \ |
| 45 |
-e "s:debug\.log:/var/log/unrealircd/debug.log:" \ |
| 46 |
-e "s:ircd\.tune:/var/lib/unrealircd/ircd.tune:" \ |
| 47 |
include/config.h \ |
| 48 |
|| die "sed failed" |
| 49 |
|
| 50 |
# http://bugs.unrealircd.org/view.php?id=3842 |
| 51 |
epatch "${FILESDIR}"/unrealircd-system-tre.patch || die "epatch failed" |
| 52 |
|
| 53 |
epatch "${FILESDIR}"/unrealircd-system-cares.patch || die "epatch failed" |
| 54 |
|
| 55 |
mv autoconf/configure.in ./ || die |
| 56 |
mv autoconf/aclocal.m4 ./acinclude.m4 || die |
| 57 |
#can't call eautoreconf because aclocal's source files aren't even in unearlircd's svn! |
| 58 |
eaclocal |
| 59 |
eautoconf |
| 60 |
} |
| 61 |
|
| 62 |
src_configure() { |
| 63 |
local myconf="" |
| 64 |
use curl && myconf="${myconf} --enable-libcurl=/usr" |
| 65 |
use ipv6 && myconf="${myconf} --enable-inet6" |
| 66 |
use zlib && myconf="${myconf} --enable-ziplinks" |
| 67 |
use hub && myconf="${myconf} --enable-hub" |
| 68 |
use ssl && myconf="${myconf} --enable-ssl" |
| 69 |
use prefixaq && myconf="${myconf} --enable-prefixaq" |
| 70 |
use spoof && myconf="${myconf} --enable-nospoof" |
| 71 |
use showlistmodes && myconf="${myconf} --with-showlistmodes" |
| 72 |
use topicisnuhost && myconf="${myconf} --with-topicisnuhost" |
| 73 |
use shunnotices && myconf="${myconf} --with-shunnotices" |
| 74 |
use operoverride || myconf="${myconf} --with-no-operoverride" |
| 75 |
use operoverride-verify && myconf="${myconf} --with-operoverride-verify" |
| 76 |
use usermod || myconf="${myconf} --with-disableusermod" |
| 77 |
|
| 78 |
econf \ |
| 79 |
--with-listen=5 \ |
| 80 |
--with-dpath="${D}"/etc/unrealircd \ |
| 81 |
--with-spath=/usr/bin/unrealircd \ |
| 82 |
--with-nick-history=2000 \ |
| 83 |
--with-sendq=3000000 \ |
| 84 |
--with-bufferpool=18 \ |
| 85 |
--with-hostname=$(hostname -f) \ |
| 86 |
--with-permissions=0600 \ |
| 87 |
--with-fd-setsize=1024 \ |
| 88 |
--with-system-cares \ |
| 89 |
--with-system-tre \ |
| 90 |
--enable-dynamic-linking \ |
| 91 |
${myconf} |
| 92 |
|
| 93 |
# Fix upstream poor autofoo |
| 94 |
sed -i \ |
| 95 |
-e "s:${D}::g" \ |
| 96 |
include/setup.h \ |
| 97 |
ircdcron/ircdchk \ |
| 98 |
|| die |
| 99 |
} |
| 100 |
|
| 101 |
src_compile() { |
| 102 |
emake MAKE=make IRCDDIR=/etc/unrealircd || die "emake failed" |
| 103 |
} |
| 104 |
|
| 105 |
src_install() { |
| 106 |
keepdir /var/{lib,log,run}/unrealircd |
| 107 |
|
| 108 |
newbin src/ircd unrealircd || die |
| 109 |
|
| 110 |
exeinto /usr/$(get_libdir)/unrealircd/modules |
| 111 |
doexe src/modules/*.so || die |
| 112 |
|
| 113 |
dodir /etc/unrealircd |
| 114 |
dosym /var/lib/unrealircd /etc/unrealircd/tmp || die |
| 115 |
|
| 116 |
insinto /etc/unrealircd |
| 117 |
doins {badwords.*,help,spamfilter,dccallow}.conf || die |
| 118 |
newins doc/example.conf unrealircd.conf || die |
| 119 |
|
| 120 |
insinto /etc/unrealircd/aliases |
| 121 |
doins aliases/*.conf || die |
| 122 |
insinto /etc/unrealircd/networks |
| 123 |
doins networks/*.network || die |
| 124 |
|
| 125 |
sed -i \ |
| 126 |
-e s:src/modules:/usr/$(get_libdir)/unrealircd/modules: \ |
| 127 |
-e s:ircd\\.log:/var/log/unrealircd/ircd.log: \ |
| 128 |
"${D}"/etc/unrealircd/unrealircd.conf \ |
| 129 |
|| die |
| 130 |
|
| 131 |
dodoc \ |
| 132 |
Changes Donation Unreal.nfo networks/makenet \ |
| 133 |
ircdcron/{ircd.cron,ircdchk} \ |
| 134 |
|| die "dodoc failed" |
| 135 |
dohtml doc/*.html || die |
| 136 |
|
| 137 |
newinitd "${FILESDIR}"/unrealircd.rc unrealircd || die |
| 138 |
newconfd "${FILESDIR}"/unrealircd.confd unrealircd |
| 139 |
|
| 140 |
fperms 700 /etc/unrealircd || die |
| 141 |
chown -R unrealircd "${D}"/{etc,var/{lib,log,run}}/unrealircd ||die |
| 142 |
} |
| 143 |
|
| 144 |
pkg_postinst() { |
| 145 |
# Move docert call from scr_install() to install_cert in pkg_postinst for |
| 146 |
# bug #201682 |
| 147 |
if use ssl ; then |
| 148 |
if [[ ! -f "${ROOT}"/etc/unrealircd/server.cert.key ]]; then |
| 149 |
install_cert /etc/unrealircd/server.cert || die |
| 150 |
chown unrealircd "${ROOT}"/etc/unrealircd/server.cert.* || die |
| 151 |
ln -snf server.cert.key "${ROOT}"/etc/unrealircd/server.key.pem || die |
| 152 |
fi |
| 153 |
fi |
| 154 |
|
| 155 |
elog |
| 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 |
elog |
| 164 |
} |