initial DJB exheres (ucspi-tcp,daemontools,djbdns)

This commit is contained in:
Daniel Mierswa 2009-01-28 20:27:43 +01:00
parent 101e3c69d5
commit cdb5813930
27 changed files with 584 additions and 0 deletions

92
exlibs/djb.exlib Normal file
View file

@ -0,0 +1,92 @@
# Copyright 2008 Daniel Mierswa <impulze@impulze.org>
# Distributed under the terms of the GNU General Public License v2
require toolchain-funcs
export_exlib_phases src_prepare src_install
HOMEPAGE_BASE="http://cr.yp.to"
HOMEPAGE_EXTENSION="${HOMEPAGE_EXTENSION:-${PN}.html}"
HOMEPAGE="${HOMEPAGE:-${HOMEPAGE_BASE}/${HOMEPAGE_EXTENSION}}"
LICENCES="${LICENCES:-public-domain}"
DOWNLOADS="${DOWNLOADS:-${HOMEPAGE_BASE}/${PN}/${PNV}.tar.gz}"
# first give gcc, ranlib and ar a host-triplet
# then replace some trivial code with newer extensions of gcc/C to
# avoid running binaries on the host to obtain the information (i.e.
# support cross-compiling)
# TODO: check if iopause.h can be created by us
djb_src_prepare() {
local basedir=$(dirname $(find -type f -name conf-cc))
local ranlib_file=$(grep -r ranlib . | sed 's/:.*//')
sed \
-e "/^gcc/s:.*:& ${CPPFLAGS} ${CFLAGS}:" \
-e "/^gcc/s:gcc:$(tc-getCC):" \
-i "${basedir}/conf-cc" || die "sed ${basedir}/conf-cc failed"
sed \
-e "/^gcc/s:.*:& ${LDFLAGS}:" \
-e "/^gcc/s:gcc:$(tc-getCC):" \
-i "${basedir}/conf-ld" || die "sed ${basedir}/conf-ld failed"
sed \
-e "/echo 'ar cr/s:ar:$(tc-getAR):" \
-e "/*) echo 'ranlib \"\\$/s:ranlib:$(tc-getRANLIB):" \
-i "${ranlib_file}" || die "sed ${ranlib_file} failed"
if [ -f "${basedir}/auto-str.c" ] ; then
cat >> "${basedir}/auto-str" <<EOF
#!/bin/bash
printf "const char \${1}[] = \"%s\";\n" \$(printf "\${2}" | od -A n -t o1 | tr ' ' '\\')
EOF
chmod u+x "${basedir}/auto-str" || die "chmod auto-str failed"
fi
if [ -f "${basedir}/hasshsgr.h1" ] ; then
ln -s hasshsgr.h1 "${basedir}"/hasshsgr.h
fi
if [ -f "${basedir}/uint64.h1" ] ; then
cat >> "${basedir}/uint64.h" <<EOF
#ifndef UINT64_H
#define UINT64_H
/* sysdep: -ulong64 */
#include <stdint.h>
typedef uint64_t uint64;
#endif
EOF
fi
if [ -f "${basedir}/conf-home" ] ; then
echo /usr > "${basedir}/conf-home" \
|| die "creating conf-home failed"
fi
default
}
djb_src_install() {
local hierc_file=$(find -type f -name hier.c)
local count dir file opts
while read line ; do
line=$(echo ${line} | tr ',' ' ' | tr -d '"')
count=$(echo ${line} | wc -w)
[ ${count} -ne 6 ] && continue
dir=$(echo ${line} | awk '{ print $2 }')
file=$(echo ${line} | awk '{ print $3 }')
opts=$(echo ${line} | awk '{ print $6 }')
opts=${opts#?}
opts=${opts%??}
[ ! "${dir%bin}" = "${dir}" ] && dir="/usr/${dir}"
insinto "${dir}"
insopts "-m${opts}"
doins "${file}"
done < "${hierc_file}"
# $(tail -n+8 "${hierc_file}" | head -n-1 | tr ',' ' ' | awk '{ print $3 }' | tr -d '"') ; do
}

View file

View file

@ -0,0 +1,4 @@
gecos = user for caching dns services
home = /dev/null
shell = /sbin/nologin
primary_group = nofiles

View file

@ -0,0 +1,4 @@
gecos = logging user for dns services
home = /dev/null
shell = /sbin/nologin
primary_group = nofiles

View file

@ -0,0 +1,4 @@
gecos = user for authoritive dns services
home = /dev/null
shell = /sbin/nologin
primary_group = nofiles

View file

@ -0,0 +1,39 @@
# Copyright 2008 Daniel Mierswa <impulze@impulze.org>
# Distributed under the terms of the GNU General Public License v2
require djb eutils
SUMMARY="Collection of DNS tools."
DESCRIPTION="
A DNS cache, a DNS server and some DNS client utilities.
"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""
DEPENDENCIES="
run:
sys-apps/daemontools
sys-apps/ucspi-tcp
user/dnscache
user/dnslog
"
DEFAULT_SRC_PREPARE_PATCHES+=(
"${FILES}/${PNV}-Makefile.patch"
"${FILES}/${PNV}-prot.patch"
"${FILES}/${PNV}-utime.patch"
# hier.c fixups?
"${FILES}/${PNV}-seek_set.patch"
"${FILES}/${PNV}-dnsq.patch"
"${FILES}/${PNV}-dnsqr.patch"
"${FILES}/${PNV}-error.patch"
)
pkg_config() {
if [ -z "${DNSCACHE_DIR}" -o -z "${DNSCACHE_IP}" ] ; then
:
# eerror "First setup
fi
}

View file

@ -0,0 +1,48 @@
pstream: No (considered finished)
Reason: own `auto-str`, `hasshsgr.h` and `uint64.h`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./Makefile.orig 2009-01-28 18:01:39.148226538 +0100
+++ ./Makefile 2009-01-28 18:02:25.025173698 +0100
@@ -30,7 +30,7 @@
./compile auto-str.c
auto_home.c: \
-auto-str conf-home
+conf-home
./auto-str auto_home `head -1 conf-home` > auto_home.c
auto_home.o: \
@@ -508,12 +500,6 @@
*) cat hasdevtcp.h1 ;; \
esac ) > hasdevtcp.h
-hasshsgr.h: \
-choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \
-warn-shsgr
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
-
hier.o: \
compile hier.c auto_home.h
./compile hier.c
@@ -536,7 +522,7 @@
iopause.h: \
choose compile load trypoll.c iopause.h1 iopause.h2
- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
+ ./choose cl trypoll iopause.h1 iopause.h2 > iopause.h
iopause.o: \
compile iopause.c taia.h tai.h uint64.h select.h iopause.h taia.h
@@ -1060,10 +1046,6 @@
compile uint32_unpack.c uint32.h
./compile uint32_unpack.c
-uint64.h: \
-choose compile load tryulong64.c uint64.h1 uint64.h2
- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
-
unix.a: \
makelib buffer_read.o buffer_write.o error.o error_str.o ndelay_off.o \
ndelay_on.o open_read.o open_trunc.o openreadclose.o readclose.o \

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `_exit`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./dnsq.c.orig 2009-01-28 18:09:34.363974616 +0100
+++ ./dnsq.c 2009-01-28 18:09:45.259090891 +0100
@@ -10,6 +10,7 @@
#include "printpacket.h"
#include "parsetype.h"
#include "dns.h"
+#include <unistd.h>
#define FATAL "dnsq: fatal: "

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `_exit`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./dnsqr.c.orig 2009-01-28 18:09:35.736978838 +0100
+++ ./dnsqr.c 2009-01-28 18:09:53.844973375 +0100
@@ -9,6 +9,7 @@
#include "printpacket.h"
#include "parsetype.h"
#include "dns.h"
+#include <unistd.h>
#define FATAL "dnsqr: fatal: "

