Skip to content

Commit

Permalink
devel/libpdel: update to version 0.6.1
Browse files Browse the repository at this point in the history
Set MASTER_SITE to SourceForge.

Fix build on FreeBSD-14 and remove DEPRECATED status from Makefile.
  • Loading branch information
stesser committed Jul 1, 2021
1 parent 9505d05 commit 6952f08
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 367 deletions.
17 changes: 10 additions & 7 deletions devel/libpdel/Makefile
@@ -1,22 +1,25 @@
# Created by: Archie Cobbs

PORTNAME= libpdel
PORTVERSION= 0.5.3
PORTREVISION= 6
PORTVERSION= 0.6.1
CATEGORIES= devel net www
MASTER_SITES= LOCAL/archie
MASTER_SITES= SF/libpdel/libpdel-combined/${PORTVERSION}/

MAINTAINER= ports@FreeBSD.org
COMMENT= Packet Design multi-purpose C library for embedded applications

DEPRECATED= mastersite disappeared as of 20210515
EXPIRATION_DATE= 2021-08-15
BROKEN_FreeBSD_14= fails to compile: /usr/include/ufs/ufs/ufsmount.h:99:31: error: field has incomplete type 'struct ufs_extattr_per_mount'
LICENSE= PACKETDESIGN
LICENSE_NAME= Packet Design
LICENSE_FILE= ${WRKSRC}/COPYRIGHT
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

LIB_DEPENDS= libexpat.so:textproc/expat2

USES= tar:bz2
USE_LDCONFIG= yes

MAKE_ENV= WITHOUT_PROFILE=yes __MAKE_CONF=/dev/null SRCCONF=/dev/null

USE_LDCONFIG= yes
WRKSRC_SUBDIR= pdel

.include <bsd.port.mk>
5 changes: 3 additions & 2 deletions devel/libpdel/distinfo
@@ -1,2 +1,3 @@
SHA256 (libpdel-0.5.3.tar.gz) = 05295e9005bc019209d54f69f8470373ecfaba615163b5e1c2499a1cafe6c8ae
SIZE (libpdel-0.5.3.tar.gz) = 479857
TIMESTAMP = 1625128805
SHA256 (libpdel-0.6.1.tar.bz2) = b0bccc74a51a936177ba6e9274c623631974986f9ccd3d7cf9461927920b5eab
SIZE (libpdel-0.6.1.tar.bz2) = 528773
15 changes: 12 additions & 3 deletions devel/libpdel/files/patch-Makefile
@@ -1,5 +1,5 @@
--- Makefile.orig 2014-04-26 19:31:00.000000000 -0300
+++ Makefile 2014-04-26 19:31:40.000000000 -0300
--- Makefile.orig 2009-05-13 21:36:05 UTC
+++ Makefile
@@ -2,6 +2,11 @@

LIB= pdel
Expand All @@ -9,6 +9,15 @@
+SHAREOWN= ${BINOWN}
+SHAREGRP= ${BINGRP}
+
SUBDIRS= config http io net ppp structs sys tmpl util
SUBDIRS= config http io misc net pdel ppp regex structs sys thread tmpl util

VERSION!= grep -w PDEL_VERSION_STRING ${.CURDIR}/version.h \
@@ -32,7 +37,7 @@ OBJDIR= ${PDELTOP}/obj/${OS}.${ARCH}
SHLIB_MAJOR= ${VERSION_MAJOR}
SHLIB_MAJOR= ${VERSION_MINOR}
MAN= libpdel.3
-NO_PROFILE=
+MK_PROFILE= no
INCHDRS= version.h
BASEINCHDRS=

@@ -1,6 +1,6 @@
--- http/http_server.c.orig 2005-01-21 16:01:58.000000000 -0500
+++ http/http_server.c 2015-03-23 19:34:45.664653000 -0400
@@ -197,7 +197,7 @@
--- http/http_server.c.orig 2009-05-13 21:36:02 UTC
+++ http/http_server.c
@@ -171,7 +171,7 @@ http_server_start(struct pevent_ctx *ctx, struct in_ad
_http_ssl_init();

/* Initialize SSL context for this server */
Expand Down
10 changes: 0 additions & 10 deletions devel/libpdel/files/patch-http_servlet_cookieauth.c

This file was deleted.

80 changes: 0 additions & 80 deletions devel/libpdel/files/patch-len

This file was deleted.

@@ -1,56 +1,14 @@
--- net/uroute.c.prev 2005-01-21 23:02:03.000000000 +0200
+++ net/uroute.c 2008-12-24 21:34:43.000000000 +0200
@@ -74,9 +74,15 @@
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
#define ADVANCE(x, n) ((x) += ROUNDUP((n)->sa_len))

+#ifdef RTF_CLONING
#define WRITABLE_FLAGS (RTF_STATIC | RTF_LLINFO | RTF_REJECT | RTF_BLACKHOLE \
| RTF_PROTO1 | RTF_PROTO2 | RTF_CLONING \
| RTF_XRESOLVE | RTF_UP | RTF_GATEWAY)
+#else
+#define WRITABLE_FLAGS (RTF_STATIC | RTF_REJECT | RTF_BLACKHOLE \
+ | RTF_PROTO1 | RTF_PROTO2 \
+ | RTF_XRESOLVE | RTF_UP | RTF_GATEWAY)
+#endif

