PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Tue Apr 3 21:39:19 PDT 2007


 acinclude.m4                      |   46 --------------------------------------
 configure.in                      |   38 +++++++------------------------
 doc/man/Makefile.am               |   12 ++++++++-
 doc/man/polkit-check-caller.1.in  |    2 -
 doc/man/polkit-check-session.1.in |    2 -
 libpolkit/Makefile.am             |    2 -
 libpolkit/libpolkit.c             |    5 +---
 tools/Makefile.am                 |    2 -
 8 files changed, 25 insertions(+), 84 deletions(-)

New commits:
diff-tree 3df61e0e3fe823b1381f4744bea6ee19d7e1d055 (from 6477d09279704e98bd2d8d18f68890f5cce305ec)
Author: David Zeuthen <davidz at redhat.com>
Date:   Wed Apr 4 00:39:16 2007 -0400

    get rid of AS_AC_EXPAND and use autoconf docdir
    
    Inspired by recent patches to both HAL and ConsoleKit from Michael
    Biebl <mbiebl at gmail.com>.

diff --git a/acinclude.m4 b/acinclude.m4
index 81ee816..18fa66a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,49 +1,3 @@
-
-dnl as-ac-expand.m4 0.1.0
-dnl autostars m4 macro for expanding directories using configure's prefix
-dnl thomas at apestaart.org 
-
-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
-dnl
-dnl example
-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
-
-AC_DEFUN([AS_AC_EXPAND],
-[
-  EXP_VAR=[$1]
-  FROM_VAR=[$2]
-
-  dnl first expand prefix and exec_prefix if necessary
-  prefix_save=$prefix
-  exec_prefix_save=$exec_prefix
-
-  dnl if no prefix given, then use /usr/local, the default prefix
-  if test "x$prefix" = "xNONE"; then
-    prefix=$ac_default_prefix
-  fi
-  dnl if no exec_prefix given, then use prefix
-  if test "x$exec_prefix" = "xNONE"; then
-    exec_prefix=$prefix
-  fi
-
-  full_var="$FROM_VAR"
-  dnl loop until it doesn't change anymore
-  while true; do
-    new_full_var="`eval echo $full_var`"
-    if test "x$new_full_var"="x$full_var"; then break; fi
-    full_var=$new_full_var
-  done
-
-  dnl clean up
-  full_var=$new_full_var
-  AC_SUBST([$1], "$full_var")
-
-  dnl restore prefix and exec_prefix
-  prefix=$prefix_save
-  exec_prefix=$exec_prefix_save
-])
-
 dnl GTK_DOC_CHECK borrowed from cairo, thanks!
 
 dnl Usage:
diff --git a/configure.in b/configure.in
index 9e12a93..17cee01 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.59c)
 AC_INIT(PolicyKit, 0.3, david at fubar.dk)
 AM_INIT_AUTOMAKE(PolicyKit, 0.3)
 AM_CONFIG_HEADER(config.h)
@@ -157,24 +157,6 @@ fi
 AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
 AC_MSG_RESULT(yes)
 
-AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
-AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-AS_AC_EXPAND(DATADIR, $datadir)
-AS_AC_EXPAND(BINDIR, $bindir)
-AS_AC_EXPAND(SBINDIR, $sbindir)
-AS_AC_EXPAND(LIBDIR, $libdir)
-AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
-
-# documentation target
-AC_ARG_WITH(doc-dir,   [  --with-doc-dir=[dirname]     directory to install documentation])
-if ! test -z "$with_doc_dir"; then
-   DOCDIR=$with_doc_dir
-else
-   DOCDIR="$DATADIR/doc/PolicyKit-$VERSION"
-fi
-
-AC_SUBST(DOCDIR)
-
 if test "x$GCC" = "xyes"; then
   LDFLAGS="-Wl,--as-needed $LDFLAGS"
 fi
@@ -191,8 +173,6 @@ doc/api/libpolkit/version.xml
 doc/spec/Makefile
 doc/spec/polkit-spec.xml.in
 doc/man/Makefile
-doc/man/polkit-check-caller.1
-doc/man/polkit-check-session.1
 ])
 
 dnl ==========================================================================
@@ -201,14 +181,14 @@ echo "
                 =================
 
         prefix:                     ${prefix}
