diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/gmp/538dfce27f41.patch | 38 | ||||
-rw-r--r-- | testing/gmp/PKGBUILD | 39 | ||||
-rw-r--r-- | testing/gmp/gmp.install | 20 | ||||
-rw-r--r-- | testing/iproute2/PKGBUILD | 51 | ||||
-rw-r--r-- | testing/iproute2/iproute2-fhs.patch | 84 | ||||
-rw-r--r-- | testing/iptables/PKGBUILD | 53 | ||||
-rw-r--r-- | testing/iptables/empty.rules | 6 | ||||
-rwxr-xr-x | testing/iptables/ip6tables | 97 | ||||
-rwxr-xr-x | testing/iptables/iptables | 95 | ||||
-rw-r--r-- | testing/iptables/iptables.conf.d | 8 | ||||
-rw-r--r-- | testing/iptables/simple_firewall.rules | 11 |
11 files changed, 502 insertions, 0 deletions
diff --git a/testing/gmp/538dfce27f41.patch b/testing/gmp/538dfce27f41.patch new file mode 100644 index 000000000..2e0a1af50 --- /dev/null +++ b/testing/gmp/538dfce27f41.patch @@ -0,0 +1,38 @@ + +# HG changeset patch +# User Torbjorn Granlund <tege@gmplib.org> +# Date 1310730221 -7200 +# Node ID 538dfce27f410b910d5e2f011119269e224d16a3 +# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366 +(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right. + +diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c +--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200 ++++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200 +@@ -7,7 +7,7 @@ + SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST + GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE. + +-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc. ++Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. + + This file is part of the GNU MP Library. + +@@ -28,7 +28,6 @@ + #include "gmp-impl.h" + + +- + mp_size_t + mpn_dcpi1_bdiv_q_n_itch (mp_size_t n) + { +@@ -130,7 +129,7 @@ + qn = nn - qn; + while (qn > dn) + { +- mpn_sub_1 (np + dn, np + dn, qn, cy); ++ mpn_sub_1 (np + dn, np + dn, qn - dn, cy); + cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp); + qp += dn; + np += dn; + diff --git a/testing/gmp/PKGBUILD b/testing/gmp/PKGBUILD new file mode 100644 index 000000000..c8b486dec --- /dev/null +++ b/testing/gmp/PKGBUILD @@ -0,0 +1,39 @@ +# $Id: PKGBUILD 131961 2011-07-18 11:43:05Z allan $ +# Maintainer: Allan McRae <allan@archlinux.org> +# Maintainer: Jan de Groot <jgc@archlinux.org> + +pkgname=gmp +pkgver=5.0.2 +pkgrel=2 +pkgdesc="A free library for arbitrary precision arithmetic" +arch=('i686' 'x86_64') +url="http://gmplib.org/" +depends=('gcc-libs' 'sh') +license=('LGPL3') +options=(!libtool) +install=gmp.install +source=(ftp://ftp.gnu.org/gnu/gmp/gmp-${pkgver}.tar.bz2 + 538dfce27f41.patch) +md5sums=('0bbaedc82fb30315b06b1588b9077cd3' + 'a769be9c41618ca9c35d83375e7097d0') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -Np1 -i $srcdir/538dfce27f41.patch + + [ "${CARCH}" = "i686" ] && export ABI="32" + ./configure --build=${CHOST} \ + --prefix=/usr --infodir=/usr/share/info \ + --enable-cxx + make +} + +check() { + cd "${srcdir}/${pkgname}-${pkgver}" + make check +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install +} diff --git a/testing/gmp/gmp.install b/testing/gmp/gmp.install new file mode 100644 index 000000000..cad3354f9 --- /dev/null +++ b/testing/gmp/gmp.install @@ -0,0 +1,20 @@ +info_dir=usr/share/info +info_files=(gmp.info gmp.info-1 gmp.info-2) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for f in ${info_files[@]}; do + install-info ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for f in ${info_files[@]}; do + install-info --delete ${info_dir}/$f.gz ${info_dir}/dir 2> /dev/null + done +} diff --git a/testing/iproute2/PKGBUILD b/testing/iproute2/PKGBUILD new file mode 100644 index 000000000..68f05ebac --- /dev/null +++ b/testing/iproute2/PKGBUILD @@ -0,0 +1,51 @@ +# $Id: PKGBUILD 131999 2011-07-18 20:47:01Z ronald $ +# Maintainer: Ronald van Haren <ronald.archlinux.org> +# Contributor: Judd Vinet <jvinet@zeroflux.org> + +pkgname=iproute2 +pkgver=2.6.39 +pkgrel=1 +pkgdesc="IP Routing Utilities" +arch=('i686' 'x86_64') +license=('GPL2') +url="http://www.linux-foundation.org/en/Net:Iproute2" +depends=('perl') +makedepends=('linux-atm') +optdepends=('linux-atm: ATM support') +provides=('iproute') +conflicts=('iproute') +replaces=('iproute') +options=('!makeflags') +backup=('etc/iproute2/ematch_map' 'etc/iproute2/rt_dsfield' 'etc/iproute2/rt_protos' \ + 'etc/iproute2/rt_realms' 'etc/iproute2/rt_scopes' 'etc/iproute2/rt_tables') +source=(http://devresources.linux-foundation.org/dev/iproute2/download/iproute2-${pkgver}.tar.gz + 'iproute2-fhs.patch') +sha1sums=('9044ad0b4a34a377a54197724373330294d743c7' + '2416b11252364d7a6c742eabb4a6924a75637a46') + + +build() { + cd $srcdir/iproute2-${pkgver} + + # set correct fhs structure + patch -Np1 -i ${srcdir}/iproute2-fhs.patch + + ./configure + + make +} + +package() { + cd $srcdir/iproute2-${pkgver} + + make DESTDIR=$pkgdir install + + # allow loopback to be started before /usr is mounted, this may not be supported in the future + mkdir -p ${pkgdir}/sbin + mv ${pkgdir}/usr/sbin/ip ${pkgdir}/sbin/ip + ln -s /sbin/ip ${pkgdir}/usr/sbin/ip + + # libnetlink isn't installed, install it FS#19385 + install -Dm644 include/libnetlink.h ${pkgdir}/usr/include/libnetlink.h + install -Dm644 lib/libnetlink.a ${pkgdir}/usr/lib/libnetlink.a +} diff --git a/testing/iproute2/iproute2-fhs.patch b/testing/iproute2/iproute2-fhs.patch new file mode 100644 index 000000000..2608414db --- /dev/null +++ b/testing/iproute2/iproute2-fhs.patch @@ -0,0 +1,84 @@ +diff -Naur iproute2.old/Makefile iproute2-2.6.29/Makefile +--- iproute2.old/Makefile 2009-11-11 22:05:21.251407668 +0100 ++++ iproute2-2.6.29/Makefile 2009-11-11 22:07:09.891833516 +0100 +@@ -1,11 +1,12 @@ + DESTDIR=/usr/ + ROOTDIR=$(DESTDIR) + LIBDIR=/usr/lib/ +-SBINDIR=/sbin ++SBINDIR=/usr/sbin + CONFDIR=/etc/iproute2 +-DOCDIR=/share/doc/iproute2 +-MANDIR=/share/man ++DOCDIR=/usr/share/doc/iproute2 ++MANDIR=/usr/share/man + ARPDDIR=/var/lib/arpd ++SHAREDIR=/usr/share + + # Path to db_185.h include + DBM_INCLUDE:=$(ROOTDIR)/usr/include +diff -Naur iproute2.old/tc/tc_util.c iproute2-2.6.29/tc/tc_util.c +--- iproute2.old/tc/tc_util.c 2009-11-11 22:05:21.298076943 +0100 ++++ iproute2-2.6.29/tc/tc_util.c 2009-11-11 22:09:32.865152646 +0100 +@@ -24,8 +24,8 @@ + #include "utils.h" + #include "tc_util.h" + +-#ifndef LIBDIR +-#define LIBDIR "/usr/lib/" ++#ifndef SHAREDIR ++#define SHAREDIR "/usr/share" + #endif + + const char *get_tc_lib(void) +@@ -34,7 +34,7 @@ + + lib_dir = getenv("TC_LIB_DIR"); + if (!lib_dir) +- lib_dir = LIBDIR "/tc/"; ++ lib_dir = SHAREDIR "/tc/"; + + return lib_dir; + } +diff -Naur iproute2.old/netem/Makefile iproute2-2.6.35/netem/Makefile +--- iproute2.old/netem/Makefile 2010-08-06 11:30:48.640940183 +0200 ++++ iproute2-2.6.35/netem/Makefile 2010-08-06 11:32:34.210908892 +0200 +@@ -20,9 +20,9 @@ + $(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm + + install: all +- mkdir -p $(DESTDIR)$(LIBDIR)/tc ++ mkdir -p $(DESTDIR)$(SHAREDIR)/tc + for i in $(DISTDATA); \ +- do install -m 644 $$i $(DESTDIR)$(LIBDIR)/tc; \ ++ do install -m 644 $$i $(DESTDIR)$(SHAREDIR)/tc; \ + done + + clean: +diff -Naur iproute2.old/tc/Makefile iproute2-2.6.35/tc/Makefile +--- iproute2.old/tc/Makefile 2010-08-06 11:48:35.607472252 +0200 ++++ iproute2-2.6.35/tc/Makefile 2010-08-06 11:49:36.977473380 +0200 +@@ -99,18 +99,11 @@ + $(AR) rcs $@ $(TCLIB) + + install: all +- mkdir -p $(MODDESTDIR) +- install -m 0755 tc $(DESTDIR)$(SBINDIR) +- for i in $(TCSO); \ +- do install -m 755 $$i $(MODDESTDIR); \ +- done +- if [ ! -f $(MODDESTDIR)/m_ipt.so ]; then \ +- if [ -f $(MODDESTDIR)/m_xt.so ]; \ +- then ln -s m_xt.so $(MODDESTDIR)/m_ipt.so ; \ +- elif [ -f $(MODDESTDIR)/m_xt_old.so ]; \ +- then ln -s m_xt_old.so $(MODDESTDIR)/m_ipt.so ; \ +- fi; \ +- fi ++ mkdir -p $(DESTDIR)$(LIBDIR)/tc ++ install -m 0755 tc $(DESTDIR)$(SBINDIR) ++ for i in $(TCSO); \ ++ do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \ ++ done + + clean: + rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \ diff --git a/testing/iptables/PKGBUILD b/testing/iptables/PKGBUILD new file mode 100644 index 000000000..b4d6939b4 --- /dev/null +++ b/testing/iptables/PKGBUILD @@ -0,0 +1,53 @@ +# $Id: PKGBUILD 131995 2011-07-18 20:27:00Z ronald $ +# Maintainer: Ronald van Haren <ronald.archlinux.org> +# Contributor: Thomas Baechler <thomas@archlinux.org> + +pkgname=iptables +pkgver=1.4.11.1 +pkgrel=1 +pkgdesc="A Linux kernel packet control tool" +arch=('i686' 'x86_64') +license=('GPL2') +url="http://www.netfilter.org/" +depends=('glibc' 'bash') +options=('!libtool') +source=(http://www.iptables.org/projects/iptables/files/${pkgname}-${pkgver}.tar.bz2 + iptables + ip6tables + empty.rules + simple_firewall.rules + iptables.conf.d) +backup=(etc/conf.d/iptables) +sha1sums=('2aa0d215485133f2817973b0914a132f628d9f3a' + 'd7540316581bb66c5594885882a14ba394e95098' + '70d70113e3a23f0fe99404c5536507a887a4ca5c' + '83b3363878e3660ce23b2ad325b53cbd6c796ecf' + '9907f9e815592837abc7fa3264a401567b7606ab' + '1c52444ffbecc09f56bb325db49e924dd32f9213') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + # http://bugs.archlinux.org/task/17046 + sed -i '87 i libxt_RATEEST.so: libxt_RATEEST.oo' extensions/GNUmakefile.in + sed -i '88 i \\t${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -lm -shared ${LDFLAGS} -o $@ $<;\n' extensions/GNUmakefile.in + + ./configure --prefix=/usr --with-kernel=usr/src/linux-$(uname -r) \ + --libexecdir=/usr/lib/iptables --sysconfdir=/etc \ + --with-xtlibdir=/usr/lib/iptables \ + --enable-devel --enable-libipq + + make +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + + make DESTDIR=${pkgdir} install + + install -D -m755 ../iptables ${pkgdir}/etc/rc.d/iptables + install -D -m755 ../ip6tables ${pkgdir}/etc/rc.d/ip6tables + install -D -m644 ../empty.rules ${pkgdir}/etc/iptables/empty.rules + install -D -m644 ../simple_firewall.rules ${pkgdir}/etc/iptables/simple_firewall.rules + install -D -m644 ../iptables.conf.d ${pkgdir}/etc/conf.d/iptables +} diff --git a/testing/iptables/empty.rules b/testing/iptables/empty.rules new file mode 100644 index 000000000..e24e1aa30 --- /dev/null +++ b/testing/iptables/empty.rules @@ -0,0 +1,6 @@ +# Empty iptables rule file +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +COMMIT diff --git a/testing/iptables/ip6tables b/testing/iptables/ip6tables new file mode 100755 index 000000000..1733db281 --- /dev/null +++ b/testing/iptables/ip6tables @@ -0,0 +1,97 @@ +#!/bin/bash + +# source application-specific settings +[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables + +# Set defaults if settings are missing +[ -z "$IP6TABLES" ] && IP6TABLES=/usr/sbin/ip6tables +[ -z "$IP6TABLES_CONF" ] && IP6TABLES_CONF=/etc/iptables/ip6tables.rules + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + if [ ! -f $IP6TABLES_CONF ]; then + echo "Cannot load iptables rules: $IP6TABLES_CONF is missing!" >&2 + exit 1 + fi + stat_busy "Starting IP6 Tables" + if [ "$IPTABLES_FORWARD" = "1" ]; then + echo 1 >/proc/sys/net/ipv6/conf/default/forwarding + echo 1 >/proc/sys/net/ipv6/conf/all/forwarding + fi + if ck_daemon ip6tables; then + /usr/sbin/ip6tables-restore < $IP6TABLES_CONF + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon ip6tables + stat_done + fi + else + stat_fail + fi + ;; + stop) + stat_busy "Stopping IP6 Tables" + echo 0 >/proc/sys/net/ipv6/conf/all/forwarding + echo 0 >/proc/sys/net/ipv6/conf/default/forwarding + if ! ck_daemon ip6tables; then + fail=0 + for table in $(cat /proc/net/ip6_tables_names); do + $IP6TABLES -t $table -F &>/dev/null && \ + $IP6TABLES -t $table -X &>/dev/null && \ + $IP6TABLES -t $table -Z &>/dev/null + [ $? -gt 0 ] && fail=1 + done + if [ $fail -gt 0 ]; then + stat_fail + else + rm_daemon ip6tables + # reset policies + for table in filter mangle raw; do + if grep -qw $table /proc/net/ip6_tables_names; then + $IP6TABLES -t $table -P OUTPUT ACCEPT + fi + done + for table in filter mangle; do + if grep -qw $table /proc/net/ip6_tables_names; then + $IP6TABLES -t $table -P INPUT ACCEPT + $IP6TABLES -t $table -P FORWARD ACCEPT + fi + done + for table in mangle raw; do + if grep -qw $table /proc/net/ip6_tables_names; then + $IP6TABLES -t $table -P PREROUTING ACCEPT + fi + done + for table in mangle; do + if grep -qw $table /proc/net/ip6_tables_names; then + $IP6TABLES -t $table -P POSTROUTING ACCEPT + fi + done + stat_done + fi + else + stat_fail + fi + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + save) + stat_busy "Saving IP6 Tables" + /usr/sbin/ip6tables-save >$IP6TABLES_CONF + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + ;; + *) + echo "usage: $0 {start|stop|restart|save}" +esac +exit 0 diff --git a/testing/iptables/iptables b/testing/iptables/iptables new file mode 100755 index 000000000..50c13d5c1 --- /dev/null +++ b/testing/iptables/iptables @@ -0,0 +1,95 @@ +#!/bin/bash + +# source application-specific settings +[ -f /etc/conf.d/iptables ] && . /etc/conf.d/iptables + +# Set defaults if settings are missing +[ -z "$IPTABLES" ] && IPTABLES=/usr/sbin/iptables +[ -z "$IPTABLES_CONF" ] && IPTABLES_CONF=/etc/iptables/iptables.rules + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + if [ ! -f $IPTABLES_CONF ]; then + echo "Cannot load iptables rules: $IPTABLES_CONF is missing!" >&2 + exit 1 + fi + stat_busy "Starting IP Tables" + if [ "$IPTABLES_FORWARD" = "1" ]; then + echo 1 >/proc/sys/net/ipv4/ip_forward + fi + if ck_daemon iptables; then + /usr/sbin/iptables-restore < $IPTABLES_CONF + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon iptables + stat_done + fi + else + stat_fail + fi + ;; + stop) + stat_busy "Stopping IP Tables" + echo 0 >/proc/sys/net/ipv4/ip_forward + if ! ck_daemon iptables; then + fail=0 + for table in $(cat /proc/net/ip_tables_names); do + $IPTABLES -t $table -F &>/dev/null && \ + $IPTABLES -t $table -X &>/dev/null && \ + $IPTABLES -t $table -Z &>/dev/null + [ $? -gt 0 ] && fail=1 + done + if [ $fail -gt 0 ]; then + stat_fail + else + rm_daemon iptables + # reset policies + for table in filter nat mangle raw; do + if grep -qw $table /proc/net/ip_tables_names; then + $IPTABLES -t $table -P OUTPUT ACCEPT + fi + done + for table in filter mangle; do + if grep -qw $table /proc/net/ip_tables_names; then + $IPTABLES -t $table -P INPUT ACCEPT + $IPTABLES -t $table -P FORWARD ACCEPT + fi + done + for table in nat mangle raw; do + if grep -qw $table /proc/net/ip_tables_names; then + $IPTABLES -t $table -P PREROUTING ACCEPT + fi + done + for table in nat mangle; do + if grep -qw $table /proc/net/ip_tables_names; then + $IPTABLES -t $table -P POSTROUTING ACCEPT + fi + done + stat_done + fi + else + stat_fail + fi + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + save) + stat_busy "Saving IP Tables" + /usr/sbin/iptables-save >$IPTABLES_CONF + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + ;; + *) + echo "usage: $0 {start|stop|restart|save}" +esac +exit 0 diff --git a/testing/iptables/iptables.conf.d b/testing/iptables/iptables.conf.d new file mode 100644 index 000000000..07bc11aa1 --- /dev/null +++ b/testing/iptables/iptables.conf.d @@ -0,0 +1,8 @@ +# Configuration for iptables rules + +IPTABLES=/usr/sbin/iptables +IP6TABLES=/usr/sbin/ip6tables + +IPTABLES_CONF=/etc/iptables/iptables.rules +IP6TABLES_CONF=/etc/iptables/ip6tables.rules +IPTABLES_FORWARD=0 # enable IP forwarding? diff --git a/testing/iptables/simple_firewall.rules b/testing/iptables/simple_firewall.rules new file mode 100644 index 000000000..e1604cc36 --- /dev/null +++ b/testing/iptables/simple_firewall.rules @@ -0,0 +1,11 @@ +*filter +:INPUT DROP [0:0] +:FORWARD DROP [0:0] +:OUTPUT ACCEPT [0:0] +-A INPUT -p icmp -j ACCEPT +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -i lo -j ACCEPT +-A INPUT -p tcp -j REJECT --reject-with tcp-reset +-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable +-A INPUT -j REJECT --reject-with icmp-proto-unreachable +COMMIT |