aboutsummaryrefslogtreecommitdiff
path: root/archivers/libdeflate
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2018-12-26 09:34:28 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2018-12-26 09:34:28 +0000
commit70ce94ec9dbc3b549f3657e87ee96d5ff6ae9629 (patch)
tree5910f257f75957407788ea0b7f30c99bc29340f8 /archivers/libdeflate
parentab4a512a23f7ed8f5f8cb756324b50ed09ed244c (diff)
downloadports-70ce94ec9dbc3b549f3657e87ee96d5ff6ae9629.tar.gz
ports-70ce94ec9dbc3b549f3657e87ee96d5ff6ae9629.zip
Instead of hand-rolled `do-install' target, make existing installation
routine PREFIX-aware and compatible with our install(1). As a bonus, it would install prefixed binaries to avoid potential clash with other gzip and gunzip implementations.
Notes
Notes: svn path=/head/; revision=488366
Diffstat (limited to 'archivers/libdeflate')
-rw-r--r--archivers/libdeflate/Makefile14
-rw-r--r--archivers/libdeflate/files/patch-Makefile30
2 files changed, 33 insertions, 11 deletions
diff --git a/archivers/libdeflate/Makefile b/archivers/libdeflate/Makefile
index 02226c908634..33d0c8a8b23d 100644
--- a/archivers/libdeflate/Makefile
+++ b/archivers/libdeflate/Makefile
@@ -4,6 +4,7 @@
PORTNAME= libdeflate
PORTVERSION= 1.1
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= archivers
MAINTAINER= danfe@FreeBSD.org
@@ -18,23 +19,14 @@ USE_LDCONFIG= yes
MAKE_ARGS= V=1
-PLIST_FILES= bin/gunzip bin/gzip \
+PLIST_FILES= bin/libdeflate-gunzip bin/libdeflate-gzip \
include/libdeflate.h \
lib/libdeflate.a lib/libdeflate.so lib/libdeflate.so.0
PORTDOCS= NEWS README.md
OPTIONS_DEFINE= DOCS
-post-patch:
- @${REINPLACE_CMD} -e 's| -O2 -fomit-frame-pointer||' ${WRKSRC}/Makefile
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/gunzip ${WRKSRC}/gzip \
- ${STAGEDIR}${PREFIX}/bin
- ${INSTALL_DATA} ${WRKSRC}/libdeflate.h ${STAGEDIR}${PREFIX}/include
- ${INSTALL_DATA} ${WRKSRC}/libdeflate.[as]* ${STAGEDIR}${PREFIX}/lib
-
-do-install-DOCS-on:
+post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
diff --git a/archivers/libdeflate/files/patch-Makefile b/archivers/libdeflate/files/patch-Makefile
new file mode 100644
index 000000000000..4b160170ded7
--- /dev/null
+++ b/archivers/libdeflate/files/patch-Makefile
@@ -0,0 +1,30 @@
+--- Makefile.orig 2018-12-23 19:13:28 UTC
++++ Makefile
+@@ -21,7 +21,7 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o
+ 1>&2 2>/dev/null; then echo $(1); fi)
+
+ override CFLAGS := \
+- $(CFLAGS) -O2 -fomit-frame-pointer -std=c99 -I. -Icommon \
++ $(CFLAGS) -std=c99 -I. -Icommon \
+ -Wall -Wundef \
+ $(call cc-option,-Wpedantic) \
+ $(call cc-option,-Wdeclaration-after-statement) \
+@@ -227,12 +227,12 @@ DEFAULT_TARGETS += gunzip$(PROG_SUFFIX)
+ all:$(DEFAULT_TARGETS)
+
+ install:all
+- install -Dm644 -t $(DESTDIR)/usr/lib $(STATIC_LIB)
+- install -Dm755 -t $(DESTDIR)/usr/lib $(SHARED_LIB)
+- ln -sf $(SHARED_LIB) $(DESTDIR)/usr/lib/libdeflate.so
+- install -Dm644 -t $(DESTDIR)/usr/include libdeflate.h
+- install -Dm755 gzip $(DESTDIR)/usr/bin/libdeflate-gzip
+- ln -f $(DESTDIR)/usr/bin/libdeflate-gzip $(DESTDIR)/usr/bin/libdeflate-gunzip
++ install -Dm644 $(STATIC_LIB) $(DESTDIR)$(PREFIX)/lib
++ install -s -Dm755 $(SHARED_LIB) $(DESTDIR)$(PREFIX)/lib
++ ln -sf $(SHARED_LIB) $(DESTDIR)$(PREFIX)/lib/libdeflate.so
++ install -Dm644 libdeflate.h $(DESTDIR)$(PREFIX)/include
++ install -s -Dm755 gzip $(DESTDIR)$(PREFIX)/bin/libdeflate-gzip
++ ln -f $(DESTDIR)$(PREFIX)/bin/libdeflate-gzip $(DESTDIR)$(PREFIX)/bin/libdeflate-gunzip
+
+ uninstall:
+ rm -f $(DESTDIR)/usr/lib/$(STATIC_LIB) \