From 6e99c40ba8555ef951fad047d30fa21b836ba5ab Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Thu, 2 Jan 2014 00:20:19 +0000 Subject: [PATCH] - Modernize and simplify the archivers/p7zip port's Makefile by getting rid of some sed calls, supporting staging. - Set LICENSE for the port. [1] - Get rid of the MINIMAL and MODULES options. They were not very useful and its handling was needlessly complicating the Makefile logic. We now always build as if MINIMAL was unset. - Stop installing the p7zip and Client7z wrappers. - Move the installation of the RAR decompression codec to archivers/p7zip-codec-rar, as its source code uses a more restrictive license than the LGPL21 used for the rest of the code base. PR: ports/185238 [1] Submitted by: Hardy Schumacher [1] --- UPDATING | 12 ++++ archivers/Makefile | 1 + archivers/p7zip-codec-rar/Makefile | 25 ++++++++ archivers/p7zip-codec-rar/pkg-descr | 3 + archivers/p7zip-codec-rar/pkg-plist | 3 + archivers/p7zip/Makefile | 96 ++++++++--------------------- archivers/p7zip/files/7z | 5 +- archivers/p7zip/pkg-plist | 11 ++++ 8 files changed, 83 insertions(+), 73 deletions(-) create mode 100644 archivers/p7zip-codec-rar/Makefile create mode 100644 archivers/p7zip-codec-rar/pkg-descr create mode 100644 archivers/p7zip-codec-rar/pkg-plist diff --git a/UPDATING b/UPDATING index df65ee46c7ab..8c5889aeee18 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,18 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20140102: + AFFECTS: users of archivers/p7zip + AUTHOR: rakuco@FreeBSD.org + + The MINIMAL and MODULES options have been removed from archivers/p7zip, + which now unconditionally installs the 7z, 7za and 7zr, as if the MINIMAL + option was previously unset. + + The RAR decompression codec, whose source code has a more restrictive + license that forbids its use for creating RAR archives, has been moved to + a separate port, archivers/p7zip-codec-rar. + 20131230: AFFECTS: ports using Apache Software License 2.0 AUTHOR: ohauer@FreeBSD.org diff --git a/archivers/Makefile b/archivers/Makefile index 885a399ca4be..8bf2d916561c 100644 --- a/archivers/Makefile +++ b/archivers/Makefile @@ -120,6 +120,7 @@ SUBDIR += p5-PerlIO-gzip SUBDIR += p5-PerlIO-via-Bzip2 SUBDIR += p7zip + SUBDIR += p7zip-codec-rar SUBDIR += packddir SUBDIR += paq SUBDIR += par diff --git a/archivers/p7zip-codec-rar/Makefile b/archivers/p7zip-codec-rar/Makefile new file mode 100644 index 000000000000..0348bec10616 --- /dev/null +++ b/archivers/p7zip-codec-rar/Makefile @@ -0,0 +1,25 @@ +# $FreeBSD$ + +PKGNAMESUFFIX= -codec-rar +PORTREVISION= 0 + +COMMENT= RAR decoder codec for p7zip + +LICENSE= LGPL21 UNRAR +LICENSE_COMB= multi +LICENSE_NAME_UNRAR= unRAR usage restriction license +LICENSE_FILE_UNRAR= ${WRKSRC}/DOCS/unRarLicense.txt +LICENSE_PERMS_UNRAR= dist-mirror dist-sell pkg-mirror pkg-sell + +MASTERDIR= ${.CURDIR}/../p7zip +ALL_TARGET= common7z +DESCR= ${.CURDIR}/pkg-descr +PLIST= ${.CURDIR}/pkg-plist + +OPTIONS_EXCLUDE= DOCS + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/p7zip/Codecs + ${INSTALL_LIB} ${WRKSRC}/bin/Codecs/Rar29.so ${STAGEDIR}${PREFIX}/libexec/p7zip/Codecs + +.include "${MASTERDIR}/Makefile" diff --git a/archivers/p7zip-codec-rar/pkg-descr b/archivers/p7zip-codec-rar/pkg-descr new file mode 100644 index 000000000000..cc3d463a1e8c --- /dev/null +++ b/archivers/p7zip-codec-rar/pkg-descr @@ -0,0 +1,3 @@ +A codec for uncompressing RAR files using the p7zip archiver. + +WWW: http://p7zip.sourceforge.net/ diff --git a/archivers/p7zip-codec-rar/pkg-plist b/archivers/p7zip-codec-rar/pkg-plist new file mode 100644 index 000000000000..5facab024d28 --- /dev/null +++ b/archivers/p7zip-codec-rar/pkg-plist @@ -0,0 +1,3 @@ +libexec/p7zip/Codecs/Rar29.so +@dirrm libexec/p7zip/Codecs +@dirrmtry libexec/p7zip diff --git a/archivers/p7zip/Makefile b/archivers/p7zip/Makefile index d1153222c4d9..acb69b97e789 100644 --- a/archivers/p7zip/Makefile +++ b/archivers/p7zip/Makefile @@ -3,67 +3,31 @@ PORTNAME= p7zip PORTVERSION= 9.20.1 +PORTREVISION?= 1 CATEGORIES= archivers MASTER_SITES= SF DISTNAME= ${PORTNAME}_${DISTVERSION}_src_all MAINTAINER= rakuco@FreeBSD.org -COMMENT= File archiver with high compression ratio +COMMENT?= File archiver with high compression ratio -OPTIONS_DEFINE= MINIMAL MODULES -OPTIONS_DEFAULT= MODULES +LICENSE?= LGPL21 -MINIMAL_DESC= Support only .7z file format -MODULES_DESC= Build modules - -NO_STAGE= yes +ALL_TARGET?= all3 USE_BZIP2= yes MAKEFILE= makefile +MAKE_ARGS= OPTFLAGS="${CXXFLAGS}" WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION} +CFLAGS_amd64= -fPIC +CFLAGS_ia64= -fPIC + +OPTIONS_DEFINE= DOCS + .include -.if ${PORT_OPTIONS:MMINIMAL} -MAN1= 7zr.1 -MLINKS= 7zr.1 7z.1 -PLIST_SUB= MODULES="@comment " -ALL_TARGET= 7zr -7ZBIN= 7zr -PLIST_FILES= bin/7zr \ - bin/7z -.else -MAN1= 7z.1 7za.1 7zr.1 p7zip.1 -DLLDIR= ${PREFIX}/libexec/p7zip -ALL_TARGET= 7za 7zr sfx -7ZBIN= 7za 7zr 7zCon.sfx -PLIST_FILES= bin/7z \ - bin/7za \ - bin/7zr \ - bin/p7zip \ - libexec/p7zip/7za \ - libexec/p7zip/7zr \ - libexec/p7zip/7zCon.sfx -.if ${PORT_OPTIONS:MMODULES} -ALL_TARGET= 7z 7za 7zr Client7z sfx -7ZBIN= 7z 7za 7zr Client7z 7zCon.sfx -PLIST_DIRS+= libexec/p7zip/Codecs -PLIST_FILES+= libexec/p7zip/7z \ - libexec/p7zip/7z.so \ - libexec/p7zip/Client7z \ - libexec/p7zip/Codecs/Rar29.so -.endif -PLIST_DIRS+= libexec/p7zip -.endif - -.include - -.if ${ARCH} == "amd64" || ${ARCH} == "ia64" -CFLAGS+= -fPIC -.endif - post-patch: - ${SED} -e 's!-O!${CFLAGS}!' \ - -e 's!g\+\+!${CXX}!' \ + ${SED} -e 's!g\+\+!${CXX}!' \ -e 's!gcc!${CC}!' \ -e 's/-D_LARGEFILE_SOURCE//' \ -e 's/-D_FILE_OFFSET_BITS=64//' \ @@ -71,28 +35,22 @@ post-patch: ${REINPLACE_CMD} -e 's|{DEST_SHARE_DOC}|${DOCSDIR}|' \ ${WRKSRC}/man1/* ${MV} ${WRKSRC}/README ${WRKSRC}/DOCS/readme.unix - ${MV} ${WRKSRC}/contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 ${WRKSRC}/man1/ +.if ${SLAVE_PORT} == "no" do-install: -.if defined(WITH_MINIMAL) - cd ${WRKSRC}/bin/&&${INSTALL_PROGRAM} ${7ZBIN} ${PREFIX}/bin/ - ${LN} -sf ${PREFIX}/bin/7zr ${PREFIX}/bin/7z -.else - ${INSTALL} -d ${DLLDIR}/ - cd ${WRKSRC}/bin/&&${INSTALL_PROGRAM} ${7ZBIN} ${DLLDIR}/ - ${INSTALL_SCRIPT} ${FILESDIR}/7z ${PREFIX}/bin/ - ${LN} -sf 7z ${PREFIX}/bin/7za - ${LN} -sf 7z ${PREFIX}/bin/7zr - ${INSTALL_SCRIPT} ${WRKSRC}/contrib/gzip-like_CLI_wrapper_for_7z/p7zip ${PREFIX}/bin/ -.if !defined(WITHOUT_MODULES) - ${INSTALL} -d ${DLLDIR}/Codecs/ - ${INSTALL_PROGRAM} ${WRKSRC}/bin/Codecs/Rar29.so ${DLLDIR}/Codecs/ - ${INSTALL_PROGRAM} ${WRKSRC}/bin/7z.so ${DLLDIR}/ -.endif -.endif -.if !defined(NOPORTDOCS) - @cd ${WRKSRC}/DOCS/&&${COPYTREE_SHARE} . ${DOCSDIR}/ -.endif - @cd ${WRKSRC}/man1/&&${INSTALL_MAN} ${MAN1} ${MAN1PREFIX}/man/man1/ + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/p7zip +.for BINARY in 7z 7za 7zr 7zCon.sfx + ${INSTALL_PROGRAM} ${WRKSRC}/bin/${BINARY} ${STAGEDIR}${PREFIX}/libexec/p7zip +.endfor -.include + ${INSTALL_SCRIPT} ${FILESDIR}/7z ${STAGEDIR}${PREFIX}/bin/ + ${LN} -sf 7z ${STAGEDIR}${PREFIX}/bin/7za + ${LN} -sf 7z ${STAGEDIR}${PREFIX}/bin/7zr + + cd ${WRKSRC}/DOCS && \ + ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC}/man1 && \ + ${INSTALL_MAN} 7z*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 +.endif + +.include diff --git a/archivers/p7zip/files/7z b/archivers/p7zip/files/7z index c2c5ba19f17e..579e4f619122 100644 --- a/archivers/p7zip/files/7z +++ b/archivers/p7zip/files/7z @@ -1,9 +1,6 @@ -#! /bin/sh +#!/bin/sh PROGNAME=${0##*/} BINPATH=$(dirname $(realpath $0))/../libexec/p7zip -if [ $PROGNAME = "7z" -a ! -x "$BINPATH/7z" -a -x "$BINPATH/7za" ]; then - PROGNAME=7za -fi exec "$BINPATH/$PROGNAME" "$@" diff --git a/archivers/p7zip/pkg-plist b/archivers/p7zip/pkg-plist index 2892d4a27ed8..26976f7a0e1e 100644 --- a/archivers/p7zip/pkg-plist +++ b/archivers/p7zip/pkg-plist @@ -1,3 +1,13 @@ +bin/7z +bin/7za +bin/7zr +libexec/p7zip/7za +libexec/p7zip/7zr +libexec/p7zip/7zCon.sfx +libexec/p7zip/7z +man/man1/7z.1.gz +man/man1/7za.1.gz +man/man1/7zr.1.gz %%PORTDOCS%%%%DOCSDIR%%/7zC.txt %%PORTDOCS%%%%DOCSDIR%%/7zFormat.txt %%PORTDOCS%%%%DOCSDIR%%/License.txt @@ -51,3 +61,4 @@ %%PORTDOCS%%@dirrm %%DOCSDIR%%/MANUAL/switches %%PORTDOCS%%@dirrm %%DOCSDIR%%/MANUAL %%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrmtry libexec/p7zip