aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/facter/Makefile
blob: ab4eea09b37e2434ad1f7340838fd6748efe726a (plain) (blame)
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
# $FreeBSD$

PORTNAME=   facter
PORTVERSION=    3.9.3
CATEGORIES?=    sysutils
MASTER_SITES=   http://downloads.puppetlabs.com/facter/

MAINTAINER= puppet@FreeBSD.org
COMMENT=    Cross-platform library for retrieving facts from OS

LICENSE=    APACHE20
LICENSE_FILE=   ${WRKSRC}/LICENSE

USES=       cmake:noninja compiler:c++11-lib ssl

BROKEN_DragonFly=   DragonFly is not supported upstream
BROKEN_powerpc64=   fails to compile: collection.cc: 'stoi' was not declared in this scope

CONFLICTS_INSTALL=  rubygem-facter-2*

LIB_DEPENDS=    libboost_system.so:devel/boost-libs \
        liblibcpp-hocon.so:devel/cpp-hocon \
        libleatherman_locale.so:devel/leatherman \
        libyaml-cpp.so:devel/yaml-cpp

PLIST_SUB=  PORTVERSION="${PORTVERSION}"

USE_LDCONFIG=   yes
USE_RUBY=   yes
CMAKE_ARGS+=    -DMAN_PATH=${MANPREFIX}/man

OPTIONS_DEFINE= FACTER_JAVA
FACTER_JAVA_DESC=   Build with Java bindings for puppetserver
FACTER_JAVA_USE=    java=yes
FACTER_JAVA_VARS=   JAVA_BUILD=yes
FACTER_JAVA_CMAKE_ON=   -DJAVA_HOME=${JAVA_HOME}

OPTIONS_DEFAULT=    FACTER_JAVA

OPTIONS_SUB=    yes

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
        ${WRKSRC}/lib/src/facts/posix/collection.cc \
        ${WRKSRC}/lib/src/util/config/posix/config.cc

test: build
    cd ${WRKSRC}/lib && bundle install --path vendor
    cd ${WRKSRC} && ${MAKE_CMD} test

.include <bsd.port.pre.mk>

.if ${OPSYS} == FreeBSD && ${COMPILER_FEATURES:Mlibstdc++}
BROKEN=     Build with system libstdc++ is unsupported
.endif

.include <bsd.port.post.mk>