diff options
author | Bjarke Istrup Pedersen <gurligebis@gentoo.org> | 2007-02-26 00:03:08 +0000 |
---|---|---|
committer | Bjarke Istrup Pedersen <gurligebis@gentoo.org> | 2007-02-26 00:03:08 +0000 |
commit | 1555a2043f5b26380bffc4694c34c2050862553f (patch) | |
tree | ef4753807261fa8a8065dceb6e32570cf06947d7 /net-irc/psybnc | |
parent | Add optional Perl deps, bug #155342 (diff) | |
download | gentoo-2-1555a2043f5b26380bffc4694c34c2050862553f.tar.gz gentoo-2-1555a2043f5b26380bffc4694c34c2050862553f.tar.bz2 gentoo-2-1555a2043f5b26380bffc4694c34c2050862553f.zip |
Moving away from /opt, fixing bug #154164
(Portage version: 2.1.2-r11)
Diffstat (limited to 'net-irc/psybnc')
-rw-r--r-- | net-irc/psybnc/ChangeLog | 7 | ||||
-rw-r--r-- | net-irc/psybnc/files/digest-psybnc-2.3.2.7-r2 (renamed from net-irc/psybnc/files/digest-psybnc-2.3.2.7-r1) | 0 | ||||
-rw-r--r-- | net-irc/psybnc/files/psybnc-2.3.2.7-r1-gentoo.diff | 11 | ||||
-rw-r--r-- | net-irc/psybnc/files/psybnc.confd | 8 | ||||
-rw-r--r-- | net-irc/psybnc/files/psybnc.initd | 28 | ||||
-rw-r--r-- | net-irc/psybnc/metadata.xml | 2 | ||||
-rw-r--r-- | net-irc/psybnc/psybnc-2.3.2.7-r1.ebuild | 83 | ||||
-rw-r--r-- | net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild | 125 |
8 files changed, 155 insertions, 109 deletions
diff --git a/net-irc/psybnc/ChangeLog b/net-irc/psybnc/ChangeLog index a09f70995c5b..4956c93e0ab7 100644 --- a/net-irc/psybnc/ChangeLog +++ b/net-irc/psybnc/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for net-irc/psybnc -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/ChangeLog,v 1.4 2006/12/28 12:52:27 hansmi Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/ChangeLog,v 1.5 2007/02/26 00:03:08 gurligebis Exp $ + + 26 Feb 2007; Bjarke Istrup Pedersen <gurligebis@gentoo.org>: + Moved away from /opt, fixing bug #154164 . 28 Dec 2006; Michael Hanselmann <hansmi@gentoo.org> psybnc-2.3.2.7-r1.ebuild: diff --git a/net-irc/psybnc/files/digest-psybnc-2.3.2.7-r1 b/net-irc/psybnc/files/digest-psybnc-2.3.2.7-r2 index d521eb7e80b0..d521eb7e80b0 100644 --- a/net-irc/psybnc/files/digest-psybnc-2.3.2.7-r1 +++ b/net-irc/psybnc/files/digest-psybnc-2.3.2.7-r2 diff --git a/net-irc/psybnc/files/psybnc-2.3.2.7-r1-gentoo.diff b/net-irc/psybnc/files/psybnc-2.3.2.7-r1-gentoo.diff deleted file mode 100644 index 2b24e8693a1b..000000000000 --- a/net-irc/psybnc/files/psybnc-2.3.2.7-r1-gentoo.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- tools/autoconf.c 2004-05-07 01:33:25.956597616 +0200 -+++ tools/autoconf.c 2004-05-07 01:33:43.075995072 +0200 -@@ -462,7 +462,7 @@ - fprintf(makefile," @echo \"* for the sake of correct Cert-Checking *\"\n"); - fprintf(makefile," @echo \"*******************************************\"\n"); - fprintf(makefile," @echo \"Generating certificate request .. \"\n"); -- fprintf(makefile," @%s req -new -config src/ssl.cnf -out key/psybnc.req.pem \\\n",sslbin); -+ fprintf(makefile," @%s req -batch -new -config src/ssl.cnf -out key/psybnc.req.pem \\\n",sslbin); - fprintf(makefile," -keyout key/psybnc.key.pem -nodes\n"); - fprintf(makefile," @echo \"Generating self-signed certificate .. \"\n"); - fprintf(makefile," @%s req -x509 -days 365 -in key/psybnc.req.pem \\\n",sslbin); diff --git a/net-irc/psybnc/files/psybnc.confd b/net-irc/psybnc/files/psybnc.confd index dfaaa010f277..cdd8f31f9457 100644 --- a/net-irc/psybnc/files/psybnc.confd +++ b/net-irc/psybnc/files/psybnc.confd @@ -1,3 +1,5 @@ -# psybnc start-up options -USER="psybnc" -BNCPATH="/opt/psybnc" +# /etc/conf.d/psybnc + +PSYBNC_CONFIG="/etc/psybnc/psybnc.conf" +PSYBNC_HOME="/var/lib/psybnc" +PSYBNC_USER="psybnc" diff --git a/net-irc/psybnc/files/psybnc.initd b/net-irc/psybnc/files/psybnc.initd index add796fa7aae..12e7b5aa8be6 100644 --- a/net-irc/psybnc/files/psybnc.initd +++ b/net-irc/psybnc/files/psybnc.initd @@ -1,32 +1,42 @@ #!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/files/psybnc.initd,v 1.2 2007/02/26 00:03:08 gurligebis Exp $ depend() { need net } check_config() { - if [ -z "${USER}" ] + if [[ ! -f ${PSYBNC_CONFIG} ]] then - eerror "Please set \$USER in /etc/conf.d/psybnc!" + eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!" return 1 fi - if [ -z "${BNCPATH}" ] + + if [[ ! -d "${PSYBNC_HOME}" ]] + then + eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!" + return 1 + fi + + if [[ -z "${PSYBNC_USER}" ]] then - eerror "Please set \$BNCPATH in /etc/conf.d/psybnc!" + eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!" return 1 fi } start() { - ebegin "Starting psybnc" check_config || return 1 - export HOME="${BNCPATH}" - start-stop-daemon -c ${USER} -S -q --chdir ${BNCPATH} -x ${BNCPATH}/psybnc 1>/dev/null 2>&1 + ebegin "Starting psyBNC" + start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null eend $? } stop() { - ebegin "Stopping psybnc" - start-stop-daemon -K -q --exec ${BNCPATH}/psybnc -s 9 + check_config || return 1 + ebegin "Stopping psyBNC" + start-stop-daemon --stop --quiet --pidfile "${PSYBNC_HOME}"/psybnc.pid --signal 9 eend $? } diff --git a/net-irc/psybnc/metadata.xml b/net-irc/psybnc/metadata.xml index 0a1292db0f73..4c9ad71be51f 100644 --- a/net-irc/psybnc/metadata.xml +++ b/net-irc/psybnc/metadata.xml @@ -6,5 +6,5 @@ <email>gurligebis@gentoo.org</email> <name>Bjarke Istrup Pedersen</name> </maintainer> - <longdescription>PsyBNC is a multi-user and multi-server gateway to IRC networks</longdescription> + <longdescription>psyBNC is a multi-user and multi-server gateway to IRC networks</longdescription> </pkgmetadata> diff --git a/net-irc/psybnc/psybnc-2.3.2.7-r1.ebuild b/net-irc/psybnc/psybnc-2.3.2.7-r1.ebuild deleted file mode 100644 index d6fab32bc502..000000000000 --- a/net-irc/psybnc/psybnc-2.3.2.7-r1.ebuild +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/psybnc-2.3.2.7-r1.ebuild,v 1.2 2006/12/28 12:52:27 hansmi Exp $ - -inherit eutils versionator -MY_PV=$(replace_version_separator 3 '-') -S=${WORKDIR}/${PN} -INSTALLDIR="/opt/psybnc" - -DESCRIPTION="PsyBNC is a multi-user and multi-server gateway to IRC networks" -HOMEPAGE="http://www.psybnc.at/index.html" -SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~sparc ~x86" -IUSE="" -DEPEND=">=dev-libs/openssl-0.9.7d" - -pkg_setup() { - enewgroup psybnc - enewuser psybnc -1 -1 ${INSTALLDIR} psybnc -} - -src_unpack() { - unpack ${A} - cd ${S} - epatch ${FILESDIR}/${PF}-gentoo.diff -} - -src_compile() { - emake || die "emake failed" -} - -src_install() { - dodoc CHANGES COPYING FAQ README SCRIPTING TODO - dodir ${INSTALLDIR}/help ${INSTALLDIR}/key ${INSTALLDIR}/lang ${INSTALLDIR}/log ${INSTALLDIR}/motd ${INSTALLDIR}/scripts - - insinto ${INSTALLDIR}/help - doins help/* - insinto ${INSTALLDIR}/key - doins key/* - insinto ${INSTALLDIR}/lang - doins lang/* - insinto ${INSTALLDIR}/log - doins log/* - insinto ${INSTALLDIR}/motd - doins motd/* - insinto ${INSTALLDIR}/scripts - doins scripts/* - insinto ${INSTALLDIR} - doins ${FILESDIR}/psybnc.conf config.h - - exeinto ${INSTALLDIR} - doexe psybnc - exeinto /etc/init.d - newexe ${FILESDIR}/psybnc.initd psybnc - insinto /etc/conf.d - newins ${FILESDIR}/psybnc.confd psybnc - - chown -R psybnc:psybnc ${D}/${INSTALLDIR} -} - -pkg_config() { - einfo "Generating certificate request..." - openssl req -new -out ${INSTALLDIR}/key/psybnc.req.pem -keyout ${INSTALLDIR}/key/psybnc.key.pem -nodes - einfo "Generating self-signed certificate..." - openssl req -x509 -days 365 -in ${INSTALLDIR}/key/psybnc.req.pem -key ${INSTALLDIR}/key/psybnc.key.pem -out ${INSTALLDIR}/key/psybnc.cert.pem - einfo "Generating fingerprint..." - openssl x509 -subject -dates -fingerprint -noout -in ${INSTALLDIR}/key/psybnc.cert.pem - einfo "Setting permissions on files..." - chmod 0640 ${INSTALLDIR}/key/psybnc.key.pem - chmod 0640 ${INSTALLDIR}/key/psybnc.req.pem - chmod 0640 ${INSTALLDIR}/key/psybnc.cert.pem -} - -pkg_postinst() { - einfo "" - einfo "Please run \"emerge --config =psybnc-${PVR}\" to create SSL certificates for your system." - einfo "You can connect to the bnc on port 23998, user=gentoo, pass=gentoo," - einfo "please edit the psybnc configuration in ${INSTALLDIR}/psybnc.conf to change this." - einfo "" -} diff --git a/net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild b/net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild new file mode 100644 index 000000000000..c107c25e729e --- /dev/null +++ b/net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/psybnc-2.3.2.7-r2.ebuild,v 1.1 2007/02/26 00:03:08 gurligebis Exp $ + +inherit eutils versionator toolchain-funcs +MY_PV="$(replace_version_separator 3 -)" +PSYBNC_HOME="/var/lib/psybnc" + +DESCRIPTION="psyBNC is a multi-user and multi-server gateway to IRC networks" +HOMEPAGE="http://www.psybnc.at/index.html" +SRC_URI="http://www.psybnc.at/download/beta/psyBNC-${MY_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~sparc ~x86" +IUSE="ipv6 ssl" + +DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )" +RDEPEND="${DEPEND}" +S="${WORKDIR}"/"${PN}" + +pkg_setup() { + enewgroup psybnc + enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc +} + +src_unpack() { + unpack ${A} + cd ${S} + + # Useless files + rm -f */INFO + + # Prevent stripping the binary + sed -i -e "/@strip/ d" tools/autoconf.c + + # Pretend we already have a certificate, we generate it in pkg_config + mkdir key + touch key/psybnc.cert.pem + + if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]] + then + einfo "Using existing salt.h for password encryption" + cp "${ROOT}"/usr/share/psybnc/salt.h salt.h + fi +} + +src_compile() { + use ipv6 || rm -f tools/chkipv6.c + use ssl || rm -f tools/chkssl.c + + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake failed" +} + +src_install() { + dobin psybnc + + insinto /usr/share/psybnc + doins -r help lang salt.h + fperms 0600 /usr/share/psybnc/salt.h + + insinto /etc/psybnc + doins "${FILESDIR}"/psybnc.conf + + keepdir "${PSYBNC_HOME}"/{log,motd,scripts} + dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang + dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help + + fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf + fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts} + fperms 0640 /etc/psybnc/psybnc.conf + + if use ssl + then + keepdir /etc/psybnc/ssl + dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key + else + # Drop SSL listener from psybnc.conf + sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf + fi + + newinitd "${FILESDIR}"/psybnc.initd psybnc + newconfd "${FILESDIR}"/psybnc.confd psybnc + + dodoc CHANGES COPYING FAQ README SCRIPTING TODO + docinto example-script + dodoc scripts/example/DEFAULT.SCRIPT +} + +pkg_config() { + if use ssl + then + if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]] + then + ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!" + ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again." + return + fi + + einfo "Generating certificate request..." + openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes + einfo "Generating self-signed certificate..." + 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 + einfo "Setting permissions on files..." + chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem + chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem + fi +} + +pkg_postinst() { + if use ssl + then + einfo + einfo "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates." + fi + + einfo + einfo "You can connect to psyBNC on port 23998 with user gentoo and password gentoo." + einfo "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this." + einfo + einfo "To be able to reuse an existing psybnc.conf, you need to make sure that the" + einfo "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new" + einfo "version of psyBNC. It is needed for password encryption and decryption." + einfo +} |