Signed-off-by: Diego Elio 'Flameeyes' Pettenò <flameeyes@xxxxxxxxx> --- Makefile.am | 9 +++- configure.ac | 1 - login-utils/Makefile.am | 140 ---------------------------------------------- login-utils/module.am | 142 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+), 142 deletions(-) delete mode 100644 login-utils/Makefile.am create mode 100644 login-utils/module.am diff --git a/Makefile.am b/Makefile.am index 4102e38..d1522aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,8 @@ include $(top_srcdir)/config/include-Makefile.am +INSTALL_EXEC_HOOKS = +INSTALL_DATA_HOOKS = + noinst_HEADERS = \ include/bitops.h \ include/blkdev.h \ @@ -45,7 +48,6 @@ endif SUBDIRS = \ $(SHLIBS_DIRS) \ - login-utils \ misc-utils \ po \ schedutils \ @@ -92,6 +94,7 @@ check_PROGRAMS = tests/helpers/test_sysinfo tests/helpers/test_pathnames tests/h tests/helpers/test_md5 noinst_PROGRAMS = +bin_PROGRAMS = sbin_PROGRAMS = usrbin_exec_PROGRAMS = usrsbin_exec_PROGRAMS = @@ -104,6 +107,7 @@ include fdisk/module.am include fsck/module.am include getopt/module.am include hwclock/module.am +include login-utils/module.am clean-local: rm -rf tests/output tests/diff @@ -123,6 +127,9 @@ checkconfig: -name '*.[hcS]' -type f -print | sort -u \ | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir) +install-exec-hook: $(INSTALL_EXEC_HOOKS) + +install-data-hook: $(INSTALL_DATA_HOOKS) ENABLE_ALL = --enable-static-programs \ --enable-elvtune --enable-init --enable-kill --enable-last \ diff --git a/configure.ac b/configure.ac index c9d456e..1510996 100644 --- a/configure.ac +++ b/configure.ac @@ -1132,7 +1132,6 @@ LIBS="" AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES([ -login-utils/Makefile Makefile misc-utils/chkdupexe:misc-utils/chkdupexe.pl misc-utils/Makefile diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am deleted file mode 100644 index 9ebd0b7..0000000 --- a/login-utils/Makefile.am +++ /dev/null @@ -1,140 +0,0 @@ -include $(top_srcdir)/config/include-Makefile.am - -bin_PROGRAMS = -usrbin_exec_PROGRAMS = -sbin_PROGRAMS = -usrsbin_exec_PROGRAMS = -dist_man_MANS = - -EXTRA_DIST = README.getty README.modems-with-agetty README.poeigl - -if BUILD_AGETTY -sbin_PROGRAMS += agetty -dist_man_MANS += agetty.8 -endif - -if BUILD_INIT - -sbin_PROGRAMS += simpleinit shutdown initctl -dist_man_MANS += fastboot.8 fasthalt.8 halt.8 reboot.8 simpleinit.8 shutdown.8 \ - initctl.8 - -simpleinit_SOURCES = simpleinit.c my_crypt.h simpleinit.h -initctl_SOURCES = initctl.c simpleinit.h - -if NEED_LIBCRYPT -simpleinit_LDADD = -lcrypt -endif - -endif # BUILD_INIT - -if BUILD_LAST -usrbin_exec_PROGRAMS += last -dist_man_MANS += last.1 -endif - -if BUILD_LOGIN_UTILS - -bin_PROGRAMS += login -usrbin_exec_PROGRAMS += chfn chsh newgrp -usrsbin_exec_PROGRAMS += vipw -dist_man_MANS += chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8 - -# login, chfn and chsh libs -login_ldadd_common = - -chfn_SOURCES = chfn.c $(chfn_chsh_common) -chsh_SOURCES = chsh.c $(chfn_chsh_common) -chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \ - $(top_srcdir)/lib/env.c -login_SOURCES = login.c login.h my_crypt.h $(top_srcdir)/lib/setproctitle.c -newgrp_SOURCES = newgrp.c my_crypt.h -vipw_SOURCES = vipw.c setpwnam.h - -chfn_LDADD = $(login_ldadd_common) -chsh_LDADD = $(login_ldadd_common) -login_LDADD = $(login_ldadd_common) -newgrp_LDADD = -vipw_LDADD = - -chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) -chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) -newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) - -chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) - -if HAVE_PAM -login_ldadd_common += -lpam -lpam_misc -else -if NEED_LIBCRYPT -login_ldadd_common += -lcrypt -endif -login_SOURCES += checktty.c -endif #! HAVE_PAM - -if NEED_LIBCRYPT -newgrp_LDADD += -lcrypt -endif - -if HAVE_AUDIT -login_LDADD += -laudit -endif - -if HAVE_SELINUX -chfn_SOURCES += selinux_utils.c selinux_utils.h -chsh_SOURCES += selinux_utils.c selinux_utils.h -vipw_LDADD += -lselinux -login_ldadd_common += -lselinux -endif - - -install-exec-hook:: - cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr - -endif - -if BUILD_MESG -usrbin_exec_PROGRAMS += mesg -dist_man_MANS += mesg.1 -endif - -if BUILD_WALL -usrbin_exec_PROGRAMS += wall -wall_SOURCES = wall.c ttymsg.c ttymsg.h -dist_man_MANS += wall.1 - -if USE_TTY_GROUP -if MAKEINSTALL_DO_CHOWN -install-exec-hook:: - chgrp tty $(DESTDIR)$(usrbin_execdir)/wall - chmod g+s $(DESTDIR)$(usrbin_execdir)/wall -endif -endif -endif - -if BUILD_INIT - -install-exec-hook:: - cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot - cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot - cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt - cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt - cd $(DESTDIR)$(sbindir) && ln -sf initctl need - cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services - cd $(DESTDIR)$(sbindir) && ln -sf initctl provide - -install-data-hook: - cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8 - cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8 - cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8 - -endif - -noinst_PROGRAMS = checktty_test islocal_test -checktty_test_SOURCES = checktty.c login.h -checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS) -islocal_test_SOURCES = islocal.c -islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS) - diff --git a/login-utils/module.am b/login-utils/module.am new file mode 100644 index 0000000..fe1ed66 --- /dev/null +++ b/login-utils/module.am @@ -0,0 +1,142 @@ +EXTRA_DIST += login-utils/README.getty \ + login-utils/README.modems-with-agetty \ + login-utils/README.poeigl + +if BUILD_AGETTY +sbin_PROGRAMS += login-utils/agetty +dist_man_MANS += login-utils/agetty.8 +endif + +if BUILD_INIT + +sbin_PROGRAMS += login-utils/simpleinit login-utils/shutdown login-utils/initctl +dist_man_MANS += login-utils/fastboot.8 login-utils/fasthalt.8 \ + login-utils/halt.8 login-utils/reboot.8 \ + login-utils/simpleinit.8 login-utils/shutdown.8 \ + login-utils/initctl.8 + +login_utils_simpleinit_SOURCES = login-utils/simpleinit.c login-utils/my_crypt.h login-utils/simpleinit.h +login_utils_initctl_SOURCES = login-utils/initctl.c login-utils/simpleinit.h + +if NEED_LIBCRYPT +login_utils_simpleinit_LDADD = -lcrypt +endif + +endif # BUILD_INIT + +if BUILD_LAST +usrbin_exec_PROGRAMS += login-utils/last +dist_man_MANS += login-utils/last.1 +endif + +if BUILD_LOGIN_UTILS + +bin_PROGRAMS += login-utils/login +usrbin_exec_PROGRAMS += login-utils/chfn login-utils/chsh login-utils/newgrp +usrsbin_exec_PROGRAMS += login-utils/vipw +dist_man_MANS += login-utils/chfn.1 login-utils/chsh.1 login-utils/login.1 login-utils/newgrp.1 login-utils/vipw.8 login-utils/vigr.8 + +# login, chfn and chsh libs +login_ldadd_common = + +chfn_chsh_common = login-utils/islocal.c login-utils/setpwnam.c \ + login-utils/islocal.h login-utils/my_crypt.h \ + login-utils/setpwnam.h lib/env.c +login_utils_chfn_SOURCES = login-utils/chfn.c $(chfn_chsh_common) +login_utils_chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_common) +login_utils_login_SOURCES = login-utils/login.c login-utils/login.h \ + login-utils/my_crypt.h lib/setproctitle.c +login_utils_newgrp_SOURCES = login-utils/newgrp.c login-utils/my_crypt.h +login_utils_vipw_SOURCES = login-utils/vipw.c login-utils/setpwnam.h + +login_utils_chfn_LDADD = $(login_ldadd_common) +login_utils_chsh_LDADD = $(login_ldadd_common) +login_utils_login_LDADD = $(login_ldadd_common) +login_utils_newgrp_LDADD = +login_utils_vipw_LDADD = + +login_utils_chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) +login_utils_chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) +login_utils_newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) + +login_utils_chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) +login_utils_chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) +login_utils_newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) + +if HAVE_PAM +login_ldadd_common += -lpam -lpam_misc +else +if NEED_LIBCRYPT +login_ldadd_common += -lcrypt +endif +login_utils_login_SOURCES += login-utils/checktty.c +endif #! HAVE_PAM + +if NEED_LIBCRYPT +login_utils_newgrp_LDADD += -lcrypt +endif + +if HAVE_AUDIT +login_utils_login_LDADD += -laudit +endif + +if HAVE_SELINUX +login_utils_chfn_SOURCES += login-utils/selinux_utils.c login-utils/selinux_utils.h +login_utils_chsh_SOURCES += login-utils/selinux_utils.c login-utils/selinux_utils.h +login_utils_vipw_LDADD += -lselinux +login_ldadd_common += -lselinux +endif + +install-exec-hook-login-utils: + cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr + +INSTALL_EXEC_HOOKS += install-exec-hook-login-utils +endif + +if BUILD_MESG +usrbin_exec_PROGRAMS += login-utils/mesg +dist_man_MANS += login-utils/mesg.1 +endif + +if BUILD_WALL +usrbin_exec_PROGRAMS += login-utils/wall +login_utils_wall_SOURCES = login-utils/wall.c login-utils/ttymsg.c login-utils/ttymsg.h +dist_man_MANS += login-utils/wall.1 + +if USE_TTY_GROUP +if MAKEINSTALL_DO_CHOWN +install-exec-hook-wall: + chgrp tty $(DESTDIR)$(usrbin_execdir)/wall + chmod g+s $(DESTDIR)$(usrbin_execdir)/wall + +INSTALL_EXEC_HOOKS += install-exec-hook-wall +endif +endif +endif + +if BUILD_INIT + +install-exec-hook-init: + cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot + cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot + cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt + cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt + cd $(DESTDIR)$(sbindir) && ln -sf initctl need + cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services + cd $(DESTDIR)$(sbindir) && ln -sf initctl provide + +install-data-hook-init: + cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8 + cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8 + cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8 + +INSTALL_EXEC_HOOKS += install-exec-hook-init +INSTALL_DATA_HOOKS += install-data-hook-init +endif + +check_PROGRAMS += login-utils/checktty_test login-utils/islocal_test +login_utils_checktty_test_SOURCES = login-utils/checktty.c login-utils/login.h +login_utils_checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS) +login_utils_islocal_test_SOURCES = login-utils/islocal.c +login_utils_islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS) + -- 1.7.1.1 -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html