From ffeb280566d90fce742af31467f6ee29912bf935 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 30 May 2012 16:10:11 +0200 Subject: build-sys: convert login-utils/ to module Signed-off-by: Karel Zak --- Makefile.am | 3 +- configure.ac | 1 - login-utils/Makefile.am | 133 ----------------------------------------- login-utils/Makemodule.am | 146 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 148 insertions(+), 135 deletions(-) delete mode 100644 login-utils/Makefile.am create mode 100644 login-utils/Makemodule.am diff --git a/Makefile.am b/Makefile.am index d604e24eb..96af99d26 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ dist_noinst_HEADERS = noinst_PROGRAMS = noinst_LTLIBRARIES = usrbin_exec_PROGRAMS = +usrsbin_exec_PROGRAMS = dist_man_MANS = man_MANS = pkgconfig_DATA = @@ -31,7 +32,6 @@ SUBDIRS = \ disk-utils \ fdisk \ getopt \ - login-utils \ misc-utils \ po \ sys-utils \ @@ -73,6 +73,7 @@ include libmount/Makemodule.am include schedutils/Makemodule.am include text-utils/Makemodule.am include term-utils/Makemodule.am +include login-utils/Makemodule.am # Arrange so that .tarball-version appears only in the distribution # tarball, and never in a checked-out repository. diff --git a/configure.ac b/configure.ac index fc5d3de56..b1a2f848c 100644 --- a/configure.ac +++ b/configure.ac @@ -1313,7 +1313,6 @@ libmount/docs/version.xml libmount/mount.pc libmount/src/libmount.h libuuid/uuid.pc -login-utils/Makefile man/ru/Makefile misc-utils/Makefile misc-utils/uuidd.service diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am deleted file mode 100644 index e061ab5ed..000000000 --- a/login-utils/Makefile.am +++ /dev/null @@ -1,133 +0,0 @@ -include $(top_srcdir)/config/include-Makefile.am - -bin_PROGRAMS = -usrbin_exec_PROGRAMS = -sbin_PROGRAMS = -usrsbin_exec_PROGRAMS = -dist_man_MANS = - -if BUILD_LAST -usrbin_exec_PROGRAMS += last -dist_man_MANS += last.1 -endif - -if BUILD_SULOGIN -sbin_PROGRAMS += sulogin -dist_man_MANS += sulogin.8 -sulogin_SOURCES = sulogin.c $(top_srcdir)/lib/strutils.c -sulogin_LDADD = -if HAVE_LIBCRYPT -sulogin_LDADD += -lcrypt -endif -if HAVE_SELINUX -sulogin_LDADD += -lselinux -endif -endif # BUILD_SULOGIN - - -if BUILD_LOGIN -bin_PROGRAMS += login -dist_man_MANS += login.1 -login_SOURCES = \ - login.c \ - logindefs.c \ - logindefs.h \ - $(top_srcdir)/lib/fileutils.c \ - $(top_srcdir)/lib/setproctitle.c -login_LDADD = -lpam -lpam_misc -if HAVE_AUDIT -login_LDADD += -laudit -endif -if HAVE_SELINUX -login_LDADD += -lselinux -endif -endif # BUILD_LOGIN - - -if BUILD_CHFN_CHSH -usrbin_exec_PROGRAMS += chfn chsh -dist_man_MANS += chfn.1 chsh.1 - -chfn_chsh_sources = \ - islocal.c \ - islocal.h \ - setpwnam.c \ - setpwnam.h \ - $(top_srcdir)/lib/env.c \ - $(top_srcdir)/lib/fileutils.c - -chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS) -chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS) -chfn_chsh_ldadd = -lpam -lpam_misc - -if HAVE_SELINUX -chfn_chsh_sources += selinux_utils.c selinux_utils.h -chfn_chsh_ldadd += -lselinux -endif - -chfn_SOURCES = chfn.c $(chfn_chsh_sources) -chfn_CFLAGS = $(chfn_chsh_cflags) -chfn_LDFLAGS = $(chfn_chsh_ldflags) -chfn_LDADD = $(chfn_chsh_ldadd) - -chsh_SOURCES = chsh.c $(chfn_chsh_sources) -chsh_CFLAGS = $(chfn_chsh_cflags) -chsh_LDFLAGS = $(chfn_chsh_ldflags) -chsh_LDADD = $(chfn_chsh_ldadd) -endif # BUILD_CHFN_CHSH - - -if BUILD_SU -bin_PROGRAMS += su -su_SOURCES = \ - su.c \ - logindefs.c \ - logindefs.h -su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) -su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -su_LDADD = -lpam -lpam_misc -endif - -if BUILD_NEWGRP -usrbin_exec_PROGRAMS += newgrp -dist_man_MANS += newgrp.1 -newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) -newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -newgrp_LDADD = -if HAVE_LIBCRYPT -newgrp_LDADD += -lcrypt -endif -endif # BUILD_NEWGRP - - -if BUILD_VIPW -usrsbin_exec_PROGRAMS += vipw -dist_man_MANS += vigr.8 vipw.8 -vipw_SOURCES = \ - vipw.c \ - setpwnam.h \ - $(top_srcdir)/lib/fileutils.c -vipw_LDADD = -if HAVE_SELINUX -vipw_LDADD += -lselinux -endif -endif # BUILD_VIPW - - -noinst_PROGRAMS = test_islocal test_logindefs -test_islocal_SOURCES = islocal.c -test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS) - -test_logindefs_SOURCES = logindefs.c logindefs.h -test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS) - - -install-exec-hook: -if BUILD_SU -if MAKEINSTALL_DO_SETUID - chmod 4755 $(DESTDIR)$(bindir)/su -endif -endif -if BUILD_VIPW - cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr -endif diff --git a/login-utils/Makemodule.am b/login-utils/Makemodule.am new file mode 100644 index 000000000..ec119896c --- /dev/null +++ b/login-utils/Makemodule.am @@ -0,0 +1,146 @@ + +if BUILD_LAST +usrbin_exec_PROGRAMS += last +dist_man_MANS += login-utils/last.1 +last_SOURCES = login-utils/last.c +endif + +if BUILD_SULOGIN +sbin_PROGRAMS += sulogin +dist_man_MANS += login-utils/sulogin.8 +sulogin_SOURCES = \ + login-utils/sulogin.c \ + lib/strutils.c +sulogin_LDADD = +if HAVE_LIBCRYPT +sulogin_LDADD += -lcrypt +endif +if HAVE_SELINUX +sulogin_LDADD += -lselinux +endif +endif # BUILD_SULOGIN + + +if BUILD_LOGIN +bin_PROGRAMS += login +dist_man_MANS += login-utils/login.1 +login_SOURCES = \ + login-utils/login.c \ + login-utils/logindefs.c \ + login-utils/logindefs.h \ + lib/fileutils.c \ + lib/setproctitle.c +login_LDADD = -lpam -lpam_misc +if HAVE_AUDIT +login_LDADD += -laudit +endif +if HAVE_SELINUX +login_LDADD += -lselinux +endif +endif # BUILD_LOGIN + + +if BUILD_CHFN_CHSH +usrbin_exec_PROGRAMS += chfn chsh +dist_man_MANS += \ + login-utils/chfn.1 \ + login-utils/chsh.1 + +chfn_chsh_sources = \ + login-utils/islocal.c \ + login-utils/islocal.h \ + login-utils/setpwnam.c \ + login-utils/setpwnam.h \ + lib/env.c \ + lib/fileutils.c + +chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS) +chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS) +chfn_chsh_ldadd = -lpam -lpam_misc + +if HAVE_SELINUX +chfn_chsh_sources += \ + login-utils/selinux_utils.c \ + login-utils/selinux_utils.h +chfn_chsh_ldadd += -lselinux +endif + +chfn_SOURCES = login-utils/chfn.c $(chfn_chsh_sources) +chfn_CFLAGS = $(chfn_chsh_cflags) +chfn_LDFLAGS = $(chfn_chsh_ldflags) +chfn_LDADD = $(chfn_chsh_ldadd) + +chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources) +chsh_CFLAGS = $(chfn_chsh_cflags) +chsh_LDFLAGS = $(chfn_chsh_ldflags) +chsh_LDADD = $(chfn_chsh_ldadd) +endif # BUILD_CHFN_CHSH + + +if BUILD_SU +bin_PROGRAMS += su +su_SOURCES = \ + login-utils/su.c \ + login-utils/logindefs.c \ + login-utils/logindefs.h +su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) +su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) +su_LDADD = -lpam -lpam_misc +endif + + +if BUILD_NEWGRP +usrbin_exec_PROGRAMS += newgrp +dist_man_MANS += login-utils/newgrp.1 +newgrp_SOURCES = login-utils/newgrp.c +newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) +newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) +newgrp_LDADD = +if HAVE_LIBCRYPT +newgrp_LDADD += -lcrypt +endif +endif # BUILD_NEWGRP + + +if BUILD_VIPW +usrsbin_exec_PROGRAMS += vipw +dist_man_MANS += \ + login-utils/vigr.8 \ + login-utils/vipw.8 +vipw_SOURCES = \ + login-utils/vipw.c \ + login-utils/setpwnam.h \ + lib/fileutils.c +vipw_LDADD = +if HAVE_SELINUX +vipw_LDADD += -lselinux +endif +install-exec-hook-vipw:: + cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr + +INSTALL_EXEC_HOOKS += install-exec-hook-vipw +endif # BUILD_VIPW + + +noinst_PROGRAMS += \ + test_islocal \ + test_logindefs + +test_islocal_SOURCES = login-utils/islocal.c +test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS) + +test_logindefs_SOURCES = \ + login-utils/logindefs.c \ + login-utils/logindefs.h +test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS) + + +install-exec-hook: +if BUILD_SU +if MAKEINSTALL_DO_SETUID + chmod 4755 $(DESTDIR)$(bindir)/su +endif +endif +if BUILD_VIPW + cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr +endif -- cgit v1.2.3-55-g7522