View file

@ -0,0 +1,18 @@
Upstream: No (considered finished)
Reason: wrong `errno` (see below)
Source: Daniel Mierswa <impulze@impulze.org>
Compilation failure:
ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in *.o
--- ./error.h.orig 2009-01-28 18:11:38.788975742 +0100
+++ ./error.h 2009-01-28 18:11:15.614974533 +0100
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+#include <errno.h>
extern int error_intr;
extern int error_nomem;

View file

@ -0,0 +1,15 @@
Upstream: No (considered finished)
Reason: implicit declaration of `set{gid,uid,groups}`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./prot.c.orig 2009-01-28 18:06:11.480975081 +0100
+++ ./prot.c 2009-01-28 18:07:06.162974257 +0100
@@ -1,5 +1,8 @@
#include "hasshsgr.h"
#include "prot.h"
+#include <grp.h>
+#include <sys/types.h>
+#include <unistd.h>
int prot_gid(int gid)
{

View file

@ -0,0 +1,12 @@
Upstream: No (considered finished)
Reason: implicit declaration of `lseek`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./seek_set.c.orig 2009-01-28 18:04:44.015224940 +0100
+++ ./seek_set.c 2009-01-28 18:04:52.018977979 +0100
@@ -1,4 +1,5 @@
#include <sys/types.h>
+#include <unistd.h>
#include "seek.h"
#define SET 0 /* sigh */

View file

@ -0,0 +1,13 @@
Upstream: No (considered finished)
Reason: implicit declaration of `utime`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./utime.c.orig 2009-01-28 18:08:22.084974424 +0100
+++ ./utime.c 2009-01-28 18:08:27.566974930 +0100
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/time.h>
+#include <utime.h>
#include "scan.h"
#include "exit.h"

View file

@ -0,0 +1,45 @@
# Copyright 2008 Daniel Mierswa <impulze@impulze.org>
# Distributed under the terms of the GNU General Public License v2
require djb
SUMMARY="A collection of free tools for managing UNIX services."
DESCRIPTION="
A suite of utilities to start, run, log, and control server programs
known as daemons, reliably and securely.
"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""
DEPENDENCIES=""
WORK="${WORKBASE}/admin/${PNV}"
DEFAULT_SRC_PREPARE_PATCHES+=(
"${FILES}/${PNV}-Makefile.patch"
"${FILES}/${PNV}-pathexec_run.patch"
"${FILES}/${PNV}-prot.patch"
"${FILES}/${PNV}-seek_set.patch"
"${FILES}/${PNV}-error.patch"
"${FILES}/${PNV}-matchtest.patch"
"${FILES}/${PNV}-multilog.patch"
"${FILES}/${PNV}-supervise.patch"
"${FILES}/${PNV}-svscanboot.patch"
)
DEFAULT_SRC_INSTALL_EXTRA_SUBDIRS+=( src )
src_compile() {
echo >src/rts.tests || "overwriting tests failed"
package/compile || die "compilation failed"
}
src_install() {
for cmd in command/* ; do
dobin "${cmd}"
done
keepdir /service
}

View file

@ -0,0 +1,34 @@
Upstream: No (considered finished)
Reason: own `auto-str`, `hasshsgr.h` and `uint64.h`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/Makefile.orig 2009-01-28 10:16:05.184974076 +0100
+++ ./src/Makefile 2009-01-28 10:17:18.306974606 +0100
@@ -163,16 +163,11 @@
hassgprm.h: choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c
./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h
-hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \
-tryshsgr.c warn-shsgr
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
-
haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h
iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c
- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
+ ./choose cl trypoll iopause.h1 iopause.h2 > iopause.h
iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h
./compile iopause.c
@@ -478,9 +473,6 @@
timestamp.o: compile tai.h taia.h timestamp.c timestamp.h uint64.h
./compile timestamp.c
-uint64.h: choose compile load tryulong64.c uint64.h1 uint64.h2
- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
-
unix.a: alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \
error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \

View file

@ -0,0 +1,18 @@
Upstream: No (considered finished)
Reason: wrong `errno` (see below)
Source: Daniel Mierswa <impulze@impulze.org>
Compilation failure:
ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in *.o
--- ./src/error.h.orig 2009-01-28 02:11:44.337224408 +0100
+++ ./src/error.h 2009-01-28 02:11:48.937972694 +0100
@@ -3,7 +3,7 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+#include <errno.h>
extern int error_intr;
extern int error_nomem;

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `_exit`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/matchtest.c.orig 2009-01-28 02:29:51.828978444 +0100
+++ ./src/matchtest.c 2009-01-28 02:29:57.041223886 +0100
@@ -1,6 +1,7 @@
#include "match.h"
#include "buffer.h"
#include "str.h"
+#include <unistd.h>
int main(int argc,char **argv)
{

View file

@ -0,0 +1,15 @@
Upstream: No (considered finished)
Reason: implicit declaration of function `rename`, wrong headers for `execve`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/multilog.c.orig 2009-01-28 02:30:57.404224908 +0100
+++ ./src/multilog.c 2009-01-28 02:31:34.363155751 +0100
@@ -20,6 +20,8 @@
#include "sig.h"
#include "match.h"
#include "deepsleep.h"
+#include <stdio.h>
+#include <unistd.h>
#define FATAL "multilog: fatal: "
#define WARNING "multilog: warning: "

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `execve`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/pathexec_run.c.orig 2009-01-28 02:21:36.419974852 +0100
+++ ./src/pathexec_run.c 2009-01-28 02:21:26.292005223 +0100
@@ -5,6 +5,7 @@
#include "str.h"
#include "env.h"
#include "pathexec.h"
+#include <unistd.h>
static stralloc tmp;

View file

@ -0,0 +1,16 @@
Upstream: No (considered finished)
Reason: implicit declaration of `set{gid,uid,groups}`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/prot.c.orig 2009-01-28 02:26:05.999975108 +0100
+++ ./src/prot.c 2009-01-28 02:26:42.815973230 +0100
@@ -2,6 +2,9 @@
#include "hasshsgr.h"
#include "prot.h"
+#include <grp.h>
+#include <sys/types.h>
+#include <unistd.h>
int prot_gid(int gid)
{

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `lseek`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/seek_set.c.orig 2009-01-28 02:28:21.689975232 +0100
+++ ./src/seek_set.c 2009-01-28 02:28:27.186224239 +0100
@@ -1,6 +1,7 @@
/* Public domain. */
#include <sys/types.h>
+#include <unistd.h>
#include "seek.h"
#define SET 0 /* sigh */

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of `rename`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/supervise.c.orig 2009-01-28 02:45:01.520225024 +0100
+++ ./src/supervise.c 2009-01-28 02:45:13.283280305 +0100
@@ -15,6 +15,7 @@
#include "iopause.h"
#include "taia.h"
#include "deepsleep.h"
+#include <stdio.h>
#define FATAL "supervise: fatal: "
#define WARNING "supervise: warning: "

View file

@ -0,0 +1,20 @@
Upstream: No (considered finished)
Reason: wrong binary location, strip unneeded PATH
Source: Daniel Mierswa <impulze@impulze.org>
--- ./src/svscanboot.sh.orig 2009-01-28 02:59:40.495975612 +0100
+++ ./src/svscanboot.sh 2009-01-28 03:00:49.056973316 +0100
@@ -1,11 +1,11 @@
-PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
exec </dev/null
exec >/dev/null
exec 2>/dev/null
-/command/svc -dx /service/* /service/*/log
+/usr/bin/svc -dx /service/* /service/*/log
env - PATH=$PATH svscan /service 2>&1 | \
env - PATH=$PATH readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................

View file

@ -0,0 +1,52 @@
Upstream: No (considered finished)
Reason: own `auto-str`, `hasshsgr.h` and `uint64.h`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./Makefile.orig 2009-01-28 07:35:12.327974383 +0100
+++ ./Makefile 2009-01-28 07:34:50.122973856 +0100
@@ -37,7 +37,7 @@
./compile auto-str.c
auto_home.c: \
-auto-str conf-home
+conf-home
./auto-str auto_home `head -1 conf-home` > auto_home.c
auto_home.o: \
@@ -325,12 +325,6 @@
choose compile load trysgprm.c hassgprm.h1 hassgprm.h2
./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h
-hasshsgr.h: \
-choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \
-warn-shsgr
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
- ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
-
haswaitp.h: \
choose compile load trywaitp.c haswaitp.h1 haswaitp.h2
./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h
--- ./Makefile.orig 2009-01-28 09:48:11.618977777 +0100
+++ ./Makefile 2009-01-28 09:48:37.447974272 +0100
@@ -785,10 +785,6 @@
compile uint32_unpack.c uint32.h
./compile uint32_unpack.c
-uint64.h: \
-choose compile load tryulong64.c uint64.h1 uint64.h2
- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
-
unix.a: \
makelib alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
buffer_copy.o buffer_get.o buffer_put.o env.o error.o error_str.o \
--- ./Makefile.orig 2009-01-28 09:58:05.365225156 +0100
+++ ./Makefile 2009-01-28 09:58:09.345975141 +0100
@@ -358,7 +358,7 @@
iopause.h: \
choose compile trypoll.c iopause.h1 iopause.h2
- ./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
+ ./choose cl trypoll iopause.h1 iopause.h2 > iopause.h
iopause.o: \
compile iopause.c taia.h tai.h uint64.h select.h iopause.h taia.h

View file

@ -0,0 +1,18 @@
Upstream: No (considered finished)
Reason: wrong `errno` (see below)
Source: Daniel Mierswa <impulze@impulze.org>
Compilation failure:
ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in *.o
--- ./error.h.orig 2009-01-28 03:40:30.768228824 +0100
+++ ./error.h 2009-01-28 03:40:24.883973528 +0100
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+#include <errno.h>
extern int error_intr;
extern int error_nomem;

View file

@ -0,0 +1,14 @@
Upstream: No (considered finished)
Reason: implicit declaration of function `_exit`
Source: Daniel Mierswa <impulze@impulze.org>
--- ./tcprulescheck.c.orig 2009-01-28 03:38:46.337974185 +0100
+++ ./tcprulescheck.c 2009-01-28 03:39:11.139128906 +0100
@@ -3,6 +3,7 @@
#include "strerr.h"
#include "env.h"
#include "rules.h"
+#include <unistd.h>
void found(char *data,unsigned int datalen)
{

View file

@ -0,0 +1,19 @@
# Copyright 2008 Daniel Mierswa <impulze@impulze.org>
# Distributed under the terms of the GNU General Public License v2
require djb
SUMMARY="UNIX Client-Server Program Interface for TCP"
DESCRIPTION="Command-Line tools for building TCP client-server applications."
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""
DEPENDENCIES=""
DEFAULT_SRC_PREPARE_PATCHES+=(
"${FILES}/${PNV}-Makefile.patch"
"${FILES}/${PNV}-tcprulescheck.patch"
"${FILES}/${PNV}-error.patch"
)