Sat Sep 9 22:46:57 2017 UTC ()
Fix build on NetBSD 8+. Fix Perl use.


(joerg)
diff -r1.91 -r1.92 pkgsrc/net/freeradius/Makefile
diff -r1.32 -r1.33 pkgsrc/net/freeradius/distinfo
diff -r1.11 -r1.12 pkgsrc/net/freeradius/patches/patch-ai
diff -r0 -r1.1 pkgsrc/net/freeradius/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/net/freeradius/patches/patch-src_lib_udpfromto.c

cvs diff -r1.91 -r1.92 pkgsrc/net/freeradius/Makefile (expand / switch to unified diff)

--- pkgsrc/net/freeradius/Makefile 2017/08/26 10:07:28 1.91
+++ pkgsrc/net/freeradius/Makefile 2017/09/09 22:46:57 1.92
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.91 2017/08/26 10:07:28 fhajny Exp $ 1# $NetBSD: Makefile,v 1.92 2017/09/09 22:46:57 joerg Exp $
2 2
3.include "Makefile.common" 3.include "Makefile.common"
4 4
5PKGNAME= ${DISTNAME:S/-server//} 5PKGNAME= ${DISTNAME:S/-server//}
6COMMENT= Free RADIUS server implementation 6COMMENT= Free RADIUS server implementation
7 7
8 8
9BUILD_DEFS+= VARBASE 9BUILD_DEFS+= VARBASE
10CONFIGURE_ARGS+= --localstatedir=${VARBASE} 10CONFIGURE_ARGS+= --localstatedir=${VARBASE}
11CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR} 11CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR}
12CONFIGURE_ARGS+= --with-logdir=${VARBASE}/log/radiusd 12CONFIGURE_ARGS+= --with-logdir=${VARBASE}/log/radiusd
13CONFIGURE_ARGS+= --without-rlm_eap_ikev2 13CONFIGURE_ARGS+= --without-rlm_eap_ikev2
14CONFIGURE_ARGS+= --without-rlm_eap_tnc 14CONFIGURE_ARGS+= --without-rlm_eap_tnc
@@ -182,26 +182,29 @@ EGDIRS= certs mods-available mods-conf @@ -182,26 +182,29 @@ EGDIRS= certs mods-available mods-conf
182 mods-config/sql/counter/sqlite mods-config/sql/cui mods-config/sql/cui/mysql \ 182 mods-config/sql/counter/sqlite mods-config/sql/cui mods-config/sql/cui/mysql \
183 mods-config/sql/cui/postgresql mods-config/sql/cui/sqlite mods-config/sql/ippool \ 183 mods-config/sql/cui/postgresql mods-config/sql/cui/sqlite mods-config/sql/ippool \
184 mods-config/sql/ippool-dhcp mods-config/sql/ippool-dhcp/mysql \ 184 mods-config/sql/ippool-dhcp mods-config/sql/ippool-dhcp/mysql \
185 mods-config/sql/ippool-dhcp/oracle mods-config/sql/ippool-dhcp/sqlite \ 185 mods-config/sql/ippool-dhcp/oracle mods-config/sql/ippool-dhcp/sqlite \
186 mods-config/sql/ippool/mysql mods-config/sql/ippool/oracle \ 186 mods-config/sql/ippool/mysql mods-config/sql/ippool/oracle \
187 mods-config/sql/ippool/postgresql mods-config/sql/ippool/sqlite \ 187 mods-config/sql/ippool/postgresql mods-config/sql/ippool/sqlite \
188 mods-config/sql/main mods-config/sql/main/mssql mods-config/sql/main/mysql \ 188 mods-config/sql/main mods-config/sql/main/mssql mods-config/sql/main/mysql \
189 mods-config/sql/main/mysql/extras mods-config/sql/main/mysql/extras/wimax \ 189 mods-config/sql/main/mysql/extras mods-config/sql/main/mysql/extras/wimax \
190 mods-config/sql/main/ndb mods-config/sql/main/oracle \ 190 mods-config/sql/main/ndb mods-config/sql/main/oracle \
191 mods-config/sql/main/postgresql mods-config/sql/main/postgresql/extras \ 191 mods-config/sql/main/postgresql mods-config/sql/main/postgresql/extras \
192 mods-config/sql/main/sqlite mods-config/unbound mods-enabled \ 192 mods-config/sql/main/sqlite mods-config/unbound mods-enabled \
193 policy.d sites-available sites-enabled 193 policy.d sites-available sites-enabled
194 194
 195REPLACE_PERL+= scripts/sql/radsqlrelay \
 196 src/modules/rlm_counter/rad_counter
 197
