Source: unworkable
Source-Version: 0.53-2
Severity: wishlist
Tags: patch

Hi!

This package contains an openbsd-compat directory with stuff missing
on non-BSD systems. Instead of duplicating that code at build and
run-time this package could switch to use libbsd which provides most
of the stuff contained there. Attached is a patch doing exactly that.

thanks,
guillem
>From d1a43d5b5e0c8a1d7ea8752348d0beb7497e463a Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Tue, 29 May 2012 20:24:46 +0200
Subject: [PATCH] Switch to use libbsd

---
 GNUmakefile    |    8 ++------
 debian/control |    3 ++-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 4899dbf..645cb01 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -29,13 +29,9 @@ SRCS=announce.c bencode.c buf.c ctl_server.c main.c network.c \
 LIBS=-levent -lcrypto -lpthread
 UNAME=$(shell uname)
 ifneq (, $(filter Linux GNU GNU/%, $(UNAME)))
-SRCS+=openbsd-compat/strlcpy.c
-SRCS+=openbsd-compat/strlcat.c
 SRCS+=openbsd-compat/sha1.c
-SRCS+=openbsd-compat/strtonum.c
-CFLAGS+=-DNO_STRLCPY
-CFLAGS+=-DNO_STRLCAT
-CFLAGS+=-DNO_STRTONUM
+LIBS+=$(shell pkg-config --libs libbsd-overlay)
+CFLAGS+=$(shell pkg-config --cflags libbsd-overlay)
 else
 ifeq ($(UNAME),sunos)
 SRCS+=openbsd-compat/err.c
diff --git a/debian/control b/debian/control
index b6c779f..045a991 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,8 @@ Source: unworkable
 Section: net
 Priority: optional
 Maintainer: Michael Stapelberg <[email protected]>
-Build-Depends: debhelper (>= 5), libevent-dev, libssl-dev, bison
+Build-Depends: debhelper (>= 5), libbsd-dev, libevent-dev, libssl-dev, bison,
+ pkg-config
 Standards-Version: 3.9.3.1
 Homepage: http://code.google.com/p/unworkable/
 
-- 
1.7.10

Reply via email to