/[gentoo-x86]/net-irc/psybnc/psybnc-2.3.2.9.ebuild
Gentoo

Contents of /net-irc/psybnc/psybnc-2.3.2.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Dec 14 18:23:14 2008 UTC (5 years, 8 months ago) by gurligebis
Branch: MAIN
Bumping to 2.3.2.9, fixing both #172650 and #246596
(Portage version: 2.2_rc17/cvs/Linux 2.6.28-rc8 i686)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild,v 1.3 2007/05/06 12:41:07 genone Exp $
4
5 inherit eutils versionator toolchain-funcs flag-o-matic
6 MY_PV="$(replace_version_separator 3 -)"
7 PSYBNC_HOME="/var/lib/psybnc"
8
9 DESCRIPTION="psyBNC is a multi-user and multi-server gateway to IRC networks"
10 HOMEPAGE="http://www.psybnc.at/index.html"
11 SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~sparc ~x86"
16 IUSE="ipv6 ssl oidentd"
17
18 DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )
19 oidentd? ( >=net-misc/oidentd-2.0 )"
20 RDEPEND="${DEPEND}"
21 S="${WORKDIR}"/"${PN}"
22
23 pkg_setup() {
24 enewgroup psybnc
25 enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc
26 }
27
28 src_unpack() {
29 unpack ${A}
30 cd "${S}"
31
32 epatch "${FILESDIR}/compile.diff"
33
34 # add oidentd
35 use oidentd && epatch "${FILESDIR}/${P}-oidentd.patch"
36
37 # Useless files
38 rm -f */INFO
39
40 # Prevent stripping the binary
41 sed -i -e "/@strip/ d" tools/autoconf.c
42
43 # Pretend we already have a certificate, we generate it in pkg_config
44 mkdir key
45 touch key/psybnc.cert.pem
46
47 if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]]
48 then
49 einfo "Using existing salt.h for password encryption"
50 cp "${ROOT}"/usr/share/psybnc/salt.h salt.h
51 fi
52 }
53
54 src_compile() {
55 use ipv6 || rm -f tools/chkipv6.c
56 use ssl || rm -f tools/chkssl.c
57
58 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake failed"
59 }
60
61 src_install() {
62 dobin psybnc
63
64 insinto /usr/share/psybnc
65 doins -r help lang salt.h
66 fperms 0600 /usr/share/psybnc/salt.h
67
68 insinto /etc/psybnc
69 doins "${FILESDIR}"/psybnc.conf
70
71 keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
72 dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
73 dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help
74
75 fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
76 fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
77 fperms 0640 /etc/psybnc/psybnc.conf
78
79 if use ssl
80 then
81 keepdir /etc/psybnc/ssl
82 dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key
83 else
84 # Drop SSL listener from psybnc.conf
85 sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf
86 fi
87
88 if use oidentd
89 then
90 insinto /etc
91 doins "${FILESDIR}"/oidentd.conf.psybnc
92 fperms 640 /etc/oidentd.conf.psybnc
93 # install init-script with oidentd-support
94 newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc
95 else
96 # install init-script without oidentd-support
97 newinitd "${FILESDIR}"/psybnc.initd psybnc
98 fi
99
100 newconfd "${FILESDIR}"/psybnc.confd psybnc
101
102 dodoc CHANGES FAQ README SCRIPTING TODO
103 docinto example-script
104 dodoc scripts/example/DEFAULT.SCRIPT
105 }
106
107 pkg_config() {
108 if use ssl
109 then
110 if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]
111 then
112 ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!"
113 ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again."
114 return
115 fi
116
117 einfo "Generating certificate request..."
118 openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes
119 einfo "Generating self-signed certificate..."
120 openssl req -x509 -days 365 -in "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -key "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -out "${ROOT}"/etc/psybnc/ssl/psybnc.cert.pem
121 einfo "Setting permissions on files..."
122 chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
123 chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
124 fi
125 }
126
127 pkg_postinst() {
128 if use ssl
129 then
130 elog
131 elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates."
132 fi
133 if use oidentd
134 then
135 elog
136 elog "You have enabled oidentd-support. You will need to set"
137 elog "up your /etc/oident.conf file before running psybnc. An example"
138 elog "for psyBNC can be found under /etc/oident.conf.psybnc."
139 fi
140 elog
141 elog "You can connect to psyBNC on port 23998 with user gentoo and password gentoo."
142 elog "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this."
143 elog
144 elog "To be able to reuse an existing psybnc.conf, you need to make sure that the"
145 elog "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new"
146 elog "version of psyBNC. It is needed for password encryption and decryption."
147 elog
148 }

  ViewVC Help
Powered by ViewVC 1.1.20