Skip to contentSkip to conversation

new package: consolekit

PATCH New Stefan Fröberg 2 participants 3 messages Feb 21, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 new package: consolekit

ConsoleKit

ConsoleKit is a framework for defining and tracking users, login sessions, and seats.

---

Most of the stuff here are from Gentoo ebuild file
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-auth/consolekit/
consolekit-0.4.5_p20120320-r1.ebuild

 package/Config.in                                  |    1 +
 package/consolekit/90-consolekit                   |   32 +++++++++
 package/consolekit/Config.in                       |   14 ++++
 package/consolekit/S35consolekit                   |   26 +++++++
 .../consolekit-cleanup_console_tags.patch          |   72 ++++++++++++++++++++
 .../consolekit/consolekit-polkit-automagic.patch   |   35 ++++++++++
 ...nsolekit-shutdown-reboot-without-policies.patch |   31 +++++++++
 package/consolekit/consolekit.mk                   |   40 +++++++++++
 package/consolekit/pam-foreground-compat.ck        |   18 +++++
 package/consolekit/system-session                  |    6 ++
 10 files changed, 275 insertions(+), 0 deletions(-)
 create mode 100644 package/consolekit/90-consolekit
 create mode 100644 package/consolekit/Config.in
 create mode 100755 package/consolekit/S35consolekit
 create mode 100644 package/consolekit/consolekit-cleanup_console_tags.patch
 create mode 100644 package/consolekit/consolekit-polkit-automagic.patch
 create mode 100644 package/consolekit/consolekit-shutdown-reboot-without-policies.patch
 create mode 100644 package/consolekit/consolekit.mk
 create mode 100755 package/consolekit/pam-foreground-compat.ck
 create mode 100644 package/consolekit/system-session
package/Config.in +1 -0
index 8588951..0db321c 100644
@@ -777,6 +777,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/bootutils/Config.in"
 endif
 source "package/bwm-ng/Config.in"
+source "package/consolekit/Config.in"
 source "package/cpuload/Config.in"
 source "package/htop/Config.in"
 source "package/keyutils/Config.in"
package/consolekit/90-consolekit new file +32 -0
new file mode 100644
index 0000000..358fc24
@@ -0,0 +1,32 @@
+# -*- sh -*-
+# Xsession.d script for ck-launch-session.
+#
+#
+# This file is sourced by Xsession(5), not executed.
+
+CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
+
+is_on_console() {
+	session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+		--type=method_call --print-reply --reply-timeout=2000 \
+		/org/freedesktop/ConsoleKit/Manager \
+		org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
+		| grep path | awk '{print $3}' | sed s/\"//g)
+	x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+		--type=method_call --print-reply --reply-timeout=2000 \
+		$session org.freedesktop.ConsoleKit.Session.GetX11Display \
+		| grep string | awk '{print $2}' | sed s/\"//g)
+
+	if [ -z "$x11_display" ] ; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+# gdm already creates a CK session for us, so do not run the expensive D-Bus
+# calls if we have $GDMSESSION
+if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
+ ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
+    command="$CK_LAUNCH_SESSION $command"
+fi
package/consolekit/Config.in new file +14 -0
new file mode 100644
index 0000000..905dada
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_CONSOLEKIT
+	bool "consolekit"
+	select BR2_PACKAGE_DBUS_GLIB
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_LIBXSLT
+	select BR2_PACKAGE_LINUX_PAM
+	select BR2_PACKAGE_POLKIT
+	select BR2_PACKAGE_ZLIB
+	help
+	  ConsoleKit is a framework for defining and tracking users, 
+	  login sessions, and seats.
+
+	  http://www.freedesktop.org/wiki/software/ConsoleKit
package/consolekit/S35consolekit new file +26 -0
new file mode 100755
index 0000000..000f719
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Start the ConsoleKit....
+#
+
+case "$1" in
+  start)
+ 	echo "Starting ConsoleKit daemon..."
+	start-stop-daemon --start --pidfile /var/run/ConsoleKit/pid \
+			  --exec /usr/sbin/console-kit-daemon --
+	;;
+  stop)
+	echo -n "Stopping ConsoleKit daemon..."
+	start-stop-daemon --stop --pidfile /var/run/ConsoleKit/pid
+	;;
+  restart|reload)
+	"$0" stop
+	"$0" start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
+
package/consolekit/consolekit-cleanup_console_tags.patch new file +72 -0