-        libdir:                     ${LIBDIR}
-        libexecdir:                 ${LIBEXECDIR}
-        bindir:                     ${BINDIR}
-        sbindir:                    ${SBINDIR}
-        datadir:                    ${DATADIR}
-        sysconfdir:                 ${SYSCONFDIR}
-        localstatedir:              ${LOCALSTATEDIR}
-        docdir:                     ${DOCDIR}
+        libdir:                     ${libdir}
+        libexecdir:                 ${libexecdir}
+        bindir:                     ${bindir}
+        sbindir:                    ${sbindir}
+        datadir:                    ${datadir}
+        sysconfdir:                 ${sysconfdir}
+        localstatedir:              ${localstatedir}
+        docdir:                     ${docdir}
 
         compiler:                   ${CC}
         cflags:                     ${CFLAGS}
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index 1786b5d..0582021 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -3,11 +3,19 @@ if MAN_PAGES_ENABLED
 
 MAN_IN_FILES = polkit-check-caller.1.in polkit-check-session.1.in
 
-man_MANS = polkit-check-caller.1 polkit-check-session.1
+man_MANS = $(MAN_IN_FILES:.in=)
 
 endif # MAN_PAGES_ENABLED
 
 EXTRA_DIST=$(man_MANS) $(MAN_IN_FILES)
 
 clean-local:
-	rm -f *~
+	rm -f *~ *.1
+
+%: %.in Makefile
+	$(edit) $< >$@
+
+edit = sed \
+	-e 's|@docdir[@]|$(docdir)|g' \
+	-e 's|@sbindir[@]|$(sbindir)|g' \
+	-e 's|@sysconfdir[@]|$(sysconfdir)|g'
diff --git a/doc/man/polkit-check-caller.1.in b/doc/man/polkit-check-caller.1.in
index 952801e..0992d9b 100644
--- a/doc/man/polkit-check-caller.1.in
+++ b/doc/man/polkit-check-caller.1.in
@@ -16,7 +16,7 @@ polkit-check-caller \- check access
 can access a given resource in a given way. For more information about
 the big picture refer to the \fIPolicyKit spec\fP which can be found
 in
-.I "/usr/share/doc/PolicyKit- at VERSION@/spec/polkit-spec.html"
+.I "@docdir@/spec/polkit-spec.html"
 depending on the distribution.
 
 .SH OPTIONS
diff --git a/doc/man/polkit-check-session.1.in b/doc/man/polkit-check-session.1.in
index 44671d3..b364104 100644
--- a/doc/man/polkit-check-session.1.in
+++ b/doc/man/polkit-check-session.1.in
@@ -16,7 +16,7 @@ polkit-check-session \- check access
 can access a given resource in a given way. For more information about
 the big picture refer to the \fIPolicyKit spec\fP which can be found
 in
-.I "/usr/share/doc/PolicyKit- at VERSION@/spec/polkit-spec.html"
+.I "@docdir@/spec/polkit-spec.html"
 depending on the distribution.
 
 .SH OPTIONS
diff --git a/libpolkit/Makefile.am b/libpolkit/Makefile.am
index dfdad79..0c013e5 100644
--- a/libpolkit/Makefile.am
+++ b/libpolkit/Makefile.am
@@ -7,7 +7,7 @@ INCLUDES = \
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
 	-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT	\
 	@GLIB_CFLAGS@ @DBUS_CFLAGS@
 
diff --git a/libpolkit/libpolkit.c b/libpolkit/libpolkit.c
index 87ac370..2a1ff3c 100644
--- a/libpolkit/libpolkit.c
+++ b/libpolkit/libpolkit.c
@@ -120,10 +120,9 @@ libpolkit_can_session_access_resource (P
  *
  * Determine if a given caller can access a given resource in a given way.
  *
- * Returns: TRUE if, and only if, the given caller can access the given interface
- * of the given resource in the given way.
+ * Returns: TRUE if, and only if, the given caller can access the
+ * given resource in the given way.
  */
-
 gboolean
 libpolkit_can_caller_access_resource (PolKitContext   *pk_context,
                                       PolKitPrivilege *privilege,
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 1bbaeeb..f4b443d 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -7,7 +7,7 @@ INCLUDES = \
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
 	-DPACKAGE_BIN_DIR=\""$(bindir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	@GLIB_CFLAGS@ \
 	@DBUS_CFLAGS@
 


More information about the hal-commit mailing list