ebuild for beta version of psybnc
This commit is contained in:
parent
bc57d77f91
commit
30552ac982
14
net-irc/psybnc/Manifest
Normal file
14
net-irc/psybnc/Manifest
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
AUX compile.diff 3231 RMD160 f484b2f3878c4a4da8033a23a26e7b0d75d93f3b SHA1 0bcf8a297512cc568718a1c569d0abbb2c800968 SHA256 e6b301659412519872948ee21958b97c57c21e248dae3d040cefcd61032764ee
|
||||||
|
AUX oidentd.conf.psybnc 92 RMD160 690ab54b796e4959d81a23d06dd194c7a4a081c2 SHA1 be9f023fe93250e44be3dc52b94c9d16a8d61bbf SHA256 0363f6f7c2b2a39dc2b1ee3e41596adf6209bf3e770e9e7c0f13a9f6787c50dc
|
||||||
|
AUX psybnc-2.4_beta1-config.h 661 RMD160 d4b10e6027ca0c23e1c6d74aeda9362c36b42fad SHA1 e712be0259827608995699aeb3786aa498d10dba SHA256 b4220b04eacd5013b80263f3ffe90103014a25fbbacd90cc411b9b4aea4967c1
|
||||||
|
AUX psybnc-2.4_beta1-ldflags-fix.patch 507 RMD160 a0f164f49919d6576154ef2f6d241e30b3e0ea5f SHA1 c8d68360a29e93115a70b6ca8d67eec59b9caa27 SHA256 7a879b655163e4724ad162e8e55e85a306e000316039b9d52a66d511ad902e44
|
||||||
|
AUX psybnc-2.4_beta1-multinetwork.patch 258 RMD160 bce9e8763def9e00b44deba705f2b8b8ff0b2c87 SHA1 398f5613a1f0ed4041436e5be411e587c0720b11 SHA256 7c8e6c3c6abd96cf28d135084b97eebc3bc7eba0dd7dc57931e055f6fcb1603e
|
||||||
|
AUX psybnc-2.4_beta1-oidentd.patch 237 RMD160 24cd04928d4fb503bbfbff13bad33a9475ca782c SHA1 7312415f50c9024b369d843d0b787cfc92b6ea7b SHA256 43593043db85bf3dc3f1a5162afd873ac079afcb0aff9520799b51f362a2e29f
|
||||||
|
AUX psybnc-2.4_beta1-scripting.patch 244 RMD160 13158cfa696af2fb41cecc9958fcd623f805864d SHA1 aa2bb6c40153f7e1d59b5300a3d6d4647c101c61 SHA256 393a51d8da1de671e77072728086dba215e968823a1d53a5371977c9b1419396
|
||||||
|
AUX psybnc-oidentd.initd 1050 RMD160 f56ebb0801f4193a8152a9cabd05bb2ed78b4b50 SHA1 f6e4c2f8b38d1c8b163ec991a0c683754abea4ac SHA256 3093578af23359e6f203defc49a15f3202f811d55ef239069ba2fce1eccd9d4f
|
||||||
|
AUX psybnc.conf 313 RMD160 446813d0753d5b6d3c7592bd90f83f821a993973 SHA1 f9149567abc499474f482ad46b34a16b5bf8dd90 SHA256 e4b04c86a4a1ed910b6cf21fa834eb1eeed166bb372cffbfe9674613f68a080f
|
||||||
|
AUX psybnc.confd 113 RMD160 106f0f680fcd5720ab7eead55b782a271627b81d SHA1 bb64a2eda5953fbdc39653c0612e26e5016dac78 SHA256 5077226f94b59e2e1874b0019d00375f17b73a77a25533275a59f18af6bf24f2
|
||||||
|
AUX psybnc.initd 1009 RMD160 415cc2b29e9fed2f64b671527583c0666c699121 SHA1 38599f1702c2c5d411ae099cb98b0acb647b5d66 SHA256 6ca56b5cdabae78d19710f46be0524bfd451866f7aae0a9c953cab28fde5fcbd
|
||||||
|
DIST psyBNC-2.4BETA1.tar.gz 1060774 RMD160 10b5382a3223fd66aa350fd672814582be8eab6c SHA1 cfa66cc38dbddcf1bd3119df69b0c686179dd64b SHA256 4008693dc0f73c97e60d56c3a353158c17c0b4a3ba40e904a6947106003861ff
|
||||||
|
EBUILD psybnc-2.4_beta1.ebuild 4713 RMD160 3a2bd6b826ed9409f3a3448b855be7825476fcdb SHA1 e41be6279195a5b1ebea973dea2d925f5e415281 SHA256 5f3b911d4573740ca8de15422784eb29f585a85d8ce703d12cdf4870a627d937
|
||||||
|
MISC metadata.xml 434 RMD160 537840e183c5f373de34945e2c9dd85a8d11f31d SHA1 7e0b9346ad755db7df3fb92cbfa3ed881cb4916e SHA256 05a81b5e976fd8855d5d3db9f6032cbf8735f931a4689dcb9008dbccbc060141
|
79
net-irc/psybnc/files/compile.diff
Normal file
79
net-irc/psybnc/files/compile.diff
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
diff -Naurp src/p_blowfish.c src/p_blowfish.c
|
||||||
|
--- src/p_blowfish.c 2007-02-26 12:16:53.000000000 +0000
|
||||||
|
+++ src/p_blowfish.c 2007-02-26 12:17:11.000000000 +0000
|
||||||
|
@@ -31,7 +31,7 @@ static char rcsid[] = "@(#)$Id: p_blowfi
|
||||||
|
#include <string.h>
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
-char *strmncpy(char *dest, char *source, size_t len);
|
||||||
|
+char *strmncpy(char *dest, const char *source, size_t len);
|
||||||
|
char *lngtxt(int msgnum);
|
||||||
|
|
||||||
|
#define pcontext { strmncpy(ctxt,__FILE__,sizeof(ctxt));strmncpy(cfunc,__FUNCTION__,sizeof(cfunc)); cline=__LINE__; }
|
||||||
|
diff -Naurp src/p_global.h src/p_global.h
|
||||||
|
--- src/p_global.h 2007-02-26 12:16:53.000000000 +0000
|
||||||
|
+++ src/p_global.h 2007-02-26 12:17:11.000000000 +0000
|
||||||
|
@@ -972,8 +972,8 @@ int checklogging(int usern);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef P_MEMORY
|
||||||
|
-unsigned long *__pmalloc(unsigned long size,char *module,char *function,int line);
|
||||||
|
-void _pfree(void * pointer,char *module, char *function, int line);
|
||||||
|
+unsigned long *__pmalloc(unsigned long size,const char *module,const char *function,int line);
|
||||||
|
+void _pfree(void * pointer,char *module, const char *function, int line);
|
||||||
|
struct usert *user(int usern);
|
||||||
|
struct newpeert *newpeer(int usern);
|
||||||
|
struct datalinkt *datalink(int usern);
|
||||||
|
@@ -1092,7 +1092,7 @@ int replace(char *rps, char whatc, char
|
||||||
|
char *nobreak(char *tobreak);
|
||||||
|
char *randstring(int length);
|
||||||
|
char *strmcat(char *first,char *second);
|
||||||
|
-char *strmncpy(char *dest, char *source, unsigned int len);
|
||||||
|
+char *strmncpy(char *dest, const char *source, unsigned int len);
|
||||||
|
int strmncasecmp(char *one, char *two);
|
||||||
|
int strmcmp(char *one, char *two);
|
||||||
|
int strmwildcmp(char *line, char *wildcard);
|
||||||
|
diff -Naurp src/p_memory.c src/p_memory.c
|
||||||
|
--- src/p_memory.c 2007-02-26 12:16:53.000000000 +0000
|
||||||
|
+++ src/p_memory.c 2007-02-26 12:17:11.000000000 +0000
|
||||||
|
@@ -32,7 +32,7 @@ FILE *logm=NULL;
|
||||||
|
|
||||||
|
/* malloc-wrapper. No memory will log an error entry and kill the bouncer */
|
||||||
|
|
||||||
|
-unsigned long *__pmalloc(unsigned long size,char *module,char *function, int line)
|
||||||
|
+unsigned long *__pmalloc(unsigned long size,const char *module,const char *function, int line)
|
||||||
|
{
|
||||||
|
unsigned long *rc;
|
||||||
|
if (!(rc=(unsigned long *)malloc(size)))
|
||||||
|
@@ -53,7 +53,7 @@ unsigned long *__pmalloc(unsigned long s
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
-void _pfree(unsigned long *pointer, char *module, char *function, int line)
|
||||||
|
+void _pfree(unsigned long *pointer, char *module, const char *function, int line)
|
||||||
|
{
|
||||||
|
#ifdef LOGALLOC
|
||||||
|
if(logm==NULL)
|
||||||
|
diff -Naurp src/p_string.c src/p_string.c
|
||||||
|
--- src/p_string.c 2007-02-26 12:16:53.000000000 +0000
|
||||||
|
+++ src/p_string.c 2007-02-26 12:17:11.000000000 +0000
|
||||||
|
@@ -51,7 +51,7 @@ char *lngtxt(unsigned int msgnum)
|
||||||
|
|
||||||
|
/* string copy with len and zero delimit */
|
||||||
|
|
||||||
|
-char *strmncpy(char *dest, char *source, unsigned int len)
|
||||||
|
+char *strmncpy(char *dest, const char *source, unsigned int len)
|
||||||
|
{
|
||||||
|
char bf[strlen(source)+2];
|
||||||
|
char *pt;
|
||||||
|
diff -Naurp src/match.c src/match.c
|
||||||
|
--- src/match.c 2007-02-26 12:26:10.000000000 +0000
|
||||||
|
+++ src/match.c 2007-02-26 12:26:17.000000000 +0000
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
/* Remove the next line to use this in IrcII */
|
||||||
|
#define EGGDROP
|
||||||
|
|
||||||
|
+#include <p_global.h>
|
||||||
|
|
||||||
|
/* ===================================================================
|
||||||
|
* Best to leave stuff after this point alone, but go on and change
|
7
net-irc/psybnc/files/oidentd.conf.psybnc
Normal file
7
net-irc/psybnc/files/oidentd.conf.psybnc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
user psybnc {
|
||||||
|
default {
|
||||||
|
allow spoof
|
||||||
|
allow spoof_all
|
||||||
|
allow spoof_privport
|
||||||
|
}
|
||||||
|
}
|
56
net-irc/psybnc/files/psybnc-2.4_beta1-config.h
Normal file
56
net-irc/psybnc/files/psybnc-2.4_beta1-config.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Configuration file for psyBNC, created by menuconf
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Encryption */
|
||||||
|
|
||||||
|
#define CRYPT
|
||||||
|
|
||||||
|
/* Encryption Type*/
|
||||||
|
|
||||||
|
#define BLOWFISH
|
||||||
|
|
||||||
|
/* Allow Translation */
|
||||||
|
|
||||||
|
#define TRANSLATE
|
||||||
|
|
||||||
|
/* Allow internal network */
|
||||||
|
|
||||||
|
#define INTNET
|
||||||
|
|
||||||
|
/* Allow traffic logging */
|
||||||
|
|
||||||
|
#define TRAFFICLOG
|
||||||
|
|
||||||
|
/* Allow linkage of bouncers */
|
||||||
|
|
||||||
|
#define LINKAGE
|
||||||
|
|
||||||
|
/* Allow the dcc File-Functions */
|
||||||
|
|
||||||
|
#define DCCFILES
|
||||||
|
|
||||||
|
/* Pipe dcc Chats */
|
||||||
|
|
||||||
|
#define DCCCHAT
|
||||||
|
|
||||||
|
/* Allow to add more users */
|
||||||
|
|
||||||
|
#define MULTIUSER
|
||||||
|
|
||||||
|
/* Number of max. Users */
|
||||||
|
|
||||||
|
#define MAXUSER 50
|
||||||
|
|
||||||
|
/* Number of max. Connections per User */
|
||||||
|
|
||||||
|
#define MAXCONN 99
|
||||||
|
|
||||||
|
/* The logging level */
|
||||||
|
|
||||||
|
#define LOGLEVEL 0
|
||||||
|
|
||||||
|
/* SSL-Security */
|
||||||
|
|
||||||
|
#define SSLSEC 2
|
||||||
|
|
11
net-irc/psybnc/files/psybnc-2.4_beta1-ldflags-fix.patch
Normal file
11
net-irc/psybnc/files/psybnc-2.4_beta1-ldflags-fix.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- tools/autoconf.c.orig 2012-07-03 22:55:46.955338792 +0400
|
||||||
|
+++ tools/autoconf.c 2012-07-03 22:56:17.977337001 +0400
|
||||||
|
@@ -637,7 +637,7 @@
|
||||||
|
fprintf(makefile,"TARGET = psybnc\n");
|
||||||
|
fprintf(makefile,"\n");
|
||||||
|
fprintf(makefile,"all: $(OBJS)\n");
|
||||||
|
- fprintf(makefile," $(CC) -o $(TARGET) $(CFLAGS) $(OBJS) %s $(LIBS)\n", dnsobj);
|
||||||
|
+ fprintf(makefile," $(CC) -o $(TARGET) $(CFLAGS) ${LDFLAGS} $(OBJS) %s $(LIBS)\n", dnsobj);
|
||||||
|
/* fprintf(makefile," @strip $(TARGET)\n");*/
|
||||||
|
if(ssl==0)
|
||||||
|
{
|
13
net-irc/psybnc/files/psybnc-2.4_beta1-multinetwork.patch
Normal file
13
net-irc/psybnc/files/psybnc-2.4_beta1-multinetwork.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- config.h.orig 2012-07-03 23:34:31.863039326 +0400
|
||||||
|
+++ config.h 2012-07-03 23:34:57.407038916 +0400
|
||||||
|
@@ -10,6 +10,10 @@
|
||||||
|
|
||||||
|
#define BLOWFISH
|
||||||
|
|
||||||
|
+/* Allow multiple irc connections per user */
|
||||||
|
+
|
||||||
|
+#define NETWORK
|
||||||
|
+
|
||||||
|
/* Allow Translation */
|
||||||
|
|
||||||
|
#define TRANSLATE
|
13
net-irc/psybnc/files/psybnc-2.4_beta1-oidentd.patch
Normal file
13
net-irc/psybnc/files/psybnc-2.4_beta1-oidentd.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- config.h.orig 2008-12-14 20:02:57.000000000 +0000
|
||||||
|
+++ config.h 2008-12-14 20:03:35.000000000 +0000
|
||||||
|
@@ -14,6 +14,10 @@
|
||||||
|
|
||||||
|
#define TRANSLATE
|
||||||
|
|
||||||
|
+/* Support oIdentd */
|
||||||
|
+
|
||||||
|
+#define OIDENTD
|
||||||
|
+
|
||||||
|
/* Allow internal network */
|
||||||
|
|
||||||
|
#define INTNET
|
13
net-irc/psybnc/files/psybnc-2.4_beta1-scripting.patch
Normal file
13
net-irc/psybnc/files/psybnc-2.4_beta1-scripting.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- config.h.orig 2009-01-03 17:30:41.000000000 +0000
|
||||||
|
+++ config.h 2009-01-03 17:31:27.000000000 +0000
|
||||||
|
@@ -26,6 +26,10 @@
|
||||||
|
|
||||||
|
#define TRAFFICLOG
|
||||||
|
|
||||||
|
+/* Allow scripting */
|
||||||
|
+
|
||||||
|
+#define SCRIPTING
|
||||||
|
+
|
||||||
|
/* Allow linkage of bouncers */
|
||||||
|
|
||||||
|
#define LINKAGE
|
42
net-irc/psybnc/files/psybnc-oidentd.initd
Normal file
42
net-irc/psybnc/files/psybnc-oidentd.initd
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/sbin/runscript
|
||||||
|
# Copyright 1999-2007 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/files/psybnc-oidentd.initd,v 1.1 2008/12/14 18:23:14 gurligebis Exp $
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net oidentd
|
||||||
|
}
|
||||||
|
|
||||||
|
check_config() {
|
||||||
|
if [[ ! -f ${PSYBNC_CONFIG} ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "${PSYBNC_HOME}" ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${PSYBNC_USER}" ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
check_config || return 1
|
||||||
|
ebegin "Starting psyBNC"
|
||||||
|
start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" -e HOME="${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
check_config || return 1
|
||||||
|
ebegin "Stopping psyBNC"
|
||||||
|
start-stop-daemon --stop --quiet --pidfile "${PSYBNC_HOME}"/psybnc.pid --signal 9
|
||||||
|
eend $?
|
||||||
|
}
|
17
net-irc/psybnc/files/psybnc.conf
Normal file
17
net-irc/psybnc/files/psybnc.conf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Name
|
||||||
|
PSYBNC.SYSTEM.ME=Gentoo
|
||||||
|
|
||||||
|
# Default listener
|
||||||
|
PSYBNC.SYSTEM.PORT1=23998
|
||||||
|
PSYBNC.SYSTEM.HOST1=*
|
||||||
|
PSYBNC.HOSTALLOWS.ENTRY0=*;*
|
||||||
|
|
||||||
|
# Default SSL listener
|
||||||
|
PSYBNC.SYSTEM.PORT2=23889
|
||||||
|
PSYBNC.SYSTEM.HOST2=S=*
|
||||||
|
PSYBNC.HOSTALLOWS.ENTRY1=*;*
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
USER1.USER.NICK=gentoo
|
||||||
|
USER1.USER.PASS=gentoo
|
||||||
|
USER1.USER.RIGHTS=1
|
5
net-irc/psybnc/files/psybnc.confd
Normal file
5
net-irc/psybnc/files/psybnc.confd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# /etc/conf.d/psybnc
|
||||||
|
|
||||||
|
PSYBNC_CONFIG="/etc/psybnc/psybnc.conf"
|
||||||
|
PSYBNC_HOME="/var/lib/psybnc"
|
||||||
|
PSYBNC_USER="psybnc"
|
42
net-irc/psybnc/files/psybnc.initd
Normal file
42
net-irc/psybnc/files/psybnc.initd
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/sbin/runscript
|
||||||
|
# Copyright 1999-2007 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: /var/cvsroot/gentoo-x86/net-irc/psybnc/files/psybnc.initd,v 1.2 2007/02/26 00:03:08 gurligebis Exp $
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
}
|
||||||
|
|
||||||
|
check_config() {
|
||||||
|
if [[ ! -f ${PSYBNC_CONFIG} ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_CONFIG in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "${PSYBNC_HOME}" ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_HOME in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${PSYBNC_USER}" ]]
|
||||||
|
then
|
||||||
|
eerror "Please set \$PSYBNC_USER in /etc/conf.d/psybnc!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
check_config || return 1
|
||||||
|
ebegin "Starting psyBNC"
|
||||||
|
start-stop-daemon --start --quiet --chuid "${PSYBNC_USER}" --chdir "${PSYBNC_HOME}" --exec /usr/bin/psybnc -- "${PSYBNC_CONFIG}" &>/dev/null
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
check_config || return 1
|
||||||
|
ebegin "Stopping psyBNC"
|
||||||
|
start-stop-daemon --stop --quiet --pidfile "${PSYBNC_HOME}"/psybnc.pid --signal 9
|
||||||
|
eend $?
|
||||||
|
}
|
10
net-irc/psybnc/metadata.xml
Normal file
10
net-irc/psybnc/metadata.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||||
|
<pkgmetadata>
|
||||||
|
<use>
|
||||||
|
<flag name='oidentd'>Adds support for oidentd</flag>
|
||||||
|
<flag name='scripting'>Adds scripting support</flag>
|
||||||
|
<flag name='multinetwork'>Adds support for multiple networks</flag>
|
||||||
|
</use>
|
||||||
|
<longdescription>psyBNC is a multi-user and multi-server gateway to IRC networks</longdescription>
|
||||||
|
</pkgmetadata>
|
163
net-irc/psybnc/psybnc-2.4_beta1.ebuild
Normal file
163
net-irc/psybnc/psybnc-2.4_beta1.ebuild
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Header: $
|
||||||
|
|
||||||
|
EAPI="2"
|
||||||
|
|
||||||
|
inherit eutils versionator toolchain-funcs flag-o-matic user
|
||||||
|
MY_PV="$(get_version_component_range 1-2)BETA1"
|
||||||
|
PSYBNC_HOME="/var/lib/psybnc"
|
||||||
|
|
||||||
|
DESCRIPTION="psyBNC is a multi-user and multi-server gateway to IRC networks"
|
||||||
|
HOMEPAGE="http://www.psybnc.at/index.html"
|
||||||
|
SRC_URI="http://www.psybnc.dk/download/psyBNC-${MY_PV}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64 ~sparc ~x86 ~ppc"
|
||||||
|
IUSE="ipv6 ssl oidentd scripting multinetwork"
|
||||||
|
|
||||||
|
DEPEND="ssl? ( >=dev-libs/openssl-0.9.7d )
|
||||||
|
oidentd? ( >=net-misc/oidentd-2.0 )
|
||||||
|
net-dns/c-ares"
|
||||||
|
RDEPEND="${DEPEND}"
|
||||||
|
S="${WORKDIR}"/"${PN}"
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup psybnc
|
||||||
|
enewuser psybnc -1 -1 ${PSYBNC_HOME} psybnc
|
||||||
|
}
|
||||||
|
|
||||||
|
src_unpack() {
|
||||||
|
unpack ${A}
|
||||||
|
cd "${S}"
|
||||||
|
|
||||||
|
# Useless files
|
||||||
|
rm -f */INFO
|
||||||
|
|
||||||
|
# Pretend we already have a certificate, we generate it in pkg_config
|
||||||
|
mkdir -p key
|
||||||
|
touch key/psybnc.cert.pem
|
||||||
|
|
||||||
|
if [[ -f ${ROOT}/usr/share/psybnc/salt.h ]]
|
||||||
|
then
|
||||||
|
einfo "Using existing salt.h for password encryption"
|
||||||
|
cp "${ROOT}"/usr/share/psybnc/salt.h salt.h
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Pinkbyte: copy bundled config.h
|
||||||
|
cp "${FILESDIR}"/${P}-config.h "${S}"/config.h
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
epatch "${FILESDIR}/compile.diff"
|
||||||
|
epatch "${FILESDIR}/${P}-ldflags-fix.patch"
|
||||||
|
|
||||||
|
# add oidentd
|
||||||
|
use oidentd && epatch "${FILESDIR}/${P}-oidentd.patch"
|
||||||
|
|
||||||
|
# add scripting support
|
||||||
|
use scripting && epatch "${FILESDIR}/${P}-scripting.patch"
|
||||||
|
|
||||||
|
# add multinetwork support
|
||||||
|
use multinetwork && epatch "${FILESDIR}/${P}-multinetwork.patch"
|
||||||
|
|
||||||
|
# Prevent stripping the binary
|
||||||
|
sed -i -e "/@strip/ d" tools/autoconf.c
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
use ipv6 || rm -f tools/chkipv6.c
|
||||||
|
use ssl || rm -f tools/chkssl.c
|
||||||
|
|
||||||
|
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die "emake failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
dobin psybnc
|
||||||
|
|
||||||
|
insinto /usr/share/psybnc
|
||||||
|
doins -r help lang salt.h
|
||||||
|
fperms 0600 /usr/share/psybnc/salt.h
|
||||||
|
|
||||||
|
insinto /etc/psybnc
|
||||||
|
doins "${FILESDIR}"/psybnc.conf
|
||||||
|
|
||||||
|
keepdir "${PSYBNC_HOME}"/{log,motd,scripts}
|
||||||
|
dosym /usr/share/psybnc/lang "${PSYBNC_HOME}"/lang
|
||||||
|
dosym /usr/share/psybnc/help "${PSYBNC_HOME}"/help
|
||||||
|
|
||||||
|
fowners psybnc:psybnc "${PSYBNC_HOME}"/{,log,motd,scripts} /etc/psybnc/psybnc.conf
|
||||||
|
fperms 0750 "${PSYBNC_HOME}"/{,log,motd,scripts}
|
||||||
|
fperms 0640 /etc/psybnc/psybnc.conf
|
||||||
|
|
||||||
|
if use ssl
|
||||||
|
then
|
||||||
|
keepdir /etc/psybnc/ssl
|
||||||
|
dosym /etc/psybnc/ssl "${PSYBNC_HOME}"/key
|
||||||
|
else
|
||||||
|
# Drop SSL listener from psybnc.conf
|
||||||
|
sed -i -e "/^# Default SSL listener$/,+4 d" "${D}"/etc/psybnc/psybnc.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if use oidentd
|
||||||
|
then
|
||||||
|
insinto /etc
|
||||||
|
doins "${FILESDIR}"/oidentd.conf.psybnc
|
||||||
|
fperms 640 /etc/oidentd.conf.psybnc
|
||||||
|
# install init-script with oidentd-support
|
||||||
|
newinitd "${FILESDIR}"/psybnc-oidentd.initd psybnc
|
||||||
|
else
|
||||||
|
# install init-script without oidentd-support
|
||||||
|
newinitd "${FILESDIR}"/psybnc.initd psybnc
|
||||||
|
fi
|
||||||
|
|
||||||
|
newconfd "${FILESDIR}"/psybnc.confd psybnc
|
||||||
|
|
||||||
|
dodoc CHANGES FAQ README scripts/SCRIPTING TODO
|
||||||
|
docinto example-script
|
||||||
|
dodoc scripts/example/DEFAULT.SCRIPT
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_config() {
|
||||||
|
if use ssl
|
||||||
|
then
|
||||||
|
if [[ -f ${ROOT}/etc/psybnc/ssl/psybnc.cert.pem || -f ${ROOT}/etc/psybnc/ssl/psybnc.key.pem ]]
|
||||||
|
then
|
||||||
|
ewarn "Existing /etc/psybnc/psybnc.cert.pem or /etc/psybnc/psybnc.key.pem found!"
|
||||||
|
ewarn "Remove /etc/psybnc/psybnc.*.pem and run emerge --config =${CATEGORY}/${PF} again."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
einfo "Generating certificate request..."
|
||||||
|
openssl req -new -out "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -keyout "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -nodes
|
||||||
|
einfo "Generating self-signed certificate..."
|
||||||
|
openssl req -x509 -days 365 -in "${ROOT}"/etc/psybnc/ssl/psybnc.req.pem -key "${ROOT}"/etc/psybnc/ssl/psybnc.key.pem -out "${ROOT}"/etc/psybnc/ssl/psybnc.cert.pem
|
||||||
|
einfo "Setting permissions on files..."
|
||||||
|
chown root:psybnc "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
|
||||||
|
chmod 0640 "${ROOT}"/etc/psybnc/ssl/psybnc.{cert,key,req}.pem
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
if use ssl
|
||||||
|
then
|
||||||
|
elog
|
||||||
|
elog "Please run \"emerge --config =${CATEGORY}/${PF}\" to create needed SSL certificates."
|
||||||
|
fi
|
||||||
|
if use oidentd
|
||||||
|
then
|
||||||
|
elog
|
||||||
|
elog "You have enabled oidentd-support. You will need to set"
|
||||||
|
elog "up your /etc/oident.conf file before running psybnc. An example"
|
||||||
|
elog "for psyBNC can be found under /etc/oident.conf.psybnc."
|
||||||
|
fi
|
||||||
|
elog
|
||||||
|
elog "You can connect to psyBNC on port 23998 with user gentoo and password gentoo."
|
||||||
|
elog "Please edit the psyBNC configuration at /etc/psybnc/psybnc.conf to change this."
|
||||||
|
elog
|
||||||
|
elog "To be able to reuse an existing psybnc.conf, you need to make sure that the"
|
||||||
|
elog "old salt.h is available at /usr/share/psybnc/salt.h when compiling a new"
|
||||||
|
elog "version of psyBNC. It is needed for password encryption and decryption."
|
||||||
|
elog
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user