72 lines not on this page · raw message

package/consolekit/consolekit-polkit-automagic.patch new file +35 -0
new file mode 100644
index 0000000..4100acd
@@ -0,0 +1,35 @@
+http://bugs.freedesktop.org/show_bug.cgi?id?47587
+
+Upstream-Status:	Pending
+URL:			http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86
+			/sys-auth/consolekit/files/
+			consolekit-0.4.5-polit-automagic.patch
+
+--- ConsoleKit-0.4.5.org/configure.ac	2013-02-21 17:05:13.991352412 +0200
++++ ConsoleKit-0.4.5/configure.ac	2013-02-21 17:19:00.431388684 +0200
+@@ -55,10 +55,21 @@
+   gthread-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+ 
+-PKG_CHECK_MODULES(POLKIT,
+-  polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+-  have_polkit=yes,
+-  have_polkit=no)
++AC_ARG_ENABLE([polkit],
++  AC_HELP_STRING([--enable-polkit], [Enable PolicyKit support (default auto)]),
++  enable_polkit=$enableval,
++  enable_polkit=auto)
++
++if test "x$enable_polkit" != "xno"; then
++  PKG_CHECK_MODULES(POLKIT,
++    polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
++    have_polkit=yes,
++    have_polkit=no)
++  if test "x$enable_polkit"  = "xyes" -a "x$have_polkit" = "xno"; then
++    AC_MSG_ERROR([PolicyKit support explicitly requested but dependencies not found])
++  fi
++fi
++
+ if test "x$have_polkit" = "xyes" ; then
+        AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
+ fi
package/consolekit/consolekit-shutdown-reboot-without-policies.patch new file +31 -0
new file mode 100644
index 0000000..1d9bd8a
@@ -0,0 +1,31 @@
+From: Romain Perier <[email protected]>
+Date: Sat, 24 Oct 2009 18:43:43 +0200
+Subject: [PATCH] Be able to shutdown or reboot even without polkit or RBAC
+supports
+
+Ck does NOTHING at the origin if its built without polkit or RBAC supports, 
+except display a warning using g_warning() (which does not make sense).
+The trick is to to call do_stop()/do_restart() in the #else directive :)
+
+Upstream-Status:	Pending
+URL:			http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86
+			/sys-auth/consolekit-shutdown-reboot-without-policies.patch
+
+--- ConsoleKit-0.4.5.org/src/ck-manager.c	2013-02-21 17:05:13.999353431 +0200
++++ ConsoleKit-0.4.5/src/ck-manager.c	2013-02-21 17:09:08.290130585 +0200
+@@ -1131,6 +1131,7 @@
+         check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_restart);
+ #else
+         g_warning ("Compiled without PolicyKit or RBAC support!");
++        do_restart(manager, context);
+ #endif
+ 
+         return TRUE;
+@@ -1207,6 +1208,7 @@
+         check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_stop);
+ #else
+         g_warning ("Compiled without PolicyKit or RBAC support!");
++        do_stop(manager, context);
+ #endif
+ 
+         return TRUE;
package/consolekit/consolekit.mk new file +40 -0
new file mode 100644
index 0000000..25b552c
@@ -0,0 +1,40 @@
+#############################################################
+#
+# ConsoleKit
+#
+#############################################################
+
+CONSOLEKIT_VERSION = 0.4.5
+CONSOLEKIT_SOURCE = ConsoleKit-$(CONSOLEKIT_VERSION).tar.bz2
+CONSOLEKIT_SITE = http://www.freedesktop.org/software/ConsoleKit/dist
+CONSOLEKIT_DEPENDENCIES = dbus-glib libglib2 linux-pam polkit xlib_libX11 \
+			  libxslt zlib
+CONSOLEKIT_INSTALL_STAGING = YES
+CONSOLEKIT_AUTORECONF = YES
+CONSOLEKIT_CONF_OPT += --disable-static --localstatedir=/var \
+			--libexecdir=/usr/lib/ConsoleKit \
+			--enable-pam-module --disable-udev-acl \
+			--with-dbus-services=/usr/share/dbus-1/services \
+			--with-pam-module-dir=/lib/security
+
+define	CONSOLEKIT_POST_INSTALL
+	# Append ConsoleKit Pam Module Configuration stuff to system-session
+	cat package/consolekit/system-session >> \
+	$(TARGET_DIR)/etc/pam.d/system-session
+	
+	# Helper script that creates a file in /var/run/console named as 
+	# the currently logged in user and that contains the D-Bus address of 
+	# the session
+	$(INSTALL) -m 755 -D package/consolekit/pam-foreground-compat.ck \
+	$(TARGET_DIR)/usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck
+
+
+	$(INSTALL) -D package/consolekit/90-consolekit $(TARGET_DIR)/etc/X11/xinit/xinitrc.d/90-consolekit
+
+	# We start right after dbus which is included as /etc/init.d/S30dbus in buildroot
+	$(INSTALL) -m 755 -D package/consolekit/S35consolekit $(TARGET_DIR)/etc/init.d/S35consolekit
+endef
+
+CONSOLEKIT_POST_INSTALL_TARGET_HOOKS += CONSOLEKIT_POST_INSTALL 
+
+$(eval $(autotools-package))
package/consolekit/pam-foreground-compat.ck new file +18 -0
new file mode 100755
index 0000000..9688e87
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+TAGDIR=/var/run/console
+
+[ -n "$CK_SESSION_USER_UID" ] || exit 1
+
+
+TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`"
+
+if [ "$1" = "session_added" ]; then
+	mkdir -p "$TAGDIR"
+	echo "$CK_SESSION_ID" >> "$TAGFILE"
+fi
+
+if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then
+	sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE"
+	[ -s "$TAGFILE" ] || rm -f "$TAGFILE"
+fi
package/consolekit/system-session new file +6 -0
new file mode 100644
index 0000000..3825efe
@@ -0,0 +1,6 @@
+# Begin ConsoleKit addition
+
+session   optional    pam_loginuid.so
+session   optional    pam_ck_connector.so nox11
+
+# End ConsoleKit addition
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 new package: consolekit

Stefan, All,

Quoted 1 line · On Thursday 21 February 2013 Stefan Fr?berg wrote:

ConsoleKit

^^^
Useless line.

Quoted 4 lines

ConsoleKit is a framework for defining and tracking users, login sessions, and seats.

[--SNIP--]

package/consolekit/90-consolekit

Quoted 5 lines
package/consolekit/90-consolekit new file +0 -0
new file mode 100644
index 0000000..358fc24

Did you author that file? If not, they please point to where you got it from. If yes, say so. (In a comment in the file.)

[--SNIP--]

package/consolekit/Config.in line 4

Quoted 10 lines
package/consolekit/Config.in new file +4 -0
new file mode 100644
index 0000000..905dada
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_CONSOLEKIT
+	bool "consolekit"
+	select BR2_PACKAGE_DBUS_GLIB
+	select BR2_PACKAGE_LIBGLIB2

You need to propagate the dbus-glib dependencies here:
depends on BR2_TOOLCHAIN_HAS_THREADS # dbus depends on BR2_USE_MMU # dbus
select BR2_PACKAGE_DBUS_GLIB
depends on BR2_USE_WCHAR # glib2

I am not sure we want to do all of that. Maybe just add instead:
depend on BR2_PACKAGE_DBUS_GLIB

Peter, your opinion?

package/consolekit/Config.in line 5

Quoted 1 line
package/consolekit/Config.in new file +1 -0
+	select BR2_PACKAGE_XLIB_LIBX11

And the xlib_libX11 dependencies too:
depends on BR2_PACKAGE_XORG7 # xlib_libX11

Note: for other patckages, we'd add a 'select BR2_PACKAGE_XORG7', but as xorg is xonsidered a /huge/ package, we usualy use 'depends on' it.

package/consolekit/Config.in line 7

Quoted 2 lines
package/consolekit/Config.in new file +2 -0
+	select BR2_PACKAGE_LIBXSLT
+	select BR2_PACKAGE_LINUX_PAM

And dependencies of linux-pam:

    depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam

package/consolekit/Config.in line 8

Quoted 1 line
package/consolekit/Config.in new file +1 -0
+	select BR2_PACKAGE_POLKIT

And add dependencies for polkit:
depends on BR2_USE_WCHAR # libglib2

[--SNIP--]

package/consolekit/S35consolekit

Quoted 5 lines
package/consolekit/S35consolekit new file +0 -0
new file mode 100755
index 0000000..000f719

Ditto: origin of this file?

Quoted 16 lines
package/consolekit/S35consolekit new file +15 -0
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Start the ConsoleKit....
+#
+
+case "$1" in
+  start)
+ 	echo "Starting ConsoleKit daemon..."
+	start-stop-daemon --start --pidfile /var/run/ConsoleKit/pid \
+			  --exec /usr/sbin/console-kit-daemon --
+	;;
+  stop)
+	echo -n "Stopping ConsoleKit daemon..."
+	start-stop-daemon --stop --pidfile /var/run/ConsoleKit/pid
+	;;

package/consolekit/S35consolekit line 25

Quoted 10 lines
package/consolekit/S35consolekit new file +10 -0
+  restart|reload)
+	"$0" stop
+	"$0" start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?

Hu? Unneeded, the shell will always exit with the last command's error-code.

(Well, we have S40network that does that, but it's useless).

package/consolekit/consolekit-cleanup_console_tags.patch

Quoted 5 lines
package/consolekit/consolekit-cleanup_console_tags.patch new file +0 -0
new file mode 100644
index 0000000..27e9cc3

[--SNIP--]

For your patches, can't you use:

    CONSOLEKIT_PATCHES = URL-of-patch-1 \
                         URL-of-patch-2 \
                         URL-of-patch-3
Quoted 7 lines
package/consolekit/consolekit.mk new file +1 -0
new file mode 100644
index 0000000..25b552c
@@ -0,0 +1,40 @@
+#############################################################

package/consolekit/consolekit.mk line 11

Quoted 10 lines
package/consolekit/consolekit.mk new file +10 -0
+#
+# ConsoleKit
+#
+#############################################################
+
+CONSOLEKIT_VERSION = 0.4.5
+CONSOLEKIT_SOURCE = ConsoleKit-$(CONSOLEKIT_VERSION).tar.bz2
+CONSOLEKIT_SITE = http://www.freedesktop.org/software/ConsoleKit/dist
+CONSOLEKIT_DEPENDENCIES = dbus-glib libglib2 linux-pam polkit xlib_libX11 \
+			  libxslt zlib

License ?

package/consolekit/consolekit.mk line 20

Quoted 9 lines
package/consolekit/consolekit.mk new file +9 -0
+CONSOLEKIT_INSTALL_STAGING = YES
+CONSOLEKIT_AUTORECONF = YES
+CONSOLEKIT_CONF_OPT += --disable-static --localstatedir=/var \
+			--libexecdir=/usr/lib/ConsoleKit \
+			--enable-pam-module --disable-udev-acl \
+			--with-dbus-services=/usr/share/dbus-1/services \
+			--with-pam-module-dir=/lib/security
+
+define	CONSOLEKIT_POST_INSTALL

Space-damage: use a single space between 'define' and the variable name, not a tab.

package/consolekit/consolekit.mk line 23

Quoted 3 lines
package/consolekit/consolekit.mk new file +3 -0
+	# Append ConsoleKit Pam Module Configuration stuff to system-session
+	cat package/consolekit/system-session >> \
+	$(TARGET_DIR)/etc/pam.d/system-session

Indent with a secondleading tab on continuation lines, please.

package/consolekit/consolekit.mk line 24

Quoted 1 line
package/consolekit/consolekit.mk new file +1 -0
+	

^^^
No leading-tab on blank lines.

package/consolekit/consolekit.mk line 29

Quoted 5 lines
package/consolekit/consolekit.mk new file +5 -0
+	# Helper script that creates a file in /var/run/console named as 
+	# the currently logged in user and that contains the D-Bus address of 
+	# the session
+	$(INSTALL) -m 755 -D package/consolekit/pam-foreground-compat.ck \
+	$(TARGET_DIR)/usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck

Ditto: further indent continuation lines.

package/consolekit/consolekit.mk line 31

Quoted 2 lines
package/consolekit/consolekit.mk new file +2 -0
+
+

One single separator line, please.

package/consolekit/consolekit.mk line 35

Quoted 4 lines
package/consolekit/consolekit.mk new file +4 -0
+	$(INSTALL) -D package/consolekit/90-consolekit $(TARGET_DIR)/etc/X11/xinit/xinitrc.d/90-consolekit
+
+	# We start right after dbus which is included as /etc/init.d/S30dbus in buildroot
+	$(INSTALL) -m 755 -D package/consolekit/S35consolekit $(TARGET_DIR)/etc/init.d/S35consolekit

We have infrastructure to add startup scripts:
http://buildroot.net/downloads/manual/manual.html#generic-package-reference

Excerpt:
LIBFOO_INSTALL_INIT_SYSV and LIBFOO_INSTALL_INIT_SYSTEMD list the actions to install init scripts either for the systemV-like init systems (busybox, sysvinit, etc.) or for the systemd units.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 new package: consolekit

21.2.2013 23:21, Yann E. MORIN kirjoitti:

Quoted 6 lines

Stefan, All,

Quoted 1 line · On Thursday 21 February 2013 Stefan Fr?berg wrote:

ConsoleKit

^^^
Useless line.

Ok

Quoted 4 lines
Quoted 4 lines

ConsoleKit is a framework for defining and tracking users, login sessions, and seats.

Quoted 8 lines

[--SNIP--]

package/consolekit/90-consolekit

Quoted 5 lines
package/consolekit/90-consolekit new file +0 -0
new file mode 100644
index 0000000..358fc24

Did you author that file? If not, they please point to where you got it from. If yes, say so. (In a comment in the file.)

Ok

Quoted 20 lines

[--SNIP--]

package/consolekit/Config.in line 4

Quoted 10 lines
package/consolekit/Config.in new file +4 -0
new file mode 100644
index 0000000..905dada
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_CONSOLEKIT
+	bool "consolekit"
+	select BR2_PACKAGE_DBUS_GLIB
+	select BR2_PACKAGE_LIBGLIB2

You need to propagate the dbus-glib dependencies here:
depends on BR2_TOOLCHAIN_HAS_THREADS # dbus depends on BR2_USE_MMU # dbus
select BR2_PACKAGE_DBUS_GLIB
depends on BR2_USE_WCHAR # glib2

I am not sure we want to do all of that. Maybe just add instead:
depend on BR2_PACKAGE_DBUS_GLIB

Quoted 8 lines

Peter, your opinion?

package/consolekit/Config.in line 5

Quoted 1 line
package/consolekit/Config.in new file +1 -0
+	select BR2_PACKAGE_XLIB_LIBX11

And the xlib_libX11 dependencies too:
depends on BR2_PACKAGE_XORG7 # xlib_libX11

Note: for other patckages, we'd add a 'select BR2_PACKAGE_XORG7', but as xorg is xonsidered a /huge/ package, we usualy use 'depends on' it.

So depend BR2_PACKAGE_DBUS_GLIB and depend BR2_PACKAGE_XORG7 ? Ok

Quoted 8 lines

package/consolekit/Config.in line 7

Quoted 2 lines
package/consolekit/Config.in new file +2 -0
+	select BR2_PACKAGE_LIBXSLT
+	select BR2_PACKAGE_LINUX_PAM

And dependencies of linux-pam:

    depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam

package/consolekit/Config.in line 8

Quoted 1 line
package/consolekit/Config.in new file +1 -0
+	select BR2_PACKAGE_POLKIT

And add dependencies for polkit:
depends on BR2_USE_WCHAR # libglib2

Ok

Quoted 7 lines

[--SNIP--]

package/consolekit/S35consolekit

Quoted 5 lines
package/consolekit/S35consolekit new file +0 -0
new file mode 100755
index 0000000..000f719

Ditto: origin of this file?

Used buildroot S40network as template.

Quoted 38 lines
Quoted 16 lines
package/consolekit/S35consolekit new file +15 -0
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Start the ConsoleKit....
+#
+
+case "$1" in
+  start)
+ 	echo "Starting ConsoleKit daemon..."
+	start-stop-daemon --start --pidfile /var/run/ConsoleKit/pid \
+			  --exec /usr/sbin/console-kit-daemon --
+	;;
+  stop)
+	echo -n "Stopping ConsoleKit daemon..."
+	start-stop-daemon --stop --pidfile /var/run/ConsoleKit/pid
+	;;

package/consolekit/S35consolekit line 25

Quoted 10 lines
package/consolekit/S35consolekit new file +10 -0
+  restart|reload)
+	"$0" stop
+	"$0" start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?

Hu? Unneeded, the shell will always exit with the last command's error-code.

(Well, we have S40network that does that, but it's useless).

package/consolekit/consolekit-cleanup_console_tags.patch

Quoted 5 lines
package/consolekit/consolekit-cleanup_console_tags.patch new file +0 -0
new file mode 100644
index 0000000..27e9cc3

[--SNIP--]

Quoted 4 lines

For your patches, can't you use:

    CONSOLEKIT_PATCHES = URL-of-patch-1 \
                         URL-of-patch-2 \
                         URL-of-patch-3

Nope, because those gentoo folks mix and match their patch level. Sometimes they use -p1 but often also -p0 (which those patches originally were if I remember)
And because buildroot only uses patch level -p1 all the way .....

Quoted 58 lines
Quoted 7 lines
package/consolekit/consolekit.mk new file +1 -0
new file mode 100644
index 0000000..25b552c
@@ -0,0 +1,40 @@
+#############################################################

package/consolekit/consolekit.mk line 11

Quoted 10 lines
package/consolekit/consolekit.mk new file +10 -0
+#
+# ConsoleKit
+#
+#############################################################
+
+CONSOLEKIT_VERSION = 0.4.5
+CONSOLEKIT_SOURCE = ConsoleKit-$(CONSOLEKIT_VERSION).tar.bz2
+CONSOLEKIT_SITE = http://www.freedesktop.org/software/ConsoleKit/dist
+CONSOLEKIT_DEPENDENCIES = dbus-glib libglib2 linux-pam polkit xlib_libX11 \
+			  libxslt zlib

License ?

package/consolekit/consolekit.mk line 20

Quoted 9 lines
package/consolekit/consolekit.mk new file +9 -0
+CONSOLEKIT_INSTALL_STAGING = YES
+CONSOLEKIT_AUTORECONF = YES
+CONSOLEKIT_CONF_OPT += --disable-static --localstatedir=/var \
+			--libexecdir=/usr/lib/ConsoleKit \
+			--enable-pam-module --disable-udev-acl \
+			--with-dbus-services=/usr/share/dbus-1/services \
+			--with-pam-module-dir=/lib/security
+
+define	CONSOLEKIT_POST_INSTALL

Space-damage: use a single space between 'define' and the variable name, not a tab.

package/consolekit/consolekit.mk line 23

Quoted 3 lines
package/consolekit/consolekit.mk new file +3 -0
+	# Append ConsoleKit Pam Module Configuration stuff to system-session
+	cat package/consolekit/system-session >> \
+	$(TARGET_DIR)/etc/pam.d/system-session

Indent with a secondleading tab on continuation lines, please.

package/consolekit/consolekit.mk line 24

Quoted 1 line
package/consolekit/consolekit.mk new file +1 -0
+	

^^^
No leading-tab on blank lines.

package/consolekit/consolekit.mk line 29

Quoted 5 lines
package/consolekit/consolekit.mk new file +5 -0
+	# Helper script that creates a file in /var/run/console named as 
+	# the currently logged in user and that contains the D-Bus address of 
+	# the session
+	$(INSTALL) -m 755 -D package/consolekit/pam-foreground-compat.ck \
+	$(TARGET_DIR)/usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck

Ditto: further indent continuation lines.

package/consolekit/consolekit.mk line 31

Quoted 2 lines
package/consolekit/consolekit.mk new file +2 -0
+
+

One single separator line, please.

package/consolekit/consolekit.mk line 35

Quoted 4 lines
package/consolekit/consolekit.mk new file +4 -0
+	$(INSTALL) -D package/consolekit/90-consolekit $(TARGET_DIR)/etc/X11/xinit/xinitrc.d/90-consolekit
+
+	# We start right after dbus which is included as /etc/init.d/S30dbus in buildroot
+	$(INSTALL) -m 755 -D package/consolekit/S35consolekit $(TARGET_DIR)/etc/init.d/S35consolekit

We have infrastructure to add startup scripts:
http://buildroot.net/downloads/manual/manual.html#generic-package-reference

Quoted 4 lines

Excerpt:
LIBFOO_INSTALL_INIT_SYSV and LIBFOO_INSTALL_INIT_SYSTEMD list the actions to install init scripts either for the systemV-like init systems (busybox, sysvinit, etc.) or for the systemd units.

Ok

Quoted 3 lines

Regards,
Yann E. MORIN.

Thanks!

Stefan