diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-03-30 19:56:03 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-03-30 19:56:03 +0000 |
commit | 91ec719475cff9c7d949c4d7020eec820abc9ca0 (patch) | |
tree | 41dbf4480f0a34367e73cdffd528e7f796e9aba7 /main | |
parent | 140c56e4b3ea0c5796dc0867bf8b9a7d6727395d (diff) | |
parent | 556b9732698a2c9aedb4c4a32bd62305e7b7db15 (diff) | |
download | aports-91ec719475cff9c7d949c4d7020eec820abc9ca0.tar.bz2 aports-91ec719475cff9c7d949c4d7020eec820abc9ca0.tar.xz |
Merge branch 'master' of git://git.alpinelinux.org/msmith/aports
Diffstat (limited to 'main')
-rw-r--r-- | main/apache-mod-auth-ntlm-winbind/APKBUILD | 2 | ||||
-rw-r--r-- | main/duplicity/APKBUILD | 33 | ||||
-rw-r--r-- | main/mysql/APKBUILD | 41 | ||||
-rw-r--r-- | main/nsd/0010-stop-unlink-pid-error.patch | 26 | ||||
-rw-r--r-- | main/nsd/APKBUILD | 76 | ||||
-rw-r--r-- | main/nsd/nsd.confd | 15 | ||||
-rw-r--r-- | main/nsd/nsd.initd | 420 | ||||
-rw-r--r-- | main/nsd/nsd.post-deinstall | 4 | ||||
-rw-r--r-- | main/nsd/nsd.pre-install | 4 | ||||
-rw-r--r-- | main/nsd/nsdc | 30 | ||||
-rw-r--r-- | main/pdnsd/APKBUILD | 101 | ||||
-rw-r--r-- | main/pdnsd/pdnsd.conf | 51 | ||||
-rw-r--r-- | main/pdnsd/pdnsd.confd | 18 | ||||
-rw-r--r-- | main/pdnsd/pdnsd.initd | 25 | ||||
-rw-r--r-- | main/pdnsd/pdnsd.post-deinstall | 4 | ||||
-rw-r--r-- | main/pdnsd/pdnsd.pre-install | 4 | ||||
-rw-r--r-- | main/py-boto/APKBUILD | 51 |
17 files changed, 884 insertions, 21 deletions
diff --git a/main/apache-mod-auth-ntlm-winbind/APKBUILD b/main/apache-mod-auth-ntlm-winbind/APKBUILD index c9f2f7d016..abc0a90221 100644 --- a/main/apache-mod-auth-ntlm-winbind/APKBUILD +++ b/main/apache-mod-auth-ntlm-winbind/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa <natanael.copa@gmail.com> pkgname=apache-mod-auth-ntlm-winbind pkgver=0.1 -pkgrel=2 +pkgrel=3 pkgdesc="Authentication module for Apache using NTLM protocol with winbind helper" url="http://samba.org/ftp/unpacked/lorikeet/mod_auth_ntlm_winbind/" arch="all" diff --git a/main/duplicity/APKBUILD b/main/duplicity/APKBUILD new file mode 100644 index 0000000000..2562ee2d40 --- /dev/null +++ b/main/duplicity/APKBUILD @@ -0,0 +1,33 @@ +# Contributor: Matt Smith <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +pkgname=duplicity +pkgver=0.6.12 +pkgrel=0 +pkgdesc="Encrypted bandwidth-efficient backup using the rsync algorithm" +url="http://duplicity.nongnu.org/" +arch="all" +license="GPL" +depends="python py-boto ncftp librsync gnupg" +makedepends="wget python-dev py-setuptools librsync-dev" +install= +subpackages="$pkgname-doc" +source="https://code.launchpad.net/$pkgname/${pkgver:0:3}-series/$pkgver/+download/$pkgname-$pkgver.tar.gz" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + python setup.py build || return 1 +} + +package() { + cd "$_builddir" + python setup.py install --root "$pkgdir" +} + +md5sums="9b84c984054550bbb2ba29b553567b7b duplicity-0.6.12.tar.gz" diff --git a/main/mysql/APKBUILD b/main/mysql/APKBUILD index d559876b8f..b77e322c37 100644 --- a/main/mysql/APKBUILD +++ b/main/mysql/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Carlo Landmeter <clandmeter@gmail.com> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=mysql -pkgver=5.1.54 +pkgver=5.1.56 pkgrel=0 pkgdesc="A fast SQL database server" url="http://www.mysql.com/" @@ -41,53 +41,54 @@ build() { --with-plugins=partition,archive,blackhole,csv,federated,heap,innobase,innodb_plugin,ndbcluster \ --mandir=/usr/share/man \ || return 1 - make + make || return 1 } package() { cd $_builddir - make -j1 DESTDIR="$pkgdir/" install - install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname - install -Dm 644 "$startdir"/$pkgname.mycnf $pkgdir/etc/mysql/my.cnf - install -dDo mysql $pkgdir/var/log/mysql - install -dDo mysql $pkgdir/var/run/mysqld + make -j1 DESTDIR="$pkgdir/" install || return 1 + install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname \ + || return 1 + install -Dm 644 "$startdir"/$pkgname.mycnf $pkgdir/etc/mysql/my.cnf \ + || return 1 + install -dDo mysql $pkgdir/var/log/mysql || return 1 + install -dDo mysql $pkgdir/var/run/mysqld || return 1 } libmysqlclient() { pkgdesc="MySQL client library" # some files moved replaces="mysql" - mkdir -p "$subpkgdir"/usr/lib/mysql + mkdir -p "$subpkgdir"/usr/lib/mysql || return 1 mv "$pkgdir"/usr/lib/mysql/libmysqlclient.so* \ "$pkgdir"/usr/lib/mysql/libmysqlclient_r.so* \ - "$subpkgdir"/usr/lib/mysql + "$subpkgdir"/usr/lib/mysql || return 1 # make symlinks - cd "$subpkgdir"/usr/lib + cd "$subpkgdir"/usr/lib || return 1 for i in mysql/*; do - ln -s "$i" "${i##*/}" + ln -s "$i" "${i##*/}" || return 1 done } test() { - mkdir -p "$subpkgdir"/usr - mv "$pkgdir"/usr/mysql-test "$subpkgdir"/usr/ + mkdir -p "$subpkgdir"/usr || return 1 + mv "$pkgdir"/usr/mysql-test "$subpkgdir"/usr/ || return 1 } client() { pkgdesc="client for the MySQL database" install="" - local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug mysqlcheck - mysql_client_test mysqldump mysqldumpslow mysql_explain_log mysql_find_rows - mysql_fix_extensions mysqlimport mysqlshow mysql_tableinfo mysqltestmanagerc - mysqltestmanager-pwgen mysql_waitpid" + local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug + mysqlcheck mysql_client_test mysqldump mysqldumpslow mysql_find_rows + mysql_fix_extensions mysqlimport mysqlshow mysql_waitpid" - mkdir -p "$subpkgdir"/usr/bin/ + mkdir -p "$subpkgdir"/usr/bin/ || return 1 for i in $bins; do - mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ || return 1 done } -md5sums="2a0f45a2f8b5a043b95ce7575796a30b mysql-5.1.54.tar.gz +md5sums="15161d67f4830aad3a8a89e083749d49 mysql-5.1.56.tar.gz 25d08b02bff6aa379dc45859b7a3f28a mysql.initd 15a7e3ddd6a40bf5a1eb3a8c69d9c34c mysql.mycnf" diff --git a/main/nsd/0010-stop-unlink-pid-error.patch b/main/nsd/0010-stop-unlink-pid-error.patch new file mode 100644 index 0000000000..24175df337 --- /dev/null +++ b/main/nsd/0010-stop-unlink-pid-error.patch @@ -0,0 +1,26 @@ +This patch prevents nsd from attempting to unlink the pidfile on nsd +shutdown. The reason for this is because we get a permission denied +error in nsd.log when it attempts to do so. + +I think this is needed because of how normal OpenRC init scripts are +designed and handled. + +See the included /etc/init.d/nsd (nsd.initd) for my conversion of the +nsdc script that's normally distributed with nsd. The included nsdc +script is a wrapper for the converted OpenRC init script, designed to +maintain compatibility. + +Matt Smith <msmith@alpinelinux.org> + + +--- a/server.c ++++ b/server.c +@@ -1167,7 +1167,7 @@ + close(fd); + + /* Unlink it if possible... */ +- unlinkpid(nsd->pidfile); ++ //unlinkpid(nsd->pidfile); + + if(reload_listener.fd > 0) { + sig_atomic_t cmd = NSD_QUIT; diff --git a/main/nsd/APKBUILD b/main/nsd/APKBUILD new file mode 100644 index 0000000000..a110b94a8f --- /dev/null +++ b/main/nsd/APKBUILD @@ -0,0 +1,76 @@ +# Contributor: Matt Smith <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +pkgname=nsd +pkgver=3.2.8 +pkgrel=0 +pkgdesc="NSD is an authoritative only, high performance, simple and open source name server." +url="http://www.nlnetlabs.nl/projects/nsd/" +arch="all" +license="BSD" +depends= +depends_dev= +makedepends="$depends_dev openssl-dev" +install="$pkgname.pre-install $pkgname.post-deinstall" +subpackages="$pkgname-doc" +pkgusers="nsd" +pkggroups="nsd" +source="http://www.nlnetlabs.nl/downloads/$pkgname/$pkgname-$pkgver.tar.gz + 0010-stop-unlink-pid-error.patch + nsdc + nsd.initd + nsd.confd + " + +_builddir="$srcdir/$pkgname-$pkgver" +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + + ./configure \ + --sbindir=/usr/sbin \ + --mandir=/usr/share/man \ + --with-user=nsd \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + + install -m755 -D "$srcdir"/nsdc \ + "$pkgdir"/usr/sbin/nsdc || return 1 + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/nsd || return 1 + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/nsd || return 1 + + chown nsd "$pkgdir"/var/db/nsd || return 1 +} + +doc() { + arch="noarch" + + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname || return 1 + cp -a "$_builddir"/doc/* \ + "$subpkgdir"/usr/share/doc/$pkgname/ || return 1 + cp -a "$_builddir"/contrib/ \ + "$subpkgdir"/usr/share/doc/$pkgname/ || return 1 + mv "$pkgdir"/usr/share/man \ + "$subpkgdir"/usr/share/man || return 1 +} + +md5sums="963c2123853e7759ffb772da40c68838 nsd-3.2.8.tar.gz +cc592572846b978a6f52130a8e518ab3 0010-stop-unlink-pid-error.patch +3aa94004a39319db89a329e9f24fb9da nsdc +4c0eef07caac9083aeeb9b15602d014d nsd.initd +37bd648259fdd919c79aaa0168b4423c nsd.confd" diff --git a/main/nsd/nsd.confd b/main/nsd/nsd.confd new file mode 100644 index 0000000000..e37f716baf --- /dev/null +++ b/main/nsd/nsd.confd @@ -0,0 +1,15 @@ +# +# Specify nsd options here. +# + +# configuration file default +configfile="/etc/nsd/nsd.conf" + +# The directory where NSD binaries reside +sbindir="/usr/sbin" + +# how verbose is zonec run. Specify Nothing (empty string), -v or -vv. +ZONEC_VERBOSE=-v + +# how patch is done. Specify 1 (with use of textfiles, default) or 0 (without) +PATCH_STYLE=1 diff --git a/main/nsd/nsd.initd b/main/nsd/nsd.initd new file mode 100644 index 0000000000..f400080494 --- /dev/null +++ b/main/nsd/nsd.initd @@ -0,0 +1,420 @@ +#!/sbin/runscript +# +# nsdc.sh -- a shell script to manage the beast +# +# Copyright (c) 2001-2006, NLnet Labs. All rights reserved. +# +# See LICENSE for the license. +# +# OpenRC conversion by Matt Smith <msmith@alpinelinux.org> +# +# + +name=nsd +daemon=/usr/sbin/${name} +initd=/etc/init.d/${name} + +description="NSD, authoritative only high performance name server." + +extra_commands="stats reload running patch rebuild update notify do_start do_stop" +description_reload="Reloads the nsd database file." +description_running="Prints message and exits nonzero if server is not running." +description_patch="Merge zone transfer changes back to zone files." +description_rebuild="Compile database file from zone files." +description_update="Try to update all slave zones hosted on this server." +description_notify="Send notify messages to all secondary servers." +description_do_start="Internal command; use 'start' instead." +description_do_stop="Internal command; use 'stop' instead." + +depend() { + need net + after firewall +} + +# +# You sure heard this many times before: NO USER SERVICEABLE PARTS BELOW +# + +# see if user selects a different config file, with -c <filename> +if test "x$1" = "x-c"; then + shift + if [ -e $1 ]; then + configfile=$1 + shift + else + echo "`basename $0`: Config file "$1" does not exist." + exit 1 + fi +fi + +# locate nsd-checkconf : in sbindir, PATH, nsdc_dir or . +nsd_checkconf="" +if [ -e ${sbindir}/nsd-checkconf ]; then + nsd_checkconf=${sbindir}/nsd-checkconf +else + if which nsd-checkconf >/dev/null 2>&1 ; then + if which nsd-checkconf 2>&1 | grep "^[Nn]o " >/dev/null; then + nsd_checkconf="" + else + nsd_checkconf=`which nsd-checkconf` + fi + fi + if [ -z "${nsd_checkconf}" -a -e `dirname $0`/nsd-checkconf ]; then + nsd_checkconf=`dirname $0`/nsd-checkconf + fi + if [ -z "${nsd_checkconf}" -a -e ./nsd-checkconf ]; then + nsd_checkconf=./nsd-checkconf + fi + if [ -z "${nsd_checkconf}" ]; then + echo "`basename $0`: Could not find nsd programs" \ + "in $sbindir, in PATH=$PATH, in cwd=`pwd`," \ + "or in dir of nsdc=`dirname $0`" + exit 1 + fi +fi + +# check the config syntax before using it +${nsd_checkconf} ${configfile} +if test $? -ne 0 ; then + ${initd} describe + exit 1 +fi + +# Read some settings from the config file. +dbfile=`${nsd_checkconf} -o database ${configfile}` +pidfile=`${nsd_checkconf} -o pidfile ${configfile}` +difffile=`${nsd_checkconf} -o difffile ${configfile}` +zonesdir=`${nsd_checkconf} -o zonesdir ${configfile}` +lockfile="${dbfile}.lock" # still needed +sbindir=`dirname ${nsd_checkconf}` + +# move to zonesdir (if specified), and make absolute pathnames. +if test -n "${zonesdir}"; then + zonesdir=`dirname ${zonesdir}/.` + if echo "${zonesdir}" | grep "^[^/]" >/dev/null; then + zonesdir=`pwd`/${zonesdir} + fi + if echo "${dbfile}" | grep "^[^/]" >/dev/null; then + dbfile=${zonesdir}/${dbfile} + fi + if echo "${pidfile}" | grep "^[^/]" >/dev/null; then + pidfile=${zonesdir}/${pidfile} + fi + if echo "${lockfile}" | grep "^[^/]" >/dev/null; then + lockfile=${zonesdir}/${lockfile} + fi + if echo "${difffile}" | grep "^[^/]" >/dev/null; then + difffile=${zonesdir}/${difffile} + fi +fi + +# for bash: -C or noclobber. For tcsh: noclobber. For bourne: -C. +noclobber_set="set -C" +# ugly check for tcsh +if echo /bin/sh | grep tcsh >/dev/null; then + noclobber_set="set noclobber" +fi + +# +# useful routines +# +signal() { + if [ -s ${pidfile} ] + then + kill -"$1" `cat ${pidfile}` && return 0 + else + echo "nsd is not running" + fi + return 1 +} + +lock_file() { + (umask 222; ${noclobber_set}; echo "$$" >${lockfile}) +} + +lock() { + lock_file + if [ $? = 1 ] + then + # check if the lockfile has not gone stale + LPID=`cat ${lockfile}` + echo database locked by PID: $LPID + if kill -0 $LPID 2>/dev/null; then + exit 1 + fi + + # locking process does not exist, consider lockfile stale + echo stale lockfile, removing... && rm -f ${lockfile} && lock_file + fi + + if [ $? = 1 ] + then + echo lock failed + exit 1 + fi + return 0 +} + +unlock() { + rm -f ${lockfile} +} + +do_start() { + if test -x ${sbindir}/nsd; then + ${sbindir}/nsd -c ${configfile} + test $? = 0 || (echo "nsd startup failed."; exit 1) + else + echo "${sbindir}/nsd not an executable file, nsd startup failed."; exit 1 + fi +} + +controlled_sleep() { + if [ $1 -ge 25 ]; then + sleep 1 + fi +} + +controlled_stop() { + pid=$1 + try=1 + + while [ $try -ne 0 ]; do + if [ ${try} -gt 50 ]; then + echo "nsdc stop failed" + return 1 + else + if [ $try -eq 1 ]; then + kill -TERM ${pid} + else + kill -TERM ${pid} >/dev/null 2>&1 + fi + + # really stopped? + kill -0 ${pid} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + controlled_sleep ${try} + try=`expr ${try} + 1` + else + try=0 + fi + fi + done + + return 0 +} + +do_controlled_stop() { + if [ -s ${pidfile} ]; then + pid=`cat ${pidfile}` + controlled_stop ${pid} && return 0 + else + echo "nsd is not running, starting anyway" && return 0 + fi + return 1 +} + +do_stop() { + signal "TERM" +} + +do_reload() { + signal "HUP" +} + +# send_updates zone_name {ip_spec key_spec} +send_updates() { + local zonename=$1 + shift 1 + # extract port number (if any) + port=`${nsd_checkconf} -o port ${configfile}` + if test -n "${port}"; then + port="-p ${port}" + fi + update_sent="no" + + while test $# -gt 0; do + ip_spec=$1 + key_spec=$2 + shift 2 + # only localhost is allowed. + # see if zone has 127.0.0.1 or ::1 as allowed. + if test Z${ip_spec} = "Z127.0.0.1" -o Z${ip_spec} = "Z::1"; then + secret="" + if test K${key_spec} != KNOKEY -a K${key_spec} != KBLOCKED; then + secret=`${nsd_checkconf} -s ${key_spec} ${configfile}` + algo=`${nsd_checkconf} -a ${key_spec} ${configfile}` + secret="-y ${key_spec}:${secret}:${algo}" + fi + if test K${key_spec} != KBLOCKED; then + #echo "${sbindir}/nsd-notify -a ${ip_spec} ${port} ${secret} -z ${zonename} ${ip_spec}" + ${sbindir}/nsd-notify -a ${ip_spec} ${port} ${secret} -z ${zonename} ${ip_spec} && update_sent="yes" + fi + fi + done + if test ${update_sent} = no; then + req_xfr=`${nsd_checkconf} -z "${zonename}" -o request-xfr ${configfile}` + if test -n "${req_xfr}"; then + # must be a slave zone (has request-xfr). + echo "`basename $0`: Could not send notify for slave zone ${zonename}: not configured (with allow-notify: 127.0.0.1 or ::1)" + fi + fi +} + +# send_notify zone_name ifc_spec {ip_spec key_spec} +send_notify() { + local zonename=$1 + # set local interface + ifc_spec="" + if test I$2 != INOIFC; then + ifc_spec="-a $2" + fi + shift 2 + + while test $# -gt 0; do + ip_spec=$1 + key_spec=$2 + shift 2 + secret="" + + if test K${key_spec} != KNOKEY -a K${key_spec} != KBLOCKED; then + secret=`${nsd_checkconf} -s ${key_spec} ${configfile}` + algo=`${nsd_checkconf} -a ${key_spec} ${configfile}` + secret="-y ${key_spec}:${secret}:${algo}" + fi + if test K${key_spec} != KBLOCKED; then + port="" + ipaddr=${ip_spec} + if echo ${ip_spec} | grep @ >/dev/null; then + port="-p "`echo ${ip_spec} | sed -e 's/[^@]*@\([0-9]*\)/\1/'` + ipaddr=`echo ${ip_spec} | sed -e 's/\([^@]*\)@[0-9]*/\1/'` + fi + #echo "${sbindir}/nsd-notify ${ifc_spec} ${port} ${secret} -z ${zonename} ${ipaddr}" + ${sbindir}/nsd-notify ${ifc_spec} ${port} ${secret} -z ${zonename} ${ipaddr} + fi + done +} + +# do_patch {with-textfile} +do_patch() { + if test I$1 = I1; then + lock && mv ${difffile} ${difffile}.$$ && \ + ${sbindir}/nsd-patch -c ${configfile} -x ${difffile}.$$ && \ + rm -f ${difffile}.$$ && unlock && do_rebuild + result=$? + else # without textfile + lock && mv ${difffile} ${difffile}.$$ && \ + ${sbindir}/nsd-patch -c ${configfile} -x ${difffile}.$$ -s -o ${dbfile}.$$ \ + && rm -f ${difffile}.$$ && unlock && \ + mv ${dbfile}.$$ ${dbfile} + result=$? + fi + + return ${result} +} + +do_rebuild() { + lock && \ + ${sbindir}/zonec ${ZONEC_VERBOSE} -c ${configfile} -f ${dbfile}.$$ && \ + mv ${dbfile}.$$ ${dbfile} + result=$? + unlock + [ $result != 0 ] && echo "${dbfile} is unmodified" + rm -f ${dbfile}.$$ + return ${result} +} + +start() { + ebegin "Starting ${name}" + if test -s ${pidfile} && kill -"0" `cat ${pidfile}` + then + (echo "process `cat ${pidfile}` exists, please use restart"; exit 1) + else + start-stop-daemon --start --quiet \ + --pidfile ${pidfile} \ + --exec ${initd} -- do_start + fi + eend $? +} + +stop() { + ebegin "Stopping ${name}" + start-stop-daemon --stop --quiet \ + --pidfile ${pidfile} \ + --exec ${initd} -- do_stop + eend $? +} + +stats() { + signal "USR1" +} + +reload() { + do_reload +} + +running() { + signal "0" +} + +patch() { + # patch queue clearen + if test -s ${difffile}; then + #${sbindir}/nsd-patch -c ${configfile} -x ${difffile} -l #debug + #echo ${sbindir}/nsd-patch -c ${configfile} -x ${difffile} + if do_patch ${PATCH_STYLE}; then + do_reload + else + unlock + # try to move back the transfer data + if [ -e ${difffile}.$$ -a ! -e ${difffile} ]; then + mv ${difffile}.$$ ${difffile} + fi + echo "`basename $0`: patch failed." + exit 1 + fi + else + echo "`basename $0`: no patch necessary." + fi +} + +rebuild() { + do_rebuild +} + +update() { + # send notifies to localhost for all zones that allow it + echo "Sending notify to localhost to update secondary zones..." + if [ -s ${pidfile} ]; then + zoneslist=`${nsd_checkconf} -o zones ${configfile}` + for zonename in ${zoneslist}; do + notify_allow=`${nsd_checkconf} -z "${zonename}" -o allow-notify ${configfile}` + if test "" != "${notify_allow}"; then + send_updates ${zonename} ${notify_allow} + fi + done + else + echo "nsd is not running" + fi +} + +notify() { + # send notifies to all slaves + echo "Sending notify to slave servers..." + zoneslist=`${nsd_checkconf} -o zones ${configfile}` + for zonename in ${zoneslist}; do + notify=`${nsd_checkconf} -z "${zonename}" -o notify ${configfile}` + local_ifc=`${nsd_checkconf} -z "${zonename}" -o outgoing-interface ${configfile}` + if test "" = "${local_ifc}"; then + local_ifc="NOIFC" + fi + if test "" != "${notify}"; then + for ifc in ${local_ifc}; do + send_notify ${zonename} ${ifc} ${notify} + done + fi + done +} + +restart() { + do_controlled_stop && do_start +} diff --git a/main/nsd/nsd.post-deinstall b/main/nsd/nsd.post-deinstall new file mode 100644 index 0000000000..4d5fc40932 --- /dev/null +++ b/main/nsd/nsd.post-deinstall @@ -0,0 +1,4 @@ +#!/bin/sh + +deluser nsd 2>/dev/null +exit 0 diff --git a/main/nsd/nsd.pre-install b/main/nsd/nsd.pre-install new file mode 100644 index 0000000000..daabc70b38 --- /dev/null +++ b/main/nsd/nsd.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +adduser -S -H -h /var/db/nsd -s /bin/false nsd 2>/dev/null +exit 0 diff --git a/main/nsd/nsdc b/main/nsd/nsdc new file mode 100644 index 0000000000..ff4cb5c6b7 --- /dev/null +++ b/main/nsd/nsdc @@ -0,0 +1,30 @@ +#!/bin/sh +# +# nsdc replacement script by Matt Smith <msmith@alpinelinux.org> +# + +usage() { + echo "Usage: `basename $0` {start|stop|reload|rebuild|restart|" + echo " running|update|notify|patch}" + echo "commands:" + echo " start Start nsd server." + echo " stop Stop nsd server." + echo " reload Nsd server reloads database file." + echo " rebuild Compile database file from zone files." + echo " restart Stop the nsd server and start it again." + echo " running Prints message and exit nonzero if server not running." + echo " update Try to update all slave zones hosted on this server." + echo " notify Send notify messages to all secondary servers." + echo " patch Merge zone transfer changes back to zone files." +} + +if [ $# -eq 0 ]; then + usage +else + case "$1" in + "-h"|"--help") + usage;; + *) + /etc/init.d/nsd $* + esac +fi diff --git a/main/pdnsd/APKBUILD b/main/pdnsd/APKBUILD new file mode 100644 index 0000000000..cdc494cb44 --- /dev/null +++ b/main/pdnsd/APKBUILD @@ -0,0 +1,101 @@ +# Contributor: Matt Smith <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +pkgname=pdnsd +pkgver=1.2.8 +_realver=$pkgver-par +pkgrel=0 +pkgdesc="A proxy DNS server with permanent caching" +url="http://www.phys.uu.nl/~rombouts/pdnsd/" +arch="all" +license="GPL" +depends= +depends_dev= +makedepends="$depends_dev" +install="$pkgname.pre-install $pkgname.post-deinstall" +subpackages="$pkgname-doc" +pkgusers="pdnsd" +pkggroups="pdnsd" +source="http://www.phys.uu.nl/~rombouts/pdnsd/releases/$pkgname-$_realver.tar.gz + pdnsd.initd + pdnsd.confd + pdnsd.conf + " + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --enable-ipv6 \ + --with-random-device=/dev/urandom \ + --enable-tcp-subseq \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname || return 1 + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname || return 1 + install -m644 -D "$srcdir"/$pkgname.conf \ + "$pkgdir"/etc/$pkgname.conf || return 1 + + chown -R pdnsd "$pkgdir"/var/cache/pdnsd || return 1 + sed -ri 's/([ ]*run_as=)"nobody";/\1"pdnsd";/' \ + "$pkgdir"/etc/pdnsd.conf.sample || return 1 + sed -ri '/pid_file/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1 + sed -ri '/query_method/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1 +} + +doc() { + arch="noarch" + + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/html || return 1 + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/txt || return 1 + mkdir -p "$subpkgdir"/usr/share/$pkgname/contrib || return 1 + + # /usr/share/{man,doc/$pkgname} + cp -a "$pkgdir"/usr/share/ "$subpkgdir"/usr/ || return 1 + rm -rf "$pkgdir"/usr/share/ || return 1 + _docs="AUTHORS COPYING COPYING.BSD ChangeLog ChangeLog.old \ + NEWS README README.par README.par.old THANKS TODO" + for _doc in $_docs; do + cp "$_builddir"/$_doc "$subpkgdir"/usr/share/doc/$pkgname/ \ + || return 1 + done + cp -R "$_builddir"/doc/html/* \ + "$subpkgdir"/usr/share/doc/$pkgname/html/ || return 1 + cp -R "$_builddir"/doc/txt/* \ + "$subpkgdir"/usr/share/doc/$pkgname/txt/ || return 1 + + # /usr/share/$pkgname + mv "$pkgdir"/etc/pdnsd.conf.sample \ + "$subpkgdir"/usr/share/$pkgname/ || return 1 + _contribs="README change_pdnsd_server_ip.pl dhcp2pdnsd pdnsd_dhcp.pl" + for _contrib in $_contribs; do + cp -a "$_builddir"/contrib/$_contrib \ + "$subpkgdir"/usr/share/$pkgname/contrib/ || return 1 + done +} + +md5sums="779c5d19576e561fbf2455de435e5597 pdnsd-1.2.8-par.tar.gz +14d6c0a1e9e552999cc4efb2c1251d98 pdnsd.initd +4bced9066febfe33b4a527f28cfb6a48 pdnsd.confd +f7cf4b9391b67ee421485a0c24aa8a5c pdnsd.conf" diff --git a/main/pdnsd/pdnsd.conf b/main/pdnsd/pdnsd.conf new file mode 100644 index 0000000000..f3e6ae4b75 --- /dev/null +++ b/main/pdnsd/pdnsd.conf @@ -0,0 +1,51 @@ +# +# Default Alpine Linux pdnsd config +# +# See /usr/share/pdnsd/pdnsd.conf.sample and the pdnsd.conf(5) manpage, +# both available in the pdnsd-doc package. +# +# Comments can begin with either '#' or '//', and entire blocks may be +# commented out with '/*' and '*/'. +# +global { + perm_cache=2048; + cache_dir="/var/cache/pdnsd"; + run_as="pdnsd"; + server_ip = any; + status_ctl = on; +# paranoid=on; # This option reduces the chance of cache poisoning + # but may make pdnsd less efficient, unfortunately. + min_ttl=15m; # Retain cached entries at least 15 minutes. + max_ttl=1w; # One week. + timeout=10; # Global timeout option (10 seconds). + neg_domain_pol=on; +} + +server { + label= "googledns"; + ip = 8.8.8.8, 8.8.4.4; + proxy_only=on; + lean_query=on; + timeout=4; # Server timeout; this may be much shorter + # that the global timeout option. + uptest=none; + interval=10m; # Check every 10 minutes. + purge_cache=off; +} + +/* +source { + owner=localhost; +# serve_aliases=on; + file="/etc/hosts"; +} +*/ + +rr { + name=localhost; + reverse=on; + a=127.0.0.1; +# a=::1; + owner=localhost; + soa=localhost,root.localhost,42,86400,900,86400,86400; +} diff --git a/main/pdnsd/pdnsd.confd b/main/pdnsd/pdnsd.confd new file mode 100644 index 0000000000..8f8820c8da --- /dev/null +++ b/main/pdnsd/pdnsd.confd @@ -0,0 +1,18 @@ +# +# Specify pdnsd options here. +# +# -4 run in IPv4 mode +# -6 run in IPv6 mode +# -a autodetects IPv6 supports, falls back to IPv4 +# NOTE: IPv6 mode seems to have issues. +# -d run in daemon mode +# -s enables the status control socket so pdnsd-ctl can be used at run-time +# (same as setting status_ctl=on; in the config file) +# -t enables the TCP server thread alongside the UDP server thread +# -mut sets the query method to 'ut': udp first, fallback to tcp +# -c specifies the config file +# -p specifies the pid file +# -g enables debugging/logging output at /var/cache/pdnsd/pdnsd.debug +# -vn where n specifies the debugging verbosity level (0-3) + +pdnsd_opts="-4 -d -s -t -mut -c /etc/pdnsd.conf -p /var/run/pdnsd.pid" diff --git a/main/pdnsd/pdnsd.initd b/main/pdnsd/pdnsd.initd new file mode 100644 index 0000000000..355163ce12 --- /dev/null +++ b/main/pdnsd/pdnsd.initd @@ -0,0 +1,25 @@ +#!/sbin/runscript + +name=pdnsd +daemon=/usr/sbin/$name + +depend() { + need net + after firewall +} + +start() { + ebegin "Starting ${name}" + start-stop-daemon --start --quiet \ + --pidfile /var/run/${name}.pid \ + --exec ${daemon} -- ${pdnsd_opts} + eend $? +} + +stop() { + ebegin "Stopping ${name}" + start-stop-daemon --stop --quiet \ + --pidfile /var/run/$name.pid \ + --exec ${daemon} + eend $? +} diff --git a/main/pdnsd/pdnsd.post-deinstall b/main/pdnsd/pdnsd.post-deinstall new file mode 100644 index 0000000000..f5cb9e80cb --- /dev/null +++ b/main/pdnsd/pdnsd.post-deinstall @@ -0,0 +1,4 @@ +#!/bin/sh + +deluser pdnsd 2>/dev/null +exit 0 diff --git a/main/pdnsd/pdnsd.pre-install b/main/pdnsd/pdnsd.pre-install new file mode 100644 index 0000000000..1ae14a9a5e --- /dev/null +++ b/main/pdnsd/pdnsd.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +adduser -S -H -h /var/cache/pdnsd -s /bin/false pdnsd 2>/dev/null +exit 0 diff --git a/main/py-boto/APKBUILD b/main/py-boto/APKBUILD new file mode 100644 index 0000000000..8663a6de0c --- /dev/null +++ b/main/py-boto/APKBUILD @@ -0,0 +1,51 @@ +# Contributor: Matt Smith <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +pkgname=py-boto +_pkgname=boto +pkgver=1.9b +pkgrel=1 +pkgdesc="An integrated interface to current and future infrastructural services offered by Amazon Web Services." +url="http://code.google.com/p/boto/" +arch="noarch" +license="MIT" +depends="python" +makedepends="python-dev py-setuptools" +install= +subpackages="$pkgname-doc" +source="http://$_pkgname.googlecode.com/files/$_pkgname-$pkgver.tar.gz" + +_builddir="$srcdir"/$_pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + python setup.py build || return 1 +} + +package() { + cd "$_builddir" + python setup.py install --root "$pkgdir" +} + +doc() { + cd "$_builddir" + + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname + install -Dm644 README "$subpkgdir"/usr/share/doc/$pkgname/README + + # Note: The documentation in the 'docs' directory can only be generated + # (via sphinx-build from the py-sphinx package) once this package has + # been installed. Copying it off for the user. + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/docs + cp -R ./docs/* "$subpkgdir"/usr/share/doc/$pkgname/docs/ + chmod -R 644 "$subpkgdir"/usr/share/doc/$pkgname/docs/ + + # Fix subdir perms + find "$subpkgdir"/usr/share/doc/$pkgname/ -type d -exec chmod 755 '{}' \; +} + +md5sums="4fc2fd7b70a971b1363f8465aafe7091 boto-1.9b.tar.gz" |