summaryrefslogtreecommitdiff
path: root/sysutils/hal/Makefile
blob: f03f07b190c1ce2d16ef060aab2cb1cbd7a7bc76 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# $NetBSD: Makefile,v 1.93 2021/01/08 11:50:20 mef Exp $

DISTNAME=		hal-0.5.14
PKGREVISION=		25
CATEGORIES=		sysutils
MASTER_SITES=		http://hal.freedesktop.org/releases/
EXTRACT_SUFX=		.tar.bz2

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		https://www.freedesktop.org/wiki/Software/hal/
COMMENT=		FreeDesktop hardware abstraction layer
LICENSE=		gnu-gpl-v2

DEPENDS+=		pciids-[0-9]*:../../misc/pciids

BUILD_DEFS+=		VARBASE PKG_SYSCONFBASE

GNU_CONFIGURE=		YES
USE_PKGLOCALEDIR=	YES
USE_TOOLS+=		gmake intltool msgfmt perl pkg-config
USE_TOOLS+=		autoconf automake autoreconf
USE_LIBTOOL=		YES

MAKE_DIRS+=		/media
MAKE_DIRS+=		${VARBASE}/cache/hald
SPECIAL_PERMS+=		${VARBASE}/cache/hald ${HAL_USER} ${HAL_GROUP} 0644

# devinfo_mass.c: In function 'devinfo_mass_disklabel_add':
# devinfo_mass.c:340:28: error: array subscript has type 'char'
#   part = &label.d_partitions[unit];
# Maybe fix this later.
BUILDLINK_TRANSFORM+=	rm:-Werror=char-subscripts

EGDIR=			${PREFIX}/share/examples/hal

CONF_FILES=		${EGDIR}/hal.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/hal.conf

CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASE}
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
CONFIGURE_ARGS+=	--with-pci-ids=${PREFIX}/share/pciids
CONFIGURE_ARGS+=	--with-usb-ids=${PREFIX}/share/usbids
CONFIGURE_ARGS+=	--without-os-type

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

.if ${OPSYS} == "DragonFly"
.include "../../devel/libvolume_id/buildlink3.mk"
CONFIGURE_ARGS+=	--with-eject=/usr/sbin/cdcontrol
CONFIGURE_ARGS+=	--with-backend=freebsd
PLIST_SRC=		PLIST.DragonFly PLIST

.elif ${OPSYS} == "FreeBSD"
.include "../../devel/libvolume_id/buildlink3.mk"
CONFIGURE_ARGS+=	--with-eject=/usr/sbin/cdcontrol
CONFIGURE_ARGS+=	--with-backend=freebsd
PLIST_SRC=		PLIST.FreeBSD PLIST

.elif ${OPSYS} == "NetBSD"
.include "../../devel/libvolume_id/buildlink3.mk"
CONFIGURE_ARGS+=	--with-backend=netbsd
HAL_GROUP=		operator

.elif ${OPSYS} == "Linux"
.include "../../devel/gperf/buildlink3.mk"
.include "../../devel/libblkid/buildlink3.mk"
.include "../../devel/libvolume_id/buildlink3.mk"
# XXX we install libpci headers to an unexpected location
# as far as this package is concerned, so it fails
# to detect libpci!
#.include "../../sysutils/pciutils/buildlink3.mk"
CONFIGURE_ARGS+=	--with-backend=linux
MAKE_DIRS+=		/etc/udev
MAKE_DIRS+=		/etc/udev/rules.d
CONF_FILES+=		${EGDIR}/90-hal.rules \
			/etc/udev/rules.d/90-hal.rules
PLIST_VARS+=	imac
.  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
PLIST.imac=	yes
CONFIGURE_ARGS+=	--with-imac
.  else
CONFIGURE_ARGS+=	--without-imac
.  endif
.else	# Unsupported systems
# Pull in the dummy backend
.include "../../devel/libvolume_id/buildlink3.mk"
CONFIGURE_ARGS+=	--with-backend=dummy
PLIST_SRC=		PLIST
.endif

CFLAGS.SunOS+=		-Du_int32_t=uint32_t

BUILDLINK_TRANSFORM.SunOS+=	opt:-Wl,--as-needed:-Wl,-zignore

REPLACE_INTERPRETER+=	bash
REPLACE.bash.old=	/bin/bash
REPLACE.bash.new=	${SH}
.for halscript in luks-remove luks-setup luks-teardown system-wol-enable system-wol-enabled system-wol-supported
REPLACE_FILES.bash+=	tools/hal-${halscript}
.endfor

HAL_USER?=		haldaemon
HAL_GROUP?=		haldaemon
CONFIGURE_ARGS+=	--with-hal-user=${HAL_USER}
CONFIGURE_ARGS+=	--with-hal-group=${HAL_GROUP}
CONFIGURE_ARGS+=	--disable-pmu

RCD_SCRIPTS=		hal
SMF_METHODS=		hal

.if ${HAL_GROUP} != "operator"
PKG_GROUPS=		${HAL_GROUP}
.endif
PKG_USERS=		${HAL_USER}:${HAL_GROUP}
PKG_HOME.haldaemon=	${VARBASE}/run/hald

FILES_SUBST+=		HAL_USER=${HAL_USER}
FILES_SUBST+=		HAL_GROUP=${HAL_GROUP}
FILES_SUBST+=		PKG_HOME.haldaemon=${PKG_HOME.haldaemon}

PLIST_SUBST+=		PKG_SYSCONFDIR=${PKG_SYSCONFDIR}

TEST_TARGET=		check

post-extract:
	${CP} -r ${FILESDIR}/hald-netbsd ${WRKSRC}/hald/netbsd
	${CP} -r ${FILESDIR}/tools-netbsd ${WRKSRC}/tools/netbsd

pre-configure:
	cd ${WRKSRC} && autoreconf -vi ${AUTORECONF_ARGS}

.include "../../devel/glib2/buildlink3.mk"
.include "../../misc/usbids/buildlink3.mk"
.include "../../security/policykit/buildlink3.mk"
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"
.include "../../sysutils/hal-info/buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
.include "../../textproc/gtk-doc/buildlink3.mk"