summaryrefslogtreecommitdiffstats
path: root/archivers/p7zip/Makefile
blob: 5225938325fddfc1002935e13894d8f7dceec8d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# New ports collection makefile for:	p7zip
# Date created:			Sun Jul 18 15:07:26 CEST 2004
# Whom:				Juergen Lock <nox@jelal.kn-bremen.de>
#
# $FreeBSD$
#

PORTNAME=	p7zip
PORTVERSION=	4.16
CATEGORIES=	archivers
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	p7zip
DISTNAME=	${PORTNAME}_${PORTVERSION}_src

MAINTAINER=	nox@jelal.kn-bremen.de
COMMENT=	Command line versions of 7-zip

USE_BZIP2=	yes
USE_GMAKE=	yes
MAKEFILE=	makefile

WRKSRC=		${WRKDIR}/${PORTNAME}_${PORTVERSION}
PORTDOCS=	*

DLLDIR=		${PREFIX}/libexec/p7zip

PLIST_SUB=	MODULES=""
ALL_TARGET=	7z 7za sfx
7ZBIN=		7z 7za 7zCon.sfx
.if defined(WITHOUT_MODULES)
PLIST_SUB=	MODULES="@comment "
ALL_TARGET=	7za sfx
7ZBIN=		7za 7zCon.sfx
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 500039
IGNORE=		requires wchar functions (mbrtowc(3) etc.) for compilation
.endif

post-patch:
	${SED} -e 's/-O2/${CFLAGS} ${PTHREAD_CFLAGS}/' \
	       -e 's!g\+\+!${CXX}!' \
	       -e 's!gcc!${CC}!' \
	       -e '/LITTLE_ENDIAN/d' \
	       -e 's/-D_LARGEFILE_SOURCE//' \
	       -e 's/-D_FILE_OFFSET_BITS=64//' \
	       -e 's/-lc_r/${PTHREAD_LIBS}/' \
	       ${WRKSRC}/makefile.freebsd > ${WRKSRC}/makefile.machine

do-install:
	${MKDIR} ${DLLDIR}
.for f in ${7ZBIN}
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${DLLDIR}
.endfor
	${INSTALL_SCRIPT} ${FILESDIR}/7z ${PREFIX}/bin
	${LN} -sf 7z ${PREFIX}/bin/7za
.if !defined(WITHOUT_MODULES)
.for f in Codecs Formats
	${MKDIR} ${DLLDIR}/${f}
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f}/* ${DLLDIR}/${f}
.endfor
.endif
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	${PAX} -rw -s,${WRKSRC}/DOCS,, ${WRKSRC}/DOCS ${DOCSDIR}
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR}
	${FIND} ${DOCSDIR} -type d | ${XARGS} ${CHMOD} 755
	${FIND} ${DOCSDIR} -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
.endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud