Bug 184697 - [NEW PORT] archivers/minizip
Summary: [NEW PORT] archivers/minizip
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Matthias Andree
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-11 18:40 UTC by Loïc Bartoletti
Modified: 2014-01-15 00:20 UTC (History)
0 users

See Also:


Attachments
file.shar (3.37 KB, text/plain)
2013-12-11 18:40 UTC, Loïc Bartoletti
no flags Details
minizip.sh (3.51 KB, application/x-shellscript)
2014-01-14 21:19 UTC, Loïc Bartoletti
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer 2013-12-11 18:40:00 UTC
Add minizip (zlib's contrib) used by osgearth


Build's log :

https://redports.org/buildarchive/20131211180454-03646/

Fix: Patch attached with submission follows:
Comment 1 Matthias Andree freebsd_committer 2014-01-14 02:00:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mandree

I'll take it.
Comment 2 Matthias Andree 2014-01-14 02:00:09 UTC
Hi, and thanks for submitting a new port.

Can you please convert the port to staging, per instructions at
<https://wiki.freebsd.org/ports/StageDir>?

Thanks a lot.
Comment 3 Matthias Andree freebsd_committer 2014-01-14 02:00:14 UTC
State Changed
From-To: open->feedback

asked submitter to convert to staging, awaiting feedback
Comment 4 Loïc Bartoletti freebsd_committer 2014-01-14 21:19:36 UTC
Here the port with stage

Redports' logs :
https://redports.org/buildarchive/20140114204810-48649/

minizip is broken for version 8. I guess it comes from the system
library -lz.

Regards.
Comment 5 Matthias Andree 2014-01-15 00:13:45 UTC
Thanks a bunch.

Note: for your next port, when staging, the MAN* macros are useless, and
the man files must be listed, with .gz suffix, in pkg-plist.

It turns out that the only thing 8.x lacked was a definition of the
z_crc_t type, and I am replacing it to uint32_t because that's its
intention.

I have also made tweaks to make sure that our CPPFLAGS and CFLAGS from
the ports framework propagate, and I have added missing -include
sys/stat.h to avoid clang compiler complaints about a missing mkdir()
prototype.

I have also added a regression-test target that runs a simple
smoke-test: it just compresses and uncompresses the ports's WRKSRC
directory and compares that they are identical, so I can reasonably sure
that the code works inside my 8.X Tinderbox.

I have added a LICENSE=ZLIB tag, to match what's in the
MiniZip64_info.txt file.

Finally, I will remove the include* stuff from the install, there is no
library anyone could use, and if someone uses libz, he should use the
original headers.
Comment 6 dfilter service freebsd_committer 2014-01-15 00:15:00 UTC
Author: mandree
Date: Wed Jan 15 00:14:51 2014
New Revision: 339732
URL: http://svnweb.freebsd.org/changeset/ports/339732
QAT: https://qat.redports.org/buildarchive/r339732/

Log:
  Add new port archivers/minizip, which installs contributed
  minizip/miniunz programs from the ZLib.
  
  PR:		ports/184697
  Submitted by:	lbartoletti <coder@tuxfamily.org>

Added:
  head/archivers/minizip/
  head/archivers/minizip/Makefile   (contents, props changed)
  head/archivers/minizip/distinfo   (contents, props changed)
  head/archivers/minizip/files/
  head/archivers/minizip/files/patch-contrib-minizip-Makefile   (contents, props changed)
  head/archivers/minizip/pkg-descr   (contents, props changed)
  head/archivers/minizip/pkg-plist   (contents, props changed)
Modified:
  head/archivers/Makefile

Modified: head/archivers/Makefile
==============================================================================
--- head/archivers/Makefile	Tue Jan 14 23:50:12 2014	(r339731)
+++ head/archivers/Makefile	Wed Jan 15 00:14:51 2014	(r339732)
@@ -81,6 +81,7 @@
     SUBDIR += makeself
     SUBDIR += mar
     SUBDIR += mate-file-archiver
+    SUBDIR += minizip
     SUBDIR += mscompress
     SUBDIR += mtf
     SUBDIR += nomarch

Added: head/archivers/minizip/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/archivers/minizip/Makefile	Wed Jan 15 00:14:51 2014	(r339732)
@@ -0,0 +1,41 @@
+# Created by: lbartoletti <coder@tuxfamily.org>
+# $FreeBSD$
+
+PORTNAME=	minizip
+PORTVERSION=	1.2.8
+CATEGORIES=	archivers
+MASTER_SITES=	https://github.com/madler/zlib/archive/
+DISTNAME=	v${PORTVERSION}
+DIST_SUBDIR=	${PORTNAME}
+
+MAINTAINER=	coder@tuxfamily.org
+COMMENT=	Minizip and miniunz programs from Zlib contributions
+
+LICENSE=	ZLIB
+
+WRKSRC=		${WRKDIR}/zlib-${PORTVERSION}/contrib/minizip
+MAKE_ARGS=	CFLAGS="${CPPFLAGS} ${CFLAGS} -include sys/stat.h -include stdint.h"
+
+USE_ZIP=	yes
+
+.include <bsd.port.pre.mk>
+
+# work around missing typedef in 8.X's libz configuration
+.if ${OSVERSION} < 900000
+CPPFLAGS+=	-Dz_crc_t=uint32_t
+.endif
+
+post-patch:
+	${REINPLACE_CMD} -e 's/#ifdef unix \|\| __APPLE__/#ifdef unix/' ${WRKSRC}/mini???.c
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${WRKSRC}/miniunz ${STAGEDIR}${PREFIX}/bin/
+	${INSTALL_MAN} ${WRKSRC}/*.1 ${STAGEDIR}${PREFIX}/man/man1
+
+regression-test:
+	${RM} -f ${WRKDIR}/test.zip && (cd ${WRKSRC} && ./${PORTNAME} ${WRKDIR}/test.zip *)
+	${RM} -rf ${WRKDIR}/regression-test && ${MKDIR} ${WRKDIR}/regression-test
+	${WRKSRC}/miniunz ${WRKDIR}/test.zip -d ${WRKDIR}/regression-test
+	diff -ur >/dev/null ${WRKSRC} ${WRKDIR}/regression-test
+
+.include <bsd.port.post.mk>

Added: head/archivers/minizip/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/archivers/minizip/distinfo	Wed Jan 15 00:14:51 2014	(r339732)
@@ -0,0 +1,2 @@
+SHA256 (minizip/v1.2.8.zip) = da78eabfef55cbab21776d4cca207cf7e0dde483b4dd3590e525421667bfb6a7
+SIZE (minizip/v1.2.8.zip) = 724598

Added: head/archivers/minizip/files/patch-contrib-minizip-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/archivers/minizip/files/patch-contrib-minizip-Makefile	Wed Jan 15 00:14:51 2014	(r339732)
@@ -0,0 +1,28 @@
+--- Makefile.orig	2013-04-29 02:23:49.000000000 +0200
++++ Makefile	2013-12-10 10:06:34.000000000 +0100
+@@ -1,8 +1,9 @@
+ CC=cc
+-CFLAGS=-O -I../..
++CFLAGS=-O -I/usr/local
++LDFLAGS=-L/usr/lib -lz
+ 
+-UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
+-ZIP_OBJS = minizip.o zip.o   ioapi.o ../../libz.a
++UNZ_OBJS = miniunz.o unzip.o ioapi.o
++ZIP_OBJS = minizip.o zip.o   ioapi.o
+ 
+ .c.o:
+ 	$(CC) -c $(CFLAGS) $*.c
+@@ -10,10 +11,10 @@
+ all: miniunz minizip
+ 
+ miniunz:  $(UNZ_OBJS)
+-	$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(UNZ_OBJS)
+ 
+ minizip:  $(ZIP_OBJS)
+-	$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ZIP_OBJS)
+ 
+ test:	miniunz minizip
+ 	./minizip test readme.txt

Added: head/archivers/minizip/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/archivers/minizip/pkg-descr	Wed Jan 15 00:14:51 2014	(r339732)
@@ -0,0 +1,9 @@
+The Zlib library allows to deflate compressed files and to create gzip (.gz) 
+files. Zlib is free software and small.
+
+An archive in ZIP format can contain several files compressed with this method, 
+while a .gz archive can containt only one file. It is a very popular format, 
+that is why I have written a package for reading files compressed within a Zip 
+archive.
+
+WWW: http://www.winimage.com/zLibDll/minizip.html

Added: head/archivers/minizip/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/archivers/minizip/pkg-plist	Wed Jan 15 00:14:51 2014	(r339732)
@@ -0,0 +1,4 @@
+bin/minizip
+bin/miniunz
+man/man1/miniunzip.1.gz
+man/man1/minizip.1.gz
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Matthias Andree freebsd_committer 2014-01-15 00:15:12 UTC
State Changed
From-To: feedback->closed

Committed, with changes as documented in this PR. Thank you!