diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2007-11-19 13:56:54 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2007-11-19 13:56:54 +0000 |
commit | 321e23b95974493f715036c3900240c7cd68c182 (patch) | |
tree | e87404f407f6b9e3da5318b139b89d931f2bd6f7 /net-irc | |
parent | Add snapshot USE flag for the rbot live ebuild. (diff) | |
download | gentoo-2-321e23b95974493f715036c3900240c7cd68c182.tar.gz gentoo-2-321e23b95974493f715036c3900240c7cd68c182.tar.bz2 gentoo-2-321e23b95974493f715036c3900240c7cd68c182.zip |
Take maintainership again, and add the live SVN ebuild I had in my overlay. More development will follow.
(Portage version: 2.1.3.19)
Diffstat (limited to 'net-irc')
-rw-r--r-- | net-irc/rbot/ChangeLog | 6 | ||||
-rw-r--r-- | net-irc/rbot/files/digest-rbot-9999-r3 | 0 | ||||
-rw-r--r-- | net-irc/rbot/files/rbot.conf | 22 | ||||
-rw-r--r-- | net-irc/rbot/files/rbot.init | 55 | ||||
-rw-r--r-- | net-irc/rbot/metadata.xml | 3 | ||||
-rw-r--r-- | net-irc/rbot/rbot-9999-r3.ebuild | 81 |
6 files changed, 166 insertions, 1 deletions
diff --git a/net-irc/rbot/ChangeLog b/net-irc/rbot/ChangeLog index 77372546004c..38e4a110c211 100644 --- a/net-irc/rbot/ChangeLog +++ b/net-irc/rbot/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-irc/rbot # Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/ChangeLog,v 1.20 2007/03/19 03:25:29 kloeri Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/ChangeLog,v 1.21 2007/11/19 13:56:54 flameeyes Exp $ + + 19 Nov 2007; Diego Pettenò <flameeyes@gentoo.org> ChangeLog: + Take maintainership again, and add the live SVN ebuild I had in my overlay. + More development will follow. 19 Mar 2007; Bryan Østergaard <kloeri@gentoo.org> metadata.xml: Remove flameeyes from metadata.xml due to retirement. diff --git a/net-irc/rbot/files/digest-rbot-9999-r3 b/net-irc/rbot/files/digest-rbot-9999-r3 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/net-irc/rbot/files/digest-rbot-9999-r3 diff --git a/net-irc/rbot/files/rbot.conf b/net-irc/rbot/files/rbot.conf new file mode 100644 index 000000000000..0c22544f385a --- /dev/null +++ b/net-irc/rbot/files/rbot.conf @@ -0,0 +1,22 @@ +# Configuration file for rbot service(s) +# +# To allow running more than one rbot service on your box, you can +# symlink /etc/init.d/rbot to any name starting with rbot. +# By doing this, after this configuration file, the service will +# source the relative /etc/conf.d/rbot.$name file, where you can set +# your particular configuration for that rbot instance. +# +# NOTE: please make sure you always use a different RBOTDIR for +# multiple instances; you can still use the same user though. +# Also note that, as in the home of the user there will be the +# password for both rbot and NickServ access, the directory should not +# have world readable permissions. + +# Base directory for the bot, with the configuration data +RBOTDIR="/var/lib/rbot" + +# User to run the rbot instance with. +# Note 1: you can specify also a group in the form of user:group. +# Note 2: the HOME of the user will be hardwired to /dev/null for +# safety. +RBOTUSER="rbot:nobody" diff --git a/net-irc/rbot/files/rbot.init b/net-irc/rbot/files/rbot.init new file mode 100644 index 000000000000..a308d5c8e3d5 --- /dev/null +++ b/net-irc/rbot/files/rbot.init @@ -0,0 +1,55 @@ +#!/sbin/runscript +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/files/rbot.init,v 1.1 2007/11/19 13:56:54 flameeyes Exp $ + +depend() { + need net + use dns +} + +start() { + if ! [ -d "${RBOTDIR}" ]; then + eerror "The path you specified (${RBOTDIR}) is not a directory." + eerror "Please set RBOTDIR variable in /etc/conf.d/${myservice}" + eerror "to a proper value for an rbot base directory." + return 1 + fi + + if ! [ -f "${RBOTDIR}/conf.yaml" ]; then + eerror "You didn't configure rbot yet. Please configure rbot by running" + eerror " rbot ${RBOTDIR}" + eerror "at least once." + return 1 + fi + + # for a series of reason, we can't rely on the process being started + # with 'ruby' name. As using ruby18 would break for ruby 1.9, get the + # linked name to use as rubyname. + ruby="$(readlink /usr/bin/ruby)" + + export USER="${RBOTUSER%%:*}" + export HOME="/dev/null" + ebegin "Starting rbot" + start-stop-daemon \ + --start \ + --exec "/usr/bin/${ruby}" --name "${ruby}" \ + --pidfile "${RBOTDIR}/rbot.pid" \ + --chuid "${RBOTUSER}" \ + -- /usr/bin/rbot --background "${RBOTDIR}" + eend $? +} + +stop() { + # for a series of reason, we can't rely on the process being started + # with 'ruby' name. As using ruby18 would break for ruby 1.9, get the + # linked name to use as rubyname. + ruby="$(readlink /usr/bin/ruby)" + + ebegin "Stopping rbot" + start-stop-daemon --stop \ + --exec "/usr/bin/${ruby}" \ + --pidfile "${RBOTDIR}/rbot.pid" \ + --user "${RBOTUSER%%:*}" + eend $? +} diff --git a/net-irc/rbot/metadata.xml b/net-irc/rbot/metadata.xml index 6ef15e900f17..ed40de5d0486 100644 --- a/net-irc/rbot/metadata.xml +++ b/net-irc/rbot/metadata.xml @@ -2,4 +2,7 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <herd>net-irc</herd> +<maintainer> + <email>flameeyes@gentoo.org</email> +</maintainer> </pkgmetadata> diff --git a/net-irc/rbot/rbot-9999-r3.ebuild b/net-irc/rbot/rbot-9999-r3.ebuild new file mode 100644 index 000000000000..0c78f63442c7 --- /dev/null +++ b/net-irc/rbot/rbot-9999-r3.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/rbot/rbot-9999-r3.ebuild,v 1.1 2007/11/19 13:56:54 flameeyes Exp $ + +inherit ruby gems + +[[ ${PV} == "9999" ]] && inherit subversion + +DESCRIPTION="rbot is a ruby IRC bot" +HOMEPAGE="http://www.linuxbrit.co.uk/rbot/" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="" +IUSE="spell" + +RDEPEND=">=virtual/ruby-1.8 + dev-ruby/ruby-bdb + dev-ruby/tzinfo" +DEPEND="" + +if [[ ${PV} == "9999" ]]; then + SRC_URI="" + ESVN_REPO_URI="svn://linuxbrit.co.uk/giblet/rbot/trunk" + + DEPEND="${DEPEND} + dev-ruby/rake + app-arch/zip" + + IUSE="${IUSE} snapshot" +else + SRC_URI="http://www.linuxbrit.co.uk/downloads/${P}.gem" +fi + +pkg_setup() { + enewuser rbot -1 -1 /var/lib/rbot nobody +} + +svn_gem_version() { + use snapshot && \ + echo 9998.${ESVN_WC_REVISION} || \ + echo 9999 +} + +src_unpack() { + [[ ${PV} == "9999" ]] || return 0 + subversion_src_unpack + + cd "${S}" + sed -i -e "/s.version =/s:'.\+':'$(svn_gem_version)':" Rakefile \ + || die "Unable to fix Rakefile version." + sed -i -e '/\$version=/s:".\+":"'$(svn_gem_version)'":' bin/rbot \ + || die "Unable to fix rbot script version." +} + +src_compile() { + [[ ${PV} == "9999" ]] || return 0 + rake || die "Gem generation failed" +} + +src_install() { + if [[ ${PV} == "9999" ]]; then + GEM_SRC="${S}/pkg/rbot-$(svn_gem_version).gem" + MY_P="${PN}-$(svn_gem_version)" + fi + gems_src_install + + diropts -o rbot -g nobody -m 0700 + keepdir /var/lib/rbot + + newinitd "${FILESDIR}/rbot.init" rbot + newconfd "${FILESDIR}/rbot.conf" rbot +} + +pkg_postinst() { + einfo + elog "rbot now can be started as a normal service." + elog "Check /etc/conf.d/rbot file for more information" + elog "about using this feature." + einfo +} |