summaryrefslogtreecommitdiff
path: root/security/policykit/Makefile
blob: dd760ecf358aab475a16e68a2ee9f64e5eafa0cc (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
# $NetBSD: Makefile,v 1.44 2021/12/08 16:02:35 adam Exp $

POLICYKIT_VER=		0.9
DISTNAME=		PolicyKit-${POLICYKIT_VER}
PKGNAME=		policykit-${POLICYKIT_VER}
PKGREVISION=		30
CATEGORIES=		security
MASTER_SITES=		http://hal.freedesktop.org/releases/

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		https://hal.freedesktop.org/
COMMENT=		Framework for managing admin policies and privileges
LICENSE=		mit

BUILD_DEPENDS+=		libxslt-[0-9]*:../../textproc/libxslt
BUILD_DEPENDS+=		docbook-xsl-[0-9]*:../../textproc/docbook-xsl

PKG_SYSCONFSUBDIR=	PolicyKit

EGDIR=		${PREFIX}/share/examples/policykit
CONF_FILES+=	${EGDIR}/PolicyKit.conf ${PKG_SYSCONFDIR}/PolicyKit.conf
CONF_FILES+=	${EGDIR}/org.freedesktop.PolicyKit.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/org.freedesktop.PolicyKit.conf
#CONF_FILES+=	${EGDIR}/polkit ${PKG_SYSCONFBASE}/pam.d/polkit
#CONF_FILES+=	${EGDIR}/polkit-bash-completion.sh ${PKG_SYSCONFDIR}/profile.d/polkit-bash-completion.sh

BUILD_DEFS+=		VARBASE
BUILD_DEFS+=		PKG_SYSCONFBASE

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

USE_LANGUAGES=		c99

AUTOCONF_REQD=		2.59

POLICYKIT_USER?=	polkit
POLICYKIT_GROUP?=	polkit
PKG_GROUPS=		${POLICYKIT_GROUP}
PKG_USERS=		${POLICYKIT_USER}:${POLICYKIT_GROUP}
PKG_GROUPS_VARS+=	POLICYKIT_GROUP
PKG_USERS_VARS+=	POLICYKIT_USER

PKGCONFIG_OVERRIDE+=	data/polkit-dbus.pc.in
PKGCONFIG_OVERRIDE+=	data/polkit-grant.pc.in
PKGCONFIG_OVERRIDE+=	data/polkit.pc.in

CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFBASE:Q}
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
CONFIGURE_ARGS+=	--with-polkit-user=${POLICYKIT_USER}
CONFIGURE_ARGS+=	--with-polkit-group=${POLICYKIT_GROUP}
CONFIGURE_ARGS+=	--disable-selinux

OWN_DIRS_PERMS+=	${VARBASE}/lib/PolicyKit \
				${REAL_ROOT_USER} ${POLICYKIT_GROUP} 0770
OWN_DIRS_PERMS+=	${VARBASE}/lib/PolicyKit-public \
				${POLICYKIT_USER} ${REAL_ROOT_GROUP} 0755
OWN_DIRS_PERMS+=	${VARBASE}/lib/misc ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
CONF_FILES_PERMS+=	/dev/null ${VARBASE}/lib/misc/PolicyKit.reload \
				${POLICYKIT_USER} ${POLICYKIT_GROUP} 0664

SPECIAL_PERMS+=		${PREFIX}/libexec/polkit-explicit-grant-helper \
				${REAL_ROOT_USER} ${POLICYKIT_GROUP} 2555
SPECIAL_PERMS+=		${PREFIX}/libexec/polkit-grant-helper \
				${REAL_ROOT_USER} ${POLICYKIT_GROUP} 2555
SPECIAL_PERMS+=		${PREFIX}/libexec/polkit-read-auth-helper \
				${REAL_ROOT_USER} ${POLICYKIT_GROUP} 2555
SPECIAL_PERMS+=		${PREFIX}/libexec/polkit-revoke-helper \
				${REAL_ROOT_USER} ${POLICYKIT_GROUP} 2555

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

.if ${OPSYS} == "NetBSD" || ${OPSYS} == "DragonFly"
post-install:
	${INSTALL_DATA} ${FILESDIR}/PolicyKit.conf.NetBSD ${DESTDIR}${EGDIR}/PolicyKit.conf
.endif

BUILDLINK_TRANSFORM+=	rm:-Wl,--as-needed

pre-configure:
	cd ${WRKSRC} && autoconf

.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../textproc/xmlcatmgr/buildlink3.mk"
.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"
.include "../../mk/pam.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"