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