Use https by default
[gentoo.git] / net-irc / eggdrop / eggdrop-1.6.21-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit eutils
8
9 MY_P="eggdrop${PV}"
10 PATCHSET_V="1.0"
11
12 DESCRIPTION="An IRC bot extensible with C or TCL"
13 HOMEPAGE="http://www.eggheads.org/"
14 SRC_URI="
15         ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/${MY_P}.tar.bz2
16         https://dev.gentoo.org/~binki/distfiles/${CATEGORY}/${PN}/${P}-patches-${PATCHSET_V}.tar.bz2"
17
18 KEYWORDS="alpha amd64 ia64 ~mips ppc sparc x86"
19 LICENSE="GPL-2"
20 SLOT="0"
21 IUSE="debug mysql postgres ssl static vanilla"
22
23 REQUIRED_USE="vanilla? ( !mysql !postgres !ssl )"
24
25 DEPEND="
26         dev-lang/tcl:0
27         sys-apps/gentoo-functions
28         !vanilla? (
29                 mysql? ( virtual/mysql )
30                 postgres? ( dev-db/postgresql[server] )
31                 ssl? ( dev-libs/openssl )
32         )"
33 RDEPEND="${DEPEND}"
34
35 S=${WORKDIR}/${MY_P}
36
37 src_prepare()  {
38         if use vanilla; then
39                 rm -f "${WORKDIR}"/patch/[1-6]*.patch || die
40         fi
41
42         EPATCH_SUFFIX="patch" epatch
43
44         # fix bug #335230
45         sed -i \
46                 -e '/\$(LD)/s/-o/$(CFLAGS) $(LDFLAGS) &/' \
47                 src/mod/*.mod/Makefile* src/Makefile.in || die
48 }
49
50 src_configure() {
51         use mysql    || ( echo mysql ; echo mystats ) >>disabled_modules
52         use postgres || echo pgstats >>disabled_modules
53         use static   && ( echo rijndael ; echo twofish ) >>disabled_modules
54
55         econf $(use_with ssl)
56
57         emake config
58 }
59
60 src_compile() {
61         local target=""
62
63         if use static && use debug; then
64                 target="sdebug"
65         elif use static; then
66                 target="static"
67         elif use debug; then
68                 target="debug"
69         fi
70
71         emake ${target}
72 }
73
74 src_install() {
75         local a b
76         emake DEST="${D}"/opt/eggdrop install
77
78         for a in doc/*; do
79                 [ -f ${a} ] && dodoc ${a}
80         done
81
82         for a in src/mod/*.mod; do
83                 for b in README UPDATES INSTALL TODO CONTENTS; do
84                         [[ -f ${a}/${b} ]] && newdoc ${a}/${b} ${b}.${a##*/}
85                 done
86         done
87
88         dodoc text/motd.*
89
90         use vanilla || dodoc \
91                 src/mod/botnetop.mod/botnetop.conf \
92                 src/mod/gseen.mod/gseen.conf \
93                 src/mod/mc_greet.mod/mc_greet.conf \
94                 src/mod/stats.mod/stats.conf \
95                 src/mod/away.mod/away.doc \
96                 src/mod/rcon.mod/matchbot.tcl \
97                 src/mod/mystats.mod/tools/mystats.{conf,sql} \
98                 src/mod/pgstats.mod/tools/{pgstats.conf,setup.sql}
99
100         dohtml doc/html/*.html
101
102         dobin "${FILESDIR}"/eggdrop-installer
103         doman doc/man1/eggdrop.1
104 }
105
106 pkg_postinst() {
107         elog "Please run /usr/bin/eggdrop-installer to install your eggdrop bot."
108 }