[tnftp] Link with system libedit rather than using internal one (#1079639)

David Cantrell dcantrel at fedoraproject.org
Wed Jun 25 13:58:58 UTC 2014


commit 79138b9369f55ce585e0c03185072c56450e1db3
Author: David Cantrell <dcantrell at redhat.com>
Date:   Wed Jun 25 09:58:18 2014 -0400

    Link with system libedit rather than using internal one (#1079639)

 .gitignore                       |    3 +
 sources                          |    3 +
 tnftp-20130505-portability.patch |  116 ++++++++++++++++++++++++++++++++++++++
 tnftp.spec                       |   14 ++++-
 4 files changed, 134 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b5b0fda..29c2a83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
 /tnftp-20130505.tar.gz
+/stringlist.h
+/vis.h
+/glob.h
diff --git a/sources b/sources
index d800313..4c55501 100644
--- a/sources
+++ b/sources
@@ -1 +1,4 @@
+004635931bdeec3912fc8faf5654dbb0  glob.h
+66148f5fa2fb23e3252b45ad76ef7ae0  vis.h
 66e218d02ec7d9fc39ab70ba2900305a  tnftp-20130505.tar.gz
+ee9318e2eef9d4e58abecade62b92170  stringlist.h
diff --git a/tnftp-20130505-portability.patch b/tnftp-20130505-portability.patch
new file mode 100644
index 0000000..4382c9d
--- /dev/null
+++ b/tnftp-20130505-portability.patch
@@ -0,0 +1,116 @@
+diff -up tnftp-20130505/libnetbsd/fgetln.c.orig tnftp-20130505/libnetbsd/fgetln.c
+--- tnftp-20130505/libnetbsd/fgetln.c.orig	2008-04-29 06:26:23.000000000 -0400
++++ tnftp-20130505/libnetbsd/fgetln.c	2014-06-25 08:28:25.113747232 -0400
+@@ -29,6 +29,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <stdio.h>
++#include <stdlib.h>
++#include <errno.h>
+ #include "tnftp.h"
+ 
+ char *
+diff -up tnftp-20130505/libnetbsd/glob.c.orig tnftp-20130505/libnetbsd/glob.c
+--- tnftp-20130505/libnetbsd/glob.c.orig	2013-05-05 09:20:16.000000000 -0400
++++ tnftp-20130505/libnetbsd/glob.c	2014-06-25 09:31:05.919747232 -0400
+@@ -61,8 +61,6 @@
+ 
+ #include "tnftp.h"
+ 
+-#if 0
+-
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ 
+@@ -76,8 +74,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <glob.h>
+ 
+-#endif
++#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
+ 
+ #define NO_GETPW_R
+ 
+diff -up tnftp-20130505/libnetbsd/setprogname.c.orig tnftp-20130505/libnetbsd/setprogname.c
+--- tnftp-20130505/libnetbsd/setprogname.c.orig	2008-04-29 06:26:23.000000000 -0400
++++ tnftp-20130505/libnetbsd/setprogname.c	2014-06-25 08:28:44.729747232 -0400
+@@ -30,6 +30,7 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <string.h>
+ #include "tnftp.h"
+ 
+ static const char *__progname = "<unset_progname>";
+diff -up tnftp-20130505/libnetbsd/sl_init.c.orig tnftp-20130505/libnetbsd/sl_init.c
+--- tnftp-20130505/libnetbsd/sl_init.c.orig	2008-04-29 06:26:23.000000000 -0400
++++ tnftp-20130505/libnetbsd/sl_init.c	2014-06-25 08:33:51.727747232 -0400
+@@ -30,6 +30,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <stdlib.h>
++#include <stringlist.h>
+ #include "tnftp.h"
+ 
+ #define _SL_CHUNKSIZE	20
+@@ -102,7 +104,7 @@ sl_free(StringList *sl, int all)
+  * sl_find(): Find a name in the string list
+  */
+ char *
+-sl_find(StringList *sl, char *name)
++sl_find(StringList *sl, const char *name)
+ {
+ 	size_t i;
+ 
+diff -up tnftp-20130505/libnetbsd/strlcat.c.orig tnftp-20130505/libnetbsd/strlcat.c
+--- tnftp-20130505/libnetbsd/strlcat.c.orig	2005-05-16 02:55:48.000000000 -0400
++++ tnftp-20130505/libnetbsd/strlcat.c	2014-06-25 08:35:57.510747232 -0400
+@@ -18,6 +18,8 @@
+  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include <stdio.h>
++#include <string.h>
+ #include "tnftp.h"
+ 
+ /*
+diff -up tnftp-20130505/libnetbsd/strlcpy.c.orig tnftp-20130505/libnetbsd/strlcpy.c
+--- tnftp-20130505/libnetbsd/strlcpy.c.orig	2005-05-16 02:58:06.000000000 -0400
++++ tnftp-20130505/libnetbsd/strlcpy.c	2014-06-25 08:35:41.030747232 -0400
+@@ -18,6 +18,7 @@
+  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include <stdio.h>
+ #include "tnftp.h"
+ 
+ /*
+diff -up tnftp-20130505/libnetbsd/strunvis.c.orig tnftp-20130505/libnetbsd/strunvis.c
+--- tnftp-20130505/libnetbsd/strunvis.c.orig	2005-06-01 07:48:49.000000000 -0400
++++ tnftp-20130505/libnetbsd/strunvis.c	2014-06-25 08:43:44.603747232 -0400
+@@ -30,6 +30,7 @@
+  * SUCH DAMAGE.
+  */
+ 
++#include <vis.h>
+ #include "tnftp.h"
+ 
+ /*
+diff -up tnftp-20130505/libnetbsd/strvis.c.orig tnftp-20130505/libnetbsd/strvis.c
+--- tnftp-20130505/libnetbsd/strvis.c.orig	2008-04-29 06:26:23.000000000 -0400
++++ tnftp-20130505/libnetbsd/strvis.c	2014-06-25 09:07:50.713747232 -0400
+@@ -56,6 +56,10 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <stdlib.h>
++#include <string.h>
++#include <stdint.h>
++#include <vis.h>
+ #include "tnftp.h"
+ 
+ #undef BELL
diff --git a/tnftp.spec b/tnftp.spec
index e289fc7..87fbb73 100644
--- a/tnftp.spec
+++ b/tnftp.spec
@@ -10,8 +10,11 @@ License:       BSD and ISC
 # See http://www.NetBSD.org/ for more details about NetBSD.
 URL:           http://www.NetBSD.org/
 Source0:       ftp://ftp.netbsd.org/pub/NetBSD/misc/%{name}/%{name}-%{version}.tar.gz
+Source1:       ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/include/stringlist.h
+Source2:       ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/include/vis.h
 
 Patch0:        tnftp-20130505-autognu.patch
+Patch1:        tnftp-20130505-portability.patch
 
 BuildRequires: libedit-devel
 BuildRequires: openssl-devel
@@ -32,11 +35,18 @@ formerly called lukemftp.
 # remove libedit and patch autognu files
 rm -rf libedit
 %patch0 -p1
+%patch1 -p1
 autoreconf -i
 
+# header files we need from /usr/include on NetBSD
+install -m 0644 %{SOURCE1} libnetbsd/stringlist.h
+install -m 0644 %{SOURCE2} libnetbsd/vis.h
+
 %build
-env CFLAGS="%{optflags} -D_GNU_SOURCE" %configure \
-    --enable-editcomplete --enable-ipv6 --enable-ssl
+
+# "DOGS AND CATS LIVING TOGETHER!"
+env CFLAGS="%{optflags} -D_GNU_SOURCE -D__LIBC12_SOURCE__ -D_NETBSD_SOURCE" \
+%configure --enable-editcomplete --enable-ipv6 --enable-ssl
 ln -s ../tnftp.h libnetbsd/tnftp.h
 ln -s ../tnftp.h src/tnftp.h
 make %{?_smp_mflags}


More information about the scm-commits mailing list