Add option to build minimal possible executable supporting only 7zip archives.

PR:		ports/140903
Submitted by:	Eugene Perevyazko <john@dnepro.net>
This commit is contained in:
Juergen Lock 2009-11-26 21:02:41 +00:00
parent 0b7394b480
commit 664dabf887
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=244801
2 changed files with 35 additions and 19 deletions

View file

@ -13,21 +13,45 @@ DISTNAME= ${PORTNAME}_${DISTVERSION}_src_all
MAINTAINER= nox@FreeBSD.org
COMMENT= File archiver with high compression ratio
OPTIONS= MINIMAL "Support only .7z file format" off
USE_BZIP2= yes
MAKEFILE= makefile
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION}
MAN1= 7z.1 7za.1 7zr.1 p7zip.1
MAKE_JOBS_UNSAFE= yes
DLLDIR= ${PREFIX}/libexec/p7zip
PLIST_SUB= MODULES=""
ALL_TARGET= 7z 7za 7zr Client7z sfx
7ZBIN= 7z 7za 7zr Client7z 7zCon.sfx
.if defined(WITHOUT_MODULES)
.include <bsd.port.options.mk>
.if defined(WITH_MINIMAL)
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 !defined(WITHOUT_MODULES)
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>
@ -51,6 +75,10 @@ post-patch:
${MV} ${WRKSRC}/contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1 ${WRKSRC}/man1/
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/
@ -62,6 +90,7 @@ do-install:
${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

View file

@ -1,16 +1,3 @@
bin/7z
bin/7za
bin/7zr
bin/p7zip
%%MODULES%%libexec/p7zip/7z
%%MODULES%%libexec/p7zip/7z.so
%%MODULES%%libexec/p7zip/Client7z
libexec/p7zip/7za
libexec/p7zip/7zr
libexec/p7zip/7zCon.sfx
%%MODULES%%libexec/p7zip/Codecs/Rar29.so
%%MODULES%%@dirrm libexec/p7zip/Codecs
@dirrm libexec/p7zip
%%PORTDOCS%%%%DOCSDIR%%/7zC.txt
%%PORTDOCS%%%%DOCSDIR%%/7zFormat.txt
%%PORTDOCS%%%%DOCSDIR%%/License.txt