diff options
author | mezz <mezz@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-08-22 02:36:12 +0800 |
---|---|---|
committer | mezz <mezz@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-08-22 02:36:12 +0800 |
commit | afb1617ed2ffe9677ead908ad8f620858cc9dc12 (patch) | |
tree | 417694d471a83f18f0367916acadf30db8bebca6 | |
parent | aa68e424a63a0467321826d761ea11b42148bf94 (diff) | |
download | marcuscom-ports-afb1617ed2ffe9677ead908ad8f620858cc9dc12.tar.gz marcuscom-ports-afb1617ed2ffe9677ead908ad8f620858cc9dc12.tar.zst marcuscom-ports-afb1617ed2ffe9677ead908ad8f620858cc9dc12.zip |
Fix with ConsoleKit 0.3.x API, bump the PORTREVISION.
Obtained from: PolicyKit-0.9-2.fc10.src.rpm (Fedora)
Reviewed by: marcus
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@11360 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | sysutils/policykit/Makefile | 56 | ||||
-rw-r--r-- | sysutils/policykit/distinfo | 3 | ||||
-rw-r--r-- | sysutils/policykit/files/patch-Makefile.in | 11 | ||||
-rw-r--r-- | sysutils/policykit/files/patch-consolekit03 | 83 | ||||
-rw-r--r-- | sysutils/policykit/files/patch-data_Makefile.in | 25 | ||||
-rw-r--r-- | sysutils/policykit/files/patch-data_PolicyKit.conf.in | 11 | ||||
-rw-r--r-- | sysutils/policykit/files/patch-src_kit_kit-string.c | 27 | ||||
-rw-r--r-- | sysutils/policykit/pkg-descr | 4 | ||||
-rw-r--r-- | sysutils/policykit/pkg-install | 47 | ||||
-rw-r--r-- | sysutils/policykit/pkg-plist | 71 |
10 files changed, 338 insertions, 0 deletions
diff --git a/sysutils/policykit/Makefile b/sysutils/policykit/Makefile new file mode 100644 index 000000000..b37a85d4a --- /dev/null +++ b/sysutils/policykit/Makefile @@ -0,0 +1,56 @@ +# New ports collection makefile for: PolicyKit +# Date Created: 01 May 2006 +# Whom: Joe Marcus Clarke <marcus@FreeBSD.org> +# +# $FreeBSD$ +# $MCom$ +# + +PORTNAME= policykit +PORTVERSION= 0.9 +PORTREVISION= 2 +CATEGORIES= sysutils gnome +MASTER_SITES= http://hal.freedesktop.org/releases/ +DISTNAME= PolicyKit-${PORTVERSION} + +MAINTAINER= gnome@FreeBSD.org +COMMENT= Framework for controlling access to system-wide components + +BUILD_DEPENDS= ${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 + +USE_GNOME= gnomehack gnometarget glib20 intlhack +USE_GMAKE= yes +GNU_CONFIGURE= yes +USE_LDCONFIG= yes +CONFIGURE_ARGS= --disable-gtk-doc \ + --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" + +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 + +.include <bsd.port.mk> diff --git a/sysutils/policykit/distinfo b/sysutils/policykit/distinfo new file mode 100644 index 000000000..52bb1a259 --- /dev/null +++ b/sysutils/policykit/distinfo @@ -0,0 +1,3 @@ +MD5 (PolicyKit-0.9.tar.gz) = 802fd13ae41f73d79359e5ecb0a98716 +SHA256 (PolicyKit-0.9.tar.gz) = f40c7c6bec19d7dba2335bddcffd0457494409a0dfce11d888c748dc892e80b7 +SIZE (PolicyKit-0.9.tar.gz) = 1254318 diff --git a/sysutils/policykit/files/patch-Makefile.in b/sysutils/policykit/files/patch-Makefile.in new file mode 100644 index 000000000..29a907e44 --- /dev/null +++ b/sysutils/policykit/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- 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@ + 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-consolekit03 b/sysutils/policykit/files/patch-consolekit03 new file mode 100644 index 000000000..21ce5e7b8 --- /dev/null +++ b/sysutils/policykit/files/patch-consolekit03 @@ -0,0 +1,83 @@ +diff --git a/src/polkit-dbus/polkit-dbus.c b/src/polkit-dbus/polkit-dbus.c +index f7be03f..cad4a76 100644 +--- a/src/polkit-dbus/polkit-dbus.c ++++ src/polkit-dbus/polkit-dbus.c +@@ -214,11 +214,17 @@ polkit_session_new_from_objpath (DBusConnection *con, const char *objpath, uid_t + dbus_message_unref (reply); + goto out; + } ++ /* GetUnixUser API Changed in CK 0.3.0 */ + if (!dbus_message_get_args (reply, NULL, +- DBUS_TYPE_INT32, &uid, ++ DBUS_TYPE_UINT32, &uid, + DBUS_TYPE_INVALID)) { +- kit_warning ("Invalid GetUnixUser reply from CK"); +- goto out; ++ /* try the older API */ ++ if (!dbus_message_get_args (reply, NULL, ++ DBUS_TYPE_INT32, &uid, ++ DBUS_TYPE_INVALID)) { ++ kit_warning ("Invalid GetUnixUser reply from CK"); ++ goto out; ++ } + } + dbus_message_unref (message); + dbus_message_unref (reply); +@@ -1326,16 +1332,21 @@ polkit_tracker_dbus_func (PolKitTracker *pk_tracker, DBusMessage *message) + + dbus_error_init (&error); + seat_objpath = dbus_message_get_path (message); +- if (!dbus_message_get_args (message, &error, +- DBUS_TYPE_STRING, &session_objpath, ++ /* API fixed in CK 0.3 to match spec */ ++ if (!dbus_message_get_args (message, &error, ++ DBUS_TYPE_OBJECT_PATH, &session_objpath, + DBUS_TYPE_INVALID)) { ++ if (!dbus_message_get_args (message, &error, ++ DBUS_TYPE_STRING, &session_objpath, ++ DBUS_TYPE_INVALID)) { + +- /* TODO: should be _pk_critical */ +- kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat " +- "interface for object %s has the wrong signature! " +- "Your system is misconfigured.", seat_objpath); ++ /* TODO: should be _pk_critical */ ++ kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat " ++ "interface for object %s has the wrong signature! " ++ "Your system is misconfigured.", seat_objpath); + +- goto out; ++ goto out; ++ } + } + + /* TODO: add to sessions - see polkit_tracker_is_authorization_relevant() */ +@@ -1353,16 +1364,21 @@ polkit_tracker_dbus_func (PolKitTracker *pk_tracker, DBusMessage *message) + + dbus_error_init (&error); + seat_objpath = dbus_message_get_path (message); +- if (!dbus_message_get_args (message, &error, +- DBUS_TYPE_STRING, &session_objpath, ++ /* API fixed in CK 0.3 to match spec */ ++ if (!dbus_message_get_args (message, &error, ++ DBUS_TYPE_OBJECT_PATH, &session_objpath, + DBUS_TYPE_INVALID)) { ++ if (!dbus_message_get_args (message, &error, ++ DBUS_TYPE_STRING, &session_objpath, ++ DBUS_TYPE_INVALID)) { + +- /* TODO: should be _pk_critical */ +- kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat " +- "interface for object %s has the wrong signature! " +- "Your system is misconfigured.", seat_objpath); ++ /* TODO: should be _pk_critical */ ++ kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat " ++ "interface for object %s has the wrong signature! " ++ "Your system is misconfigured.", seat_objpath); + +- goto out; ++ goto out; ++ } + } + + _remove_caller_by_session (pk_tracker, session_objpath); diff --git a/sysutils/policykit/files/patch-data_Makefile.in b/sysutils/policykit/files/patch-data_Makefile.in new file mode 100644 index 000000000..f32ab19c0 --- /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-data_PolicyKit.conf.in b/sysutils/policykit/files/patch-data_PolicyKit.conf.in new file mode 100644 index 000000000..8f0410475 --- /dev/null +++ b/sysutils/policykit/files/patch-data_PolicyKit.conf.in @@ -0,0 +1,11 @@ +--- data/PolicyKit.conf.in.orig 2008-03-29 12:05:27.000000000 -0400 ++++ data/PolicyKit.conf.in 2008-03-29 12:06:48.000000000 -0400 +@@ -6,4 +6,8 @@ + <!-- See the manual page PolicyKit.conf(5) for file format --> + + <config version="0.1"> ++ <match user="root"> ++ <return result="yes"/> ++ </match> ++ <define_admin_auth group="wheel"/> + </config> 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 000000000..eff7cb997 --- /dev/null +++ b/sysutils/policykit/files/patch-src_kit_kit-string.c @@ -0,0 +1,27 @@ +--- src/kit/kit-string.c.orig 2008-05-30 17:24:44.000000000 -0400 ++++ src/kit/kit-string.c 2008-07-24 01:21:34.000000000 -0400 +@@ -123,13 +123,18 @@ static char + if ( !s ) + return NULL; + +- if ( strlen(s) > n ) +- nAvail = n + 1; +- else +- nAvail = strlen(s) + 1; +- p = malloc ( nAvail ); ++ if (memchr(s, '\0', n) != NULL) { ++ nAvail = strlen(s); ++ if ( nAvail > n ) ++ nAvail = n; ++ } else { ++ nAvail = n; ++ } ++ p = malloc ( nAvail + 1 ); ++ if (p == NULL) ++ return NULL; + memcpy ( p, s, nAvail ); +- p[nAvail - 1] = '\0'; ++ p[nAvail] = '\0'; + + return p; + } diff --git a/sysutils/policykit/pkg-descr b/sysutils/policykit/pkg-descr new file mode 100644 index 000000000..9746a6470 --- /dev/null +++ b/sysutils/policykit/pkg-descr @@ -0,0 +1,4 @@ +PolicyKit is a framework for defining policy for system-wide components and +for desktop pieces to configure it. It is used by HAL. + +WWW: http://www.freedesktop.org/wiki/Software/PolicyKit diff --git a/sysutils/policykit/pkg-install b/sysutils/policykit/pkg-install new file mode 100644 index 000000000..3d49ff206 --- /dev/null +++ b/sysutils/policykit/pkg-install @@ -0,0 +1,47 @@ +#!/bin/sh + +case $2 in +POST-INSTALL) + USER=polkit + GROUP=${USER} + UID=562 + GID=${UID} + PW=/usr/sbin/pw + + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/nonexistent" -s /sbin/nologin -c "PolicyKit Daemon User" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + + /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 new file mode 100644 index 000000000..bdce11067 --- /dev/null +++ b/sysutils/policykit/pkg-plist @@ -0,0 +1,71 @@ +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 ; fi +etc/PolicyKit/PolicyKit.conf.dist +@exec [ -f %B/PolicyKit.conf ] || cp %B/%f %B/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.2 +libdata/pkgconfig/polkit-dbus.pc +libdata/pkgconfig/polkit-grant.pc +libdata/pkgconfig/polkit.pc +libexec/polkit-explicit-grant-helper +libexec/polkit-grant-helper +libexec/polkit-grant-helper-pam +libexec/polkit-read-auth-helper +libexec/polkit-resolve-exe-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 -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 |