195.for f in ${EGFILES} 198.for f in ${EGFILES}
196CONF_FILES_PERMS+= ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f} \ 199CONF_FILES_PERMS+= ${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f} \
197 ${RADIUS_USER} ${RADIUS_GROUP} 0640 200 ${RADIUS_USER} ${RADIUS_GROUP} 0640
198.endfor 201.endfor
199CONF_FILES_PERMS+= ${EGDIR}/certs/bootstrap ${PKG_SYSCONFDIR}/certs/bootstrap \ 202CONF_FILES_PERMS+= ${EGDIR}/certs/bootstrap ${PKG_SYSCONFDIR}/certs/bootstrap \
200 ${RADIUS_USER} ${RADIUS_GROUP} 0750 203 ${RADIUS_USER} ${RADIUS_GROUP} 0750
201 204
202.for d in ${EGDIRS} 205.for d in ${EGDIRS}
203OWN_DIRS_PERMS+= ${PKG_SYSCONFDIR}/${d} ${RADIUS_USER} ${RADIUS_GROUP} 0750 206OWN_DIRS_PERMS+= ${PKG_SYSCONFDIR}/${d} ${RADIUS_USER} ${RADIUS_GROUP} 0750
204.endfor 207.endfor
205 208
206INSTALL_MAKE_FLAGS+= raddbdir=${EGDIR} 209INSTALL_MAKE_FLAGS+= raddbdir=${EGDIR}
207 210

cvs diff -r1.32 -r1.33 pkgsrc/net/freeradius/distinfo (expand / switch to unified diff)

--- pkgsrc/net/freeradius/distinfo 2017/08/26 10:07:28 1.32
+++ pkgsrc/net/freeradius/distinfo 2017/09/09 22:46:57 1.33
@@ -1,12 +1,14 @@ @@ -1,12 +1,14 @@
1$NetBSD: distinfo,v 1.32 2017/08/26 10:07:28 fhajny Exp $ 1$NetBSD: distinfo,v 1.33 2017/09/09 22:46:57 joerg Exp $
2 2
3SHA1 (freeradius-server-3.0.15.tar.bz2) = f651142a31b514fc80d888fe8ab5040cbfdd546e 3SHA1 (freeradius-server-3.0.15.tar.bz2) = f651142a31b514fc80d888fe8ab5040cbfdd546e
4RMD160 (freeradius-server-3.0.15.tar.bz2) = 46d2d491b71516c6db7659e46e1ec44c7fbf9d1f 4RMD160 (freeradius-server-3.0.15.tar.bz2) = 46d2d491b71516c6db7659e46e1ec44c7fbf9d1f
5SHA512 (freeradius-server-3.0.15.tar.bz2) = a2808f0b70b73f11c4c7d00edcb4a56a2ab8f73ce0ff74a9834c8b613ce5ed75ece372f852b0891f68c6a33f50c1bababb76d2eff9326a7fc29fe6b45ec9af88 5SHA512 (freeradius-server-3.0.15.tar.bz2) = a2808f0b70b73f11c4c7d00edcb4a56a2ab8f73ce0ff74a9834c8b613ce5ed75ece372f852b0891f68c6a33f50c1bababb76d2eff9326a7fc29fe6b45ec9af88
6Size (freeradius-server-3.0.15.tar.bz2) = 3038070 bytes 6Size (freeradius-server-3.0.15.tar.bz2) = 3038070 bytes
7SHA1 (patch-ai) = 837af388cd6f4f4c41177eb28e2eebdfd74e7d8d 7SHA1 (patch-ai) = 834fea0886410de30ed489fa39be066fa3fb3186
 8SHA1 (patch-configure.ac) = 2e1a979f51122f4c214f11574116a9a7695387d0
8SHA1 (patch-main_command.c) = 1c79b29eb13df341906c710c8dd41860a27473dd 9SHA1 (patch-main_command.c) = 1c79b29eb13df341906c710c8dd41860a27473dd
9SHA1 (patch-main_util.c) = b9cefdb9bc30df0906184e8c0bb883e5258767c3 10SHA1 (patch-main_util.c) = b9cefdb9bc30df0906184e8c0bb883e5258767c3
10SHA1 (patch-rlm_krb5_configure) = e97f0efe85c449d3b8a9aa450b6b7d1d0e4c6b89 11SHA1 (patch-rlm_krb5_configure) = e97f0efe85c449d3b8a9aa450b6b7d1d0e4c6b89
11SHA1 (patch-rlm_perl_configure) = 577d6f0df7322ee12a99aafcdcc2d0b40e89eb69 12SHA1 (patch-rlm_perl_configure) = 577d6f0df7322ee12a99aafcdcc2d0b40e89eb69
12SHA1 (patch-rlm_yubikey_configure) = ea62cc0e87da014befbd0ad79f68dc852dc0f254 13SHA1 (patch-rlm_yubikey_configure) = ea62cc0e87da014befbd0ad79f68dc852dc0f254
 14SHA1 (patch-src_lib_udpfromto.c) = 28322d32ed95c40b59d26072261ea29f5cd2e4da

