net-irc/qwebirc: Update for EAPI-5 net-irc/qwebirc
authorW. Trevor King <wking@tremily.us>
Mon, 15 Apr 2013 17:15:04 +0000 (13:15 -0400)
committerW. Trevor King <wking@tremily.us>
Mon, 15 Apr 2013 18:19:17 +0000 (14:19 -0400)
I also tried to convert shell commands to their builtin EAPI
equivalents.

files/qwebirc.confd [new file with mode: 0644]
files/qwebirc.initd [moved from files/init-script with 52% similarity]
qwebirc-9999.ebuild

diff --git a/files/qwebirc.confd b/files/qwebirc.confd
new file mode 100644 (file)
index 0000000..cf60170
--- /dev/null
@@ -0,0 +1 @@
+PORT=9090
similarity index 52%
rename from files/init-script
rename to files/qwebirc.initd
index cb937c3d38ff25ae2f19e3b605b46503698cc794..41336f09d312f15e2048cae7eeef07ba4aeca3ce 100644 (file)
@@ -1,10 +1,10 @@
 #!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: qwebirc.initd,v 1.0 2011/03/11 12:11:50 lkraav Exp $
+# $Header: $
 
 SVCHOME="/var/www/qwebirc"
-LOGFILE="/var/log/qwebirc"
+LOGFILE="/var/log/qwebirc.log"
 
 depend() {
        use net
@@ -15,13 +15,13 @@ depend() {
 start() {
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --user qwebirc:qwebirc --chdir ${SVCHOME} \
-               --quiet --exec ${SVCHOME}/run.py \
-               -- -l ${LOGFILE} -p ${PORT} -P /var/run/qwebirc/${SVCNAME}.pid
+               --quiet --exec python2.7 \
+               -- run.py -l ${LOGFILE} -p ${PORT} -P /run/qwebirc/${SVCNAME}.pid
        eend $?
 }
 
 stop() {
        ebegin "Stopping ${SVCNAME}"
-       start-stop-daemon --stop --quiet --pidfile /var/run/qwebirc/${SVCNAME}.pid
+       start-stop-daemon --stop --quiet --pidfile /run/qwebirc/${SVCNAME}.pid
        eend $?
 }
index 34e28967dc14bccdc19107ef6269d987f13d204d..24572dbd1904f0d95baa04511f03a645c775d429 100644 (file)
@@ -1,15 +1,22 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
-EAPI=2
+EAPI="5"
+PYTHON_COMPAT=( python{2_6,2_7} )
 
-EHG_REPO_URI=http://hg.qwebirc.org/qwebirc/
+inherit eutils python-single-r1
 
-inherit eutils mercurial
+DESCRIPTION="A multi-user IRC client, used by QuakeNet, Freenode, etc."
+HOMEPAGE="http://qwebirc.org"
 
-DESCRIPTION="qwebirc is a fast, easy to use, free and open source IRC client designed by and originally just for the QuakeNet IRC network."
-HOMEPAGE="http://www.qwebirc.org"
+if [[ "${PV}" == "9999" ]]; then
+       inherit mercurial
+       EHG_REPO_URI=http://hg.qwebirc.org/qwebirc/
+       SRC_URI=""
+else
+       SRC_URI=""  # upstream doesn't cut releases, see http://qwebirc.org/download
+fi
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -17,40 +24,45 @@ KEYWORDS="~amd64 ~x86"
 IUSE=""
 
 RDEPEND=">=dev-lang/python-2.5
+       dev-python/pyopenssl
        dev-python/simplejson
        >=dev-python/twisted-mail-8.2
        >=dev-python/twisted-names-8.2
+       >=dev-python/twisted-runner-8.2
        >=dev-python/twisted-web-8.2
        >=dev-python/twisted-words-8.2
+       net-zope/zope-interface
        >=virtual/jre-1.6
 "
 DEPEND="${RDEPEND}"
 
 pkg_setup() {
-       enewgroup qwebirc
-       enewuser qwebirc -1 /bin/true /var/lib/qwebirc qwebirc -r -d /var/www/qwebirc
+       ebegin "Creating ${PN} user and group"
+       enewgroup "${PN}"
+       enewuser "${PN}" -1 -1 -1 "${PN}"
+       eend $?
 }
 
 src_compile() {
-       ./compile.py
+       cp config.py{.example,}
+       "${EPYTHON}" ./compile.py
+       python_fix_shebang run.py
 }
 
 src_install() {
-       mkdir -p ${D}/var/www
-       # copy the whole repository, including the .hg stuff
-       cp -rp ${S} ${D}/var/www/qwebirc
-       chown -R qwebirc:qwebirc ${D}/var/www/qwebirc
-
-       # create the logfile as qwebirc does not have the permission to create it itself
-       mkdir -p ${D}/var/log
-       touch ${D}/var/log/qwebirc
-       chown qwebirc:qwebirc ${D}/var/log/qwebirc
-       chmod 640  ${D}/var/log/qwebirc
-
-       mkdir -p ${D}/etc/init.d
-       cp ${FILESDIR}/init-script ${D}/etc/init.d/qwebirc
-       chmod 755  ${D}/etc/init.d/qwebirc
-
-       mkdir -p ${D}/etc/conf.d
-       echo "PORT=9090" > ${D}/etc/conf.d/qwebirc
+       insinto /var/www/qwebirc/
+       doins -r bin css dummyauthgate esimplejson js qwebirc static twisted util
+       doins -r .checked .compiled
+       doins README AUTHORS LICENSE *.py qwebirc.pdn qwebirc.png
+       chown -R "${PN}:${PN}" "${ED}/var/www/qwebirc/"
+
+       # create the logfile as qwebirc does not have the permission to
+       # create it itself
+       dodir /var/log
+       touch "${ED}/var/log/qwebirc.log"
+       fowners qwebirc:qwebirc /var/log/qwebirc.log
+       fperms 640 /var/log/qwebirc.log
+
+       newinitd "${FILESDIR}/qwebirc.initd" qwebirc
+       newconfd "${FILESDIR}/qwebirc.confd" qwebirc
 }