diff options
author | Andrew Nelless | 2015-06-18 14:31:52 +0100 |
---|---|---|
committer | Andrew Nelless | 2015-06-18 14:31:52 +0100 |
commit | 541d3d0272a3b1aaa891c26444be5f96ac26086e (patch) | |
tree | 81175ddf3735d698df5ab483d1a7d65b4decabbc | |
download | aur-541d3d0272a3b1aaa891c26444be5f96ac26086e.tar.gz |
Import from AUR3
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | PKGBUILD | 95 | ||||
-rw-r--r-- | arch-fixes.patch | 56 | ||||
-rw-r--r-- | pie.patch | 226 | ||||
-rw-r--r-- | unrealircd.install | 12 | ||||
-rw-r--r-- | unrealircd.service | 12 | ||||
-rw-r--r-- | unrealircd.tmpfiles.d | 1 |
7 files changed, 434 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1cf75f32248b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = unrealircd-pie + pkgdesc = Open Source IRC Server (hardened) + pkgver = 3.2.10.4 + pkgrel = 1 + url = http://unrealircd.com + install = unrealircd.install + arch = i686 + arch = x86_64 + license = GPL2 + makedepends = sed + depends = openssl + depends = curl + depends = c-ares + depends = tre=0.8.0 + provides = ircd + provides = unrealircd + conflicts = ircd + conflicts = unrealircd + backup = etc/unrealircd/unrealircd.conf + source = http://www.unrealircd.com/downloads/Unreal3.2.10.4.tar.gz + source = unrealircd.service + source = unrealircd.tmpfiles.d + source = arch-fixes.patch + source = pie.patch + md5sums = ea4e303a9783f703ecf7769d4c07a124 + md5sums = 677d8de0bae770488a2c1730f9475a51 + md5sums = 3ec519ea7dbe99696eb6c51dfc0d382a + md5sums = 5f4bf9f99f6c78bc9e6ee4ec66b021fa + md5sums = 939998a9ea163375ca3ecba457406adc + +pkgname = unrealircd-pie + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a67740cb0c4f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,95 @@ +# $Id$ +# Maintainer: Andrew Nelless <andrew+aur@nelless.net> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Zerial <fernando@zerial.org> + +pkgname=unrealircd-pie +pkgver=3.2.10.4 +pkgrel=1 +pkgdesc="Open Source IRC Server (hardened)" +arch=('i686' 'x86_64') +url="http://unrealircd.com" +license=('GPL2') +depends=('openssl' 'curl' 'c-ares' 'tre=0.8.0') +makedepends=('sed') +conflicts=('ircd' 'unrealircd') +provides=('ircd' 'unrealircd') +backup=('etc/unrealircd/unrealircd.conf') +install=unrealircd.install +source=(http://www.unrealircd.com/downloads/Unreal$pkgver.tar.gz + unrealircd.service + unrealircd.tmpfiles.d + arch-fixes.patch + pie.patch) +md5sums=('ea4e303a9783f703ecf7769d4c07a124' + '677d8de0bae770488a2c1730f9475a51' + '3ec519ea7dbe99696eb6c51dfc0d382a' + '5f4bf9f99f6c78bc9e6ee4ec66b021fa' + '939998a9ea163375ca3ecba457406adc') + +prepare() { + cd $srcdir/Unreal$pkgver + patch -p1 <$srcdir/arch-fixes.patch + patch -p1 <$srcdir/pie.patch +} + +build() { + cd $srcdir/Unreal$pkgver + + CPPFLAGS=`echo $CPPFLAGS | sed -E 's/\-D_FORTIFY_SOURCE(=[0-9]+)?//g'` + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + + CFLAGS=`echo $CFLAGS | sed -E 's/\-fstack-protector(\-strong)?//g' |\ + sed -E 's/\-\-param=ssp\-buffer\-size=[0-9]+//g'` + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector" + + LDFLAGS=`echo $LDFLAGS | sed -E 's/,\-z,now(,)?/\1/g;s/,\-z,relro(,)?/\1/g'` + LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" + + echo $CFLAGS + echo $CPPFLAGS + echo $LDFLAGS + + ac_cv_ip6=yes ./configure --with-showlistmodes \ + --enable-prefixaq --with-listen=5 \ + --with-dpath=/etc/unrealircd \ + --with-spath=/usr/bin \ + --with-nick-history=2000 --with-sendq=3000000 \ + --with-bufferpool=18 \ + --with-permissions=0600 --with-fd-setsize=1024 \ + --enable-dynamic-linking \ + --enable-ziplinks \ + --enable-ssl \ + --enable-inet6 \ + --enable-libcurl=/usr \ + --with-system-tre \ + --with-system-cares + make +} + +package() { + cd $srcdir/Unreal$pkgver + + mkdir -p $pkgdir/etc/unrealircd + mkdir -p $pkgdir/usr/bin + + make IRCDDIR=$pkgdir/etc/unrealircd BINDIR=$pkgdir/usr/bin install + + mv $srcdir/Unreal$pkgver/src/ircd $pkgdir/usr/bin/unrealircd + mv $srcdir/Unreal$pkgver/doc/example.conf $pkgdir/etc/unrealircd/unrealircd.conf + mkdir -p $pkgdir/usr/lib/unrealircd + mv $pkgdir/etc/unrealircd/modules $pkgdir/usr/lib/unrealircd/ + ln -s /usr/lib/unrealircd/modules $pkgdir/etc/unrealircd/modules + + # log + mkdir -p $pkgdir/var/log/unrealircd/ + touch $pkgdir/var/log/unrealircd/ircd.log + ln -s /var/log/unrealircd/ircd.log $pkgdir/etc/unrealircd/ircd.log + + find $pkgdir/usr -type f -exec chmod ugo+r {} \; + find $pkgdir/usr -type d -exec chmod ugo+rx {} \; + + rm -f $pkgdir/etc/unrealircd/unreal + install -Dm0644 $srcdir/unrealircd.service $pkgdir/usr/lib/systemd/system/unrealircd.service + install -Dm0644 $srcdir/unrealircd.tmpfiles.d $pkgdir/usr/lib/tmpfiles.d/unrealircd.conf +} diff --git a/arch-fixes.patch b/arch-fixes.patch new file mode 100644 index 000000000000..2f89647bce39 --- /dev/null +++ b/arch-fixes.patch @@ -0,0 +1,56 @@ +diff -wbBur Unreal3.2.10.2.org/doc/example.conf Unreal3.2.10.2/doc/example.conf +--- Unreal3.2.10.2.org/doc/example.conf 2013-11-24 23:24:26.000000000 +0400 ++++ Unreal3.2.10.2/doc/example.conf 2014-01-27 14:38:16.669081776 +0400 +@@ -33,8 +33,8 @@ + */ + + /* FOR *NIX, uncomment the following 2lines: */ +-//loadmodule "src/modules/commands.so"; +-//loadmodule "src/modules/cloak.so"; ++loadmodule "modules/commands.so"; ++loadmodule "modules/cloak.so"; + + /* FOR Windows, uncomment the following 2 lines: */ + //loadmodule "modules/commands.dll"; +diff -wbBur Unreal3.2.10.2.org/include/config.h Unreal3.2.10.2/include/config.h +--- Unreal3.2.10.2.org/include/config.h 2013-11-24 23:24:26.000000000 +0400 ++++ Unreal3.2.10.2/include/config.h 2014-01-27 14:38:53.349081379 +0400 +@@ -248,7 +248,7 @@ + #define RPATH "ircd.rules" /* server rules file */ + #define OPATH "oper.motd" /* Operators MOTD file */ + #define LPATH "debug.log" /* Where the debug file lives, if DEBUGMODE */ +-#define PPATH "ircd.pid" /* file for server pid */ ++#define PPATH "/run/unrealircd/ircd.pid" /* file for server pid */ + #define VPATH "ircd.svsmotd" /* Services MOTD append. */ + #define BPATH "bot.motd" /* Bot MOTD */ + #define IRCDTUNE "ircd.tune" /* tuning .. */ +diff -wbBur Unreal3.2.10.2.org/src/ircd.c Unreal3.2.10.2/src/ircd.c +--- Unreal3.2.10.2.org/src/ircd.c 2013-11-24 23:24:26.000000000 +0400 ++++ Unreal3.2.10.2/src/ircd.c 2014-01-27 14:38:16.669081776 +0400 +@@ -840,7 +840,7 @@ + const char *compiledfor, *runtime; + int error = 0; + +-#ifdef USE_SSL ++#if 0 + compiledfor = OPENSSL_VERSION_TEXT; + runtime = SSLeay_version(SSLEAY_VERSION); + if (strcasecmp(compiledfor, runtime)) +@@ -850,7 +850,7 @@ + error=1; + } + #endif +-#ifdef ZIP_LINKS ++#if 0 + runtime = zlibVersion(); + compiledfor = ZLIB_VERSION; + if (*compiledfor != *runtime) +@@ -860,7 +860,7 @@ + error = 1; + } + #endif +-#ifdef USE_LIBCURL ++#if 0 + /* Perhaps someone should tell them to do this a bit more easy ;) + * problem is runtime output is like: 'libcurl/7.11.1 zlib/1.2.1 c-ares/1.2.0' + * while header output is like: '7.11.1'. diff --git a/pie.patch b/pie.patch new file mode 100644 index 000000000000..17bb5a08c9d5 --- /dev/null +++ b/pie.patch @@ -0,0 +1,226 @@ +diff -uNr Unreal3.2.10.4/src/Makefile Unreal3.2.10.4-patched/src/Makefile +--- Unreal3.2.10.4/src/Makefile 2014-07-26 16:42:10.000000000 +0100 ++++ Unreal3.2.10.4-patched/src/Makefile 2015-03-15 19:07:47.841447670 +0000 +@@ -63,7 +63,7 @@ + +cd modules; $(MY_MAKE) MODULEFILE=$(MODULEFILE) 'EXLIBS=$(EXLIBS)' custommodule + + ircd: $(OBJS) +- $(CC) $(CFLAGS) $(CRYPTOLIB) -o ircd $(OBJS) $(LDFLAGS) $(IRCDLIBS) $(CRYPTOLIB) ++ $(CC) $(CFLAGS) $(CRYPTOLIB) -pie -o ircd $(OBJS) $(LDFLAGS) $(IRCDLIBS) $(CRYPTOLIB) + + staticircd: $(OBJS) + $(CC) $(CFLAGS) $(CRYPTOLIB) -DSTATIC_LINKING -o ircd.static $(OBJS) \ +@@ -89,58 +89,59 @@ + $(SHELL) version.c.SH + + version.o: version.c $(INCLUDES) +- $(CC) $(CFLAGS) -c version.c ++ $(CC) $(CFLAGS) -fPIE -c version.c + + parse.o: parse.c $(INCLUDES) +- $(CC) $(CFLAGS) -c parse.c ++ $(CC) $(CFLAGS) -fPIE -c parse.c + + socket.o: socket.c $(INCLUDES) +- $(CC) $(CFLAGS) -c socket.c ++ $(CC) $(CFLAGS) -fPIE -c socket.c + + + + dbuf.o: dbuf.c $(INCLUDES) +- $(CC) $(CFLAGS) -c dbuf.c ++ $(CC) $(CFLAGS) -fPIE -c dbuf.c + + packet.o: packet.c $(INCLUDES) +- $(CC) $(CFLAGS) -c packet.c ++ $(CC) $(CFLAGS) -fPIE -c packet.c + + aln.o: aln.c $(INCLUDES) +- $(CC) $(CFLAGS) -c aln.c ++ $(CC) $(CFLAGS) -fPIE -c aln.c + + auth.o: auth.c $(INCLUDES) +- $(CC) $(CFLAGS) -c auth.c ++ $(CC) $(CFLAGS) -fPIE -c auth.c + + zip.o: zip.c $(INCLUDES) +- $(CC) $(CFLAGS) -c zip.c ++ $(CC) $(CFLAGS) -fPIE -c zip.c + + send.o: send.c $(INCLUDES) +- $(CC) $(CFLAGS) -c send.c ++ $(CC) $(CFLAGS) -fPIE -c send.c + + ssl.o: ssl.c $(INCLUDES) +- $(CC) $(CFLAGS) -c ssl.c ++ $(CC) $(CFLAGS) -fPIE -c ssl.c + + match.o: match.c $(INCLUDES) +- $(CC) $(CFLAGS) -c match.c ++ $(CC) $(CFLAGS) -fPIE -c match.c + + modules.o: modules.c $(INCLUDES) ++ $(CC) $(CFLAGS) -fPIE -c modules.c + + support.o: support.c $(INCLUDES) +- $(CC) $(CFLAGS) -c support.c ++ $(CC) $(CFLAGS) -fPIE -c support.c + + umodes.o: umodes.c $(INCLUDES) +- $(CC) $(CFLAGS) -c umodes.c ++ $(CC) $(CFLAGS) -fPIE -c umodes.c + + userload.o: userload.c $(INCLUDES) +- $(CC) $(CFLAGS) -c userload.c ++ $(CC) $(CFLAGS) -fPIE -c userload.c + + s_svs.o: s_svs.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_svs.c ++ $(CC) $(CFLAGS) -fPIE -c s_svs.c + events.o: events.c $(INCLUDES) +- $(CC) $(CFLAGS) -c events.c ++ $(CC) $(CFLAGS) -fPIE -c events.c + + help.o: help.c $(INCLUDES) +- $(CC) $(CFLAGS) -c help.c ++ $(CC) $(CFLAGS) -fPIE -c help.c + + #install: all + # -if [ ! -d ${IRCDDIR} -a ! -f ${IRCDDIR} ] ; then \ +@@ -165,103 +166,103 @@ + makedepend -I${INCLUDEDIR} ${SRC} + + channel.o: channel.c $(INCLUDES) +- $(CC) $(CFLAGS) -c channel.c ++ $(CC) $(CFLAGS) -fPIE -c channel.c + + ircd.o: ircd.c $(INCLUDES) +- $(CC) $(CFLAGS) -c ircd.c ++ $(CC) $(CFLAGS) -fPIE -c ircd.c + + list.o: list.c $(INCLUDES) +- $(CC) $(CFLAGS) -c list.c ++ $(CC) $(CFLAGS) -fPIE -c list.c + + lusers.o: lusers.c $(INCLUDES) +- $(CC) $(CFLAGS) -c lusers.c ++ $(CC) $(CFLAGS) -fPIE -c lusers.c + + res.o: res.c $(INCLUDES) ../include/res.h +- $(CC) $(CFLAGS) -c res.c ++ $(CC) $(CFLAGS) -fPIE -c res.c + + timesynch.o: timesynch.c $(INCLUDES) +- $(CC) $(CFLAGS) -c timesynch.c ++ $(CC) $(CFLAGS) -fPIE -c timesynch.c + + cloak.o: cloak.c $(INCLUDES) +- $(CC) $(CFLAGS) -c cloak.c ++ $(CC) $(CFLAGS) -fPIE -c cloak.c + + fdlist.o: fdlist.c $(INCLUDES) +- $(CC) $(CFLAGS) -c fdlist.c ++ $(CC) $(CFLAGS) -fPIE -c fdlist.c + + s_bsd.o: s_bsd.c $(INCLUDES) ../include/res.h +- $(CC) $(CFLAGS) -c s_bsd.c ++ $(CC) $(CFLAGS) -fPIE -c s_bsd.c + + s_auth.o: s_auth.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_auth.c ++ $(CC) $(CFLAGS) -fPIE -c s_auth.c + + s_conf.o: s_conf.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_conf.c ++ $(CC) $(CFLAGS) -fPIE -c s_conf.c + + s_debug.o: s_debug.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_debug.c ++ $(CC) $(CFLAGS) -fPIE -c s_debug.c + + s_err.o: s_err.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_err.c ++ $(CC) $(CFLAGS) -fPIE -c s_err.c + + s_misc.o: s_misc.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_misc.c ++ $(CC) $(CFLAGS) -fPIE -c s_misc.c + + scache.o: scache.c $(INCLUDES) +- $(CC) $(CFLAGS) -c scache.c ++ $(CC) $(CFLAGS) -fPIE -c scache.c + + ircsprintf.o: ircsprintf.c $(INCLUDES) +- $(CC) $(CFLAGS) -c ircsprintf.c ++ $(CC) $(CFLAGS) -fPIE -c ircsprintf.c + + s_user.o: s_user.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_user.c ++ $(CC) $(CFLAGS) -fPIE -c s_user.c + + charsys.o: charsys.c $(INCLUDES) +- $(CC) $(CFLAGS) -c charsys.c ++ $(CC) $(CFLAGS) -fPIE -c charsys.c + + s_extra.o: s_extra.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_extra.c ++ $(CC) $(CFLAGS) -fPIE -c s_extra.c + + s_kline.o: s_kline.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_kline.c ++ $(CC) $(CFLAGS) -fPIE -c s_kline.c + + s_serv.o: s_serv.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_serv.c ++ $(CC) $(CFLAGS) -fPIE -c s_serv.c + + s_numeric.o: s_numeric.c $(INCLUDES) +- $(CC) $(CFLAGS) -c s_numeric.c ++ $(CC) $(CFLAGS) -fPIE -c s_numeric.c + + whowas.o: whowas.c $(INCLUDES) +- $(CC) $(CFLAGS) -c whowas.c ++ $(CC) $(CFLAGS) -fPIE -c whowas.c + + hash.o: hash.c $(INCLUDES) +- $(CC) $(CFLAGS) -c hash.c ++ $(CC) $(CFLAGS) -fPIE -c hash.c + + crule.o: crule.c $(INCLUDES) +- $(CC) $(CFLAGS) -c crule.c ++ $(CC) $(CFLAGS) -fPIE -c crule.c + + cidr.o: cidr.c $(INCLUDES) +- $(CC) $(CFLAGS) -c cidr.c ++ $(CC) $(CFLAGS) -fPIE -c cidr.c + + random.o: random.c $(INCLUDES) +- $(CC) $(CFLAGS) -c random.c ++ $(CC) $(CFLAGS) -fPIE -c random.c + + extcmodes.o: extcmodes.c $(INCLUDES) +- $(CC) $(CFLAGS) -c extcmodes.c ++ $(CC) $(CFLAGS) -fPIE -c extcmodes.c + + extbans.o: extbans.c $(INCLUDES) +- $(CC) $(CFLAGS) -c extbans.c ++ $(CC) $(CFLAGS) -fPIE -c extbans.c + + md5.o: md5.c $(INCLUDES) +- $(CC) $(CFLAGS) -c md5.c ++ $(CC) $(CFLAGS) -fPIE -c md5.c + + api-command.o: api-command.c $(INCLUDES) +- $(CC) $(CFLAGS) -c api-command.c ++ $(CC) $(CFLAGS) -fPIE -c api-command.c + + api-isupport.o: api-isupport.c $(INCLUDES) +- $(CC) $(CFLAGS) -c api-isupport.c ++ $(CC) $(CFLAGS) -fPIE -c api-isupport.c + + url.o: url.c $(INCLUDES) +- $(CC) $(CFLAGS) -c url.c ++ $(CC) $(CFLAGS) -fPIE -c url.c + + # DO NOT DELETE THIS LINE -- make depend depends on it. + diff --git a/unrealircd.install b/unrealircd.install new file mode 100644 index 000000000000..edfe57882f7f --- /dev/null +++ b/unrealircd.install @@ -0,0 +1,12 @@ +post_install() { + getent passwd ircd >/dev/null || useradd -r ircd + chown -R ircd etc/unrealircd var/log/unrealircd + systemd-tmpfiles --create unrealircd.conf + echo "SSL is enabled by default, so you need to create pem files" + echo "unrealircd.conf needs adjustments" + echo "See also: https://wiki.archlinux.org/index.php/UnrealIRCd" +} + +post_upgrade() { + post_install +} diff --git a/unrealircd.service b/unrealircd.service new file mode 100644 index 000000000000..7550ebe1543c --- /dev/null +++ b/unrealircd.service @@ -0,0 +1,12 @@ +[Unit] +Description=IRC daemon +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +User=ircd +PIDFile=/run/unrealircd/ircd.pid +ExecStart=/usr/bin/unrealircd + +[Install] +WantedBy=multi-user.target diff --git a/unrealircd.tmpfiles.d b/unrealircd.tmpfiles.d new file mode 100644 index 000000000000..1374312339b1 --- /dev/null +++ b/unrealircd.tmpfiles.d @@ -0,0 +1 @@ +d /run/unrealircd 0755 ircd root - |