Merge from vendor branch TNF:
[pkgsrcv2.git] / archivers / dar / Makefile
1 # $NetBSD: Makefile,v 1.35 2010/01/17 12:02:03 wiz Exp $
2
3 DISTNAME=       dar-2.3.8
4 PKGREVISION=    2
5 CATEGORIES=     archivers sysutils
6 MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE:=dar/}
7
8 MAINTAINER=     pkgsrc-users@NetBSD.org
9 HOMEPAGE=       http://dar.linux.free.fr/
10 COMMENT=        Disk archiver
11
12 PKG_INSTALLATION_TYPES= overwrite pkgviews
13 PKG_DESTDIR_SUPPORT=    user-destdir
14
15 USE_LANGUAGES=          c c++
16 USE_LIBTOOL=            yes
17 USE_PKGLOCALEDIR=       yes
18 USE_TOOLS+=             gmake pkg-config
19
20 GNU_CONFIGURE=          yes
21 CONFIGURE_ARGS+=        --disable-dar-static
22 CONFIGURE_ARGS+=        --enable-static=no
23 CONFIGURE_ARGS+=        --disable-nodump-flag
24 CONFIGURE_ARGS+=        --disable-upx
25 CONFIGURE_ARGS+=        --enable-examples
26 CONFIGURE_ARGS+=        doxygen=no
27
28 PKGCONFIG_OVERRIDE=     src/libdar/libdar.pc.tmpl.in
29
30 ## We use the logic below to find a path for a non-existent ${BASH}.
31 ## Yeah, I suppose it's a hack, but it does work.
32 #
33 CHECK_INTERPRETER_SKIP+=        share/dar/samples/*
34 REPLACE_PERL+=                  doc/samples/dar_backup
35 REPLACE_BASH+=                  doc/samples/*.bash doc/samples/clust*.sh
36
37 .if defined(TOOLS_PLATFORM.bash) && exists(${${TOOLS_PLATFORM.bash}:L})
38 BASH?=                  ${TOOLS_PLATFORM.bash}
39 .else
40 BASH?=                  ${TOOLS_PREFIX.bash}/bin/bash
41 TOOLS_FIND_PREFIX+=     TOOLS_PREFIX.bash=bash
42 .endif
43
44 ## Our threading check here is the same as the one used in devel/perl5.
45 #
46 CHECK_BUILTIN.pthread:=yes
47 .  include "../../mk/pthread.builtin.mk"
48 CHECK_BUILTIN.pthread:=no
49
50 ## XXX I'm following the USE_FEATURES semantics used in security/openssl.
51 #
52 .if !empty(USE_BUILTIN.pthread:tl:Myes)
53 USE_FEATURES.dar=       threads
54 .else
55 USE_FEATURES.dar=       # empty
56 .endif
57
58 PKG_OPTIONS_VAR=                PKG_OPTIONS.dar
59 PKG_OPTIONS_OPTIONAL_GROUPS+=   int
60 PKG_OPTIONS_GROUP.int=          dar-int32 dar-int64
61 PKG_SUGGESTED_OPTIONS=          dar-int64 ${USE_FEATURES.dar}
62 PKG_SUPPORTED_OPTIONS=          threads
63
64 .include "../../mk/bsd.options.mk"
65
66 ## Dar is built by default with an arbitrary-size-integer library for
67 ## managing all file length/timestamp details.  If 32-bit or 64-bit
68 ## integers (with overflow protection) are sufficient for requirements,
69 ## the following options can significantly reduce the run-time memory
70 ## and CPU overheads of Dar.
71 #
72 DARBITS=                ${PKG_OPTIONS:C/[^[:digit:]]*//:M[36][24]}
73 PLIST_SUBST+=           DARBITS=${DARBITS}
74
75 .if !empty(DARBITS)
76 CONFIGURE_ARGS+=        --enable-mode=${DARBITS:Q}
77 .endif
78
79 ## We want the threading library to be specified by pkgsrc, and only
80 ## when desired, viz. in the case below.  Using PTHREAD_AUTO_VARS
81 ## with the accompanying BUILDLINK_TRANSFORM directive is easier
82 ## then patching configure.
83 #
84 .if !empty(PKG_OPTIONS:Mthreads)
85 USE_FEATURES.openssl+=  threads
86 PTHREAD_AUTO_VARS=      yes
87 BUILDLINK_TRANSFORM+=   rm:-lpthread
88 .else
89 CONFIGURE_ARGS+=        --disable-thread-safe
90 .endif
91
92 UNLIMIT_RESOURCES=      datasize
93
94 ## XXX Needed for getopt() with SunPro (USE_FEATURES?)
95 #
96 CPPFLAGS.SunOS+=        -D__EXTENSIONS__
97
98 .include "../../archivers/bzip2/buildlink3.mk"
99 .include "../../devel/gettext-lib/buildlink3.mk"
100 .include "../../devel/zlib/buildlink3.mk"
101 .include "../../mk/pthread.buildlink3.mk"
102 .include "../../security/openssl/buildlink3.mk"
103
104 .include "../../mk/bsd.pkg.mk"