cvs diff -r1.11 -r1.12 pkgsrc/net/freeradius/patches/Attic/patch-ai (expand / switch to unified diff)

--- pkgsrc/net/freeradius/patches/Attic/patch-ai 2017/08/26 10:07:28 1.11
+++ pkgsrc/net/freeradius/patches/Attic/patch-ai 2017/09/09 22:46:57 1.12
@@ -1,42 +1,93 @@ @@ -1,42 +1,93 @@
1$NetBSD: patch-ai,v 1.11 2017/08/26 10:07:28 fhajny Exp $ 1$NetBSD: patch-ai,v 1.12 2017/09/09 22:46:57 joerg Exp $
2 2
3Portable test syntax 3Portable test syntax
4 4
5--- configure.orig 2016-09-29 15:19:48.000000000 +0000 5--- configure.orig 2017-07-17 12:43:00.000000000 +0000
6+++ configure 6+++ configure
7@@ -9031,7 +9031,7 @@ fi 7@@ -9047,7 +9047,7 @@ fi
8  8
9 smart_prefix= 9 smart_prefix=
10  10
11- if test "x$ac_cv_header_pcap_h" == "xyes"; then 11- if test "x$ac_cv_header_pcap_h" == "xyes"; then
12+ if test "x$ac_cv_header_pcap_h" = "xyes"; then 12+ if test "x$ac_cv_header_pcap_h" = "xyes"; then
13  13
14 $as_echo "#define HAVE_PCAP_H 1" >>confdefs.h 14 $as_echo "#define HAVE_PCAP_H 1" >>confdefs.h
15  15
16@@ -9274,7 +9274,7 @@ fi 16@@ -9290,7 +9290,7 @@ fi
17  17
18 smart_prefix= 18 smart_prefix=
19  19
20- if test "x$ac_cv_header_collectd_client_h" == "xyes"; then 20- if test "x$ac_cv_header_collectd_client_h" == "xyes"; then
21+ if test "x$ac_cv_header_collectd_client_h" = "xyes"; then 21+ if test "x$ac_cv_header_collectd_client_h" = "xyes"; then
22  22
23 $as_echo "#define HAVE_COLLECTDC_H 1" >>confdefs.h 23 $as_echo "#define HAVE_COLLECTDC_H 1" >>confdefs.h
24  24
25@@ -9517,7 +9517,7 @@ fi 25@@ -9533,7 +9533,7 @@ fi
26  26
27 smart_prefix= 27 smart_prefix=
28  28
29- if test "x$ac_cv_header_sys_capability_h" == "xyes"; then 29- if test "x$ac_cv_header_sys_capability_h" == "xyes"; then
30+ if test "x$ac_cv_header_sys_capability_h" = "xyes"; then 30+ if test "x$ac_cv_header_sys_capability_h" = "xyes"; then
31  31
32 $as_echo "#define HAVE_CAPABILITY_H 1" >>confdefs.h 32 $as_echo "#define HAVE_CAPABILITY_H 1" >>confdefs.h
33  33
34@@ -12640,7 +12640,7 @@ subdirs="$subdirs $mysubdirs" 34@@ -10133,7 +10133,49 @@ $as_echo "no" >&6; }
 35 eval "ac_cv_type_${ac_safe_type}_has_ipi_addr="
 36 fi
 37
 38-if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then
 39+
 40+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipi_spec_dst in struct in_pktinfo" >&5
 41+$as_echo_n "checking for ipi_spec_dst in struct in_pktinfo... " >&6; }
 42+
 43+
 44+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 45+/* end confdefs.h. */
 46+
 47+#include <netinet/in.h>
 48+#ifdef HAVE_STDDEF_H
 49+#include <stddef.h>
 50+#endif
 51+#ifndef offsetof
 52+#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
 53+#endif
 54+
 55+int
 56+main ()
 57+{
 58+ int foo = offsetof(struct in_pktinfo, ipi_spec_dst)
 59+ ;
 60+ return 0;
 61+}
 62+_ACEOF
 63+if ac_fn_c_try_compile "$LINENO"; then :
 64+ has_element=" "
 65+else
 66+ has_element=
 67+fi
 68+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 69+
 70+ ac_safe_type=`echo "struct in_pktinfo" | sed 'y% %_%'`
 71+ if test "x$has_element" != "x"; then
 72+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 73+$as_echo "yes" >&6; }
 74+ eval "ac_cv_type_${ac_safe_type}_has_ipi_spec_dst=yes"
 75+ else
 76+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 77+$as_echo "no" >&6; }
 78+ eval "ac_cv_type_${ac_safe_type}_has_ipi_spec_dst="
 79+ fi
 80+
 81+if test "$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "yes" && test "$ac_cv_type_struct_in_pktinfo_has_ipi_spec_dst" = "yes"; then
 82
 83 $as_echo "#define HAVE_IP_PKTINFO /**/" >>confdefs.h
 84
 85@@ -12656,7 +12698,7 @@ subdirs="$subdirs $mysubdirs"
