From b177039ee7fc2d0fccd45ee31eccd0d0e84bd054 Mon Sep 17 00:00:00 2001 From: Josh Lilly Date: Fri, 1 Nov 2019 15:40:39 +1100 Subject: [PATCH 1/2] FreeBSD build + install support added to Makefile --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index e0f8422..bdfaa3e 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,15 @@ VERSION=1.2.0 CFLAGS += -O2 -Wall -Wextra -Wshadow -rdynamic -D_GNU_SOURCE\ -D_FILE_OFFSET_BITS=64 -DVERSION=\"$(VERSION)\"\ `pkg-config --cflags-only-I gumbo libcurl fuse uuid expat` +LDFLAGS += `pkg-config --libs-only-L gumbo libcurl fuse uuid expat` LIBS = -pthread -lgumbo -lcurl -lfuse -lcrypto -luuid -lexpat COBJS = main.o network.o fuse_local.o link.o cache.o util.o sonic.o +OS := $(shell uname) +ifeq ($(OS),FreeBSD) + LIBS += -lexecinfo +endif + prefix ?= /usr/local all: httpdirfs @@ -17,10 +23,19 @@ httpdirfs: $(COBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) install: +ifeq ($(OS),Linux) install -m 755 -D httpdirfs \ $(DESTDIR)$(prefix)/bin/httpdirfs install -m 644 -D doc/man/httpdirfs.1 \ $(DESTDIR)$(prefix)/share/man/man1/httpdirfs.1 +endif +ifeq ($(OS),FreeBSD) + install -m 755 httpdirfs \ + $(DESTDIR)$(prefix)/bin/httpdirfs + gzip -f -k doc/man/httpdirfs.1 + install -m 644 doc/man/httpdirfs.1.gz \ + $(DESTDIR)$(prefix)/man/man1/httpdirfs.1.gz +endif doc: doxygen Doxyfile @@ -34,7 +49,12 @@ distclean: clean uninstall: -rm -f $(DESTDIR)$(prefix)/bin/httpdirfs +ifeq ($(OS),Linux) -rm -f $(DESTDIR)$(prefix)/share/man/man1/httpdirfs.1 +endif +ifeq ($(OS),FreeBSD) + -rm -f $(DESTDIR)$(prefix)/man/man1/httpdirfs.1.gz +endif depend: .depend .depend: src/*.c From 068d5f1f9726942feaafc9094597c673e922dd2f Mon Sep 17 00:00:00 2001 From: Josh Lilly Date: Fri, 1 Nov 2019 16:36:10 +1100 Subject: [PATCH 2/2] Added instructions for build+install on FreeBSD --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 498904c..32d4a9a 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,24 @@ OpenSSL 1.1 do not. You can check your SSL engine version using the ``--version`` flag. +### FreeBSD +The following dependencies are required from either pkg or ports: + +Packages: + + gmake fusefs-libs gumbo e2fsprogs-libuuid curl expat + +Ports: + + devel/gmake sysutils/fusefs-libs devel/gumbo misc/e2fsprogs-libuuid ftp/curl textproc/expat2 + +**Note:** If you want brotli compression support, you will need to install curl from ports and enable the option. + +You can then build + install with: + + gmake + sudo gmake install + ## Usage ./httpdirfs -f --cache $URL $MOUNT_POINT