Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 154164
Collapse All | Expand All

(-)metadata.xml (-1 / +1 lines)
Lines 6-10 Link Here
6
		<email>gurligebis@gentoo.org</email>
6
		<email>gurligebis@gentoo.org</email>
7
		<name>Bjarke Istrup Pedersen</name>
7
		<name>Bjarke Istrup Pedersen</name>
8
	</maintainer>
8
	</maintainer>
9
	<longdescription>PsyBNC is a multi-user and multi-server gateway to IRC networks</longdescription>
9
	<longdescription>psyBNC is a multi-user and multi-server gateway to IRC networks</longdescription>
10
</pkgmetadata>
10
</pkgmetadata>
(-)psybnc-2.3.2.7-r1.ebuild (-51 / +96 lines)
Lines 1-83 Link Here
1
# Copyright 1999-2006 Gentoo Foundation
1
# Copyright 1999-2006 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
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-r1.ebuild,v 1.1 2006/10/18 15:17:02 gurligebis Exp $
3
# $Header: $
4
4
5
inherit eutils versionator
5
inherit eutils versionator toolchain-funcs
6
MY_PV=$(replace_version_separator 3 '-')
7
S=${WORKDIR}/${PN}
8
INSTALLDIR="/opt/psybnc"
9
6
10
DESCRIPTION="PsyBNC is a multi-user and multi-server gateway to IRC networks"
7
MY_PV="$(replace_version_separator 3 -)"
8
PSYBNC_HOME="/var/lib/psybnc"
9
10
DESCRIPTION="psyBNC is a multi-user and multi-server gateway to IRC networks"
11
HOMEPAGE="http://www.psybnc.at/index.html"
11
HOMEPAGE="http://www.psybnc.at/index.html"
12
SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz"
12
SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz"
13
13
14
LICENSE="GPL-2"
14
LICENSE="GPL-2"
15
SLOT="0"
15
SLOT="0"
16
KEYWORDS="~x86 ~amd64"
16
KEYWORDS="~x86 ~amd64"
17
IUSE=""
17
IUSE="ipv6 ssl"
18
DEPEND=">=dev-libs/openssl-0.9.7d"
18
19
DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )"
20
RDEPEND="${DEPEND}"
21
22
S="${WORKDIR}"/${PN}
19
23
20
pkg_setup() {
24
pkg_setup() {
21
	enewgroup psybnc
25
	enewgroup psybnc
22
	enewuser psybnc -1 -1 ${INSTALLDIR} psybnc
26
	enewuser psybnc -1 -1 "${PSYBNC_HOME}" psybnc
23
}
27
}
24
28
25
src_unpack() {
29
src_unpack() {
26
	unpack ${A}
30
	unpack ${A}
27
	cd ${S}
31
	cd "${S}"
28
	epatch ${FILESDIR}/${PF}-gentoo.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
29
}
49
}
30
50
31
src_compile() {
51
src_compile() {
32
	emake || die "emake failed"
52
	use ipv6 || rm -f tools/chkipv6.c
53
	use ssl || rm -f tools/chkssl.c
54
55
	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake failed"
33
}
56
}
34
57
35
src_install() {
58
src_install() {
36
	dodoc CHANGES COPYING FAQ README SCRIPTING TODO
59
	dobin psybnc
37
	dodir ${INSTALLDIR}/help ${INSTALLDIR}/key ${INSTALLDIR}/lang ${INSTALLDIR}/log ${INSTALLDIR}/motd ${INSTALLDIR}/scripts
38
60
39
	insinto ${INSTALLDIR}/help
61
	insinto /usr/share/psybnc
40
	doins help/*
62
	doins -r help lang salt.h
41
	insinto ${INSTALLDIR}/key
63
	fperms 0600 /usr/share/psybnc/salt.h
42
	doins key/*
64
43
	insinto ${INSTALLDIR}/lang
65
	insinto /etc/psybnc
44
	doins lang/*
66
	doins "${FILESDIR}"/psybnc.conf
45
	insinto ${INSTALLDIR}/log
67
46
	doins log/*
68
	keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
47
	insinto ${INSTALLDIR}/motd
69
	dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
48
	doins motd/*
70
	dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help
49
	insinto	${INSTALLDIR}/scripts
71
50
	doins scripts/*
72
	fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
51
	insinto ${INSTALLDIR}
73
	fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
52
	doins ${FILESDIR}/psybnc.conf config.h
74
	fperms 0640 /etc/psybnc/psybnc.conf
53
75
54
	exeinto ${INSTALLDIR}
76
	if use ssl
55
	doexe psybnc
77
	then
56
	exeinto /etc/init.d
78
		keepdir /etc/psybnc/ssl
57
	newexe ${FILESDIR}/psybnc.initd psybnc
79
		dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key
58
	insinto /etc/conf.d
80
	else
59
	newins ${FILESDIR}/psybnc.confd psybnc
81
		# Drop SSL listener from psybnc.conf
82
		sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf
83
	fi
60
84
61
	chown -R psybnc:psybnc ${D}/${INSTALLDIR}
85
	newinitd "${FILESDIR}"/psybnc.initd psybnc
86
	newconfd "${FILESDIR}"/psybnc.confd psybnc
87
88
	dodoc CHANGES COPYING FAQ README SCRIPTING TODO
89
	docinto example-script
90
	dodoc scripts/example/DEFAULT.SCRIPT
62
}
91
}
63
92
64
pkg_config() {
93
pkg_config() {
65
	einfo "Generating certificate request..."
94
	if use ssl
66
	openssl req -new -out ${INSTALLDIR}/key/psybnc.req.pem -keyout ${INSTALLDIR}/key/psybnc.key.pem -nodes
95
	then
67
	einfo "Generating self-signed certificate..."
96
		if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]
68
	openssl req -x509 -days 365 -in ${INSTALLDIR}/key/psybnc.req.pem -key ${INSTALLDIR}/key/psybnc.key.pem -out ${INSTALLDIR}/key/psybnc.cert.pem
97
		then
69
	einfo "Generating fingerprint..."
98
			ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!"
70
	openssl x509 -subject -dates -fingerprint -noout -in ${INSTALLDIR}/key/psybnc.cert.pem
99
			ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again."
71
	einfo "Setting permissions on files..."
100
			return
72
	chmod 0640 ${INSTALLDIR}/key/psybnc.key.pem
101
		fi
73
	chmod 0640 ${INSTALLDIR}/key/psybnc.req.pem
102
74
	chmod 0640 ${INSTALLDIR}/key/psybnc.cert.pem
103
		einfo "Generating certificate request..."
104
		openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes
105
		einfo "Generating self-signed certificate..."
106
		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
107
		einfo "Setting permissions on files..."
108
		chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
109
		chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
110
	fi
75
}
111
}
76
112
77
pkg_postinst() {
113
pkg_postinst() {
78
	einfo ""
114
	if use ssl
79
	einfo "Please run \"emerge --config =psybnc-${PVR}\" to create SSL certificates for your system."
115
	then
80
	einfo "You can connect to the bnc on port 23998, user=gentoo, pass=gentoo,"
116
		einfo
81
	einfo "please edit the psybnc configuration in ${INSTALLDIR}/psybnc.conf to change this."
117
		einfo "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates."
82
	einfo ""
118
	fi
119
120
	einfo
121
	einfo "You can connect to psyBNC on port 23998 with user gentoo and password gentoo."
122
	einfo "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this."
123
	einfo
124
	einfo "To be able to reuse an existing psybnc.conf, you need to make sure that the"
125
	einfo "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new"
126
	einfo "version of psyBNC. It is needed for password encryption and decryption."
127
	einfo
83
}
128
}
(-)files/psybnc-2.3.2.7-r1-gentoo.diff
Removed Link Here
(-)files/psybnc.confd (-3 / +5 lines)
Lines 1-3 Link Here
1
# psybnc start-up options
1
# /etc/conf.d/psybnc
2
USER="psybnc"
2
3
BNCPATH="/opt/psybnc"
3
PSYBNC_CONFIG="/etc/psybnc/psybnc.conf"
4
PSYBNC_HOME="/var/lib/psybnc"
5
PSYBNC_USER="psybnc"
(-)files/psybnc.initd (-11 / +21 lines)
Lines 1-32 Link Here
1
#!/sbin/runscript
1
#!/sbin/runscript
2
# Copyright 1999-2006 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: $
2
5
3
depend() {
6
depend() {
4
	need net
7
	need net
5
}
8
}
6
9
7
check_config() {
10
check_config() {
8
	if [ -z "${USER}" ]
11
	if [[ ! -f ${PSYBNC_CONFIG} ]]
9
	then
12
	then
10
	    eerror "Please set \$USER in /etc/conf.d/psybnc!"
13
		eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!"
11
	    return 1
14
		return 1
12
	fi
15
	fi
13
	if [ -z "${BNCPATH}" ]
16
17
	if [[ ! -d ${PSYBNC_HOME} ]]
14
	then
18
	then
15
	    eerror "Please set \$BNCPATH in /etc/conf.d/psybnc!"
19
		eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!"
16
	    return 1
20
		return 1
21
	fi
22
23
	if [[ -z ${PSYBNC_USER} ]]
24
	then
25
		eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!"
26
		return 1
17
	fi
27
	fi
18
}
28
}
19
29
20
start() {
30
start() {
21
	ebegin "Starting psybnc"
22
	check_config || return 1
31
	check_config || return 1
23
	export HOME="${BNCPATH}"
32
	ebegin "Starting psyBNC"
24
	start-stop-daemon -c ${USER} -S -q --chdir ${BNCPATH} -x ${BNCPATH}/psybnc  1>/dev/null 2>&1
33
	start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null
25
	eend $?
34
	eend $?
26
}
35
}
27
36
28
stop() {
37
stop() {
29
	ebegin "Stopping psybnc"
38
	check_config || return 1
30
	start-stop-daemon -K -q --exec ${BNCPATH}/psybnc -s 9
39
	ebegin "Stopping psyBNC"
40
	start-stop-daemon --stop --quiet --pidfile "${PSYBNC_HOME}"/psybnc.pid --signal 9
31
	eend $?
41
	eend $?
32
}
42
}

Return to bug 154164