struct route_flag {
const char *name;
@@ -92,15 +98,23 @@ static const struct route_flag route_fla
FLAG(DYNAMIC),
FLAG(MODIFIED),
FLAG(DONE),
+#ifdef RTF_CLONING
FLAG(CLONING),
+#endif
FLAG(XRESOLVE),
+#ifdef RTF_LLINFO
FLAG(LLINFO),
+#endif
FLAG(STATIC),
FLAG(BLACKHOLE),
FLAG(PROTO2),
FLAG(PROTO1),
+#ifdef RTF_PRCLONING
FLAG(PRCLONING),
+#endif
+#ifdef RTF_WASCLONED
FLAG(WASCLONED),
+#endif
FLAG(PROTO3),
FLAG(PINNED),
FLAG(LOCAL),
--- net/if_arp.c.prev 2005-01-21 23:02:02.000000000 +0200
+++ net/if_arp.c 2008-12-24 23:01:46.000000000 +0200
@@ -68,7 +68,6 @@
--- net/if_arp.c.orig 2009-05-13 21:36:04 UTC
+++ net/if_arp.c
@@ -35,7 +35,6 @@
#include "structs/type/array.h"

#include "net/if_util.h"
-#include "net/uroute.h"
#include "util/typed_mem.h"

#define ROUNDUP(a) \
@@ -124,7 +123,11 @@ if_get_arp(struct in_addr ip, u_char *et
@@ -91,7 +90,11 @@ if_get_arp(struct in_addr ip, u_char *ether)
mib[2] = 0;
mib[3] = AF_INET;
mib[4] = NET_RT_FLAGS;
Expand All @@ -62,7 +20,7 @@
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
return (-1);
needed += 128;
@@ -227,9 +230,11 @@ tryagain:
@@ -194,9 +197,11 @@ tryagain:
sdl = (struct sockaddr_dl *)(void *)
(ROUNDUP(sin->sin_len) + (char *)sin);
if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) {
Expand All @@ -77,15 +35,15 @@
switch (sdl->sdl_type) {
case IFT_ETHER:
case IFT_FDDI:
@@ -278,6 +283,7 @@ arp_delete(int sock, struct in_addr ip)
@@ -245,6 +250,7 @@ arp_delete(int sock, struct in_addr ip)
struct rt_msghdr *const rtm = &m_rtmsg.m_rtm;
struct sockaddr_dl *sdl;

+ sdl_m = zero_sdl;
sin_m = zero_sin;
sin->sin_addr = ip;
tryagain:
@@ -286,14 +292,15 @@ tryagain:
@@ -253,14 +259,15 @@ tryagain:
sin = (struct sockaddr_inarp *)(rtm + 1);
sdl = (struct sockaddr_dl *)(void *)
(ROUNDUP(sin->sin_len) + (char *)sin);
Expand All @@ -106,34 +64,14 @@
}
if (sin_m.sin_other & SIN_PROXY) {
errno = ENOENT;
@@ -384,42 +391,55 @@ int
@@ -351,42 +358,55 @@ int
if_flush_arp(void)
{
int errno_save = errno;
- struct uroute **list;
- int rtn = 0;
- int num;
- int i;
-
- /* Get list of routes */
- if ((num = uroute_get_all(&list, TYPED_MEM_TEMP)) == -1)
- return (-1);
-
- /* Delete ARP routes */
- for (i = 0; i < num; i++) {
- struct uroute *const route = list[i];
- const struct sockaddr *dest;
- const struct sockaddr *gw;
-
- /* Is this an ARP entry? */
- dest = uroute_get_dest(route);
- gw = uroute_get_gateway(route);
- if ((uroute_get_flags(route)
- & (RTF_HOST|RTF_LLINFO|RTF_WASCLONED))
- != (RTF_HOST|RTF_LLINFO|RTF_WASCLONED)
- || dest->sa_family != AF_INET
- || gw->sa_family != AF_LINK)
- continue;
+ int mib[6];
+ size_t needed;
+ char *lim, *buf, *next;
Expand All @@ -142,15 +80,17 @@
+ struct sockaddr_dl *sdl;
+ int sock, rtn = -1;

- /* Delete it */
- if (uroute_delete(route) == -1) {
- errno_save = errno;
- rtn = -1;
- }
- /* Get list of routes */
- if ((num = uroute_get_all(&list, TYPED_MEM_TEMP)) == -1)
+ /* Get socket */
+ if ((sock = socket(PF_ROUTE, SOCK_RAW, 0)) == -1)
+ return (-1);
+
return (-1);

- /* Delete ARP routes */
- for (i = 0; i < num; i++) {
- struct uroute *const route = list[i];
- const struct sockaddr *dest;
- const struct sockaddr *gw;
+ /* Get ARP table */
+ mib[0] = CTL_NET;
+ mib[1] = PF_ROUTE;
Expand All @@ -170,7 +110,22 @@
+ if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+ goto done2;
+ }
+

- /* Is this an ARP entry? */
- dest = uroute_get_dest(route);
- gw = uroute_get_gateway(route);
- if ((uroute_get_flags(route)
- & (RTF_HOST|RTF_LLINFO|RTF_WASCLONED))
- != (RTF_HOST|RTF_LLINFO|RTF_WASCLONED)
- || dest->sa_family != AF_INET
- || gw->sa_family != AF_LINK)
- continue;
-
- /* Delete it */
- if (uroute_delete(route) == -1) {
- errno_save = errno;
- rtn = -1;
- }
+ /* Find desired entry */
+ lim = buf + needed;
+ for (next = buf; next < lim; next += rtm->rtm_msglen) {
Expand Down
@@ -1,6 +1,6 @@
--- net/route_msg.c.orig 2014-04-26 19:28:21.000000000 -0300
+++ net/route_msg.c 2014-04-26 19:28:57.000000000 -0300
@@ -608,8 +608,12 @@
--- net/route_msg.c.orig 2009-05-13 21:36:04 UTC
+++ net/route_msg.c
@@ -575,8 +575,12 @@ route_msg_print(struct route_msg *msg, FILE *fp)
case RTM_REDIRECT: typestr = "REDIRECT"; break;
case RTM_MISS: typestr = "MISS"; break;
case RTM_LOCK: typestr = "LOCK"; break;
Expand Down
42 changes: 42 additions & 0 deletions devel/libpdel/files/patch-net_uroute.c
@@ -0,0 +1,42 @@
--- net/uroute.c.orig 2009-05-13 21:36:04 UTC
+++ net/uroute.c
@@ -41,9 +41,15 @@
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
#define ADVANCE(x, n) ((x) += ROUNDUP((n)->sa_len))

+#ifdef RTF_CLONING
#define WRITABLE_FLAGS (RTF_STATIC | RTF_LLINFO | RTF_REJECT | RTF_BLACKHOLE \
| RTF_PROTO1 | RTF_PROTO2 | RTF_CLONING \
| RTF_XRESOLVE | RTF_UP | RTF_GATEWAY)
+#else
+#define WRITABLE_FLAGS (RTF_STATIC | RTF_REJECT | RTF_BLACKHOLE \
+ | RTF_PROTO1 | RTF_PROTO2 \
+ | RTF_XRESOLVE | RTF_UP | RTF_GATEWAY)
+#endif

struct route_flag {
const char *name;
@@ -59,15 +65,23 @@ static const struct route_flag route_flags[] = {
FLAG(DYNAMIC),
FLAG(MODIFIED),
FLAG(DONE),
+#ifdef RTF_CLONING
FLAG(CLONING),
+#endif
FLAG(XRESOLVE),
+#ifdef RTF_LLINFO
FLAG(LLINFO),
+#endif
FLAG(STATIC),
FLAG(BLACKHOLE),
FLAG(PROTO2),
FLAG(PROTO1),
+#ifdef RTF_PRCLONING
FLAG(PRCLONING),
+#endif
+#ifdef RTF_WASCLONED
FLAG(WASCLONED),
+#endif
FLAG(PROTO3),
FLAG(PINNED),
FLAG(LOCAL),

0 comments on commit 6952f08

Please sign in to comment.