aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/heartbeat/Makefile
blob: 3985711fe3316e00ee5095436548a56359ffae33 (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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Created by: Scott Kleihege <scott-ports@tummy.com>
# $FreeBSD$

PORTNAME=   heartbeat
PORTVERSION=    2.1.4
PORTREVISION=   26
CATEGORIES= sysutils
#MASTER_SITES=  http://hg.linux-ha.org/lha-2.1/archive/STABLE-2.1.4.tar.bz2
MASTER_SITES=   LOCAL/kuriyama/heartbeat
DISTNAME=   STABLE-${PORTVERSION}
DIST_SUBDIR=    heartbeat

MAINTAINER= ports@encarnate.com
COMMENT=    Subsystem for High-Availability Clustering

LICENSE=    GPLv2 LGPL21
LICENSE_COMB=   multi

LIB_DEPENDS=    libltdl.so:${PORTSDIR}/devel/libltdl \
        libgnutls.so:${PORTSDIR}/security/gnutls \
        libnet.so:${PORTSDIR}/net/libnet \
        libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
        libxml2.so:${PORTSDIR}/textproc/libxml2
BUILD_DEPENDS=  bison:${PORTSDIR}/devel/bison

USES=       autoreconf cpe gettext gmake libtool perl5 pkgconfig python tar:bzip2 \
        shebangfix
SHEBANG_FILES=  ldirectord/ldirectord.in \
        lib/plugins/stonith/external/ibmrsa-telnet \
        lib/plugins/stonith/external/vmware \
        lib/plugins/stonith/external/xen0-ha-dom0-stonith-helper \
        lib/plugins/stonith/external/xen0-ha.in
USE_GNOME=  glib20
USE_LDCONFIG=   yes

CPE_VENDOR= linux-ha

GNU_CONFIGURE=  yes
INSTALL_TARGET= install-strip

USERS=      hacluster
GROUPS=     haclient

CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib

CONFIGURE_ARGS= --localstatedir=/var \
        --with-miBsdir=${PREFIX}/snmp/mibs \
        --with-initdir=${PREFIX}/etc/rc.d \
        --with-group-id=275 \
        --with-ccmuser-id=275 \
        --with-ocf-root=${PREFIX}/etc/ocf \
        --disable-rpath \
        --disable-dopd \
        --disable-fatal-warnings

SUB_FILES=  pkg-install pkg-message

PKGDEINSTALL=   ${PKGINSTALL}

PLIST_SUB=  USER=${USERS} GROUP=${GROUPS}

OPTIONS_DEFINE=     MGMT LDIRECTORD APCSNMP DRAC3 DOCS
MGMT_DESC=      Enable X11 Management Utilities
LDIRECTORD_DESC=    Enable Linux Director Daemon
APCSNMP_DESC=       Enable APC SNMP Stonith Device
DRAC3_DESC=     Enable Dell DRACIII Stonith Device

APCSNMP_LIB_DEPENDS=    libnetsnmp.so:${PORTSDIR}/net-mgmt/net-snmp
DRAC3_LIB_DEPENDS=  libcurl.so:${PORTSDIR}/ftp/curl

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMGMT}
BUILD_DEPENDS+=     swig:${PORTSDIR}/devel/swig13
RUN_DEPENDS+=       ${LOCALBASE}/libdata/pkgconfig/pygtk-2.0.pc:${PORTSDIR}/x11-toolkits/py-gtk2
PLIST_SUB+=     MGMT=""
.else
CONFIGURE_ARGS+=    --disable-mgmt
PLIST_SUB+=     MGMT="@comment "
.endif

.if ${PORT_OPTIONS:MLDIRECTORD}
RUN_DEPENDS+=       p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
            p5-Mail-Tools>=0:${PORTSDIR}/mail/p5-Mail-Tools
USES+=          perl5
USE_PERL5=      run
PLIST_SUB+=     LDIRECTORD=""
.else
CONFIGURE_ARGS+=    --disable-ldirectord
PLIST_SUB+=     LDIRECTORD="@comment "
.endif

.if ${PORT_OPTIONS:MAPCSNMP}
PLIST_SUB+= APCSNMP=""
.else
PLIST_SUB+= APCSNMP="@comment "
.endif

.if ${PORT_OPTIONS:MDRAC3}
PLIST_SUB+= DRAC3=""
.else
PLIST_SUB+= DRAC3="@comment "
.endif

# BladeHPI Stonith Automagic Building
.if exists (${STAGEDIR}${PREFIX}/include/openhpi/SaHpi.h)
PLIST_SUB+= HPI=""
.else
PLIST_SUB+= HPI="@comment "
.endif

# IPMI Lan Stonith Automagic Building
.if exists (${STAGEDIR}${PREFIX}/include/ipmilan.h)
PLIST_SUB+= IPMI=""
.else
PLIST_SUB+= IPMI="@comment "
.endif

# VACM Stonith Automagic Building
.if exists (${STAGEDIR}${PREFIX}/include/vacmclient_api.h)
PLIST_SUB+= VACM=""
.else
PLIST_SUB+= VACM="@comment "
.endif

post-extract:
    @${MV} ${WRKDIR}/Heartbeat-STABLE-2-1-${DISTNAME} ${WRKSRC}
    @${CP} -f ${FILESDIR}/heartbeat.in ${WRKSRC}/heartbeat/init.d/

post-patch:
    @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
        ${WRKSRC}/resources/OCF/IPaddr
.if ${PORT_OPTIONS:MDOCS}
    @${REINPLACE_CMD} -e 's|^\(docdir.*doc/\).*|\1${PORTNAME}|' \
        ${WRKSRC}/configure.in \
        ${WRKSRC}/doc/Makefile.am
.else
    @${REINPLACE_CMD} -e 's| doc | |' \
        ${WRKSRC}/Makefile.am
.endif

post-install:
    ${MKDIR} -m 0750 ${STAGEDIR}/var/run/heartbeat/pengine
    ${MKDIR} ${STAGEDIR}/var/lib/heartbeat/mgmt
    ${TOUCH} ${STAGEDIR}/var/run/heartbeat.pid

.if ${PORT_OPTIONS:MDOCS}
    # Install sample configuration
    ${CP} -p ${STAGEDIR}${DOCSDIR}/authkeys ${STAGEDIR}${PREFIX}/etc/ha.d/authkeys.sample
    ${CP} -p ${STAGEDIR}${DOCSDIR}/ha.cf ${STAGEDIR}${PREFIX}/etc/ha.d/ha.cf.sample
    ${CP} -p ${STAGEDIR}${DOCSDIR}/logd.cf ${STAGEDIR}${PREFIX}/etc/ha.d/logd.cf.sample
.endif

.if ${PORT_OPTIONS:MLDIRECTORD}
    ${CP} -p ${WRKSRC}/ldirectord/ldirectord.cf ${STAGEDIR}${PREFIX}/etc/ha.d/ldirectord.cf.sample
.endif

.include <bsd.port.mk>