summaryrefslogtreecommitdiff
path: root/archivers/dar/Makefile
blob: 7efe89dbfdb99e2fb0b4c63c4f19a6fe2f2c2da6 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# $NetBSD: Makefile,v 1.51 2014/10/09 14:05:51 wiz Exp $

DISTNAME=	dar-2.4.13
CATEGORIES=	archivers sysutils
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=dar/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://dar.linux.free.fr/
COMMENT=	Disk archiver
LICENSE=	gnu-gpl-v2

USE_LANGUAGES=		c c++
USE_LIBTOOL=		yes
USE_PKGLOCALEDIR=	yes
USE_TOOLS+=		gmake groff gsed pkg-config bash:run

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--disable-dar-static
CONFIGURE_ARGS+=	--enable-static=no
CONFIGURE_ARGS+=	--disable-nodump-flag
CONFIGURE_ARGS+=	--disable-upx
CONFIGURE_ARGS+=	--enable-examples
CONFIGURE_ARGS+=	doxygen=no

PKGCONFIG_OVERRIDE=	src/libdar/libdar.pc.tmpl.in

## We use the logic below to find a path for a non-existent ${BASH}.
## Yeah, I suppose it's a hack, but it does work.
#
CHECK_INTERPRETER_SKIP+=	share/dar/samples/*
REPLACE_PERL+=			doc/samples/dar_backup
REPLACE_BASH+=			doc/samples/*.bash doc/samples/*.sh doc/samples/*.duc

## Our threading check here is the same as the one used in devel/perl5.
#
CHECK_BUILTIN.pthread:=yes
.  include "../../mk/pthread.builtin.mk"
CHECK_BUILTIN.pthread:=no

## XXX I'm following the USE_FEATURES semantics used in security/openssl.
#
.if !empty(USE_BUILTIN.pthread:tl:Myes)
USE_FEATURES.dar=	threads
.else
USE_FEATURES.dar=	# empty
.endif

PKG_OPTIONS_VAR=		PKG_OPTIONS.dar
PKG_OPTIONS_OPTIONAL_GROUPS=	int
PKG_OPTIONS_GROUP.int=		dar-int32 dar-int64
PKG_SUGGESTED_OPTIONS=		dar-int64 ${USE_FEATURES.dar}
PKG_SUPPORTED_OPTIONS=		threads

.include "../../mk/bsd.options.mk"

## Dar is built by default with an arbitrary-size-integer library for
## managing all file length/timestamp details.  If 32-bit or 64-bit
## integers (with overflow protection) are sufficient for requirements,
## the following options can significantly reduce the run-time memory
## and CPU overheads of Dar.
#
DARBITS=		${PKG_OPTIONS:C/[^[:digit:]]*//:M[36][24]}
PLIST_SUBST+=		DARBITS=${DARBITS}

.if !empty(DARBITS)
CONFIGURE_ARGS+=	--enable-mode=${DARBITS:Q}
.endif

EGDIR=			${PREFIX}/share/examples/dar
INSTALL_MAKE_FLAGS+=	sysconfdir=${EGDIR}

CONF_FILES=		${EGDIR}/darrc ${PKG_SYSCONFDIR}/darrc

## We want the threading library to be specified by pkgsrc, and only
## when desired, viz. in the case below.  Using PTHREAD_AUTO_VARS
## with the accompanying BUILDLINK_TRANSFORM directive is easier
## then patching configure.
#
.if !empty(PKG_OPTIONS:Mthreads)
USE_FEATURES.openssl+=	threads
PTHREAD_AUTO_VARS=	yes
BUILDLINK_TRANSFORM+=	rm:-lpthread
.else
CONFIGURE_ARGS+=	--disable-thread-safe
.endif

UNLIMIT_RESOURCES=	datasize

## XXX Needed for getopt() with SunPro (USE_FEATURES?)
#
CPPFLAGS.SunOS+=	-D__EXTENSIONS__

.include "../../mk/bsd.fast.prefs.mk"

## Build a static binary with threads is currently broken with glibc.
.if ${OPSYS} == "Linux" && !empty(PKG_OPTIONS:Mthreads)
SUBST_CLASSES+=		static
SUBST_STAGE.static=	post-patch
SUBST_MESSAGE.static=	Changing -all-static to -static
SUBST_FILES.static=	src/testing/Makefile.in
SUBST_SED.static=	-e 's,-all-static,-static,g'
.endif

.if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD"
BUILDLINK_TRANSFORM=	l:execinfo:execinfo:elf
.endif

.include "../../archivers/bzip2/buildlink3.mk"
.include "../../devel/libexecinfo/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../security/libgcrypt/buildlink3.mk"

.include "../../mk/bsd.pkg.mk"