]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/Makemodule.am
build-sys: move runuser(1) to sbin dir
[thirdparty/util-linux.git] / login-utils / Makemodule.am
1
2 if BUILD_LAST
3 usrbin_exec_PROGRAMS += last
4 dist_man_MANS += login-utils/last.1
5 last_SOURCES = login-utils/last.c
6 endif
7
8 if BUILD_SULOGIN
9 sbin_PROGRAMS += sulogin
10 dist_man_MANS += login-utils/sulogin.8
11 sulogin_SOURCES = \
12 login-utils/sulogin.c
13 sulogin_LDADD = $(LDADD) libcommon.la
14 if HAVE_LIBCRYPT
15 sulogin_LDADD += -lcrypt
16 endif
17 if HAVE_SELINUX
18 sulogin_LDADD += -lselinux
19 endif
20 endif # BUILD_SULOGIN
21
22
23 if BUILD_LOGIN
24 bin_PROGRAMS += login
25 dist_man_MANS += login-utils/login.1
26 login_SOURCES = \
27 login-utils/login.c \
28 login-utils/logindefs.c \
29 login-utils/logindefs.h
30 login_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
31 if HAVE_AUDIT
32 login_LDADD += -laudit
33 endif
34 if HAVE_SELINUX
35 login_LDADD += -lselinux
36 endif
37 endif # BUILD_LOGIN
38
39
40 if BUILD_UTMPDUMP
41 usrbin_exec_PROGRAMS += utmpdump
42 dist_man_MANS += login-utils/utmpdump.1
43 utmpdump_SOURCES = login-utils/utmpdump.c
44 endif
45
46
47 if BUILD_CHFN_CHSH
48 usrbin_exec_PROGRAMS += chfn chsh
49 dist_man_MANS += \
50 login-utils/chfn.1 \
51 login-utils/chsh.1
52
53 chfn_chsh_sources = \
54 login-utils/islocal.c \
55 login-utils/islocal.h \
56 login-utils/setpwnam.c \
57 login-utils/setpwnam.h
58 chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
59 chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
60 chfn_chsh_ldadd = libcommon.la -lpam -lpam_misc
61
62 if HAVE_SELINUX
63 chfn_chsh_sources += \
64 login-utils/selinux_utils.c \
65 login-utils/selinux_utils.h
66 chfn_chsh_ldadd += -lselinux
67 endif
68
69 chfn_SOURCES = login-utils/chfn.c $(chfn_chsh_sources)
70 chfn_CFLAGS = $(chfn_chsh_cflags)
71 chfn_LDFLAGS = $(chfn_chsh_ldflags)
72 chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
73
74 chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
75 chsh_CFLAGS = $(chfn_chsh_cflags)
76 chsh_LDFLAGS = $(chfn_chsh_ldflags)
77 chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
78 endif # BUILD_CHFN_CHSH
79
80
81 if BUILD_SU
82 bin_PROGRAMS += su
83 dist_man_MANS += login-utils/su.1
84 su_SOURCES = \
85 login-utils/su.c \
86 login-utils/su-common.c \
87 login-utils/su-common.h \
88 login-utils/logindefs.c \
89 login-utils/logindefs.h
90 su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
91 su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
92 su_LDADD = $(LDADD) -lpam -lpam_misc
93 endif
94
95
96 if BUILD_RUNUSER
97 sbin_PROGRAMS += runuser
98 dist_man_MANS += login-utils/runuser.1
99 runuser_SOURCES = \
100 login-utils/runuser.c \
101 login-utils/su-common.c \
102 login-utils/su-common.h \
103 login-utils/logindefs.c \
104 login-utils/logindefs.h
105 runuser_LDADD = $(LDADD) -lpam -lpam_misc
106 endif
107
108
109 if BUILD_NEWGRP
110 usrbin_exec_PROGRAMS += newgrp
111 dist_man_MANS += login-utils/newgrp.1
112 newgrp_SOURCES = login-utils/newgrp.c
113 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
114 newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
115 newgrp_LDADD = $(LDADD)
116 if HAVE_LIBCRYPT
117 newgrp_LDADD += -lcrypt
118 endif
119 endif # BUILD_NEWGRP
120
121
122 if BUILD_VIPW
123 usrsbin_exec_PROGRAMS += vipw
124 dist_man_MANS += \
125 login-utils/vigr.8 \
126 login-utils/vipw.8
127 vipw_SOURCES = \
128 login-utils/vipw.c \
129 login-utils/setpwnam.h
130 vipw_LDADD = $(LDADD) libcommon.la
131 if HAVE_SELINUX
132 vipw_LDADD += -lselinux
133 endif
134 install-exec-hook-vipw::
135 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
136
137 INSTALL_EXEC_HOOKS += install-exec-hook-vipw
138 endif # BUILD_VIPW
139
140
141 check_PROGRAMS += \
142 test_islocal \
143 test_logindefs
144
145 test_islocal_SOURCES = login-utils/islocal.c
146 test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
147
148 test_logindefs_SOURCES = \
149 login-utils/logindefs.c \
150 login-utils/logindefs.h
151 test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
152
153
154 install-exec-hook:
155 if BUILD_SU
156 if MAKEINSTALL_DO_SETUID
157 chmod 4755 $(DESTDIR)$(bindir)/su
158 endif
159 endif
160 if BUILD_VIPW
161 cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
162 endif