Skip to content

Commit 6fcfd35

Browse files
committed
fileferry: new port
1 parent f8fcecb commit 6fcfd35

7 files changed

+327
-0
lines changed

devel/libUseful/Portfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2+
3+
PortSystem 1.0
4+
PortGroup github 1.0
5+
PortGroup openssl 1.0
6+
7+
github.setup ColumPaget libUseful 5.37 v
8+
revision 0
9+
categories net
10+
license GPL-3
11+
maintainers nomaintainer
12+
description C library of useful functions
13+
long_description {*}${description}.
14+
checksums rmd160 bbe121fb149cf476e66866919c0db7ec45b7e860 \
15+
sha256 157faf72874244bae725b924bb6d4517bd4c165a14c79ea8694e407392878ae5 \
16+
size 390419
17+
github.tarball_from archive
18+
19+
use_autoconf yes
20+
21+
# Build uses linuxisms: ln: illegal option -- r
22+
depends_build-append path:libexec/coreutils/libstdbuf.so:coreutils
23+
24+
depends_lib-append port:zlib
25+
26+
patchfiles 0001-Use-platform-specific-endianness-macros-on-Apple.patch \
27+
0002-Socket.c-no-SOCK_NONBLOCK-on-macOS.patch \
28+
0003-Entropy.c-add-a-missing-header-for-getentropy.patch \
29+
0004-Fixes-for-Makefile.patch
30+
31+
post-patch {
32+
reinplace "s,@PREFIX@,${prefix}," ${worksrcpath}/configure.ac
33+
}
34+
35+
configure.args-append --disable-simd \
36+
--enable-ip6 \
37+
--enable-soname \
38+
--enable-ssl \
39+
--enable-zlib \
40+
--sysconfdir=${prefix}/etc/${name}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From c714594110dd10cd8957a8b45d4850576bcbd2a7 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Wed, 12 Feb 2025 07:21:41 +0800
4+
Subject: [PATCH 1/4] Use platform-specific endianness macros on Apple
5+
6+
---
7+
Socket.h | 8 ++++++++
8+
includes.h | 3 +++
9+
2 files changed, 11 insertions(+)
10+
11+
diff --git Socket.h Socket.h
12+
index 547d55b..0a58117 100644
13+
--- Socket.h
14+
+++ Socket.h
15+
@@ -53,20 +53,28 @@ extern "C" {
16+
17+
18+
#ifndef HAVE_HTONLL
19+
+#ifdef __APPLE__
20+
+# define htonll(x) OSSwapHostToBigInt64(x)
21+
+#else
22+
#if __BIG_ENDIAN__
23+
# define htonll(x) (x)
24+
#else
25+
# define htonll(x) ( ( (uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32) )
26+
#endif
27+
#endif
28+
+#endif
29+
30+
#ifndef HAVE_NTOHLL
31+
+#ifdef __APPLE__
32+
+# define ntohll(x) OSSwapBigToHostInt64(x)
33+
+#else
34+
#if __BIG_ENDIAN__
35+
# define ntohll(x) (x)
36+
#else
37+
# define ntohll(x) ( ( (uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32) )
38+
#endif
39+
#endif
40+
+#endif
41+
42+
43+
44+
diff --git includes.h includes.h
45+
index e42b341..7ade40a 100644
46+
--- includes.h
47+
+++ includes.h
48+
@@ -33,6 +33,9 @@ Copyright (c) 2015 Colum Paget <[email protected]>
49+
#include <grp.h> //for gid_t
50+
#include <math.h> //for math defines like PI
51+
52+
+#ifdef __APPLE__
53+
+#include <libkern/OSByteOrder.h>
54+
+#endif
55+
56+
57+
#include "defines.h"
58+
--
59+
2.47.1
60+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 7919457b9f03a9f6fee2195be3189fc77f35c979 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Wed, 12 Feb 2025 07:30:30 +0800
4+
Subject: [PATCH 2/4] Socket.c: no SOCK_NONBLOCK on macOS
5+
6+
---
7+
Socket.c | 5 +++++
8+
1 file changed, 5 insertions(+)
9+
10+
diff --git Socket.c Socket.c
11+
index da1d472..f94e0d5 100644
12+
--- Socket.c
13+
+++ Socket.c
14+
@@ -19,6 +19,11 @@
15+
#include <linux/netfilter_ipv4.h>
16+
#endif
17+
18+
+#ifndef SOCK_NONBLOCK
19+
+#include <fcntl.h>
20+
+#define SOCK_NONBLOCK O_NONBLOCK
21+
+#endif
22+
+
23+
24+
25+
static void SocketParseConfigFlags(const char *Config, TSockSettings *Settings)
26+
--
27+
2.47.1
28+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 5939e3ce70866ad976ef307461adb2b6ec831984 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Wed, 12 Feb 2025 07:36:16 +0800
4+
Subject: [PATCH 3/4] Entropy.c: add a missing header for getentropy
5+
6+
---
7+
Entropy.c | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git Entropy.c Entropy.c
11+
index 72efc93..4d6fc9a 100644
12+
--- Entropy.c
13+
+++ Entropy.c
14+
@@ -2,6 +2,7 @@
15+
#include "Encodings.h"
16+
#include "Hash.h"
17+
#include <sys/utsname.h>
18+
+#include <sys/random.h>
19+
20+
21+
#ifdef HAVE_GETENTROPY
22+
--
23+
2.47.1
24+
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
From d67f638e281b80326d6b86ec5a65a7caf29b46f9 Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Wed, 12 Feb 2025 07:46:17 +0800
4+
Subject: [PATCH 4/4] Fixes for Makefile
5+
6+
---
7+
Makefile.in | 43 ++++++++++++++++++++++++++++---------------
8+
configure.ac | 4 ++--
9+
2 files changed, 30 insertions(+), 17 deletions(-)
10+
11+
diff --git Makefile.in Makefile.in
12+
index 957b4ff..828b26a 100644
13+
--- Makefile.in
14+
+++ Makefile.in
15+
@@ -1,9 +1,22 @@
16+
CC = @CC@
17+
AR = @AR@
18+
+LN = gln
19+
VERSION = 5.37
20+
MAJOR=5
21+
-LIBFILE=libUseful.so.$(VERSION)
22+
-SONAME=libUseful.so.$(MAJOR)
23+
+UNAME_S := $(shell uname -s)
24+
+ifeq ($(UNAME_S),Darwin)
25+
+ SONAME_SUFFIX = dylib
26+
+ SONAME_VER_SUFFIX = $(MAJOR).$(SONAME_SUFFIX)
27+
+ LIBFILE_SUFFIX = $(VERSION).$(SONAME_SUFFIX)
28+
+ LINKER_SONAME_OPTION = -dylib_install_name
29+
+else
30+
+ SONAME_SUFFIX = so
31+
+ SONAME_VER_SUFFIX = $(SONAME_SUFFIX).$(MAJOR)
32+
+ LIBFILE_SUFFIX = $(SONAME_SUFFIX).$(VERSION)
33+
+ LINKER_SONAME_OPTION = -soname
34+
+endif
35+
+LIBFILE = libUseful.$(LIBFILE_SUFFIX)
36+
+SONAME = libUseful.$(SONAME_VER_SUFFIX)
37+
CFLAGS = @CFLAGS@ @SIMD_CFLAGS@ @SONAME_FLAGS@
38+
LDFLAGS=@LDFLAGS@
39+
LIBS = @LIBS@
40+
@@ -15,13 +28,13 @@ OBJ=StrLenCache.o String.o Array.o List.o IPAddress.o Socket.o Server.o UnixSock
41+
42+
all: $(OBJ)
43+
$(CC) $(FLAGS) -shared -o $(LIBFILE) $(OBJ) $(LIBS) $(LDFLAGS)
44+
- -ln -s -r -f $(LIBFILE) libUseful-$(VERSION).so
45+
- -ln -s -r -f $(LIBFILE) libUseful-$(MAJOR).so
46+
- -ln -s -r -f $(LIBFILE) $(SONAME)
47+
- -ln -s -r -f $(LIBFILE) libUseful.so
48+
+ -$(LN) -s -r -f $(LIBFILE) libUseful-$(VERSION).$(SONAME_SUFFIX)
49+
+ -$(LN) -s -r -f $(LIBFILE) libUseful-$(MAJOR).$(SONAME_SUFFIX)
50+
+ -$(LN) -s -r -f $(LIBFILE) $(SONAME)
51+
+ -$(LN) -s -r -f $(LIBFILE) libUseful.$(SONAME_SUFFIX)
52+
$(AR) rcs libUseful-$(VERSION).a $(OBJ)
53+
- -ln -s -r -f libUseful-$(VERSION).a libUseful-$(MAJOR).a
54+
- -ln -s -r -f libUseful-$(VERSION).a libUseful.a
55+
+ -$(LN) -s -r -f libUseful-$(VERSION).a libUseful-$(MAJOR).a
56+
+ -$(LN) -s -r -f libUseful-$(VERSION).a libUseful.a
57+
58+
59+
StrLenCache.o: StrLenCache.h StrLenCache.c
60+
@@ -278,20 +291,20 @@ LibSettings.o: LibSettings.h LibSettings.c
61+
$(CC) $(FLAGS) -c LibSettings.c
62+
63+
clean:
64+
- -rm -f *.o *.so *.so.* *.a *.orig .*.swp *~
65+
- -rm config.log config.status
66+
+ -rm -f *.o *.$(SONAME_SUFFIX) *.$(SONAME_VER_SUFFIX) *.$(LIBFILE_SUFFIX) *.a *.orig .*.swp *~
67+
+ -rm config.log config.status
68+
-rm -r autom4te.cache config.cache
69+
-$(MAKE) clean -C examples
70+
71+
-install: libUseful.so
72+
- -mkdir -p $(DESTDIR)$(prefix)/lib
73+
- cp -P *.so *.so.* *.a $(DESTDIR)$(prefix)/lib
74+
+install: libUseful.$(SONAME_SUFFIX)
75+
+ -mkdir -p $(DESTDIR)$(prefix)/lib
76+
+ cp -P *.$(SONAME_SUFFIX) *.$(SONAME_VER_SUFFIX) *.$(LIBFILE_SUFFIX) *.a $(DESTDIR)$(prefix)/lib
77+
-mkdir -p $(DESTDIR)$(prefix)/include/libUseful-$(VERSION)
78+
cp *.h $(DESTDIR)$(prefix)/include/libUseful-$(VERSION)
79+
- -ln -s -r -f $(DESTDIR)$(prefix)/include/libUseful-$(VERSION) $(DESTDIR)$(prefix)/include/libUseful-5
80+
+ -$(LN) -s -r -f $(DESTDIR)$(prefix)/include/libUseful-$(VERSION) $(DESTDIR)$(prefix)/include/libUseful-5
81+
-mkdir -p $(DESTDIR)$(prefix)/etc
82+
cp *.conf $(DESTDIR)$(prefix)/etc
83+
84+
85+
-test: libUseful.so
86+
+test: libUseful.$(SONAME_SUFFIX)
87+
-echo "No tests written yet"
88+
diff --git configure.ac configure.ac
89+
index b59cfbb..dafd4ec 100644
90+
--- configure.ac
91+
+++ configure.ac
92+
@@ -54,11 +54,11 @@ if test "$cf_use_soname" != "no"
93+
then
94+
if test "$GCC" = "yes"
95+
then
96+
- AC_SUBST([SONAME_FLAGS], ['-Wl,-soname,${SONAME}'])
97+
+ AC_SUBST([SONAME_FLAGS], ['-Wl,${LINKER_SONAME_OPTION},@PREFIX@/lib/${SONAME}'])
98+
else
99+
if test "$cf_use_soname" = "yes"
100+
then
101+
- AC_SUBST([SONAME_FLAGS], ['-Wl,-soname,${SONAME}'])
102+
+ AC_SUBST([SONAME_FLAGS], ['-Wl,${LINKER_SONAME_OPTION},@PREFIX@/lib/${SONAME}'])
103+
fi
104+
fi
105+
fi
106+
--
107+
2.47.1
108+

net/fileferry/Portfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2+
3+
PortSystem 1.0
4+
PortGroup github 1.0
5+
PortGroup openssl 1.0
6+
7+
github.setup ColumPaget fileferry 3.2 v
8+
revision 0
9+
categories net
10+
license GPL-3
11+
maintainers nomaintainer
12+
description File transfer app with a focus on scripted transfers
13+
long_description {*}${description}.
14+
checksums rmd160 7633ebe711e1ab93ca048bc8c879bb311acec66e \
15+
sha256 86db2362122300f4459a8f0e3e9c022c7549f90c0924f37ac6b62e5312eb57e1 \
16+
size 1195560
17+
github.tarball_from archive
18+
19+
# https://github.com/ColumPaget/fileferry/issues/3
20+
post-extract {
21+
delete ${worksrcpath}/libUseful-5
22+
}
23+
24+
# https://github.com/ColumPaget/fileferry/issues/2
25+
patchfiles 0001-Add-a-missing-header-for-basename.patch
26+
27+
depends_lib-append port:libUseful \
28+
port:zlib
29+
30+
configure.args-append --disable-syno \
31+
--disable-synology \
32+
--disable-faw \
33+
--disable-dropbox \
34+
--disable-gdrive \
35+
--disable-gofile \
36+
--disable-filebin \
37+
--disable-allfs \
38+
--enable-ftp \
39+
--enable-sftp \
40+
--enable-http \
41+
--enable-pop3 \
42+
--prefix=${destroot}${prefix} \
43+
--with-libuseful
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From fab8078c2429d65c2ff95718050b2089f8cfd47f Mon Sep 17 00:00:00 2001
2+
From: Sergey Fedorov <[email protected]>
3+
Date: Wed, 12 Feb 2025 07:20:01 +0800
4+
Subject: [PATCH] Add a missing header for basename
5+
6+
---
7+
filestore_dirlist.c | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git filestore_dirlist.c filestore_dirlist.c
11+
index 748822d..78e0d37 100644
12+
--- filestore_dirlist.c
13+
+++ filestore_dirlist.c
14+
@@ -1,6 +1,7 @@
15+
#include "filestore_dirlist.h"
16+
#include "commands.h"
17+
#include <fnmatch.h>
18+
+#include <libgen.h> // basename on macOS and musl
19+
20+
void FileStoreDirListFree(TFileStore *FS, ListNode *Dir)
21+
{
22+
--
23+
2.47.1
24+

0 commit comments

Comments
 (0)