aboutsummaryrefslogtreecommitdiff
path: root/sysutils/policykit
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2008-03-24 03:52:36 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2008-03-24 03:52:36 +0000
commit6f32add9a75efb180e462ffbdb0b080bc88088e3 (patch)
tree0fc7af36e22fc0dc7c1dc8aacabf6fe117e881da /sysutils/policykit
parentb8d245fedd5842fb6d68d0bdc6539885555a84e3 (diff)
downloadports-6f32add9a75efb180e462ffbdb0b080bc88088e3.tar.gz
ports-6f32add9a75efb180e462ffbdb0b080bc88088e3.zip
Notes
Diffstat (limited to 'sysutils/policykit')
-rw-r--r--sysutils/policykit/Makefile39
-rw-r--r--sysutils/policykit/distinfo6
-rw-r--r--sysutils/policykit/files/patch-Makefile.in20
-rw-r--r--sysutils/policykit/files/patch-config.h.in34
-rw-r--r--sysutils/policykit/files/patch-configure735
-rw-r--r--sysutils/policykit/files/patch-configure.in57
-rw-r--r--sysutils/policykit/files/patch-data_Makefile.in25
-rw-r--r--sysutils/policykit/files/patch-polkitd_policy.c118
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-file.c26
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-file.h10
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-spawn.c10
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-string.c42
-rw-r--r--sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c43
-rw-r--r--sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c11
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_Makefile.am11
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_Makefile.in11
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c11
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c20
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c11
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c19
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c11
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-config.c10
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-context.c189
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c26
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c187
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h20
-rw-r--r--sysutils/policykit/files/patch-tools_Makefile.in14
-rw-r--r--sysutils/policykit/files/patch-tools_polkit-auth.c61
-rw-r--r--sysutils/policykit/files/polkitd.in57
-rw-r--r--sysutils/policykit/pkg-install11
-rw-r--r--sysutils/policykit/pkg-plist80
31 files changed, 1697 insertions, 228 deletions
diff --git a/sysutils/policykit/Makefile b/sysutils/policykit/Makefile
index 794b57676a41..4a083a5bd0f4 100644
--- a/sysutils/policykit/Makefile
+++ b/sysutils/policykit/Makefile
@@ -3,37 +3,54 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/sysutils/policykit/Makefile,v 1.12 2006/10/07 19:45:38 marcus Exp $
+# $MCom: ports/sysutils/policykit/Makefile,v 1.19 2008/01/20 04:41:31 marcus Exp $
#
PORTNAME= policykit
-PORTVERSION= 0.1.20060514
-PORTREVISION= 4
+PORTVERSION= 0.7
+PORTREVISION= 2
CATEGORIES= sysutils gnome
-MASTER_SITES= http://www.marcuscom.com/downloads/
+MASTER_SITES= http://hal.freedesktop.org/releases/
DISTNAME= PolicyKit-${PORTVERSION}
MAINTAINER= gnome@FreeBSD.org
COMMENT= Framework for controlling access to system-wide components
-LIB_DEPENDS= dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib
+BUILD_DEPENDS= docbook2html:${PORTSDIR}/textproc/docbook-utils \
+ ${LOCALBASE}/share/sgml/docbook/4.1/catalog:${PORTSDIR}/textproc/docbook-410 \
+ xsltproc:${PORTSDIR}/textproc/libxslt \
+ ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl
+LIB_DEPENDS= dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \
+ expat.6:${PORTSDIR}/textproc/expat2
+RUN_DEPENDS= bash:${PORTSDIR}/shells/bash
-USE_BZIP2= yes
-USE_GNOME= gnomehack gnometarget
+USE_GNOME= gnomehack gnometarget glib20 intlhack
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
CONFIGURE_ARGS= --disable-gtk-doc \
- --with-pid-file=/var/run/polkitd/polkitd.pid \
- --with-pam-include=system
+ --with-pam-include=system \
+ --with-os-type=freebsd \
+ --localstatedir=/var \
+ --with-polkit-user=polkit \
+ --with-polkit-group=polkit
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib" \
GTKDOC="false"
-USE_RC_SUBR= polkitd
-USE_GNOME_SUBR= yes
+MAN1= polkit-action.1 polkit-auth.1 polkit-config-file-validate.1 \
+ polkit-policy-file-validate.1
+MAN5= PolicyKit.conf.5
+MAN8= PolicyKit.8
post-install:
+ ${MKDIR} ${PREFIX}/etc/PolicyKit
+ if [ ! -f ${PREFIX}/etc/PolicyKit/PolicyKit.conf ]; then \
+ ${INSTALL_DATA} ${WRKSRC}/data/PolicyKit.conf \
+ ${PREFIX}/etc/PolicyKit/PolicyKit.conf ; \
+ fi
+ ${INSTALL_DATA} ${WRKSRC}/data/PolicyKit.conf \
+ ${PREFIX}/etc/PolicyKit/PolicyKit.conf.dist
.if !defined(PACKAGE_BUILDING)
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif
diff --git a/sysutils/policykit/distinfo b/sysutils/policykit/distinfo
index 2bf4052122f3..875461516bb4 100644
--- a/sysutils/policykit/distinfo
+++ b/sysutils/policykit/distinfo
@@ -1,3 +1,3 @@
-MD5 (PolicyKit-0.1.20060514.tar.bz2) = f81ac5fb28603a4b419fca6c4efc027a
-SHA256 (PolicyKit-0.1.20060514.tar.bz2) = d9015a69d63902b091475ad2cad1b6fe012cf0e8fead6603cf822c2033c9d552
-SIZE (PolicyKit-0.1.20060514.tar.bz2) = 333800
+MD5 (PolicyKit-0.7.tar.gz) = 99e0cc588310656fa25f8f66a411c71f
+SHA256 (PolicyKit-0.7.tar.gz) = 87245f790142a245a5f5ba75d4a4e95612b391e82cf4d61659b3e50c4f6b9eeb
+SIZE (PolicyKit-0.7.tar.gz) = 1214032
diff --git a/sysutils/policykit/files/patch-Makefile.in b/sysutils/policykit/files/patch-Makefile.in
index 0c9552c020d6..29a907e4414a 100644
--- a/sysutils/policykit/files/patch-Makefile.in
+++ b/sysutils/policykit/files/patch-Makefile.in
@@ -1,11 +1,11 @@
---- Makefile.in.orig Mon May 1 01:11:30 2006
-+++ Makefile.in Mon May 1 01:11:43 2006
-@@ -231,7 +231,7 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- sysconfdir = @sysconfdir@
+--- Makefile.in.orig 2007-12-22 19:11:03.000000000 -0500
++++ Makefile.in 2007-12-22 19:11:13.000000000 -0500
+@@ -246,7 +246,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
--SUBDIRS = libpolkit polkitd doc tools privileges
-+SUBDIRS = libpolkit polkitd tools privileges
- pamdir = $(sysconfdir)/pam.d
- pam_DATA = policy-kit
- pkgconfigdir = $(prefix)/libdata/pkgconfig
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = data src polkitd doc tools policy po test
++SUBDIRS = data src polkitd doc tools policy po
+ EXTRA_DIST = \
+ HACKING \
+ mkinstalldirs \
diff --git a/sysutils/policykit/files/patch-config.h.in b/sysutils/policykit/files/patch-config.h.in
new file mode 100644
index 000000000000..b8cb8f384d74
--- /dev/null
+++ b/sysutils/policykit/files/patch-config.h.in
@@ -0,0 +1,34 @@
+--- config.h.in.orig 2007-11-30 20:43:35.000000000 -0500
++++ config.h.in 2007-12-24 14:47:06.000000000 -0500
+@@ -24,6 +24,18 @@
+ /* Define to 1 if you have the `getgrouplist' function. */
+ #undef HAVE_GETGROUPLIST
+
++/* Define to 1 if you have the `clearenv' function. */
++#undef HAVE_CLEARENV
++
++/* Define to 1 if you have the `strndup' function. */
++#undef HAVE_STRNDUP
++
++/* Define to 1 if you have the `readdir64' function. */
++#undef HAVE_READDIR64
++
++/* Define to 1 if you have the `getline' function. */
++#undef HAVE_GETLINE
++
+ /* Define if the GNU gettext() function is already present or preinstalled. */
+ #undef HAVE_GETTEXT
+
+@@ -117,6 +129,12 @@
+ /* Define if pam_strerror takes two arguments */
+ #undef PAM_STRERROR_TWO_ARGS
+
++/* Enable Linux inotify() usage */
++#undef HAVE_INOTIFY
++
++/* Enable BSD kqueue() usage */
++#undef HAVE_KQUEUE
++
+ /* Authorization Database to use */
+ #undef POLKIT_AUTHDB
+
diff --git a/sysutils/policykit/files/patch-configure b/sysutils/policykit/files/patch-configure
new file mode 100644
index 000000000000..2e99765e746d
--- /dev/null
+++ b/sysutils/policykit/files/patch-configure
@@ -0,0 +1,735 @@
+--- configure.bak 2007-11-30 20:42:54.000000000 -0500
++++ configure 2007-12-23 00:35:53.000000000 -0500
+@@ -929,10 +929,16 @@ OS_TYPE_GENTOO_TRUE
+ OS_TYPE_GENTOO_FALSE
+ OS_TYPE_PARDUS_TRUE
+ OS_TYPE_PARDUS_FALSE
++OS_TYPE_FREEBSD_TRUE
++OS_TYPE_FREEBSD_FALSE
+ PAM_FILE_INCLUDE_AUTH
+ PAM_FILE_INCLUDE_ACCOUNT
+ PAM_FILE_INCLUDE_PASSWORD
+ PAM_FILE_INCLUDE_SESSION
++HAVE_INOTIFY_TRUE
++HAVE_INOTIFY_FALSE
++HAVE_KQUEUE_TRUE
++HAVE_KQUEUE_FALSE
+ INTLTOOL_DESKTOP_RULE
+ INTLTOOL_DIRECTORY_RULE
+ INTLTOOL_KEYS_RULE
+@@ -6544,7 +6550,7 @@ ia64-*-hpux*)
+ ;;
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 6547 "configure"' > conftest.$ac_ext
++ echo '#line 6553 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+@@ -8882,11 +8888,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:8885: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:8891: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:8889: \$? = $ac_status" >&5
++ echo "$as_me:8895: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -9172,11 +9178,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:9175: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:9181: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:9179: \$? = $ac_status" >&5
++ echo "$as_me:9185: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -9276,11 +9282,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:9279: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:9285: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:9283: \$? = $ac_status" >&5
++ echo "$as_me:9289: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -11627,7 +11633,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 11630 "configure"
++#line 11636 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -11727,7 +11733,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 11730 "configure"
++#line 11736 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -14147,11 +14153,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:14150: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:14156: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:14154: \$? = $ac_status" >&5
++ echo "$as_me:14160: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -14251,11 +14257,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:14254: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:14260: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:14258: \$? = $ac_status" >&5
++ echo "$as_me:14264: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -15815,11 +15821,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:15818: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:15824: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:15822: \$? = $ac_status" >&5
++ echo "$as_me:15828: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -15919,11 +15925,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:15922: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:15928: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:15926: \$? = $ac_status" >&5
++ echo "$as_me:15932: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -18108,11 +18114,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:18111: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:18117: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:18115: \$? = $ac_status" >&5
++ echo "$as_me:18121: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -18398,11 +18404,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:18401: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:18407: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:18405: \$? = $ac_status" >&5
++ echo "$as_me:18411: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+@@ -18502,11 +18508,11 @@ else
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+- (eval echo "\"\$as_me:18505: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:18511: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:18509: \$? = $ac_status" >&5
++ echo "$as_me:18515: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+@@ -22501,7 +22507,9 @@ fi
+
+
+
+-for ac_func in getgrouplist
++
++
++for ac_func in getgrouplist clearenv strndup getline readdir64
+ do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ { echo "$as_me:$LINENO: checking for $ac_func" >&5
+@@ -24087,6 +24095,14 @@ else
+ OS_TYPE_PARDUS_FALSE=
+ fi
+
++ if test x$with_os_type = xfreebsd; then
++ OS_TYPE_FREEBSD_TRUE=
++ OS_TYPE_FREEBSD_FALSE='#'
++else
++ OS_TYPE_FREEBSD_TRUE='#'
++ OS_TYPE_FREEBSD_FALSE=
++fi
++
+
+
+ # Check whether --with-pam-include was given.
+@@ -24111,6 +24127,11 @@ elif test x$with_os_type = xsuse ; then
+ PAM_FILE_INCLUDE_ACCOUNT=common-account
+ PAM_FILE_INCLUDE_PASSWORD=common-password
+ PAM_FILE_INCLUDE_SESSION=common-session
++elif test x$with_os_type = xfreebsd ; then
++ PAM_FILE_INCLUDE_AUTH=system
++ PAM_FILE_INCLUDE_ACCOUNT=system
++ PAM_FILE_INCLUDE_PASSWORD=system
++ PAM_FILE_INCLUDE_SESSION=system
+ else
+ PAM_FILE_INCLUDE_AUTH=system-auth
+ PAM_FILE_INCLUDE_ACCOUNT=system-auth
+@@ -24143,6 +24164,430 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+
++have_inotify=no
++
++for ac_header in linux/inotify.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ { echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++ { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++else
++ # Is the header compilable?
++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_compile") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_compiler=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6; }
++
++# Is the header present?
++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++
++rm -f conftest.err conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6; }
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ ( cat <<\_ASBOX
++## ----------------------------- ##
++## Report this to david@fubar.dk ##
++## ----------------------------- ##
++_ASBOX
++ ) | sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++{ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++ { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++ have_inotify=yes
++fi
++
++done
++
++
++for ac_header in sys/inotify.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ { echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++ { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++else
++ # Is the header compilable?
++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_compile") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_compiler=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6; }
++
++# Is the header present?
++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null && {
++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ }; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++
++rm -f conftest.err conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6; }
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ ( cat <<\_ASBOX
++## ----------------------------- ##
++## Report this to david@fubar.dk ##
++## ----------------------------- ##
++_ASBOX
++ ) | sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++{ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++ { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++ have_inotify=yes
++fi
++
++done
++
++
++ if test "x$have_inotify" = "xyes"; then
++ HAVE_INOTIFY_TRUE=
++ HAVE_INOTIFY_FALSE='#'
++else
++ HAVE_INOTIFY_TRUE='#'
++ HAVE_INOTIFY_FALSE=
++fi
++
++
++if test "x$have_inotify" = "xyes" ; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_INOTIFY 1
++_ACEOF
++
++fi
++
++have_kqueue=yes
++
++for ac_func in kqueue
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++{ echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char $ac_func (); below.
++ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++ <limits.h> exists even on freestanding compilers. */
++
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++
++#undef $ac_func
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined __stub_$ac_func || defined __stub___$ac_func
++choke me
++#endif
++
++int
++main ()
++{
++return $ac_func ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++ (eval "$ac_link") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest$ac_exeext &&
++ $as_test_x conftest$ac_exeext; then
++ eval "$as_ac_var=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ eval "$as_ac_var=no"
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++ac_res=`eval echo '${'$as_ac_var'}'`
++ { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++if test `eval echo '${'$as_ac_var'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++_ACEOF
++
++else
++ have_kqueue=no
++fi
++done
++
++
++ if test "x$have_kqueue" = "xyes"; then
++ HAVE_KQUEUE_TRUE=
++ HAVE_KQUEUE_FALSE='#'
++else
++ HAVE_KQUEUE_TRUE='#'
++ HAVE_KQUEUE_FALSE=
++fi
++
++
++if test "x$have_kqueue" = "xyes" ; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_KQUEUE 1
++_ACEOF
++
++fi
++
+ # ********************
+ # Internationalisation
+ # ********************
+@@ -26232,6 +26677,27 @@ echo "$as_me: error: conditional \"OS_TY
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
++if test -z "${OS_TYPE_FREEBSD_TRUE}" && test -z "${OS_TYPE_FREEBSD_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"OS_TYPE_FREEBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"OS_TYPE_FREEBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${HAVE_INOTIFY_TRUE}" && test -z "${HAVE_INOTIFY_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"HAVE_INOTIFY\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"HAVE_INOTIFY\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${HAVE_KQUEUE_TRUE}" && test -z "${HAVE_KQUEUE_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"HAVE_KQUEUE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"HAVE_KQUEUE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
+
+ ac_config_commands="$ac_config_commands po/stamp-it"
+
+@@ -26995,10 +27461,16 @@ OS_TYPE_GENTOO_TRUE!$OS_TYPE_GENTOO_TRUE
+ OS_TYPE_GENTOO_FALSE!$OS_TYPE_GENTOO_FALSE$ac_delim
+ OS_TYPE_PARDUS_TRUE!$OS_TYPE_PARDUS_TRUE$ac_delim
+ OS_TYPE_PARDUS_FALSE!$OS_TYPE_PARDUS_FALSE$ac_delim
++OS_TYPE_FREEBSD_TRUE!$OS_TYPE_FREEBSD_TRUE$ac_delim
++OS_TYPE_FREEBSD_FALSE!$OS_TYPE_FREEBSD_FALSE$ac_delim
+ PAM_FILE_INCLUDE_AUTH!$PAM_FILE_INCLUDE_AUTH$ac_delim
+ PAM_FILE_INCLUDE_ACCOUNT!$PAM_FILE_INCLUDE_ACCOUNT$ac_delim
+ PAM_FILE_INCLUDE_PASSWORD!$PAM_FILE_INCLUDE_PASSWORD$ac_delim
+ PAM_FILE_INCLUDE_SESSION!$PAM_FILE_INCLUDE_SESSION$ac_delim
++HAVE_INOTIFY_TRUE!$HAVE_INOTIFY_TRUE$ac_delim
++HAVE_INOTIFY_FALSE!$HAVE_INOTIFY_FALSE$ac_delim
++HAVE_KQUEUE_TRUE!$HAVE_KQUEUE_TRUE$ac_delim
++HAVE_KQUEUE_FALSE!$HAVE_KQUEUE_FALSE$ac_delim
+ INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim
+ INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim
+ INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim
+@@ -27022,12 +27494,6 @@ INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_de
+ INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim
+ INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim
+ INTLTOOL_PERL!$INTLTOOL_PERL$ac_delim
+-ALL_LINGUAS!$ALL_LINGUAS$ac_delim
+-DATADIRNAME!$DATADIRNAME$ac_delim
+-GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
+-USE_NLS!$USE_NLS$ac_delim
+-MSGFMT!$MSGFMT$ac_delim
+-MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim
+ _ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+@@ -27069,6 +27535,12 @@ _ACEOF
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
++ALL_LINGUAS!$ALL_LINGUAS$ac_delim
++DATADIRNAME!$DATADIRNAME$ac_delim
++GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
++USE_NLS!$USE_NLS$ac_delim
++MSGFMT!$MSGFMT$ac_delim
++MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim
+ GMSGFMT!$GMSGFMT$ac_delim
+ XGETTEXT!$XGETTEXT$ac_delim
+ CATALOGS!$CATALOGS$ac_delim
+@@ -27085,7 +27557,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/sysutils/policykit/files/patch-configure.in b/sysutils/policykit/files/patch-configure.in
new file mode 100644
index 000000000000..d54068c952b8
--- /dev/null
+++ b/sysutils/policykit/files/patch-configure.in
@@ -0,0 +1,57 @@
+--- configure.in.orig 2007-11-25 15:43:40.000000000 -0500
++++ configure.in 2007-12-23 00:34:37.000000000 -0500
+@@ -169,7 +169,7 @@ PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-
+ AC_SUBST(DBUS_GLIB_CFLAGS)
+ AC_SUBST(DBUS_GLIB_LIBS)
+
+-AC_CHECK_FUNCS(getgrouplist)
++AC_CHECK_FUNCS(getgrouplist clearenv strndup getline readdir64)
+
+ EXPAT_LIB=""
+ AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
+@@ -406,6 +406,7 @@ AM_CONDITIONAL(OS_TYPE_RED_HAT, test x$w
+ AM_CONDITIONAL(OS_TYPE_SUSE, test x$with_os_type = xsuse, [Running on SUSE OS'es])
+ AM_CONDITIONAL(OS_TYPE_GENTOO, test x$with_os_type = xgentoo, [Running on Gentoo OS'es])
+ AM_CONDITIONAL(OS_TYPE_PARDUS, test x$with_os_type = xpardus, [Running on Pardus OS'es])
++AM_CONDITIONAL(OS_TYPE_FREEBSD, test x$with_os_type = xfreebsd, [Running on FreeBSD OS'es])
+
+ AC_ARG_WITH(pam-include, [ --with-pam-include=<file> pam file to include])
+
+@@ -425,6 +426,11 @@ elif test x$with_os_type = xsuse ; then
+ PAM_FILE_INCLUDE_ACCOUNT=common-account
+ PAM_FILE_INCLUDE_PASSWORD=common-password
+ PAM_FILE_INCLUDE_SESSION=common-session
++elif test x$with_os_type = xfreebsd ; then
++ PAM_FILE_INCLUDE_AUTH=system
++ PAM_FILE_INCLUDE_ACCOUNT=system
++ PAM_FILE_INCLUDE_PASSWORD=system
++ PAM_FILE_INCLUDE_SESSION=system
+ else
+ PAM_FILE_INCLUDE_AUTH=system-auth
+ PAM_FILE_INCLUDE_ACCOUNT=system-auth
+@@ -441,6 +447,25 @@ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_ACCO
+ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_PASSWORD, "$PAM_FILE_INCLUDE_PASSWORD", [pam file password])
+ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_SESSION, "$PAM_FILE_INCLUDE_SESSION", [pam file session])
+
++have_inotify=no
++AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
++AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
++
++AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
++
++if test "x$have_inotify" = "xyes" ; then
++ AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
++fi
++
++have_kqueue=yes
++AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
++
++AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
++
++if test "x$have_kqueue" = "xyes" ; then
++ AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
++fi
++
+ # ********************
+ # Internationalisation
+ # ********************
diff --git a/sysutils/policykit/files/patch-data_Makefile.in b/sysutils/policykit/files/patch-data_Makefile.in
new file mode 100644
index 000000000000..f32ab19c0983
--- /dev/null
+++ b/sysutils/policykit/files/patch-data_Makefile.in
@@ -0,0 +1,25 @@
+--- data/Makefile.in.orig 2008-01-07 23:51:57.000000000 -0500
++++ data/Makefile.in 2008-01-07 23:52:15.000000000 -0500
+@@ -305,14 +305,14 @@ mostlyclean-libtool:
+ clean-libtool:
+ -rm -rf .libs _libs
+ install-confDATA: $(conf_DATA)
+- @$(NORMAL_INSTALL)
+- test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
+- @list='$(conf_DATA)'; for p in $$list; do \
+- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+- f=$(am__strip_dir) \
+- echo " $(confDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \
+- $(confDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \
+- done
++# @$(NORMAL_INSTALL)
++# test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
++# @list='$(conf_DATA)'; for p in $$list; do \
++# if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++# f=$(am__strip_dir) \
++# echo " $(confDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \
++# $(confDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \
++# done
+
+ uninstall-confDATA:
+ @$(NORMAL_UNINSTALL)
diff --git a/sysutils/policykit/files/patch-polkitd_policy.c b/sysutils/policykit/files/patch-polkitd_policy.c
deleted file mode 100644
index c633366a2b60..000000000000
--- a/sysutils/policykit/files/patch-polkitd_policy.c
+++ /dev/null
@@ -1,118 +0,0 @@
---- polkitd/policy.c.orig Tue Mar 14 07:14:33 2006
-+++ polkitd/policy.c Tue May 2 01:53:06 2006
-@@ -537,13 +537,15 @@
- int rc;
- char *res;
- char *buf = NULL;
-- unsigned int bufsize;
-+ long bufsize;
- struct passwd pwd;
- struct passwd *pwdp;
-
- res = NULL;
-
- bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
-+ if (bufsize < 0)
-+ bufsize = 1024;
- buf = g_new0 (char, bufsize);
-
- rc = getpwuid_r (uid, &pwd, buf, bufsize, &pwdp);
-@@ -567,13 +569,15 @@
- int rc;
- char *res;
- char *buf = NULL;
-- unsigned int bufsize;
-+ long bufsize;
- struct group gbuf;
- struct group *gbufp;
-
- res = NULL;
-
- bufsize = sysconf (_SC_GETGR_R_SIZE_MAX);
-+ if (bufsize < 0)
-+ bufsize = 1024;
- buf = g_new0 (char, bufsize);
-
- rc = getgrgid_r (gid, &gbuf, buf, bufsize, &gbufp);
-@@ -597,13 +601,15 @@
- int rc;
- uid_t res;
- char *buf = NULL;
-- unsigned int bufsize;
-+ long bufsize;
- struct passwd pwd;
- struct passwd *pwdp;
-
- res = (uid_t) -1;
-
- bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
-+ if (bufsize < 0)
-+ bufsize = 1024;
- buf = g_new0 (char, bufsize);
-
- rc = getpwnam_r (username, &pwd, buf, bufsize, &pwdp);
-@@ -627,13 +633,15 @@
- int rc;
- gid_t res;
- char *buf = NULL;
-- unsigned int bufsize;
-+ long bufsize;
- struct group gbuf;
- struct group *gbufp;
-
- res = (gid_t) -1;
-
- bufsize = sysconf (_SC_GETGR_R_SIZE_MAX);
-+ if (bufsize < 0)
-+ bufsize = 1024;
- buf = g_new0 (char, bufsize);
-
- rc = getgrnam_r (groupname, &gbuf, buf, bufsize, &gbufp);
-@@ -649,6 +657,23 @@
- return res;
- }
-
-+static int
-+getgrouplist_ala_linux (const char *name,
-+ gid_t basegid,
-+ gid_t *groups,
-+ int *ngroups)
-+{
-+ if (groups)
-+ return getgrouplist (name, basegid, groups, ngroups);
-+ else {
-+ for (*ngroups = 1;; (*ngroups)++) {
-+ gid_t _groups[*ngroups];
-+ if (getgrouplist (name, basegid, _groups, ngroups) != -1)
-+ return 0;
-+ }
-+ }
-+}
-+
- PolicyResult
- policy_get_allowed_resources_for_policy_for_uid (uid_t uid,
- const char *policy,
-@@ -665,9 +690,9 @@
- if ((username = policy_util_uid_to_name (uid, &default_gid)) == NULL)
- goto out;
-
-- if (getgrouplist(username, default_gid, NULL, &num_groups) < 0) {
-+ if (getgrouplist_ala_linux(username, default_gid, NULL, &num_groups) < 0) {
- groups = (gid_t *) g_new0 (gid_t, num_groups);
-- if (getgrouplist(username, default_gid, groups, &num_groups) < 0) {
-+ if (getgrouplist_ala_linux(username, default_gid, groups, &num_groups) < 0) {
- g_warning ("getgrouplist() failed");
- goto out;
- }
-@@ -702,9 +727,9 @@
- if ((username = policy_util_uid_to_name (uid, &default_gid)) == NULL)
- goto out;
-
-- if (getgrouplist(username, default_gid, NULL, &num_groups) < 0) {
-+ if (getgrouplist_ala_linux(username, default_gid, NULL, &num_groups) < 0) {
- groups = (gid_t *) g_new0 (gid_t, num_groups);
-- if (getgrouplist(username, default_gid, groups, &num_groups) < 0) {
-+ if (getgrouplist_ala_linux(username, default_gid, groups, &num_groups) < 0) {
- g_warning ("getgrouplist() failed");
- goto out;
- }
diff --git a/sysutils/policykit/files/patch-src_kit_kit-file.c b/sysutils/policykit/files/patch-src_kit_kit-file.c
new file mode 100644
index 000000000000..af3ffe0f4974
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_kit_kit-file.c
@@ -0,0 +1,26 @@
+--- src/kit/kit-file.c.orig 2007-11-28 16:32:08.000000000 -0500
++++ src/kit/kit-file.c 2007-12-24 14:48:35.000000000 -0500
+@@ -283,7 +283,11 @@ _kit_get_num_fd (void)
+ DIR *dir;
+ char buf[128];
+ ssize_t num;
++#ifdef HAVE_READDIR64
+ struct dirent64 *d;
++#else
++ struct dirent *d;
++#endif
+
+ num = -1;
+
+@@ -296,7 +300,11 @@ _kit_get_num_fd (void)
+ }
+
+ num = -2;
++#ifdef HAVE_READDIR64
+ while ((d = readdir64 (dir)) != NULL) {
++#else
++ while ((d = readdir (dir)) != NULL) {
++#endif
+ if (d->d_name == NULL)
+ continue;
+ num++;
diff --git a/sysutils/policykit/files/patch-src_kit_kit-file.h b/sysutils/policykit/files/patch-src_kit_kit-file.h
new file mode 100644
index 000000000000..ae2a2ac7187a
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_kit_kit-file.h
@@ -0,0 +1,10 @@
+--- src/kit/kit-file.h.orig 2007-12-22 19:14:03.000000000 -0500
++++ src/kit/kit-file.h 2007-12-22 19:14:13.000000000 -0500
+@@ -34,6 +34,7 @@
+ #ifndef KIT_FILE_H
+ #define KIT_FILE_H
+
++#include <sys/stat.h>
+ #include <kit/kit.h>
+
+ KIT_BEGIN_DECLS
diff --git a/sysutils/policykit/files/patch-src_kit_kit-spawn.c b/sysutils/policykit/files/patch-src_kit_kit-spawn.c
new file mode 100644
index 000000000000..7fbee5ec794b
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_kit_kit-spawn.c
@@ -0,0 +1,10 @@
+--- src/kit/kit-spawn.c.orig 2007-12-23 00:22:49.000000000 -0500
++++ src/kit/kit-spawn.c 2007-12-23 00:22:58.000000000 -0500
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <signal.h>
+
+ #include <kit/kit.h>
+ #include "kit-test.h"
diff --git a/sysutils/policykit/files/patch-src_kit_kit-string.c b/sysutils/policykit/files/patch-src_kit_kit-string.c
new file mode 100644
index 000000000000..e7b375e05bdd
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_kit_kit-string.c
@@ -0,0 +1,42 @@
+--- src/kit/kit-string.c.orig 2007-12-23 00:42:03.000000000 -0500
++++ src/kit/kit-string.c 2007-12-23 00:41:26.000000000 -0500
+@@ -77,7 +77,15 @@ kit_strdup (const char *s)
+ out:
+ return p;
+ }
++#else /* !KIT_BUILD_TESTS */
++char *
++kit_strdup (const char *s)
++{
++ return strdup (s);
++}
++#endif /* KIT_BUILD_TESTS */
+
++#if defined(KIT_BUILD_TESTS) || !defined(HAVE_STRNDUP)
+ /**
+ * kit_strndup:
+ * @s: string
+@@ -111,13 +119,7 @@ out:
+ return p;
+ }
+
+-#else
+-
+-char *
+-kit_strdup (const char *s)
+-{
+- return strdup (s);
+-}
++#else /* !KIT_BUILD_TESTS || HAVE_STRNDUP */
+
+ char *
+ kit_strndup (const char *s, size_t n)
+@@ -125,7 +127,7 @@ kit_strndup (const char *s, size_t n)
+ return strndup (s, n);
+ }
+
+-#endif /* KIT_BUILD_TESTS */
++#endif /* KIT_BUILD_TESTS || !HAVE_STRNDUP */
+
+ /**
+ * kit_strdup_printf:
diff --git a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
new file mode 100644
index 000000000000..d9351cea6771
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
@@ -0,0 +1,43 @@
+--- src/polkit-dbus/polkit-read-auth-helper.c.orig 2007-11-28 23:33:10.000000000 -0500
++++ src/polkit-dbus/polkit-read-auth-helper.c 2007-12-24 14:53:38.000000000 -0500
+@@ -39,6 +39,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/stat.h>
+ #include <security/pam_appl.h>
+ #include <grp.h>
+@@ -156,7 +157,11 @@ dump_auths_all (const char *root)
+ {
+ DIR *dir;
+ int dfd;
++#ifdef HAVE_READDIR64
+ struct dirent64 *d;
++#else
++ struct dirent *d;
++#endif
+ polkit_bool_t ret;
+
+ ret = FALSE;
+@@ -173,7 +178,11 @@ dump_auths_all (const char *root)
+ goto out;
+ }
+
++#ifdef HAVE_READDIR64
+ while ((d = readdir64(dir)) != NULL) {
++#else
++ while ((d = readdir(dir)) != NULL) {
++#endif
+ unsigned int n, m;
+ uid_t uid;
+ size_t name_len;
+@@ -282,7 +291,7 @@ main (int argc, char *argv[])
+
+ #ifndef POLKIT_BUILD_TESTS
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto out;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
new file mode 100644
index 000000000000..8361f7c0bef2
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
@@ -0,0 +1,11 @@
+--- src/polkit-dbus/polkit-set-default-helper.c.orig 2007-12-23 01:21:04.000000000 -0500
++++ src/polkit-dbus/polkit-set-default-helper.c 2007-12-23 01:21:11.000000000 -0500
+@@ -127,7 +127,7 @@ main (int argc, char *argv[])
+
+ ret = 1;
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto out;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
new file mode 100644
index 000000000000..73f38d381015
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
@@ -0,0 +1,11 @@
+--- src/polkit-grant/Makefile.am.orig 2007-12-23 01:40:02.000000000 -0500
++++ src/polkit-grant/Makefile.am 2007-12-23 01:40:27.000000000 -0500
+@@ -47,7 +47,7 @@ polkit_grant_helper_SOURCES = polkit-gra
+ polkit_grant_helper_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
+
+ polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
+-polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
++polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+
+ polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
+ polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
new file mode 100644
index 000000000000..6723a3a127ad
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
@@ -0,0 +1,11 @@
+--- src/polkit-grant/Makefile.in.orig 2007-12-23 01:40:49.000000000 -0500
++++ src/polkit-grant/Makefile.in 2007-12-23 01:41:16.000000000 -0500
+@@ -351,7 +351,7 @@ libpolkit_grant_la_LDFLAGS = -version-in
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_SOURCES = polkit-grant-helper.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
+-@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
++@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
+ @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_LDADD = $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
new file mode 100644
index 000000000000..cf9689c67396
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
@@ -0,0 +1,11 @@
+--- src/polkit-grant/polkit-explicit-grant-helper.c.orig 2007-12-23 01:24:19.000000000 -0500
++++ src/polkit-grant/polkit-explicit-grant-helper.c 2007-12-23 01:24:24.000000000 -0500
+@@ -67,7 +67,7 @@ main (int argc, char *argv[])
+ ret = 1;
+
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto out;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
new file mode 100644
index 000000000000..bb957f167e69
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
@@ -0,0 +1,20 @@
+--- src/polkit-grant/polkit-grant-helper-pam.c.orig 2007-11-28 16:28:31.000000000 -0500
++++ src/polkit-grant/polkit-grant-helper-pam.c 2007-12-23 02:01:46.000000000 -0500
+@@ -38,6 +38,8 @@
+ #include <syslog.h>
+ #include <security/pam_appl.h>
+
++#include <polkit/polkit.h>
++
+ /* Development aid: define PGH_DEBUG to get debugging output. Do _NOT_
+ * enable this in production builds; it may leak passwords and other
+ * sensitive information.
+@@ -60,7 +62,7 @@ main (int argc, char *argv[])
+ pam_h = NULL;
+
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto error;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
new file mode 100644
index 000000000000..0cab8899cf02
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
@@ -0,0 +1,11 @@
+--- src/polkit-grant/polkit-grant-helper.c.orig 2007-12-23 01:23:13.000000000 -0500
++++ src/polkit-grant/polkit-grant-helper.c 2007-12-23 01:23:19.000000000 -0500
+@@ -546,7 +546,7 @@ main (int argc, char *argv[])
+ ret = 3;
+
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto out;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
new file mode 100644
index 000000000000..c377b9614635
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
@@ -0,0 +1,19 @@
+--- src/polkit-grant/polkit-grant.c.orig 2007-11-28 16:29:25.000000000 -0500
++++ src/polkit-grant/polkit-grant.c 2007-12-23 01:25:08.000000000 -0500
+@@ -38,6 +38,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <sys/wait.h>
++#include <signal.h>
+
+ #include <glib.h>
+ #include "polkit-grant.h"
+@@ -301,7 +302,7 @@ polkit_grant_io_func (PolKitGrant *polki
+ g_return_if_fail (polkit_grant != NULL);
+ g_return_if_fail (polkit_grant->helper_is_running);
+
+- while (getline (&line, &line_len, polkit_grant->child_stdout_f) != -1) {
++ while (polkit_sysdeps_getline (&line, &line_len, polkit_grant->child_stdout_f) != -1) {
+ if (strlen (line) > 0 &&
+ line[strlen (line) - 1] == '\n')
+ line[strlen (line) - 1] = '\0';
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
new file mode 100644
index 000000000000..c0ff4b64aaa7
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
@@ -0,0 +1,11 @@
+--- src/polkit-grant/polkit-revoke-helper.c.orig 2007-12-23 01:22:38.000000000 -0500
++++ src/polkit-grant/polkit-revoke-helper.c 2007-12-23 01:22:47.000000000 -0500
+@@ -109,7 +109,7 @@ main (int argc, char *argv[])
+
+ #ifndef POLKIT_BUILD_TESTS
+ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+- if (clearenv () != 0)
++ if (polkit_sysdeps_clearenv () != 0)
+ goto out;
+ /* set a minimal environment */
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-config.c b/sysutils/policykit/files/patch-src_polkit_polkit-config.c
new file mode 100644
index 000000000000..f5b2e008222a
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-config.c
@@ -0,0 +1,10 @@
+--- src/polkit/polkit-config.c.orig 2007-12-23 00:25:46.000000000 -0500
++++ src/polkit/polkit-config.c 2007-12-23 00:25:51.000000000 -0500
+@@ -39,7 +39,6 @@
+ #include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
+-#include <sys/inotify.h>
+ #include <regex.h>
+ #include <syslog.h>
+ #include <regex.h>
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-context.c b/sysutils/policykit/files/patch-src_polkit_polkit-context.c
new file mode 100644
index 000000000000..b27cd8edd727
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-context.c
@@ -0,0 +1,189 @@
+--- src/polkit/polkit-context.c.orig 2007-12-04 20:22:41.000000000 -0500
++++ src/polkit/polkit-context.c 2007-12-23 00:24:45.000000000 -0500
+@@ -39,7 +39,13 @@
+ #include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
++#ifdef HAVE_INOTIFY
+ #include <sys/inotify.h>
++#elif HAVE_KQUEUE
++#include <sys/event.h>
++#include <sys/time.h>
++#include <fcntl.h>
++#endif
+ #include <syslog.h>
+
+ #include "polkit-config.h"
+@@ -106,11 +112,19 @@ struct _PolKitContext
+
+ polkit_bool_t load_descriptions;
+
++#ifdef HAVE_INOTIFY
+ int inotify_fd;
+ int inotify_fd_watch_id;
+ int inotify_config_wd;
+ int inotify_policy_wd;
+ int inotify_grant_perm_wd;
++#elif HAVE_KQUEUE
++ int kqueue_fd;
++ int kqueue_fd_watch_id;
++ int kqueue_config_fd;
++ int kqueue_policy_fd;
++ int kqueue_grant_perm_fd;
++#endif
+ };
+
+ /**
+@@ -144,6 +158,10 @@ polkit_context_new (void)
+ polkit_bool_t
+ polkit_context_init (PolKitContext *pk_context, PolKitError **error)
+ {
++#ifdef HAVE_KQUEUE
++ struct kevent ev;
++#endif
++
+ kit_return_val_if_fail (pk_context != NULL, FALSE);
+
+ pk_context->policy_dir = kit_strdup (PACKAGE_DATA_DIR "/PolicyKit/policy");
+@@ -153,6 +171,7 @@ polkit_context_init (PolKitContext *pk_c
+
+ /* NOTE: we don't load the configuration file until it's needed */
+
++#ifdef HAVE_INOTIFY
+ if (pk_context->io_add_watch_func != NULL) {
+ pk_context->inotify_fd = inotify_init ();
+ if (pk_context->inotify_fd < 0) {
+@@ -203,6 +222,88 @@ polkit_context_init (PolKitContext *pk_c
+ goto error;
+ }
+ }
++#elif HAVE_KQUEUE
++ if (pk_context->io_add_watch_func != NULL) {
++ pk_context->kqueue_fd = kqueue ();
++ if (pk_context->kqueue_fd < 0) {
++ _pk_debug ("failed to initialize kqueue: %s", strerror (errno));
++ /* TODO: set error */
++ goto error;
++ }
++
++ /* Watch the /etc/PolicyKit/PolicyKit.conf file */
++ pk_context->kqueue_config_fd = open (PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf", O_RDONLY);
++ if (pk_context->kqueue_config_fd < 0) {
++ _pk_debug ("failed '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf' for reading: %s",
++ strerror (errno));
++ /* TODO: set error */
++ goto error;
++ }
++
++ EV_SET (&ev, pk_context->kqueue_config_fd, EVFILT_VNODE,
++ EV_ADD | EV_ENABLE | EV_CLEAR,
++ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
++ 0, 0);
++ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++ _pk_debug ("failed to add watch on file '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf': %s",
++ strerror (errno));
++ close (pk_context->kqueue_config_fd);
++ /* TODO: set error */
++ goto error;
++ }
++
++ /* Watch the /usr/share/PolicyKit/policy directory */
++ pk_context->kqueue_policy_fd = open (PACKAGE_DATA_DIR "/PolicyKit/policy", O_RDONLY);
++ if (pk_context->kqueue_policy_fd < 0) {
++ _pk_debug ("failed to open '" PACKAGE_DATA_DIR "/PolicyKit/policy for reading: %s",
++ strerror (errno));
++ /* TODO: set error */
++ goto error;
++ }
++
++ EV_SET (&ev, pk_context->kqueue_policy_fd, EVFILT_VNODE,
++ EV_ADD | EV_ENABLE | EV_CLEAR,
++ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
++ 0, 0);
++ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++ _pk_debug ("failed to add watch on directory '" PACKAGE_DATA_DIR "/PolicyKit/policy': %s",
++ strerror (errno));
++ close (pk_context->kqueue_policy_fd);
++ /* TODO: set error */
++ goto error;
++ }
++
++#ifdef POLKIT_AUTHDB_DEFAULT
++ /* Watch the /var/lib/misc/PolicyKit.reload file */
++ pk_context->kqueue_grant_perm_fd = open (PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload", O_RDONLY);
++ if (pk_context->kqueue_grant_perm_fd < 0) {
++ _pk_debug ("failed to open '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload' for reading: %s",
++ strerror (errno));
++ /* TODO: set error */
++ goto error;
++ }
++
++ EV_SET (&ev, pk_context->kqueue_grant_perm_fd, EVFILT_VNODE,
++ EV_ADD | EV_ENABLE | EV_CLEAR,
++ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
++ 0, 0);
++ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++ _pk_debug ("failed to add watch on file '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload': %s",
++ strerror (errno));
++ close (pk_context->kqueue_grant_perm_fd);
++ /* TODO: set error */
++ goto error;
++ }
++#endif
++
++ pk_context->kqueue_fd_watch_id = pk_context->io_add_watch_func (pk_context, pk_context->kqueue_fd);
++ if (pk_context->kqueue_fd_watch_id == 0) {
++ _pk_debug ("failed to add io watch");
++ /* TODO: set error */
++ goto error;
++ }
++ }
++#endif
+
+ return TRUE;
+ error:
+@@ -296,6 +397,7 @@ polkit_context_io_func (PolKitContext *p
+
+ config_changed = FALSE;
+
++#ifdef HAVE_INOTIFY
+ if (fd == pk_context->inotify_fd) {
+ /* size of the event structure, not counting name */
+ #define EVENT_SIZE (sizeof (struct inotify_event))
+@@ -327,6 +429,36 @@ again:
+ i += EVENT_SIZE + event->len;
+ }
+ }
++#elif HAVE_KQUEUE
++ if (fd == pk_context->kqueue_fd) {
++ struct kevent ev[1024];
++ struct timespec nullts = { 0, 0 };
++ int res;
++ int i = 0;
++
++ res = kevent (fd, NULL, 0, ev, 1024, &nullts);
++
++ if (res > 0) {
++ /* Sleep for a half-second to avoid potential races
++ * during install/uninstall. */
++ usleep (500000);
++
++ while (i < res) {
++ struct kevent *evptr;
++
++ evptr = &ev[i];
++ _pk_debug ("ident=%d filter=%d flags=%u fflags=%u",
++ evptr->ident, evptr->filter, evptr->flags, evptr->fflags);
++ _pk_debug ("config changed!");
++ config_changed = TRUE;
++
++ i++;
++ }
++ } else {
++ _pk_debug ("failed to read kqueue event: %s", strerror (errno));
++ }
++ }
++#endif
+
+ if (config_changed) {
+ polkit_context_force_reload (pk_context);
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c b/sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c
new file mode 100644
index 000000000000..793b531106a4
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c
@@ -0,0 +1,26 @@
+--- src/polkit/polkit-policy-cache.c.orig 2007-11-29 01:14:09.000000000 -0500
++++ src/polkit/polkit-policy-cache.c 2007-12-24 14:51:04.000000000 -0500
+@@ -98,7 +98,11 @@ PolKitPolicyCache *
+ _polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error)
+ {
+ DIR *dir;
++#ifdef HAVE_READDIR64
+ struct dirent64 *d;
++#else
++ struct dirent *d;
++#endif
+ PolKitPolicyCache *pc;
+
+ dir = NULL;
+@@ -119,7 +123,11 @@ _polkit_policy_cache_new (const char *di
+ goto out;
+ }
+
++#ifdef HAVE_READDIR64
+ while ((d = readdir64 (dir)) != NULL) {
++#else
++ while ((d = readdir (dir)) != NULL) {
++#endif
+ char *path;
+ PolKitPolicyFile *pf;
+ PolKitError *pk_error;
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
new file mode 100644
index 000000000000..c8e4935f105a
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
@@ -0,0 +1,187 @@
+--- src/polkit/polkit-sysdeps.c.orig 2007-11-28 16:26:14.000000000 -0500
++++ src/polkit/polkit-sysdeps.c 2008-01-02 00:42:47.000000000 -0500
+@@ -39,7 +39,6 @@
+ #include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
+-#include <sys/inotify.h>
+ #include <syslog.h>
+
+ #include "polkit-sysdeps.h"
+@@ -82,7 +81,11 @@ polkit_sysdeps_get_start_time_for_pid (p
+ start_time = 0;
+ contents = NULL;
+
++#ifdef __FreeBSD__
++ filename = kit_strdup_printf ("/proc/%d/status", pid);
++#else
+ filename = kit_strdup_printf ("/proc/%d/stat", pid);
++#endif
+ if (filename == NULL) {
+ errno = ENOMEM;
+ goto out;
+@@ -93,6 +96,35 @@ polkit_sysdeps_get_start_time_for_pid (p
+ goto out;
+ }
+
++#ifdef __FreeBSD__
++ tokens = kit_strsplit (contents, ' ', &num_tokens);
++ if (tokens == NULL)
++ goto out;
++ if (num_tokens < 8) {
++ kit_strfreev (tokens);
++ goto out;
++ }
++
++ p = kit_strdup (tokens[7]);
++ kit_strfreev (tokens);
++
++ tokens = kit_strsplit (p, ',', &num_tokens);
++ if (tokens == NULL)
++ goto out;
++ if (num_tokens >= 1) {
++ start_time = strtoll (tokens[0], &endp, 10);
++ if (endp == tokens[0]) {
++ kit_strfreev (tokens);
++ goto out;
++ }
++ } else {
++ kit_strfreev (tokens);
++ goto out;
++ }
++
++ kit_strfreev (tokens);
++#else
++
+ /* start time is the 19th token after the '(process name)' entry */
+
+ p = strchr (contents, ')');
+@@ -118,6 +150,7 @@ polkit_sysdeps_get_start_time_for_pid (p
+ }
+
+ kit_strfreev (tokens);
++#endif
+
+ out:
+ kit_free (filename);
+@@ -153,7 +186,11 @@ polkit_sysdeps_get_exe_for_pid (pid_t pi
+
+ ret = 0;
+
++#ifdef __FreeBSD__
++ snprintf (proc_name, sizeof (proc_name), "/proc/%d/file", pid);
++#else
+ snprintf (proc_name, sizeof (proc_name), "/proc/%d/exe", pid);
++#endif
+ ret = readlink (proc_name, out_buf, buf_size - 1);
+ if (ret == -1) {
+ strncpy (out_buf, "(unknown)", buf_size);
+@@ -166,6 +203,108 @@ out:
+ return ret;
+ }
+
++#ifndef HAVE_GETLINE
++/* Taken from GNU sed. */
++/* Read up to (and including) a '\n' from STREAM into *LINEPTR
++ (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
++ NULL), pointing to *N characters of space. It is realloc'd as
++ necessary. Returns the number of characters read (not including the
++ null terminator), or -1 on error or EOF. */
++
++ssize_t
++polkit_sysdeps_getline (char **lineptr, size_t *n, FILE *stream)
++{
++ char *line, *p;
++ long size, copy;
++
++ if (lineptr == NULL || n == NULL) {
++ errno = EINVAL;
++ return (ssize_t) -1;
++ }
++
++ if (ferror (stream))
++ return (ssize_t) -1;
++
++ /* Make sure we have a line buffer to start with. */
++ if (*lineptr == NULL || *n < 2) /* !seen and no buf yet need 2 chars. */ {
++#ifndef MAX_CANON
++#define MAX_CANON 256
++#endif
++ if (!*lineptr)
++ line = (char *) malloc (MAX_CANON);
++ else
++ line = (char *) realloc (*lineptr, MAX_CANON);
++ if (line == NULL)
++ return (ssize_t) -1;
++ *lineptr = line;
++ *n = MAX_CANON;
++ }
++
++ line = *lineptr;
++ size = *n;
++
++ copy = size;
++ p = line;
++
++ while (1) {
++ long len;
++
++ while (--copy > 0) {
++ int c = getc (stream);
++
++ if (c == EOF)
++ goto lose;
++ else if ((*p++ = c) == '\n')
++ goto win;
++ }
++
++ /* Need to enlarge the line buffer. */
++ len = p - line;
++ size *= 2;
++ line = (char *) realloc (line, size);
++ if (line == NULL)
++ goto lose;
++ *lineptr = line;
++ *n = size;
++ p = line + len;
++ copy = size - len;
++ }
++
++lose:
++ if (p == *lineptr)
++ return (ssize_t) -1;
++
++ /* Return a partial line since we got an error in the middle. */
++win:
++ *p = '\0';
++ return p - *lineptr;
++}
++#else
++ssize_t
++polkit_sysdeps_getline (char **lineptr, size_t *n, FILE *stream)
++{
++ return getline (lineptr, n, stream);
++}
++#endif
++
++#ifndef HAVE_CLEARENV
++extern char **environ;
++int
++polkit_sysdeps_clearenv (void)
++{
++ if (environ != NULL) {
++ environ[0] = NULL;
++ }
++ return 0;
++}
++#else
++int
++polkit_sysdeps_clearenv (void)
++{
++ return clearenv ();
++}
++#endif
++
+ #ifdef POLKIT_BUILD_TESTS
+
+ static polkit_bool_t
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h
new file mode 100644
index 000000000000..da4be3497c55
--- /dev/null
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h
@@ -0,0 +1,20 @@
+--- src/polkit/polkit-sysdeps.h.orig 2007-12-23 01:46:49.000000000 -0500
++++ src/polkit/polkit-sysdeps.h 2007-12-23 01:48:22.000000000 -0500
+@@ -35,6 +35,7 @@
+ #define POLKIT_SYSDEPS_H
+
+ #include <sys/types.h>
++#include <stdio.h>
+ #include <polkit/polkit-types.h>
+
+ POLKIT_BEGIN_DECLS
+@@ -43,6 +44,9 @@ polkit_uint64_t polkit_sysdeps_get_start
+
+ int polkit_sysdeps_get_exe_for_pid (pid_t pid, char *out_buf, size_t buf_size);
+
++ssize_t polkit_sysdeps_getline (char **lineptr, size_t *n, FILE *stream);
++
++int polkit_sysdeps_clearenv (void);
+
+ POLKIT_END_DECLS
+
diff --git a/sysutils/policykit/files/patch-tools_Makefile.in b/sysutils/policykit/files/patch-tools_Makefile.in
deleted file mode 100644
index 9308ff774f36..000000000000
--- a/sysutils/policykit/files/patch-tools_Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
---- tools/Makefile.in.orig Sun Oct 8 03:37:21 2006
-+++ tools/Makefile.in Sun Oct 8 03:37:37 2006
-@@ -252,9 +252,9 @@ INCLUDES = \
- @DBUS_CFLAGS@
-
- polkit_is_privileged_SOURCES = polkit-is-privileged.c
--polkit_is_privileged_LDADD = @DBUS_CFLAGS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
-+polkit_is_privileged_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
- polkit_list_privileges_SOURCES = polkit-list-privileges.c
--polkit_list_privileges_LDADD = @DBUS_CFLAGS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
-+polkit_list_privileges_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
- polkit_grant_privilege_SOURCES = \
- polkit-grant-privilege.c \
- polkit-interface-manager-glue.h \
diff --git a/sysutils/policykit/files/patch-tools_polkit-auth.c b/sysutils/policykit/files/patch-tools_polkit-auth.c
new file mode 100644
index 000000000000..f3ee42d1f55d
--- /dev/null
+++ b/sysutils/policykit/files/patch-tools_polkit-auth.c
@@ -0,0 +1,61 @@
+--- tools/polkit-auth.c.orig 2007-12-05 22:30:18.000000000 -0500
++++ tools/polkit-auth.c 2007-12-23 01:43:36.000000000 -0500
+@@ -37,12 +37,13 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h>
++#include <sys/wait.h>
+ #include <pwd.h>
+ #include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <termios.h>
+
+ #include <polkit-dbus/polkit-dbus.h>
+ #include <polkit-grant/polkit-grant.h>
+
+@@ -107,7 +109,7 @@ conversation_select_admin_user (PolKitGr
+ }
+ printf ("\n");
+ printf ("Select user: ");
+- getline (&lineptr, &linelen, stdin);
++ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
+ user = strdup (lineptr);
+ free (lineptr);
+ return user;
+@@ -133,7 +135,7 @@ conversation_pam_prompt_echo_off (PolKit
+ exit (1);
+ }
+
+- getline (&lineptr, &linelen, stdin);
++ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
+
+ /* Restore terminal. */
+ tcsetattr (fileno (stdout), TCSAFLUSH, &old);
+@@ -151,7 +153,7 @@ conversation_pam_prompt_echo_on (PolKitG
+ size_t linelen = 0;
+ char *result;
+ printf ("%s", request);
+- getline (&lineptr, &linelen, stdin);
++ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
+ result = strdup (lineptr);
+ free (lineptr);
+ printf ("\n");
+@@ -189,7 +191,7 @@ conversation_override_grant_type (PolKit
+ case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
+ printf ("Keep this privilege for the session? [no/session]?\n");
+ again:
+- getline (&lineptr, &linelen, stdin);
++ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
+ if (g_str_has_prefix (lineptr, "no")) {
+ ;
+ } else if (g_str_has_prefix (lineptr, "session")) {
+@@ -204,7 +206,7 @@ conversation_override_grant_type (PolKit
+ case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
+ printf ("Keep this privilege for the session or always? [no/session/always]?\n");
+ again2:
+- getline (&lineptr, &linelen, stdin);
++ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
+ if (g_str_has_prefix (lineptr, "no")) {
+ ;
+ } else if (g_str_has_prefix (lineptr, "session")) {
diff --git a/sysutils/policykit/files/polkitd.in b/sysutils/policykit/files/polkitd.in
deleted file mode 100644
index 0e2a829c6f54..000000000000
--- a/sysutils/policykit/files/polkitd.in
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-# PROVIDE: polkitd
-# REQUIRE: DAEMON dbus
-#
-# Add the following line to /etc/rc.conf to enable the PolicyKit daemon:
-#
-# polkitd_enable="YES"
-#
-
-. %%RC_SUBR%%
-. %%GNOME_SUBR%%
-
-polkitd_enable=${polkitd_enable-${gnome_enable}}
-
-name=polkitd
-rcvar=`set_rcvar`
-
-command="%%PREFIX%%/sbin/polkitd"
-pidfile="/var/run/${name}/${name}.pid"
-
-start_precmd="polkitd_precmd"
-stop_postcmd="polkitd_postcmd"
-
-local_force_depend()
-{
- _depend="$1"
- if [ -f %%LOCALBASE%%/etc/rc.d/${_depend}.sh ]; then
- _depend="${_depend}.sh"
- fi
-
- if ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 &&
- ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestart; then
- return 1
- fi
- return 0
-}
-
-polkitd_precmd()
-{
- if ! checkyesno dbus_enable
- then
- local_force_depend dbus || return 1
- fi
-
- mkdir -p $(dirname $pidfile)
-}
-
-polkitd_postcmd()
-{
- rm -f $pidfile
-}
-
-load_rc_config ${name}
-run_rc_command "$1"
diff --git a/sysutils/policykit/pkg-install b/sysutils/policykit/pkg-install
index 38383f8285ee..3d49ff2062ef 100644
--- a/sysutils/policykit/pkg-install
+++ b/sysutils/policykit/pkg-install
@@ -32,7 +32,16 @@ POST-INSTALL)
fi
fi
- /usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/polkitd
+ /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/run/PolicyKit
+ /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/lib/PolicyKit
+ /usr/bin/install -d -o root -m 0775 -g ${GROUP} /var/lib/PolicyKit-public
+ /bin/mkdir -p /var/lib/misc
+ /usr/bin/touch -f /var/lib/misc/PolicyKit.reload
+ /usr/bin/chgrp ${GROUP} /var/lib/misc/PolicyKit.reload
+ /bin/chmod 0775 /var/lib/misc/PolicyKit.reload
+ for i in ${PKG_PREFIX}/libexec/polkit-read-auth-helper ${PKG_PREFIX}/libexec/polkit-set-default-helper ${PKG_PREFIX}/libexec/polkit-grant-helper ${PKG_PREFIX}/libexec/polkit-grant-helper-pam ${PKG_PREFIX}/libexec/polkit-explicit-grant-helper ${PKG_PREFIX}/libexec/polkit-revoke-helper /var/lib/misc/PolicyKit.reload; do
+ /usr/bin/chgrp ${GROUP} ${i}
+ done
exit 0
;;
esac
diff --git a/sysutils/policykit/pkg-plist b/sysutils/policykit/pkg-plist
index 66c27dc14847..1442b6c2b740 100644
--- a/sysutils/policykit/pkg-plist
+++ b/sysutils/policykit/pkg-plist
@@ -1,19 +1,71 @@
-bin/polkit-grant-privilege
-bin/polkit-is-privileged
-bin/polkit-list-privileges
-bin/polkit-revoke-privilege
-etc/PolicyKit/privilege.d/desktop-console.privilege
-etc/dbus-1/system.d/PolicyKit.conf
-etc/pam.d/policy-kit
-include/libpolkit/libpolkit.h
+bin/polkit-action
+bin/polkit-auth
+bin/polkit-config-file-validate
+bin/polkit-policy-file-validate
+@unexec if cmp -s %D/etc/PolicyKit/PolicyKit.conf %D/etc/PolicyKit/PolicyKit.conf.dist; then rm -f %D/etc/PolicyKit/PolicyKit.conf
+etc/PolicyKit/PolicyKit.conf.dist
+@exec [ -f %B/PolicyKit.conf ] || cp %B/%f %B/PolicyKit.conf
+etc/PolicyKit/PolicyKit.conf
+etc/dbus-1/system.d/org.freedesktop.PolicyKit.conf
+etc/pam.d/polkit
+etc/profile.d/polkit-bash-completion.sh
+include/PolicyKit/polkit-dbus/polkit-dbus.h
+include/PolicyKit/polkit-dbus/polkit-simple.h
+include/PolicyKit/polkit-grant/polkit-grant.h
+include/PolicyKit/polkit/polkit-action.h
+include/PolicyKit/polkit/polkit-authorization-constraint.h
+include/PolicyKit/polkit/polkit-authorization-db.h
+include/PolicyKit/polkit/polkit-authorization.h
+include/PolicyKit/polkit/polkit-caller.h
+include/PolicyKit/polkit/polkit-config.h
+include/PolicyKit/polkit/polkit-context.h
+include/PolicyKit/polkit/polkit-error.h
+include/PolicyKit/polkit/polkit-policy-cache.h
+include/PolicyKit/polkit/polkit-policy-default.h
+include/PolicyKit/polkit/polkit-policy-file-entry.h
+include/PolicyKit/polkit/polkit-policy-file.h
+include/PolicyKit/polkit/polkit-result.h
+include/PolicyKit/polkit/polkit-seat.h
+include/PolicyKit/polkit/polkit-session.h
+include/PolicyKit/polkit/polkit-sysdeps.h
+include/PolicyKit/polkit/polkit-types.h
+include/PolicyKit/polkit/polkit.h
+lib/libpolkit-dbus.a
+lib/libpolkit-dbus.la
+lib/libpolkit-dbus.so
+lib/libpolkit-dbus.so.2
+lib/libpolkit-grant.a
+lib/libpolkit-grant.la
+lib/libpolkit-grant.so
+lib/libpolkit-grant.so.2
lib/libpolkit.a
lib/libpolkit.la
lib/libpolkit.so
-lib/libpolkit.so.0
+lib/libpolkit.so.2
+libdata/pkgconfig/polkit-dbus.pc
+libdata/pkgconfig/polkit-grant.pc
libdata/pkgconfig/polkit.pc
-sbin/polkitd
-@dirrm include/libpolkit
-@dirrm etc/PolicyKit/privilege.d
+libexec/polkit-explicit-grant-helper
+libexec/polkit-grant-helper
+libexec/polkit-grant-helper-pam
+libexec/polkit-read-auth-helper
+libexec/polkit-revoke-helper
+libexec/polkit-set-default-helper
+libexec/polkitd
+share/PolicyKit/config.dtd
+share/PolicyKit/policy/org.freedesktop.policykit.policy
+share/dbus-1/interfaces/org.freedesktop.PolicyKit.AuthenticationAgent.xml
+share/dbus-1/system-services/org.freedesktop.PolicyKit.service
+@dirrmtry share/PolicyKit/policy
+@dirrmtry share/PolicyKit
+@dirrm include/PolicyKit/polkit
+@dirrm include/PolicyKit/polkit-grant
+@dirrm include/PolicyKit/polkit-dbus
+@dirrm include/PolicyKit
+@dirrmtry etc/profile.d
@dirrm etc/PolicyKit
-@unexec rm -f /var/run/polkitd/polkitd.pid 2>/dev/null || true
-@unexec rmdir /var/run/polkitd 2>/dev/null || true
+@unexec rm -rf /var/run/PolicyKit 2>/dev/null || true
+@unexec rmdir /var/lib/PolicyKit 2>/dev/null || true
+@unexec rmdir /var/lib/PolicyKit-public 2>/dev/null || true
+@unexec rm -f /var/lib/misc/PolicyKit.reload 2>/dev/null || true
+@unexec rmdir /var/lib/misc 2>/dev/null || true