pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/40146: security/policykit fails to build on Linux



>Number:         40146
>Category:       pkg
>Synopsis:       security/policykit fails to build on Linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 10 12:30:00 +0000 2008
>Originator:     cheusov%tut.by@localhost
>Release:        NetBSD 4.0_STABLE
>Organization:
>Environment:
System: NetBSD chen.chizhovka.net 4.0_STABLE NetBSD 4.0_STABLE (GENERIC) #1: 
Fri Nov 21 18:49:50 EET 2008 
cheusov%chen.chizhovka.net@localhost:/srv/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
http://mova.org/~cheusov/pub/pkgsrc-distbb/Linux/current/\
logs/20081201.1911/security_policykit_policykit-0.9nb3/stage_build.html

There are three problems with this package.
1) linux/inotify.h is checked but never #include'ed
2) presense of linux/inotify.h is not enough to enable inotify functions
   on Linux. glibc-2.3 (Debian/Etch) doesn't implement
   necessary functions, i.e. even if you'll #include <linux/inotify.h>
   build will fail at linking stage. AFAIK glib-2.5 or so is required
   to enable inotify support.

3) HAVE_INOTIFY define is not always checked properly in *.c files.

With the following patch this package is built fine.
Please review it and if it is ok, apply in pkgsrc and resend to upstream.

>How-To-Repeat:
Try to build policykit on glibc-2.3-based system.

>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/security/policykit/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile    26 Nov 2008 08:22:24 -0000      1.5
+++ Makefile    10 Dec 2008 12:22:27 -0000
@@ -30,9 +30,11 @@
 GNU_CONFIGURE=         YES
 USE_DIRS+=             xdg-1.4
 USE_PKGLOCALEDIR=      YES
-USE_TOOLS+=            gmake intltool msgfmt perl pkg-config
+USE_TOOLS+=            gmake intltool msgfmt perl pkg-config autoconf
 USE_LIBTOOL=           YES
 
+AUTOCONF_REQD=         2.59
+
 POLICYKIT_USER?=       polkit
 POLICYKIT_GROUP?=      polkit
 PKG_GROUPS=            ${POLICYKIT_GROUP}
@@ -47,6 +49,9 @@
 
 .include "../../mk/bsd.prefs.mk"
 
+pre-configure:
+       cd ${WRKSRC} && autoconf
+
 .if ${OPSYS} == "NetBSD" || ${OPSYS} == "DragonFly"
 post-install:
        ${INSTALL_DATA} ${FILESDIR}/PolicyKit.conf.NetBSD 
${DESTDIR}${EGDIR}/PolicyKit.conf
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/security/policykit/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo    23 Nov 2008 22:28:23 -0000      1.3
+++ distinfo    10 Dec 2008 12:22:27 -0000
@@ -13,3 +13,5 @@
 SHA1 (patch-ah) = a1ae419a77bb3c8be02706bb67476af9443af92a
 SHA1 (patch-ai) = 9ec3744b394b0f6181a8a3367f0ce93e32b7fc4f
 SHA1 (patch-aj) = 596b9eb54173e25176ba0f363e4b2c4c137dd89f
+SHA1 (patch-ak) = 0f7ff03c58b6536f2d2985569e89f01d458cddc0
+SHA1 (patch-al) = db4c9ac8d3d636d5129fa91f00cfffb7657b9f1b
Index: patches/patch-ak
===================================================================
RCS file: patches/patch-ak
diff -N patches/patch-ak
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ak    10 Dec 2008 12:22:27 -0000
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- configure.in.orig  2008-06-30 22:40:59.000000000 +0300
++++ configure.in
+@@ -528,7 +528,7 @@ case "$host_os" in
+ esac
+ 
+ have_inotify=no
+-AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
++#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")
Index: patches/patch-al
===================================================================
RCS file: patches/patch-al
diff -N patches/patch-al
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-al    10 Dec 2008 12:22:27 -0000
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- src/polkit/polkit-context.c.orig   2008-05-31 00:24:44.000000000 +0300
++++ src/polkit/polkit-context.c
+@@ -310,6 +310,7 @@ polkit_context_init (PolKitContext *pk_c
+       }
+ #else
+         if (pk_context->io_add_watch_func != NULL) {
++#ifdef HAVE_INOTIFY
+                 pk_context->inotify_fd = inotify_init ();
+                 if (pk_context->inotify_fd < 0) {
+                         polkit_debug ("failed to initialize inotify: %s", 
strerror (errno));
+@@ -358,6 +359,7 @@ polkit_context_init (PolKitContext *pk_c
+                         /* TODO: set error */
+                         goto error;
+                 }
++#endif
+         }
+ #endif
+ 
+@@ -571,7 +573,7 @@ polkit_context_io_func (PolKitContext *p
+                       polkit_debug ("failed to read kqueue event: %s", 
strerror (errno));
+               }
+       }
+-#else
++#elif HAVE_INOTIFY
+         if (fd == pk_context->inotify_fd) {
+ /* size of the event structure, not counting name */
+ #define EVENT_SIZE  (sizeof (struct inotify_event))



Home | Main Index | Thread Index | Old Index