1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- 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 <hardy.schumacher@gmx.de> [1]
This commit is contained in:
Raphael Kubo da Costa 2014-01-02 00:20:19 +00:00
parent 13cb94b98a
commit 6e99c40ba8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=338410
8 changed files with 83 additions and 73 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -0,0 +1,3 @@
A codec for uncompressing RAR files using the p7zip archiver.
WWW: http://p7zip.sourceforge.net/

View File

@ -0,0 +1,3 @@
libexec/p7zip/Codecs/Rar29.so
@dirrm libexec/p7zip/Codecs
@dirrmtry libexec/p7zip

View File

@ -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 <bsd.port.options.mk>
.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 <bsd.port.pre.mk>
.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 <bsd.port.post.mk>
${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 <bsd.port.mk>

View File

@ -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" "$@"

View File

@ -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