35  86
36  87
37  88
38-if test "x$werror" == "xyes"; then 89-if test "x$werror" == "xyes"; then
39+if test "x$werror" = "xyes"; then 90+if test "x$werror" = "xyes"; then
40 CFLAGS="-Werror $CFLAGS" 91 CFLAGS="-Werror $CFLAGS"
41 fi 92 fi
42  93

File Added: pkgsrc/net/freeradius/patches/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2017/09/09 22:46:57 joerg Exp $

Check if in_pkt_info has ipi_spec_dst before trying to use (NetBSD 8 doesn't).
Fix test syntax.

--- configure.ac.orig	2017-07-17 12:43:00.000000000 +0000
+++ configure.ac
@@ -1213,7 +1213,7 @@ else
   dnl #
   smart_try_dir="$pcap_include_dir"
   FR_SMART_CHECK_INCLUDE([pcap.h])
-  if test "x$ac_cv_header_pcap_h" == "xyes"; then
+  if test "x$ac_cv_header_pcap_h" = "xyes"; then
     AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the <pcap.h> header file.])
     AC_SUBST(PCAP_LIBS)
     AC_SUBST(PCAP_LDFLAGS)
@@ -1231,7 +1231,7 @@ else
   dnl #
   smart_try_dir="$collectdclient_include_dir"
   FR_SMART_CHECK_INCLUDE([collectd/client.h])
-  if test "x$ac_cv_header_collectd_client_h" == "xyes"; then
+  if test "x$ac_cv_header_collectd_client_h" = "xyes"; then
     AC_DEFINE(HAVE_COLLECTDC_H, 1, [Define to 1 if you have the `collectdclient' library (-lcollectdclient).])
     AC_SUBST(COLLECTDC_LIBS)
     AC_SUBST(COLLECTDC_LDFLAGS)
@@ -1251,7 +1251,7 @@ else
   dnl #
   smart_try_dir="$cap_include_dir"
   FR_SMART_CHECK_INCLUDE([sys/capability.h])
-  if test "x$ac_cv_header_sys_capability_h" == "xyes"; then
+  if test "x$ac_cv_header_sys_capability_h" = "xyes"; then
     AC_DEFINE(HAVE_CAPABILITY_H, 1, [Define to 1 if you have the <sys/capability.h> header file.])
   else
     AC_MSG_WARN([cap headers not found, will not perform debugger checks. Use --with-cap-include-dir=<path>.])
@@ -1511,7 +1511,8 @@ dnl #
 dnl #  struct ip_pktinfo
 dnl #
 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
-if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then
+FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_spec_dst)
+if test "$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "yes" && test "$ac_cv_type_struct_in_pktinfo_has_ipi_spec_dst" = "yes"; then
   AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
 fi
 
@@ -2217,7 +2218,7 @@ dnl #  Add -Werror last, so it doesn't i
 dnl #  test programs.
 dnl #
 dnl #############################################################
-if test "x$werror" == "xyes"; then
+if test "x$werror" = "xyes"; then
   CFLAGS="-Werror $CFLAGS"
 fi
 

File Added: pkgsrc/net/freeradius/patches/patch-src_lib_udpfromto.c
$NetBSD: patch-src_lib_udpfromto.c,v 1.1 2017/09/09 22:46:57 joerg Exp $

Only use IP_PKTINFO if the configure checks for the necessary members
passed.

--- src/lib/udpfromto.c.orig	2017-09-09 18:10:18.070426265 +0000
+++ src/lib/udpfromto.c
@@ -386,11 +386,11 @@ int sendfromto(int s, void *buf, size_t 
 	msgh.msg_name = to;
 	msgh.msg_namelen = tolen;
 
-# if defined(IP_PKTINFO) || defined(IP_SENDSRCADDR)
+# if defined(HAVE_IP_PKTINFO) || defined(IP_SENDSRCADDR)
 	if (from->sa_family == AF_INET) {
 		struct sockaddr_in *s4 = (struct sockaddr_in *) from;
 
-#  ifdef IP_PKTINFO
+#  ifdef HAVE_IP_PKTINFO
 		struct cmsghdr *cmsg;
 		struct in_pktinfo *pkt;