From 795e12d8315c4f7f0d4b2abb77fb49e0417e362a Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 30 Jan 2009 11:55:46 -0500 Subject: Spec file patch Take 2: Adding support for generating RPMS for sssd. Fixing TDB autoconf macros to require version 1.1.3 and support for the tdb_repack symbol (required by LDB) Updating tdb.h to #include for proper autoconf Build system modifications to simplify RPM generation Fixing RPM build system as recommended during code review Minor tweaks to Makefile and sssd.spec Make policykit and infopipe configurable Soname and symlinks --- server/conf_macros.m4 | 37 ++++++++++++++++++++++++++++--------- server/confdb/confdb.c | 4 ++++ server/configure.ac | 4 +++- server/external/libtdb.m4 | 7 ++++--- server/nss/nsssrv_packet.c | 2 +- server/server.mk | 10 ++++++---- 6 files changed, 46 insertions(+), 18 deletions(-) (limited to 'server') diff --git a/server/conf_macros.m4 b/server/conf_macros.m4 index 33290d89..2c182cc1 100644 --- a/server/conf_macros.m4 +++ b/server/conf_macros.m4 @@ -58,16 +58,35 @@ AC_DEFUN(WITH_PIPE_PATH, AC_DEFINE_UNQUOTED(PIPE_PATH, "$pipepath", [Where to store pipe files for the SSSD interconnects]) ]) -AC_DEFUN(WITH_DBUS_SYSBUS_PATH, - [ AC_ARG_WITH([dbus-sysbus-path], - [AC_HELP_STRING([--with-dbus-sysbus-path=PATH], - [Where to store policy files for the D-BUS system bus [/etc/dbus-1/system.d]] +AC_DEFUN(WITH_POLICYKIT, + [ AC_ARG_WITH([policykit], + [AC_HELP_STRING([--with-policykit], + [Whether to include PolicyKit support [yes]] ) - ] + ], + [], + with_policykit=yes ) - sysbuspath="/etc/dbus-1/system.d" - if test x"$with_dbus_sysbus_path" != x; then - sysbuspath=$with_dbus_sysbus_path + if test x"$with_policykit" == xyes; then + AC_DEFINE(HAVE_POLICYKIT, 1, [Include PolicyKit support]) + HAVE_POLICYKIT=1 + AC_SUBST(HAVE_POLICYKIT) fi - AC_SUBST(sysbuspath) ]) + +AC_DEFUN(WITH_INFOPIPE, + [ AC_ARG_WITH([infopipe], + [AC_HELP_STRING([--with-infopipe], + [Whether to include InfoPipe support [yes]] + ) + ], + [], + with_infopipe=yes + ) + if test x"$with_infopipe" == xyes; then + AC_DEFINE(HAVE_INFOPIPE, 1, [Include InfoPipe support]) + HAVE_INFOPIPE=1 + AC_SUBST(HAVE_INFOPIPE) + fi + ]) + diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c index 72967d20..743ce277 100644 --- a/server/confdb/confdb.c +++ b/server/confdb/confdb.c @@ -515,6 +515,7 @@ static int confdb_init_db(struct confdb_ctx *cdb) if (ret != EOK) goto done; /* InfoPipe */ +#ifdef HAVE_INFOPIPE /* Set the sssd_info description */ val[0] = "InfoPipe Configuration"; ret = confdb_add_param(cdb, false, "config/services/infp", "description", val); @@ -529,8 +530,10 @@ static int confdb_init_db(struct confdb_ctx *cdb) val[0] = "infp"; ret = confdb_add_param(cdb, false, "config/services", "activeServices", val); if (ret != EOK) goto done; +#endif /* PolicyKit */ +#ifdef HAVE_POLICYKIT /* Set the sssd_pk description */ val[0] = "PolicyKit Backend Configuration"; ret = confdb_add_param(cdb, false, "config/services/spk", "description", val); @@ -545,6 +548,7 @@ static int confdb_init_db(struct confdb_ctx *cdb) val[0] = "spk"; ret = confdb_add_param(cdb, false, "config/services", "activeServices", val); if (ret != EOK) goto done; +#endif /* Domains */ val[0] = "Domains served by SSSD"; diff --git a/server/configure.ac b/server/configure.ac index 4ef3ffc9..b2f73b2e 100644 --- a/server/configure.ac +++ b/server/configure.ac @@ -34,13 +34,15 @@ AC_SUBST(SSSD_INTROSPECT_PATH) m4_include(build_macros.m4) BUILD_WITH_SHARED_BUILD_DIR +AC_LD_SONAMEFLAG m4_include(conf_macros.m4) WITH_DB_PATH WITH_PLUGIN_PATH WITH_PID_PATH WITH_PIPE_PATH -WITH_DBUS_SYSBUS_PATH +WITH_INFOPIPE +WITH_POLICYKIT m4_include(pkg.m4) m4_include(libpopt.m4) diff --git a/server/external/libtdb.m4 b/server/external/libtdb.m4 index 8c2cab70..196bc5cc 100644 --- a/server/external/libtdb.m4 +++ b/server/external/libtdb.m4 @@ -2,6 +2,7 @@ AC_SUBST(TDB_OBJ) AC_SUBST(TDB_CFLAGS) AC_SUBST(TDB_LIBS) -AC_CHECK_HEADER(tdb.h, - [AC_CHECK_LIB(tdb, tdb_open, [TDB_LIBS="-ltdb"]) ], - [PKG_CHECK_MODULES(TDB, tdb >= 1.1.0)]) +AC_CHECK_HEADERS([tdb.h], + [AC_CHECK_LIB(tdb, tdb_repack, [TDB_LIBS="-ltdb"], [AC_MSG_ERROR([TDB must support tdb_repack])]) ], + [PKG_CHECK_MODULES(TDB, tdb >= 1.1.3)] +) diff --git a/server/nss/nsssrv_packet.c b/server/nss/nsssrv_packet.c index bdf453f6..f79087d4 100644 --- a/server/nss/nsssrv_packet.c +++ b/server/nss/nsssrv_packet.c @@ -23,7 +23,7 @@ #include #include #include -#include "../talloc/talloc.h" +#include "talloc.h" #include "util/util.h" #include "nss/nsssrv.h" diff --git a/server/server.mk b/server/server.mk index c256477e..b37be9fa 100644 --- a/server/server.mk +++ b/server/server.mk @@ -65,11 +65,13 @@ sbin/sssd_info: $(INFOPIPE_OBJ) $(UTIL_OBJ) sbin/sssd_pk: $(POLKIT_OBJ) $(UTIL_OBJ) $(CC) -o sbin/sssd_pk $(POLKIT_OBJ) $(UTIL_OBJ) $(LDFLAGS) $(LIBS) -lib/libsss_proxy.$(SHLIBEXT): $(PROXY_BE_OBJ) - $(SHLD) $(SHLD_FLAGS) -o $@ $(PROXY_BE_OBJ) $(LDFLAGS) $(LIBS) +lib/$(PROXY_BE_SOBASE): $(PROXY_BE_OBJ) + $(SHLD) $(SHLD_FLAGS) $(SONAMEFLAG)$(PROXY_BE_SONAME) -o lib/$(PROXY_BE_SOLIB) $(PROXY_BE_OBJ) $(LDFLAGS) $(LIBS) + ln -fs $(PROXY_BE_SOLIB) $@ -lib/memberof.$(SHLIBEXT): $(MEMBEROF_OBJ) - $(SHLD) $(SHLD_FLAGS) -o $@ $(MEMBEROF_OBJ) $(LDFLAGS) $(LDB_LIBS) +lib/$(MEMBEROF_SOBASE): $(MEMBEROF_OBJ) + $(SHLD) $(SHLD_FLAGS) $(SONAMEFLAG)$(MEMBEROF_SONAME) -o lib/$(MEMBEROF_SOLIB) $(MEMBEROF_OBJ) $(LDFLAGS) $(LDB_LIBS) + ln -fs $(MEMBEROF_SOLIB) $@ #Tests tests/sysdb-tests: $(SYSDB_TEST_OBJ) $(UTIL_OBJ) -- cgit