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

Contents of /net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Dec 14 18:23:14 2008 UTC (5 years, 7 months ago) by gurligebis
Branch: MAIN
Changes since 1.3: +5 -5 lines
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
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"
17
18 DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )"
19 RDEPEND="${DEPEND}"
20 S="${WORKDIR}"/"${PN}"
21
22 pkg_setup() {
23 enewgroup psybnc
24 enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc
25 }
26
27 src_unpack() {
28 unpack ${A}
29 cd "${S}"
30
31 epatch "${FILESDIR}/compile.diff"
32
33 # Useless files
34 rm -f */INFO
35
36 # Prevent stripping the binary
37 sed -i -e "/@strip/ d" tools/autoconf.c
38
39 # Pretend we already have a certificate, we generate it in pkg_config
40 mkdir key
41 touch key/psybnc.cert.pem
42
43 if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]]
44 then
45 einfo "Using existing salt.h for password encryption"
46 cp "${ROOT}"/usr/share/psybnc/salt.h salt.h
47 fi
48 }
49
50 src_compile() {
51 use ipv6 || rm -f tools/chkipv6.c
52 use ssl || rm -f tools/chkssl.c
53
54 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake failed"
55 }
56
57 src_install() {
58 dobin psybnc
59
60 insinto /usr/share/psybnc
61 doins -r help lang salt.h
62 fperms 0600 /usr/share/psybnc/salt.h
63
64 insinto /etc/psybnc
65 doins "${FILESDIR}"/psybnc.conf
66
67 keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
68 dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
69 dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help
70
71 fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
72 fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
73 fperms 0640 /etc/psybnc/psybnc.conf
74
75 if use ssl
76 then
77 keepdir /etc/psybnc/ssl
78 dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key
79 else
80 # Drop SSL listener from psybnc.conf
81 sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf
82 fi
83
84 newinitd "${FILESDIR}"/psybnc.initd psybnc
85 newconfd "${FILESDIR}"/psybnc.confd psybnc
86
87 dodoc CHANGES FAQ README SCRIPTING TODO
88 docinto example-script
89 dodoc scripts/example/DEFAULT.SCRIPT
90 }
91
92 pkg_config() {
93 if use ssl
94 then
95 if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]
96 then
97 ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!"
98 ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again."
99 return
100 fi
101
102 einfo "Generating certificate request..."
103 openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes
104 einfo "Generating self-signed certificate..."
105 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
106 einfo "Setting permissions on files..."
107 chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
108 chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
109 fi
110 }
111
112 pkg_postinst() {
113 if use ssl
114 then
115 elog
116 elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates."
117 fi
118 elog
119 elog "You can connect to psyBNC on port 23998 with user gentoo and password gentoo."
120 elog "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this."
121 elog
122 elog "To be able to reuse an existing psybnc.conf, you need to make sure that the"
123 elog "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new"
124 elog "version of psyBNC. It is needed for password encryption and decryption."
125 elog
126 }

  ViewVC Help
Powered by ViewVC 1.1.20