From e510426ed9d910466624143ec588c5f3d2a28ce9 Mon Sep 17 00:00:00 2001 From: Bjarke Istrup Pedersen Date: Mon, 18 Feb 2013 08:25:51 +0000 Subject: Fixing init script to ensure /run directory exists, fixing #448464 (Portage version: 2.2.0_alpha163/cvs/Linux i686, signed Manifest commit with key 15AE484C) --- net-irc/anope/ChangeLog | 10 ++- net-irc/anope/anope-1.8.7-r1.ebuild | 120 ++++++++++++++++++++++++++++++++++++ net-irc/anope/anope-1.8.7.ebuild | 120 ------------------------------------ net-irc/anope/files/anope-init.d | 17 ++--- 4 files changed, 137 insertions(+), 130 deletions(-) create mode 100644 net-irc/anope/anope-1.8.7-r1.ebuild delete mode 100644 net-irc/anope/anope-1.8.7.ebuild (limited to 'net-irc/anope') diff --git a/net-irc/anope/ChangeLog b/net-irc/anope/ChangeLog index 9a598e86bd7e..b72ae54c8db2 100644 --- a/net-irc/anope/ChangeLog +++ b/net-irc/anope/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-irc/anope -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/ChangeLog,v 1.21 2012/07/01 21:07:35 binki Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/ChangeLog,v 1.22 2013/02/18 08:25:51 gurligebis Exp $ + +*anope-1.8.7-r1 (18 Feb 2013) + + 18 Feb 2013; -anope-1.8.7.ebuild, + +anope-1.8.7-r1.ebuild, files/anope-init.d: + Fixing init script to ensure /run directory exists, fixing #448464 01 Jul 2012; Nathan Phillip Brink anope-1.8.7.ebuild: Ensure that /var/lib/anope/backups directory exists so that database backups diff --git a/net-irc/anope/anope-1.8.7-r1.ebuild b/net-irc/anope/anope-1.8.7-r1.ebuild new file mode 100644 index 000000000000..6ca2cfc24159 --- /dev/null +++ b/net-irc/anope/anope-1.8.7-r1.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/anope-1.8.7-r1.ebuild,v 1.1 2013/02/18 08:25:51 gurligebis Exp $ + +EAPI=4 + +inherit autotools eutils multilib versionator user + +DESCRIPTION="Anope IRC Services" +HOMEPAGE="http://www.anope.org" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="mysql" + +DEPEND="mysql? ( virtual/mysql )" +RDEPEND="${DEPEND}" + +pkg_pretend() { + local replaced_version + for replaced_version in ${REPLACING_VERSIONS} ; do + if ! version_is_at_least 1.8.7 ${replaced_version} && [[ -f ${ROOT}opt/anope/data/nick.db ]]; then + eerror "It looks like you have an older version of Anope installed." + eerror "To upgrade, shut down Anope and copy your databases to" + eerror "${ROOT}var/lib/anope and your configuration to ${ROOT}etc/anope" + eerror "You can do this by:" + eerror "# mkdir -p ${ROOT}var/lib/anope ${ROOT}etc/anope" + eerror "# chown anope:anope ${ROOT}var/lib/anope" + eerror "# mv ${ROOT}opt/anope/data/*.db ${ROOT}var/lib/anope" + eerror "# mv ${ROOT}opt/anope/data/services.conf ${ROOT}etc/anope" + die "Please move your anope database files from /opt/anope/data" + fi + done +} + +pkg_setup() { + enewgroup anope + enewuser anope -1 -1 -1 anope +} + +src_prepare() { + epatch "${FILESDIR}/pid-patch.diff" + epatch "${FILESDIR}/${P}-ldflags-fix.patch" + epatch "${FILESDIR}/${P}-libdir-gentoo.patch" + epatch "${FILESDIR}"/${P}-mariadb.patch # bug 381119 + eautoconf +} + +src_configure() { + local myconf + if ! use mysql; then + myconf="${myconf} --without-mysql" + fi + + econf \ + ${myconf} \ + --with-bindir=/usr/bin/ \ + --with-datadir=/var/lib/anope \ + --with-libdir=/usr/$(get_libdir)/anope/ \ + --with-rungroup=anope \ + --with-permissions=077 + + sed -i -e "/^build:/s:$: language:g" "${S}"/Makefile || die "sed failed" +} + +src_install() { + keepdir /var/{log,run}/anope /var/lib/anope/backups + fowners anope:anope /var/{lib,log,run}/anope /var/lib/anope/backups + + local baselibdir + baselibdir="${D}/usr/$(get_libdir)/anope" + + dodir /usr/$(get_libdir)/anope/{lang,modules} + emake DATDEST="${baselibdir}" \ + BINDEST="${D}/usr/bin" \ + MODULE_PATH="${baselibdir}/modules" \ + install + + newinitd "${FILESDIR}/anope-init.d" anope + newconfd "${FILESDIR}/anope-conf.d" anope + + dodoc Changes Changes.conf Changes.lang Changes.mysql docs/* data/example.conf + use mysql && dodoc data/tables.sql + + insinto /etc/anope + newins data/example.conf services.conf +} + +pkg_preinst() { + if has_version net-irc/anope ; then + local directory + directory="${ROOT}"var/lib/anope/pre-update + elog "Making a backup of your databases to ${directory}" + if [ ! -d "${directory}" ]; then + mkdir -p "${directory}" || die "failed to create backup directory" + chown anope:anope "${directory}"/../ || die "failed to chown data directory" + fi + # don't die otherwise merge will fail if there are no existing databases + cp "${ROOT}"/var/lib/anope/*.db "${directory}" + fi +} + +pkg_postinst() { + echo + ewarn "Anope won't run out of the box, you still have to configure it to match your IRCD's configuration." + ewarn "Edit /etc/anope/services.conf to configure Anope." + + if use mysql; then + echo + ewarn "!!! ATTENTION !!!" + ewarn "Be sure to read Changes.mysql to update your MySQL" + ewarn "tables or anope will break after restart" + ewarn "!!! ATTENTION !!!" + echo + einfo "The mysql script for updating the tables is located in the" + einfo "/usr/share/doc/${PF} directory" + fi +} diff --git a/net-irc/anope/anope-1.8.7.ebuild b/net-irc/anope/anope-1.8.7.ebuild deleted file mode 100644 index a1829fcf0191..000000000000 --- a/net-irc/anope/anope-1.8.7.ebuild +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/anope-1.8.7.ebuild,v 1.3 2012/07/01 21:07:35 binki Exp $ - -EAPI=4 - -inherit autotools eutils multilib versionator - -DESCRIPTION="Anope IRC Services" -HOMEPAGE="http://www.anope.org" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="mysql" - -DEPEND="mysql? ( virtual/mysql )" -RDEPEND="${DEPEND}" - -pkg_pretend() { - local replaced_version - for replaced_version in ${REPLACING_VERSIONS} ; do - if ! version_is_at_least 1.8.7 ${replaced_version} && [[ -f ${ROOT}opt/anope/data/nick.db ]]; then - eerror "It looks like you have an older version of Anope installed." - eerror "To upgrade, shut down Anope and copy your databases to" - eerror "${ROOT}var/lib/anope and your configuration to ${ROOT}etc/anope" - eerror "You can do this by:" - eerror "# mkdir -p ${ROOT}var/lib/anope ${ROOT}etc/anope" - eerror "# chown anope:anope ${ROOT}var/lib/anope" - eerror "# mv ${ROOT}opt/anope/data/*.db ${ROOT}var/lib/anope" - eerror "# mv ${ROOT}opt/anope/data/services.conf ${ROOT}etc/anope" - die "Please move your anope database files from /opt/anope/data" - fi - done -} - -pkg_setup() { - enewgroup anope - enewuser anope -1 -1 -1 anope -} - -src_prepare() { - epatch "${FILESDIR}/pid-patch.diff" - epatch "${FILESDIR}/${P}-ldflags-fix.patch" - epatch "${FILESDIR}/${P}-libdir-gentoo.patch" - epatch "${FILESDIR}"/${P}-mariadb.patch # bug 381119 - eautoconf -} - -src_configure() { - local myconf - if ! use mysql; then - myconf="${myconf} --without-mysql" - fi - - econf \ - ${myconf} \ - --with-bindir=/usr/bin/ \ - --with-datadir=/var/lib/anope \ - --with-libdir=/usr/$(get_libdir)/anope/ \ - --with-rungroup=anope \ - --with-permissions=077 - - sed -i -e "/^build:/s:$: language:g" "${S}"/Makefile || die "sed failed" -} - -src_install() { - keepdir /var/{log,run}/anope /var/lib/anope/backups - fowners anope:anope /var/{lib,log,run}/anope /var/lib/anope/backups - - local baselibdir - baselibdir="${D}/usr/$(get_libdir)/anope" - - dodir /usr/$(get_libdir)/anope/{lang,modules} - emake DATDEST="${baselibdir}" \ - BINDEST="${D}/usr/bin" \ - MODULE_PATH="${baselibdir}/modules" \ - install - - newinitd "${FILESDIR}/anope-init.d" anope - newconfd "${FILESDIR}/anope-conf.d" anope - - dodoc Changes Changes.conf Changes.lang Changes.mysql docs/* data/example.conf - use mysql && dodoc data/tables.sql - - insinto /etc/anope - newins data/example.conf services.conf -} - -pkg_preinst() { - if has_version net-irc/anope ; then - local directory - directory="${ROOT}"var/lib/anope/pre-update - elog "Making a backup of your databases to ${directory}" - if [ ! -d "${directory}" ]; then - mkdir -p "${directory}" || die "failed to create backup directory" - chown anope:anope "${directory}"/../ || die "failed to chown data directory" - fi - # don't die otherwise merge will fail if there are no existing databases - cp "${ROOT}"/var/lib/anope/*.db "${directory}" - fi -} - -pkg_postinst() { - echo - ewarn "Anope won't run out of the box, you still have to configure it to match your IRCD's configuration." - ewarn "Edit /etc/anope/services.conf to configure Anope." - - if use mysql; then - echo - ewarn "!!! ATTENTION !!!" - ewarn "Be sure to read Changes.mysql to update your MySQL" - ewarn "tables or anope will break after restart" - ewarn "!!! ATTENTION !!!" - echo - einfo "The mysql script for updating the tables is located in the" - einfo "/usr/share/doc/${PF} directory" - fi -} diff --git a/net-irc/anope/files/anope-init.d b/net-irc/anope/files/anope-init.d index a7a529626dd5..66e6ecf11a8c 100644 --- a/net-irc/anope/files/anope-init.d +++ b/net-irc/anope/files/anope-init.d @@ -1,33 +1,34 @@ #!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/files/anope-init.d,v 1.1 2011/12/28 20:25:48 gurligebis Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/anope/files/anope-init.d,v 1.2 2013/02/18 08:25:51 gurligebis Exp $ + +PIDFILE=/run/anope/services.pid extra_started_commands="reload" -depend() { - use net mysql ircd - provide irc-services +start_pre() { + checkpath -o ${ANOPE_USER} -d "$(dirname $PIDFILE)" } start() { ebegin "Starting Anope IRC Services" start-stop-daemon --start --exec /usr/bin/services \ - --user ${ANOPE_USER} --pidfile /var/run/anope/services.pid \ + --user ${ANOPE_USER} --pidfile ${PIDFILE} \ -- ${ANOPE_OPTS} eend $? } stop() { ebegin "Stopping Anope IRC Services" - start-stop-daemon --stop --pidfile /var/run/anope/services.pid + start-stop-daemon --stop --pidfile ${PIDFILE} eend $? } reload() { ebegin "Reloading Anope IRC Services" start-stop-daemon --signal USR2 --exec /usr/bin/services \ - --pidfile /var/run/anope/services.pid + --pidfile ${PIDFILE} eend $? } -- cgit v1.2.3-65-gdbad