diff options
Diffstat (limited to 'net-irc/anope')
-rw-r--r-- | net-irc/anope/Manifest | 1 | ||||
-rw-r--r-- | net-irc/anope/anope-1.8.7-r1.ebuild | 120 | ||||
-rw-r--r-- | net-irc/anope/files/anope-1.8.7-ldflags-fix.patch | 47 | ||||
-rw-r--r-- | net-irc/anope/files/anope-1.8.7-libdir-gentoo.patch | 91 | ||||
-rw-r--r-- | net-irc/anope/files/anope-1.8.7-mariadb.patch | 109 | ||||
-rw-r--r-- | net-irc/anope/files/anope-conf.d | 9 | ||||
-rw-r--r-- | net-irc/anope/files/anope-init.d | 34 | ||||
-rw-r--r-- | net-irc/anope/files/pid-patch.diff | 11 | ||||
-rw-r--r-- | net-irc/anope/metadata.xml | 13 |
9 files changed, 435 insertions, 0 deletions
diff --git a/net-irc/anope/Manifest b/net-irc/anope/Manifest new file mode 100644 index 000000000000..f40a60829509 --- /dev/null +++ b/net-irc/anope/Manifest @@ -0,0 +1 @@ +DIST anope-1.8.7.tar.gz 1586164 SHA256 804516153936b1147a79960a283229191d29e1d9162c3ec70d86d099ee04447b SHA512 3fb67f73b8f4dbdfbb9b4ac41a20e3b5c46d54cf5abb303f4a25d3a5863ef860ba5bdffc67439e5f1435675f80f86b2c283932c1a05edde2ae49612947fbd074 WHIRLPOOL 347231e1a9be8bfd9f09a895af5ede179a24c1ac56cefbfb0fb343ea060497f2985e9cc2fd368857e58ea919751fde1c10bef1f02333f989928c7504314c0f13 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..95b969e5687a --- /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 +# $Id$ + +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/anope /var/lib/anope/backups + fowners anope:anope /var/{lib,log}/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-1.8.7-ldflags-fix.patch b/net-irc/anope/files/anope-1.8.7-ldflags-fix.patch new file mode 100644 index 000000000000..98500509693b --- /dev/null +++ b/net-irc/anope/files/anope-1.8.7-ldflags-fix.patch @@ -0,0 +1,47 @@ +diff -aurp a/src/core/Makefile b/src/core/Makefile +--- a/src/core/Makefile 2010-10-10 19:55:31.396999906 +0000 ++++ b/src/core/Makefile 2010-10-10 19:53:54.877001245 +0000 +@@ -24,7 +24,7 @@ distclean: spotless + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< + + .o.s: +- $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} ++ $(CC) $(CFLAGS) $(LDFLAGS) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} + @$(TOUCH) $*.s + + subs: +diff -aurp a/src/modules/Makefile b/src/modules/Makefile +--- a/src/modules/Makefile 2010-10-10 19:55:32.486000023 +0000 ++++ b/src/modules/Makefile 2010-10-10 19:54:07.240000026 +0000 +@@ -27,7 +27,7 @@ distclean: spotless + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< + + .o.s: +- $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} ++ $(CC) $(CFLAGS) $(LDFLAGS) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} + @$(TOUCH) $*.s + + subs: +diff -aurp a/src/protocol/Makefile b/src/protocol/Makefile +--- a/src/protocol/Makefile 2010-10-10 19:55:33.605002302 +0000 ++++ b/src/protocol/Makefile 2010-10-10 19:54:19.271997806 +0000 +@@ -24,7 +24,7 @@ distclean: clean spotless + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< + + .o.s: +- $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} ++ $(CC) $(CFLAGS) $(LDFLAGS) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} + @$(TOUCH) $*.s + + subs: +--- a/src/tools/Makefile 2011-12-28 20:00:00.646427623 +0000 ++++ b/src/tools/Makefile 2011-12-28 20:00:41.030430806 +0000 +@@ -10,7 +10,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' + 'RUNGROUP=${RUNGROUP}' + + .c.o: +- $(CC) $(CFLAGS) -I../include/ $< -o $* ++ $(CC) $(LDFLAGS) $(CFLAGS) -I../include/ $< -o $* + + all: ${OBJS} + diff --git a/net-irc/anope/files/anope-1.8.7-libdir-gentoo.patch b/net-irc/anope/files/anope-1.8.7-libdir-gentoo.patch new file mode 100644 index 000000000000..7a86d0f517b9 --- /dev/null +++ b/net-irc/anope/files/anope-1.8.7-libdir-gentoo.patch @@ -0,0 +1,91 @@ +--- configure.in ++++ configure.in +@@ -286,6 +286,15 @@ + ]) + + AC_SUBST(DATDEST) ++ ++AC_ARG_WITH(libdir, [ --with-libdir=libdir Specify the location of the services lib folder], [ ++ AC_DEFINE_UNQUOTED(LIB_DIR,"$withval","services lib dir") ++ AC_DEFINE_UNQUOTED(MODULE_PATH,"${withval}/modules/","Module dir") ++ DATDEST=$withval ++ MODULE_PATH=${withval}/modules/ ++]) ++ ++AC_SUBST(LIB_PATH) + AC_SUBST(MODULE_PATH) + + AC_CONFIG_FILES( \ +--- src/Makefile ++++ src/Makefile +@@ -115,10 +115,6 @@ + ln $(BINDEST)/services $(BINDEST)/listnicks + ln $(BINDEST)/services $(BINDEST)/listchans + (cd ../lang ; $(MAKE) install) +- $(CP) ../data/* $(DATDEST) +- $(INSTALL) bin/mydbgen $(DATDEST)/mydbgen +- test -d $(DATDEST)/backups || mkdir $(DATDEST)/backups +- test -d $(DATDEST)/logs || mkdir $(DATDEST)/logs + @if [ "$(MODULE_PATH)" ] ; then \ + test -d ${MODULE_PATH} || mkdir ${MODULE_PATH} ; \ + test -d ${MODULE_PATH}/runtime || mkdir ${MODULE_PATH}/runtime ; \ +--- include/sysconf.h.in ++++ include/sysconf.h.in +@@ -96,6 +96,9 @@ + /* "Module dir" */ + #undef MODULE_PATH + ++/* "Lib dir" */ ++#undef LIB_DIR ++ + /* "Has mysql/mysql.h" */ + #undef MYSQL_HEADER_PREFIX + +--- include/config.h ++++ include/config.h +@@ -22,10 +22,10 @@ + /******* General configuration *******/ + + /* Name of configuration file (in Services directory) */ +-#define SERVICES_CONF "services.conf" ++#define SERVICES_CONF "/etc/anope/services.conf" + + /* Name of log file (in Services directory) */ +-#define LOG_FILENAME "services.log" ++#define LOG_FILENAME "/var/log/anope/services.log" + + /* Maximum amount of data from/to the network to buffer (bytes). */ + #define NET_BUFSIZE 65536 +--- src/log.c ++++ src/log.c +@@ -33,7 +33,7 @@ + + /* fix bug 577 */ + strftime(timestamp, sizeof(timestamp), "%Y%m%d", tm); +- snprintf(name, count, "logs/%s.%s", log_filename, timestamp); ++ snprintf(name, count, "%s.%s", log_filename, timestamp); + curday = tm->tm_yday; + + return 1; +--- src/modules.c ++++ src/modules.c +@@ -2846,7 +2846,7 @@ + + + #ifndef _WIN32 +- snprintf(dirbuf, BUFSIZE, "%s/modules/runtime", services_dir); ++ snprintf(dirbuf, BUFSIZE, "%s/modules/runtime", LIB_DIR); + #else + snprintf(dirbuf, BUFSIZE, "\\%s", "modules/runtime"); + #endif +--- src/language.c ++++ src/language.c +@@ -71,7 +71,7 @@ + alog("debug: Loading language %d from file `languages/%s'", + index, filename); + } +- snprintf(buf, sizeof(buf), "languages/%s", filename); ++ snprintf(buf, sizeof(buf), "%s/languages/%s", LIB_DIR, filename); + #ifndef _WIN32 + if (!(f = fopen(buf, "r"))) { + #else diff --git a/net-irc/anope/files/anope-1.8.7-mariadb.patch b/net-irc/anope/files/anope-1.8.7-mariadb.patch new file mode 100644 index 000000000000..98a1b3634b6a --- /dev/null +++ b/net-irc/anope/files/anope-1.8.7-mariadb.patch @@ -0,0 +1,109 @@ +Author: Adam +Date: 2012-01-11 +Subject: Fix https://bugs.gentoo.org/381119 , where -I ordering causes + mariadb's services.h to be #include-ed improperly. + +diff --git a/src/Makefile b/src/Makefile +index 739c918..a9a2ee2 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -25,7 +25,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ + 'RDB=${RDB}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' + + .c.o: +- $(CC) $(CFLAGS) -I../include/ -c $< ++ $(CC) -I../include/ $(CFLAGS) -c $< + + all: services + +diff --git a/src/core/Makefile b/src/core/Makefile +index 4ec2754..32c049f 100644 +--- a/src/core/Makefile ++++ b/src/core/Makefile +@@ -21,7 +21,7 @@ install: + distclean: spotless + + .c.o: +- $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< ++ $(CC) -I../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + .o.s: + $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} +diff --git a/src/core/Makefile.sub b/src/core/Makefile.sub +index 9fbadf3..d93e6d5 100644 +--- a/src/core/Makefile.sub ++++ b/src/core/Makefile.sub +@@ -16,7 +16,7 @@ module: $(OBJECTS) so + distclean: spotless + + .c.o: +- $(CC) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< ++ $(CC) -I../ -I../../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + so: + $(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE} +diff --git a/src/modules/Makefile b/src/modules/Makefile +index cafbe45..bde65b3 100644 +--- a/src/modules/Makefile ++++ b/src/modules/Makefile +@@ -24,7 +24,7 @@ install: + distclean: spotless + + .c.o: +- $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< ++ $(CC) -I../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + .o.s: + $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} +diff --git a/src/modules/Makefile.sub b/src/modules/Makefile.sub +index 7697249..b7c244f 100644 +--- a/src/modules/Makefile.sub ++++ b/src/modules/Makefile.sub +@@ -16,7 +16,7 @@ module: $(OBJECTS) so + distclean: spotless + + .c.o: +- $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< ++ $(CC) -I../ -I../../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + so: + $(CC) ${SHARED} ../../mod_version.o $(OBJECTS) -o ../$(TARGET).so ${PROFILE} +diff --git a/src/protocol/Makefile b/src/protocol/Makefile +index ab837e4..d962d8b 100644 +--- a/src/protocol/Makefile ++++ b/src/protocol/Makefile +@@ -21,7 +21,7 @@ install: + distclean: clean spotless + + .c.o: +- $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< ++ $(CC) -I../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + .o.s: + $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE} +diff --git a/src/protocol/Makefile.sub b/src/protocol/Makefile.sub +index a2d6a41..d93e6d5 100644 +--- a/src/protocol/Makefile.sub ++++ b/src/protocol/Makefile.sub +@@ -16,7 +16,7 @@ module: $(OBJECTS) so + distclean: spotless + + .c.o: +- $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< ++ $(CC) -I../ -I../../${INCLUDEDIR} ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -c $< + + so: + $(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE} +diff --git a/src/tools/Makefile b/src/tools/Makefile +index 4dffbf0..87bd0ae 100644 +--- a/src/tools/Makefile ++++ b/src/tools/Makefile +@@ -10,7 +10,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ + 'RUNGROUP=${RUNGROUP}' + + .c.o: +- $(CC) $(LDFLAGS) $(CFLAGS) -I../include/ $< -o $* ++ $(CC) -I../include/ $(LDFLAGS) $(CFLAGS) $< -o $* + + all: ${OBJS} + diff --git a/net-irc/anope/files/anope-conf.d b/net-irc/anope/files/anope-conf.d new file mode 100644 index 000000000000..0aee1203d013 --- /dev/null +++ b/net-irc/anope/files/anope-conf.d @@ -0,0 +1,9 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# user to run ultimate-ircd as +ANOPE_USER="anope" + +# Additional commandline parameters +ANOPE_OPTS="" diff --git a/net-irc/anope/files/anope-init.d b/net-irc/anope/files/anope-init.d new file mode 100644 index 000000000000..6523007e93e5 --- /dev/null +++ b/net-irc/anope/files/anope-init.d @@ -0,0 +1,34 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +PIDFILE=/run/anope/services.pid + +extra_started_commands="reload" + +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 ${PIDFILE} \ + -- ${ANOPE_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Anope IRC Services" + start-stop-daemon --stop --pidfile ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading Anope IRC Services" + start-stop-daemon --signal USR2 --exec /usr/bin/services \ + --pidfile ${PIDFILE} + eend $? +} + diff --git a/net-irc/anope/files/pid-patch.diff b/net-irc/anope/files/pid-patch.diff new file mode 100644 index 000000000000..c92e1216be9c --- /dev/null +++ b/net-irc/anope/files/pid-patch.diff @@ -0,0 +1,11 @@ +--- data/example.conf.orig 2008-12-14 20:37:22.000000000 +0000 ++++ data/example.conf 2008-12-14 20:37:43.000000000 +0000 +@@ -285,7 +285,7 @@ HostServName "HostServ" "vHost Server" + # PIDFile <filename> [REQUIRED] + # Specifies the name of the file containing Services' process ID. + +-PIDFile services.pid ++PIDFile /var/run/anope/services.pid + + # MOTDFile <filename> [REQUIRED] + # Specifies the name of the Message of the Day file. diff --git a/net-irc/anope/metadata.xml b/net-irc/anope/metadata.xml new file mode 100644 index 000000000000..e180509b7d60 --- /dev/null +++ b/net-irc/anope/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>net-irc</herd> + <maintainer> + <email>gurligebis@gentoo.org</email> + <name>Bjarke Istrup Pedersen</name> + </maintainer> + <longdescription>Anope IRC Services</longdescription> + <upstream> + <remote-id type="sourceforge">anope</remote-id> + </upstream> +</pkgmetadata> |