diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-irc/znc | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-irc/znc')
-rw-r--r-- | net-irc/znc/Manifest | 2 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.0-systemwideconfig.patch | 147 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.2-webadmin-correctly-handle-channel-names.patch | 73 | ||||
-rw-r--r-- | net-irc/znc/files/znc.confd | 7 | ||||
-rw-r--r-- | net-irc/znc/files/znc.initd | 39 | ||||
-rw-r--r-- | net-irc/znc/metadata.xml | 12 | ||||
-rw-r--r-- | net-irc/znc/znc-1.2-r1.ebuild | 167 | ||||
-rw-r--r-- | net-irc/znc/znc-1.4-r1.ebuild | 168 | ||||
-rw-r--r-- | net-irc/znc/znc-1.4.ebuild | 167 | ||||
-rw-r--r-- | net-irc/znc/znc-9999.ebuild | 167 |
10 files changed, 949 insertions, 0 deletions
diff --git a/net-irc/znc/Manifest b/net-irc/znc/Manifest new file mode 100644 index 000000000000..7ceadbc650a4 --- /dev/null +++ b/net-irc/znc/Manifest @@ -0,0 +1,2 @@ +DIST znc-1.2.tar.gz 1235150 SHA256 d9a2cd2a484ff23e6fc9cbde8dd8a43efbcd8d288afca7b1268914ca0d18701d SHA512 dff24e56127e5599d64b4c62de967d5d48d8ebf23ca8597d33bf0b3622640512db7a462bfa7c2031cd8307f402bab8efa345f6d1fc813e78eb0dcae581de3cf7 WHIRLPOOL b0810eb66e63be762f74f04eb2289e3634b18d6ecbd36d55f6a6772697e0397637d59b9ea01eaf62ef1cbe5f6e65b06432a254f4ada35194aa06b65c4a2f7994 +DIST znc-1.4.tar.gz 1239648 SHA256 86e98fd0ed182d39828c926809f8075d836ee3b70a6dd43dfbb434822f2a7b52 SHA512 0c33b05e8232084999812cbaa467dc7d37b80cafc1001b82e89c702b4303d8db9a27b948fe653e7090404eb1c66f5492f02f3524bc39efabade4be8bdb476671 WHIRLPOOL 420e665fa193b3f0284a070e021c4c467e3d40a0812eedeef9b2f65a6626a050b7af8bf15a754ac571d12261705832cfa18a0f7a7817cce96d220028a86230cf diff --git a/net-irc/znc/files/znc-1.0-systemwideconfig.patch b/net-irc/znc/files/znc-1.0-systemwideconfig.patch new file mode 100644 index 000000000000..336163dd6a0c --- /dev/null +++ b/net-irc/znc/files/znc-1.0-systemwideconfig.patch @@ -0,0 +1,147 @@ +diff --git a/include/znc/znc.h b/include/znc/znc.h +index 03be646..f493c83 100644 +--- a/include/znc/znc.h ++++ b/include/znc/znc.h +@@ -169,6 +169,8 @@ public: + + static void DumpConfig(const CConfig* Config); + ++ void SetSystemWideConfig(bool systemWideConfig); ++ + private: + CFile* InitPidFile(); + bool DoRehash(CString& sError); +@@ -209,6 +211,7 @@ protected: + unsigned int m_uiConnectPaused; + TCacheMap<CString> m_sConnectThrottle; + bool m_bProtectWebSessions; ++ bool m_bSystemWideConfig; + }; + + #endif // !_ZNC_H +diff --git a/src/main.cpp b/src/main.cpp +index a1f3904..4950911 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -10,6 +10,9 @@ + #include <znc/FileUtils.h> + #include <sys/wait.h> + #include <signal.h> ++#include <sys/types.h> ++#include <pwd.h> ++#include <grp.h> + + using std::cout; + using std::endl; +@@ -46,6 +49,7 @@ static const struct option g_LongOpts[] = { + { "makepass", no_argument, 0, 's' }, + { "makepem", no_argument, 0, 'p' }, + { "datadir", required_argument, 0, 'd' }, ++ { "system-wide-config-as", required_argument, 0, 'S' }, + { 0, 0, 0, 0 } + }; + +@@ -127,6 +131,8 @@ int main(int argc, char** argv) { + bool bMakeConf = false; + bool bMakePass = false; + bool bAllowRoot = false; ++ bool bSystemWideConfig = false; ++ CString sSystemWideConfigUser = "znc"; + bool bForeground = false; + #ifdef ALWAYS_RUN_IN_FOREGROUND + bForeground = true; +@@ -135,7 +141,7 @@ int main(int argc, char** argv) { + bool bMakePem = false; + #endif + +- while ((iArg = getopt_long(argc, argv, "hvnrcspd:Df", g_LongOpts, &iOptIndex)) != -1) { ++ while ((iArg = getopt_long(argc, argv, "hvnrcspd:DfS:", g_LongOpts, &iOptIndex)) != -1) { + switch (iArg) { + case 'h': + GenerateHelp(argv[0]); +@@ -153,6 +159,10 @@ int main(int argc, char** argv) { + case 'c': + bMakeConf = true; + break; ++ case 'S': ++ bSystemWideConfig = true; ++ sSystemWideConfigUser = optarg; ++ break; + case 's': + bMakePass = true; + break; +@@ -187,8 +197,36 @@ int main(int argc, char** argv) { + return 1; + } + ++ if (bSystemWideConfig && getuid() == 0) { ++ struct passwd *pwd; ++ ++ pwd = getpwnam(sSystemWideConfigUser.c_str()); ++ if (pwd == NULL) { ++ CUtils::PrintError("Daemon user not found."); ++ return 1; ++ } ++ ++ if ((long) pwd->pw_uid == 0) { ++ CUtils::PrintError("Please define a daemon user other than root."); ++ return 1; ++ } ++ if (setgroups(0, NULL) != 0) { ++ CUtils::PrintError("setgroups: Unable to clear supplementary group IDs"); ++ return 1; ++ } ++ if (setgid((long) pwd->pw_gid) != 0) { ++ CUtils::PrintError("setgid: Unable to drop group privileges"); ++ return 1; ++ } ++ if (setuid((long) pwd->pw_uid) != 0) { ++ CUtils::PrintError("setuid: Unable to drop user privileges"); ++ return 1; ++ } ++ } ++ + CZNC* pZNC = &CZNC::Get(); + pZNC->InitDirs(((argc) ? argv[0] : ""), sDataDir); ++ pZNC->SetSystemWideConfig(bSystemWideConfig); + + #ifdef HAVE_LIBSSL + if (bMakePem) { +@@ -229,7 +267,7 @@ int main(int argc, char** argv) { + CUtils::PrintStatus(true, ""); + } + +- if (isRoot()) { ++ if (isRoot() && !bSystemWideConfig) { + CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid"); + CUtils::PrintError("reasons for this and it can, in theory, cause great damage!"); + if (!bAllowRoot) { +diff --git a/src/znc.cpp b/src/znc.cpp +index 9469790..297b021 100644 +--- a/src/znc.cpp ++++ b/src/znc.cpp +@@ -47,6 +47,7 @@ CZNC::CZNC() { + m_sConnectThrottle.SetTTL(30000); + m_pLockFile = NULL; + m_bProtectWebSessions = true; ++ m_bSystemWideConfig = false; + } + + CZNC::~CZNC() { +@@ -952,7 +953,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { + CUtils::PrintMessage(""); + + File.UnLock(); +- return bFileOpen && CUtils::GetBoolInput("Launch ZNC now?", true); ++ return bFileOpen && !m_bSystemWideConfig && CUtils::GetBoolInput("Launch ZNC now?", true); + } + + size_t CZNC::FilterUncommonModules(set<CModInfo>& ssModules) { +@@ -1971,3 +1972,7 @@ void CZNC::LeakConnectQueueTimer(CConnectQueueTimer *pTimer) { + bool CZNC::WaitForChildLock() { + return m_pLockFile && m_pLockFile->ExLock(); + } ++ ++void CZNC::SetSystemWideConfig(bool systemWideConfig) { ++ m_bSystemWideConfig = systemWideConfig; ++} diff --git a/net-irc/znc/files/znc-1.2-webadmin-correctly-handle-channel-names.patch b/net-irc/znc/files/znc-1.2-webadmin-correctly-handle-channel-names.patch new file mode 100644 index 000000000000..93705f77ecb3 --- /dev/null +++ b/net-irc/znc/files/znc-1.2-webadmin-correctly-handle-channel-names.patch @@ -0,0 +1,73 @@ +https://bugs.gentoo.org/show_bug.cgi?id=507794 + +From 5e6e3be32acfeadeaf1fb3bb17bada08aec6432f Mon Sep 17 00:00:00 2001 +From: Uli Schlachter <psychon@znc.in> +Date: Sun, 13 Apr 2014 20:36:55 +0200 +Subject: [PATCH] webadmin/add channel: Correctly handle channel names + +The CChan constructor makes sure that the channel name begins with a valid +channel prefix. Thus, this could change the name of the resulting channel. + +When you edited an irc network which already had a channel "#foo", were +connected to IRC (so ZNC knows which prefixes are valid) and added a channel +"foo", this would lead to a problem: + +Webadmin checks and sees that there is no channel "foo" yet. Webadmin creates a +new CChan instance for "foo". The CChan constructor notices that "f" is not a +valid channel prefix and instead calls itself "#foo". Then, +CIRCNetwork::AddChan() would see that this channel already exists, delete the +given channel and return false. + +However, webadmin didn't check this result and would continue changing settings +on an already destroyed CChan instance. + +Fix this by checking if the channel exists after CChan had its chance to mess +with the channel name. Also handle failures from CIRCNetwork::AddChan(). + +Fixes #528. + +Signed-off-by: Uli Schlachter <psychon@znc.in> +--- + modules/webadmin.cpp | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp +index 40a28d3..90ddfd2 100644 +--- a/modules/webadmin.cpp ++++ b/modules/webadmin.cpp +@@ -668,13 +668,19 @@ class CWebAdminMod : public CModule { + return true; + } + +- if (pNetwork->FindChan(sChanName.Token(0))) { +- WebSock.PrintErrorPage("Channel [" + sChanName.Token(0) + "] already exists"); ++ // This could change the channel name and e.g. add a "#" prefix ++ pChan = new CChan(sChanName, pNetwork, true); ++ ++ if (pNetwork->FindChan(pChan->GetName())) { ++ WebSock.PrintErrorPage("Channel [" + pChan->GetName() + "] already exists"); ++ delete pChan; + return true; + } + +- pChan = new CChan(sChanName, pNetwork, true); +- pNetwork->AddChan(pChan); ++ if (!pNetwork->AddChan(pChan)) { ++ WebSock.PrintErrorPage("Could not add channel [" + pChan->GetName() + "]"); ++ return true; ++ } + } + + pChan->SetBufferCount(WebSock.GetParam("buffercount").ToUInt(), spSession->IsAdmin()); +@@ -700,7 +706,7 @@ class CWebAdminMod : public CModule { + + CTemplate TmplMod; + TmplMod["User"] = pUser->GetUserName(); +- TmplMod["ChanName"] = sChanName; ++ TmplMod["ChanName"] = pChan->GetName(); + TmplMod["WebadminAction"] = "change"; + FOR_EACH_MODULE(it, pNetwork) { + (*it)->OnEmbeddedWebRequest(WebSock, "webadmin/channel", TmplMod); +-- +1.9.1 + diff --git a/net-irc/znc/files/znc.confd b/net-irc/znc/files/znc.confd new file mode 100644 index 000000000000..9681f8d792fb --- /dev/null +++ b/net-irc/znc/files/znc.confd @@ -0,0 +1,7 @@ +# /etc/conf.d/znc + +# Location of the znc configuration folder +ZNC_CONF="/var/lib/znc" + +# User to run znc as +ZNC_USER="znc" diff --git a/net-irc/znc/files/znc.initd b/net-irc/znc/files/znc.initd new file mode 100644 index 000000000000..f0825a1e9024 --- /dev/null +++ b/net-irc/znc/files/znc.initd @@ -0,0 +1,39 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +extra_commands="config" +extra_started_commands="reload save" + +depend() { + need net +} + +start() { + ebegin "Starting ZNC" + start-stop-daemon --start --user ${ZNC_USER} --name znc \ + --exec /usr/bin/znc -- -d ${ZNC_CONF} + eend $? +} + +stop() { + ebegin "Stopping ZNC" + start-stop-daemon --signal SIGINT --name znc \ + --exec /usr/bin/znc -- -d ${ZNC_CONF} + eend $? +} + +reload() { + ebegin "Reloading ZNC Configuration File from Disk" + start-stop-daemon --signal SIGHUP --name znc \ + --exec /usr/bin/znc -- -d ${ZNC_CONF} + eend $? +} + +save() { + ebegin "Saving ZNC Configuration File to Disk" + start-stop-daemon --signal SIGUSR1 --name znc \ + --exec /usr/bin/znc -- -d ${ZNC_CONF} + eend $? +} diff --git a/net-irc/znc/metadata.xml b/net-irc/znc/metadata.xml new file mode 100644 index 000000000000..b37157dfe4de --- /dev/null +++ b/net-irc/znc/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>net-irc</herd> +<maintainer> + <email>wired@gentoo.org</email> + <name>Alex Alexander</name> +</maintainer> +<use> + <flag name="daemon">Allow znc to run as a system-wide service. Installs an init script and creates a znc user:group.</flag> +</use> +</pkgmetadata> diff --git a/net-irc/znc/znc-1.2-r1.ebuild b/net-irc/znc/znc-1.2-r1.ebuild new file mode 100644 index 000000000000..b8acfc2b11ed --- /dev/null +++ b/net-irc/znc/znc-1.2-r1.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python3_3 ) +inherit base python-single-r1 user + +MY_PV=${PV/_/-} +DESCRIPTION="An advanced IRC Bouncer" + +if [[ ${PV} == *9999* ]]; then + inherit git-2 + EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"} + SRC_URI="" + KEYWORDS="" +else + SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz" + KEYWORDS="amd64 ~arm x86" +fi + +HOMEPAGE="http://znc.in" +LICENSE="GPL-2" +SLOT="0" +IUSE="daemon debug ipv6 perl python ssl sasl tcl" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + perl? ( >=dev-lang/perl-5.10 ) + python? ( ${PYTHON_DEPS} ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( >=dev-libs/openssl-0.9.7d:0 ) + tcl? ( dev-lang/tcl:0= ) +" +DEPEND=" + virtual/pkgconfig + perl? ( dev-lang/swig ) + python? ( + >=dev-lang/swig-2.0.8 + ) + ${RDEPEND} +" + +S=${WORKDIR}/${PN}-${MY_PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.0-systemwideconfig.patch" + "${FILESDIR}/${P}-webadmin-correctly-handle-channel-names.patch" +) + +CONFDIR="/var/lib/znc" + +pkg_setup() { + if use python; then + python-single-r1_pkg_setup + fi + if use daemon; then + enewgroup ${PN} + enewuser ${PN} -1 -1 /dev/null ${PN} + fi +} + +src_prepare() { + if [[ ${PV} == *9999* ]]; then + ./autogen.sh + fi + + base_src_prepare +} + +src_configure() { + econf \ + $(use_enable debug) \ + $(use_enable ipv6) \ + $(use_enable perl) \ + $(use python && echo "--enable-python=python3") \ + $(use_enable sasl cyrus) \ + $(use_enable ssl openssl) \ + $(use_enable tcl tcl) +} + +src_install() { + emake install DESTDIR="${D}" + dodoc NOTICE README.md + if use daemon; then + newinitd "${FILESDIR}"/znc.initd znc + newconfd "${FILESDIR}"/znc.confd znc + fi +} + +pkg_postinst() { + if use !daemon; then + elog + elog "Run 'znc --makeconf' as the user you want to run ZNC as" + elog "to make a configuration file" + elog "If you are using SSL you should also run 'znc --makepem'" + elog + else + elog + elog "An init-script was installed in /etc/init.d" + elog "A config file was installed in /etc/conf.d" + if [[ ! -d "${EROOT}${CONFDIR}" ]]; then + elog + elog "Run 'emerge --config znc' to configure ZNC" + elog "as a system-wide daemon." + elog + elog "If you are using SSL you should also run:" + elog " znc --system-wide-config-as znc --makepem -d ${CONFDIR}" + elog "as root" + elog + elog "If migrating from a user-based install" + elog "you can use your existing config files:" + elog " mkdir ${CONFDIR}" + elog " mv /home/\$USER/.znc/* ${CONFDIR}" + elog " rm -rf /home/\$USER/.znc" + elog " chown -R znc:znc ${CONFDIR}" + elog + elog "If you already have znc set up and want take advantage of the" + elog "init script but skip of all the above, you can also edit" + elog " /etc/conf.d/znc" + elog "and adjust the variables to your current znc user and config" + elog "location." + if [[ -d "${EROOT}"/etc/znc ]]; then + elog + ewarn "/etc/znc exists on your system." + ewarn "Due to the nature of the contents of that folder," + ewarn "we have changed the default configuration to use" + ewarn " /var/lib/znc" + ewarn "please move /etc/znc to /var/lib/znc" + ewarn "or adjust /etc/conf.d/znc" + fi + else + elog "Existing config detected in ${CONFDIR}" + elog "You're good to go :)" + fi + elog + fi +} + +pkg_config() { + if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then + einfo "Press ENTER to interactively create a new configuration file for znc." + einfo "To abort, press Control-C" + read + mkdir -p "${EROOT}${CONFDIR}" || die + chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" || + die "Setting permissions failed" + "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" || + die "Config failed" + echo + einfo "To start znc, run '/etc/init.d/znc start'" + einfo "or add znc to a runlevel:" + einfo " rc-update add znc default" + else + if use daemon; then + ewarn "${CONFDIR} already exists, aborting to avoid damaging" + ewarn "any existing configuration. If you are sure you want" + ewarn "to generate a new configuration, remove the folder" + ewarn "and try again." + else + ewarn "To configure znc as a system-wide daemon you have to" + ewarn "enable the 'daemon' use flag." + fi + fi +} diff --git a/net-irc/znc/znc-1.4-r1.ebuild b/net-irc/znc/znc-1.4-r1.ebuild new file mode 100644 index 000000000000..ef3446ed05e8 --- /dev/null +++ b/net-irc/znc/znc-1.4-r1.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{3_3,3_4} ) +inherit base python-single-r1 systemd user + +MY_PV=${PV/_/-} +DESCRIPTION="An advanced IRC Bouncer" + +if [[ ${PV} == *9999* ]]; then + inherit git-2 + EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"} + SRC_URI="" + KEYWORDS="" +else + SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz" + KEYWORDS="amd64 ~arm ~x86" +fi + +HOMEPAGE="http://znc.in" +LICENSE="GPL-2" +SLOT="0" +IUSE="daemon debug ipv6 perl python ssl sasl tcl" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + perl? ( >=dev-lang/perl-5.10 ) + python? ( ${PYTHON_DEPS} ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( >=dev-libs/openssl-0.9.7d:0 ) + tcl? ( dev-lang/tcl:0= ) +" +DEPEND=" + virtual/pkgconfig + perl? ( + >=dev-lang/swig-2.0.12 + ) + python? ( + >=dev-lang/swig-2.0.12 + ) + ${RDEPEND} +" + +S=${WORKDIR}/${PN}-${MY_PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.0-systemwideconfig.patch" +) + +CONFDIR="/var/lib/znc" + +pkg_setup() { + if use python; then + python-single-r1_pkg_setup + fi + if use daemon; then + enewgroup ${PN} + enewuser ${PN} -1 -1 /dev/null ${PN} + fi +} + +src_prepare() { + if [[ ${PV} == *9999* ]]; then + ./autogen.sh + fi + + base_src_prepare +} + +src_configure() { + econf \ + --with-systemdsystemunitdir=$(systemd_get_unitdir) \ + $(use_enable debug) \ + $(use_enable ipv6) \ + $(use_enable perl) \ + $(use python && echo "--enable-python=python3") \ + $(use_enable sasl cyrus) \ + $(use_enable ssl openssl) \ + $(use_enable tcl tcl) +} + +src_install() { + emake install DESTDIR="${D}" + dodoc NOTICE README.md + if use daemon; then + newinitd "${FILESDIR}"/znc.initd znc + newconfd "${FILESDIR}"/znc.confd znc + fi +} + +pkg_postinst() { + if use !daemon; then + elog + elog "Run 'znc --makeconf' as the user you want to run ZNC as" + elog "to make a configuration file" + elog + else + elog + elog "An init-script was installed in /etc/init.d" + elog "A config file was installed in /etc/conf.d" + if [[ ! -d "${EROOT}${CONFDIR}" ]]; then + elog + elog "Run 'emerge --config znc' to configure ZNC" + elog "as a system-wide daemon." + elog + elog "To generate a new SSL certificate, run:" + elog " znc --system-wide-config-as znc --makepem -d ${CONFDIR}" + elog "as root" + elog + elog "If migrating from a user-based install" + elog "you can use your existing config files:" + elog " mkdir ${CONFDIR}" + elog " mv /home/\$USER/.znc/* ${CONFDIR}" + elog " rm -rf /home/\$USER/.znc" + elog " chown -R znc:znc ${CONFDIR}" + elog + elog "If you already have znc set up and want take advantage of the" + elog "init script but skip of all the above, you can also edit" + elog " /etc/conf.d/znc" + elog "and adjust the variables to your current znc user and config" + elog "location." + if [[ -d "${EROOT}"/etc/znc ]]; then + elog + ewarn "/etc/znc exists on your system." + ewarn "Due to the nature of the contents of that folder," + ewarn "we have changed the default configuration to use" + ewarn " /var/lib/znc" + ewarn "please move /etc/znc to /var/lib/znc" + ewarn "or adjust /etc/conf.d/znc" + fi + else + elog "Existing config detected in ${CONFDIR}" + elog "You're good to go :)" + fi + elog + fi +} + +pkg_config() { + if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then + einfo "Press ENTER to interactively create a new configuration file for znc." + einfo "To abort, press Control-C" + read + mkdir -p "${EROOT}${CONFDIR}" || die + chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" || + die "Setting permissions failed" + "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" || + die "Config failed" + echo + einfo "To start znc, run '/etc/init.d/znc start'" + einfo "or add znc to a runlevel:" + einfo " rc-update add znc default" + else + if use daemon; then + ewarn "${CONFDIR} already exists, aborting to avoid damaging" + ewarn "any existing configuration. If you are sure you want" + ewarn "to generate a new configuration, remove the folder" + ewarn "and try again." + else + ewarn "To configure znc as a system-wide daemon you have to" + ewarn "enable the 'daemon' use flag." + fi + fi +} diff --git a/net-irc/znc/znc-1.4.ebuild b/net-irc/znc/znc-1.4.ebuild new file mode 100644 index 000000000000..bcc2710ed30e --- /dev/null +++ b/net-irc/znc/znc-1.4.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python3_3 ) +inherit base python-single-r1 user + +MY_PV=${PV/_/-} +DESCRIPTION="An advanced IRC Bouncer" + +if [[ ${PV} == *9999* ]]; then + inherit git-2 + EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"} + SRC_URI="" + KEYWORDS="" +else + SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz" + KEYWORDS="~amd64 ~arm ~x86" +fi + +HOMEPAGE="http://znc.in" +LICENSE="GPL-2" +SLOT="0" +IUSE="daemon debug ipv6 perl python ssl sasl tcl" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + perl? ( >=dev-lang/perl-5.10 ) + python? ( ${PYTHON_DEPS} ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( >=dev-libs/openssl-0.9.7d:0 ) + tcl? ( dev-lang/tcl:0= ) +" +DEPEND=" + virtual/pkgconfig + perl? ( + >=dev-lang/swig-2.0.12 + ) + python? ( + >=dev-lang/swig-2.0.12 + ) + ${RDEPEND} +" + +S=${WORKDIR}/${PN}-${MY_PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.0-systemwideconfig.patch" +) + +CONFDIR="/var/lib/znc" + +pkg_setup() { + if use python; then + python-single-r1_pkg_setup + fi + if use daemon; then + enewgroup ${PN} + enewuser ${PN} -1 -1 /dev/null ${PN} + fi +} + +src_prepare() { + if [[ ${PV} == *9999* ]]; then + ./autogen.sh + fi + + base_src_prepare +} + +src_configure() { + econf \ + $(use_enable debug) \ + $(use_enable ipv6) \ + $(use_enable perl) \ + $(use python && echo "--enable-python=python3") \ + $(use_enable sasl cyrus) \ + $(use_enable ssl openssl) \ + $(use_enable tcl tcl) +} + +src_install() { + emake install DESTDIR="${D}" + dodoc NOTICE README.md + if use daemon; then + newinitd "${FILESDIR}"/znc.initd znc + newconfd "${FILESDIR}"/znc.confd znc + fi +} + +pkg_postinst() { + if use !daemon; then + elog + elog "Run 'znc --makeconf' as the user you want to run ZNC as" + elog "to make a configuration file" + elog + else + elog + elog "An init-script was installed in /etc/init.d" + elog "A config file was installed in /etc/conf.d" + if [[ ! -d "${EROOT}${CONFDIR}" ]]; then + elog + elog "Run 'emerge --config znc' to configure ZNC" + elog "as a system-wide daemon." + elog + elog "To generate a new SSL certificate, run:" + elog " znc --system-wide-config-as znc --makepem -d ${CONFDIR}" + elog "as root" + elog + elog "If migrating from a user-based install" + elog "you can use your existing config files:" + elog " mkdir ${CONFDIR}" + elog " mv /home/\$USER/.znc/* ${CONFDIR}" + elog " rm -rf /home/\$USER/.znc" + elog " chown -R znc:znc ${CONFDIR}" + elog + elog "If you already have znc set up and want take advantage of the" + elog "init script but skip of all the above, you can also edit" + elog " /etc/conf.d/znc" + elog "and adjust the variables to your current znc user and config" + elog "location." + if [[ -d "${EROOT}"/etc/znc ]]; then + elog + ewarn "/etc/znc exists on your system." + ewarn "Due to the nature of the contents of that folder," + ewarn "we have changed the default configuration to use" + ewarn " /var/lib/znc" + ewarn "please move /etc/znc to /var/lib/znc" + ewarn "or adjust /etc/conf.d/znc" + fi + else + elog "Existing config detected in ${CONFDIR}" + elog "You're good to go :)" + fi + elog + fi +} + +pkg_config() { + if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then + einfo "Press ENTER to interactively create a new configuration file for znc." + einfo "To abort, press Control-C" + read + mkdir -p "${EROOT}${CONFDIR}" || die + chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" || + die "Setting permissions failed" + "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" || + die "Config failed" + echo + einfo "To start znc, run '/etc/init.d/znc start'" + einfo "or add znc to a runlevel:" + einfo " rc-update add znc default" + else + if use daemon; then + ewarn "${CONFDIR} already exists, aborting to avoid damaging" + ewarn "any existing configuration. If you are sure you want" + ewarn "to generate a new configuration, remove the folder" + ewarn "and try again." + else + ewarn "To configure znc as a system-wide daemon you have to" + ewarn "enable the 'daemon' use flag." + fi + fi +} diff --git a/net-irc/znc/znc-9999.ebuild b/net-irc/znc/znc-9999.ebuild new file mode 100644 index 000000000000..57071fa620e6 --- /dev/null +++ b/net-irc/znc/znc-9999.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{3_3,3_4} ) +inherit base python-single-r1 user + +MY_PV=${PV/_/-} +DESCRIPTION="An advanced IRC Bouncer" + +if [[ ${PV} == *9999* ]]; then + inherit git-2 + EGIT_REPO_URI=${EGIT_REPO_URI:-"git://github.com/znc/znc.git"} + SRC_URI="" + KEYWORDS="" +else + SRC_URI="http://znc.in/releases/${PN}-${MY_PV}.tar.gz" + KEYWORDS="~amd64 ~arm ~x86" +fi + +HOMEPAGE="http://znc.in" +LICENSE="GPL-2" +SLOT="0" +IUSE="daemon debug ipv6 perl python ssl sasl tcl" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + perl? ( >=dev-lang/perl-5.10 ) + python? ( ${PYTHON_DEPS} ) + sasl? ( >=dev-libs/cyrus-sasl-2 ) + ssl? ( >=dev-libs/openssl-0.9.7d:0 ) + tcl? ( dev-lang/tcl:0= ) +" +DEPEND=" + virtual/pkgconfig + perl? ( + >=dev-lang/swig-2.0.12 + ) + python? ( + >=dev-lang/swig-2.0.12 + ) + ${RDEPEND} +" + +S=${WORKDIR}/${PN}-${MY_PV} + +PATCHES=( + "${FILESDIR}/${PN}-1.0-systemwideconfig.patch" +) + +CONFDIR="/var/lib/znc" + +pkg_setup() { + if use python; then + python-single-r1_pkg_setup + fi + if use daemon; then + enewgroup ${PN} + enewuser ${PN} -1 -1 /dev/null ${PN} + fi +} + +src_prepare() { + if [[ ${PV} == *9999* ]]; then + ./autogen.sh + fi + + base_src_prepare +} + +src_configure() { + econf \ + $(use_enable debug) \ + $(use_enable ipv6) \ + $(use_enable perl) \ + $(use python && echo "--enable-python=python3") \ + $(use_enable sasl cyrus) \ + $(use_enable ssl openssl) \ + $(use_enable tcl tcl) +} + +src_install() { + emake install DESTDIR="${D}" + dodoc NOTICE README.md + if use daemon; then + newinitd "${FILESDIR}"/znc.initd znc + newconfd "${FILESDIR}"/znc.confd znc + fi +} + +pkg_postinst() { + if use !daemon; then + elog + elog "Run 'znc --makeconf' as the user you want to run ZNC as" + elog "to make a configuration file" + elog + else + elog + elog "An init-script was installed in /etc/init.d" + elog "A config file was installed in /etc/conf.d" + if [[ ! -d "${EROOT}${CONFDIR}" ]]; then + elog + elog "Run 'emerge --config znc' to configure ZNC" + elog "as a system-wide daemon." + elog + elog "To generate a new SSL certificate, run:" + elog " znc --system-wide-config-as znc --makepem -d ${CONFDIR}" + elog "as root" + elog + elog "If migrating from a user-based install" + elog "you can use your existing config files:" + elog " mkdir ${CONFDIR}" + elog " mv /home/\$USER/.znc/* ${CONFDIR}" + elog " rm -rf /home/\$USER/.znc" + elog " chown -R znc:znc ${CONFDIR}" + elog + elog "If you already have znc set up and want take advantage of the" + elog "init script but skip of all the above, you can also edit" + elog " /etc/conf.d/znc" + elog "and adjust the variables to your current znc user and config" + elog "location." + if [[ -d "${EROOT}"/etc/znc ]]; then + elog + ewarn "/etc/znc exists on your system." + ewarn "Due to the nature of the contents of that folder," + ewarn "we have changed the default configuration to use" + ewarn " /var/lib/znc" + ewarn "please move /etc/znc to /var/lib/znc" + ewarn "or adjust /etc/conf.d/znc" + fi + else + elog "Existing config detected in ${CONFDIR}" + elog "You're good to go :)" + fi + elog + fi +} + +pkg_config() { + if use daemon && ! [[ -d "${EROOT}${CONFDIR}" ]]; then + einfo "Press ENTER to interactively create a new configuration file for znc." + einfo "To abort, press Control-C" + read + mkdir -p "${EROOT}${CONFDIR}" || die + chown -R ${PN}:${PN} "${EROOT}${CONFDIR}" || + die "Setting permissions failed" + "${EROOT}"/usr/bin/znc --system-wide-config-as znc -c -r -d "${EROOT}${CONFDIR}" || + die "Config failed" + echo + einfo "To start znc, run '/etc/init.d/znc start'" + einfo "or add znc to a runlevel:" + einfo " rc-update add znc default" + else + if use daemon; then + ewarn "${CONFDIR} already exists, aborting to avoid damaging" + ewarn "any existing configuration. If you are sure you want" + ewarn "to generate a new configuration, remove the folder" + ewarn "and try again." + else + ewarn "To configure znc as a system-wide daemon you have to" + ewarn "enable the 'daemon' use flag." + fi + fi +} |