* Balbir Singh <[email protected]> [2009-10-22 20:55:44]: > * Jan Safranek <[email protected]> [2009-10-22 17:05:13]: > > > On 10/22/2009 04:49 PM, Balbir Singh wrote: > > >* Jan Safranek<[email protected]> [2009-10-22 15:17:57]: > > > > > >>Hi, > > >> > > >>as I promised to Balbir, here is patch which puts PAM module to standalone > > >>subpackage. And while fixing this, I've also tuned the spec file a bit. > > >> > > > > > >Jan, > > > > > >I am just beginning to test the patches, I realized since we split > > >the pam library, we also need the patch below otherwise, I see > > >that we end up linking with libpam, which we really don't need. > > > > I am not sure I understand the patch... Subpackages work in a way > > that the sources are compiled *once* and various files are > > distributed to different subpackages - i.e. to have pam_cgroup.so in > > libcgroup-pam, you must compile *whole* package with --enable-pam > > (and pam-devel and /usr/include/security/pam_modules.h). And all > > packages resulting from one source package should have the same > > License: field. > > > > If you want to compile libcgroup once without pam to get > > libcgroup.rpm and for second time with pam to get libcgroup-pam, you > > need two separate source packages. Or very ugly hacks in the .spec > > files. > > > > If License: is the problem here, you can have two licenses here, one > > for the libcgroup library and second for the pam module. > >
How does the patch below look? Fix linking of libcgroup and libpam. From: Balbir Singh <[email protected]> This new approach, splits out the configure into two directories. One under the source and the other under src/pam. We also need to hardcode top src dir to ../.. (sigh!). Signed-off-by: Balbir Singh <[email protected]> --- configure.in | 30 ++---------------------------- src/pam/Makefile.am | 4 ++-- src/pam/configure.in | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 src/pam/configure.in diff --git a/configure.in b/configure.in index 8e2a40a..4ac27c7 100644 --- a/configure.in +++ b/configure.in @@ -50,19 +50,6 @@ AC_ARG_ENABLE([tools], [with_tools=true]) AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue]) -AC_ARG_ENABLE([pam], - [AC_HELP_STRING([--enable-pam], - [compile libcgroup PAM module [default=yes]])], - [ - if test "x$enableval" = xno; then - with_pam=false - else - with_pam=true - fi - ], - [with_pam=true]) -AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue]) - AC_ARG_ENABLE([daemon], [AC_HELP_STRING([--enable-daemon], [compile libcgroup daemon [default=yes]])], @@ -127,26 +114,13 @@ AC_FUNC_REALLOC AC_FUNC_STAT AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) -if test x$with_pam = xtrue; then - AC_CHECK_LIB( - [pam], - [pam_syslog], - [], - [AC_MSG_ERROR([Cannot compile PAM module without libpam!])]) - - AC_CHECK_HEADERS( - [security/pam_modules.h security/pam_modutil.h security/pam_ext.h], - [], - [AC_MSG_ERROR([Cannot compile PAM module without necessary - header files!])]) -fi - +configdirs="src/pam" +AC_CONFIG_SUBDIRS([src/pam]) AC_CONFIG_FILES([Makefile tests/Makefile src/Makefile src/daemon/Makefile src/tools/Makefile - src/pam/Makefile scripts/Makefile scripts/init.d/cgconfig scripts/init.d/cgred diff --git a/src/pam/Makefile.am b/src/pam/Makefile.am index 2ad565e..924bc9d 100644 --- a/src/pam/Makefile.am +++ b/src/pam/Makefile.am @@ -1,10 +1,10 @@ -INCLUDES = -I $(top_srcdir)/include +INCLUDES = -I ../../include if WITH_PAM lib_LTLIBRARIES = pam_cgroup.la pam_cgroup_la_SOURCES = pam_cgroup.c pam_cgroup_la_LDFLAGS = -module -pam_cgroup_la_LIBADD = $(top_srcdir)/src/.libs/libcgroup.la -lpam +pam_cgroup_la_LIBADD = ../../src/.libs/libcgroup.la -lpam endif diff --git a/src/pam/configure.in b/src/pam/configure.in new file mode 100644 index 0000000..dcd586e --- /dev/null +++ b/src/pam/configure.in @@ -0,0 +1,38 @@ +AC_PREREQ(2.61) + +# In following section update all occurences of version, including soname +AC_INIT([libcgroup-pam], 0.34, + [http://sourceforge.net/tracker/?group_id=218421&atid=1043649]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AC_PROG_CC +AC_PROG_LIBTOOL +AC_DISABLE_STATIC +AC_ARG_ENABLE([pam], + [AC_HELP_STRING([--enable-pam], + [compile libcgroup PAM module [default=yes]])], + [ + if test "x$enableval" = xno; then + with_pam=false + else + with_pam=true + fi + ], + [with_pam=true]) +AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue]) + +if test x$with_pam = xtrue; then + AC_CHECK_LIB( + [pam], + [pam_syslog], + [], + [AC_MSG_ERROR([Cannot compile PAM module without libpam!])]) + + AC_CHECK_HEADERS( + [security/pam_modules.h security/pam_modutil.h security/pam_ext.h], + [], + [AC_MSG_ERROR([Cannot compile PAM module without necessary + header files!])]) +fi + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT -- Balbir ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
