1 |
Name: sudo |
2 |
Version: 1.9.4 |
3 |
Release: %mkrel 1 |
4 |
Epoch: 1 |
5 |
Summary: Allows command execution as root for specified users |
6 |
License: GPLv2+ |
7 |
Group: System/Base |
8 |
URL: http://www.sudo.ws/sudo |
9 |
Source0: http://www.sudo.ws/sudo/dist/%{name}-%{version}%{?pre}.tar.gz |
10 |
Source1: http://www.sudo.ws/sudo/dist/%{name}-%{version}%{?pre}.tar.gz.sig |
11 |
Source2: sudo.pamd |
12 |
Source3: sudoers |
13 |
Patch1: sudo-1.6.7p5-strip.patch |
14 |
Patch2: sudo-1.7.2p1-envdebug.patch |
15 |
BuildRequires: pkgconfig(audit) |
16 |
BuildRequires: bison |
17 |
BuildRequires: groff-for-man |
18 |
BuildRequires: pkgconfig(libcap) |
19 |
BuildRequires: openldap-devel |
20 |
BuildRequires: openssl-devel |
21 |
BuildRequires: pam-devel |
22 |
Requires(pre): openldap |
23 |
# for create_ghostfile in post |
24 |
Requires(post): rpm-helper |
25 |
|
26 |
%description |
27 |
Sudo (superuser do) allows a system administrator to give certain users (or |
28 |
groups of users) the ability to run some (or all) commands as root while |
29 |
logging all commands and arguments. Sudo operates on a per-command basis. |
30 |
It is not a replacement for the shell. Features include: the ability to |
31 |
restrict what commands a user may run on a per-host basis, copious logging |
32 |
of each command (providing a clear audit trail of who did what), a |
33 |
configurable timeout of the sudo command, and the ability to use the same |
34 |
configuration file (sudoers) on many different machines. |
35 |
|
36 |
%package devel |
37 |
Summary: Development files for sudo plugins |
38 |
Group: Development/C |
39 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
40 |
|
41 |
%description devel |
42 |
Development files for compiling sudo plugins. |
43 |
|
44 |
%prep |
45 |
%setup -q -n %{name}-%{version}%{?pre} |
46 |
%patch1 -p1 -b .strip |
47 |
%patch2 -p1 -b .envdebug |
48 |
|
49 |
# fix attribs |
50 |
find -name "Makefile.*" | xargs perl -pi -e "s|-m 0444|-m 0644|g" |
51 |
|
52 |
|
53 |
%build |
54 |
# handle newer autoconf |
55 |
rm -f acsite.m4 |
56 |
mv aclocal.m4 acinclude.m4 |
57 |
autoreconf -fv --install |
58 |
|
59 |
%serverbuild |
60 |
export CFLAGS="%{optflags} -D_GNU_SOURCE" |
61 |
|
62 |
%configure \ |
63 |
--without-rpath \ |
64 |
--with-logging=both \ |
65 |
--with-logfac=authpriv \ |
66 |
--with-logpath=%{_logdir}/sudo.log \ |
67 |
--with-editor=/bin/vi \ |
68 |
--enable-openssl \ |
69 |
--disable-root-mailer \ |
70 |
--enable-log-host \ |
71 |
--with-pam \ |
72 |
--with-pam-login \ |
73 |
--with-env-editor \ |
74 |
--with-noexec=no \ |
75 |
--with-linux-audit \ |
76 |
--with-ignore-dot \ |
77 |
--with-tty-tickets \ |
78 |
--with-ldap \ |
79 |
--with-ldap-conf-file=%{_sysconfdir}/nslcd.conf \ |
80 |
--with-ldap-secret-file=%{_sysconfdir}/nslcd.conf \ |
81 |
--with-secure-path="/sbin:%{_sbindir}:/bin:%{_bindir}:/usr/local/bin:/usr/local/sbin" \ |
82 |
--with-passprompt="[sudo] password for %p: " \ |
83 |
--with-plugindir=%{_libdir}/sudo \ |
84 |
--with-sendmail=/usr/sbin/sendmail |
85 |
|
86 |
%make_build |
87 |
|
88 |
%install |
89 |
install -d %{buildroot}/usr |
90 |
install -d %{buildroot}%{_sysconfdir}/logrotate.d |
91 |
install -d %{buildroot}%{_sysconfdir}/sudoers.d |
92 |
install -d %{buildroot}%{_sysconfdir}/pam.d |
93 |
install -d %{buildroot}%{_var}/db/sudo |
94 |
install -d %{buildroot}%{_var}/db/sudo/lectured |
95 |
install -d %{buildroot}%{_logdir}/sudo |
96 |
install -d %{buildroot}%{_logdir}/sudo-io |
97 |
|
98 |
%make_install install_uid=$UID install_gid=$(id -g) sudoers=uid=$UID sudoers_gid=$(id -g) |
99 |
|
100 |
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sudo |
101 |
install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers |
102 |
|
103 |
# Installing logrotated file |
104 |
cat <<END >%{buildroot}%{_sysconfdir}/logrotate.d/sudo |
105 |
%{_logdir}/sudo.log { |
106 |
missingok |
107 |
monthly |
108 |
compress |
109 |
} |
110 |
END |
111 |
|
112 |
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo << EOF |
113 |
#%PAM-1.0 |
114 |
auth include system-auth |
115 |
account include system-auth |
116 |
password include system-auth |
117 |
session optional pam_keyinit.so revoke |
118 |
session required pam_limits.so |
119 |
EOF |
120 |
|
121 |
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo-i << EOF |
122 |
#%PAM-1.0 |
123 |
auth include sudo |
124 |
account include sudo |
125 |
password include sudo |
126 |
session optional pam_keyinit.so force revoke |
127 |
session required pam_limits.so |
128 |
EOF |
129 |
|
130 |
# so that strip can touch it... |
131 |
chmod 755 %{buildroot}%{_bindir}/* |
132 |
chmod 755 %{buildroot}%{_sbindir}/* |
133 |
|
134 |
# (tpg) create the missing log file |
135 |
touch %{buildroot}%{_logdir}/sudo.log |
136 |
|
137 |
# move the lib to a common place |
138 |
mv %{buildroot}%{_libexecdir}/sudo/* %{buildroot}%{_libdir}/ |
139 |
rm -rf %{buildroot}%{_libexecdir}/sudo |
140 |
|
141 |
# cleanup |
142 |
rm -rf %{buildroot}%{_datadir}/examples samples |
143 |
cp -rp examples samples |
144 |
rm -f samples/Makefile* |
145 |
# too big |
146 |
rm -f %{buildroot}%{_docdir}/%{name}/ChangeLog |
147 |
|
148 |
find %{buildroot} -type f -name "*.la" | xargs rm |
149 |
|
150 |
%find_lang sudo |
151 |
%find_lang sudoers |
152 |
|
153 |
cat sudo.lang sudoers.lang > sudo_all.lang |
154 |
rm sudo.lang sudoers.lang |
155 |
|
156 |
%check |
157 |
%__make check |
158 |
|
159 |
%post |
160 |
/bin/chmod 0440 %{_sysconfdir}/sudoers || : |
161 |
%create_ghostfile %{_logdir}/sudo.log root root 600 |
162 |
|
163 |
%files -f sudo_all.lang |
164 |
%doc samples |
165 |
%{_docdir}/%{name}/CONTRIBUTORS |
166 |
%{_docdir}/%{name}/LICENSE |
167 |
%{_docdir}/%{name}/NEWS |
168 |
%{_docdir}/%{name}/HISTORY |
169 |
%{_docdir}/%{name}/README |
170 |
%{_docdir}/%{name}/README.LDAP |
171 |
%{_docdir}/%{name}/TROUBLESHOOTING |
172 |
%{_docdir}/%{name}/UPGRADE |
173 |
%{_docdir}/%{name}/schema.ActiveDirectory |
174 |
%{_docdir}/%{name}/schema.OpenLDAP |
175 |
%{_docdir}/%{name}/schema.iPlanet |
176 |
%{_docdir}/%{name}/schema.olcSudo |
177 |
%{_docdir}/%{name}/examples/*.conf |
178 |
%{_docdir}/%{name}/examples/sudoers |
179 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudoers |
180 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudoers.dist |
181 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudo.conf |
182 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudo_logsrvd.conf |
183 |
%attr(0750,root,root) %dir %{_sysconfdir}/sudoers.d/ |
184 |
%config(noreplace) %{_sysconfdir}/logrotate.d/sudo |
185 |
%config(noreplace) %{_sysconfdir}/pam.d/sudo |
186 |
%config(noreplace) %{_sysconfdir}/pam.d/sudo-i |
187 |
%attr(0755,root,root) %{_bindir}/cvtsudoers |
188 |
%attr(0755,root,root) %{_sbindir}/sudo_logsrvd |
189 |
%attr(0755,root,root) %{_sbindir}/sudo_sendlog |
190 |
%attr(4111,root,root) %{_bindir}/sudo |
191 |
%{_bindir}/sudoedit |
192 |
%attr(0111,root,root) %{_bindir}/sudoreplay |
193 |
%attr(0755,root,root) %{_sbindir}/visudo |
194 |
%ghost %{_logdir}/sudo.log |
195 |
%{_mandir}/*/* |
196 |
%attr(0700,root,root) %dir %{_var}/db/sudo |
197 |
%attr(0700,root,root) %dir %{_var}/db/sudo/lectured |
198 |
%attr(0750,root,root) %dir %{_logdir}/sudo-io |
199 |
%attr(0755,root,root) %{_libdir}/sudo/group_file.so |
200 |
%attr(0755,root,root) %{_libdir}/sudo/sudoers.so |
201 |
%attr(0755,root,root) %{_libdir}/sudo/system_group.so |
202 |
%attr(0755,root,root) %{_libdir}/sudo/audit_json.so |
203 |
%attr(0755,root,root) %{_libdir}/sudo/sample_approval.so |
204 |
%{_libdir}/libsudo_util.so.0 |
205 |
%attr(0755,root,root) %{_libdir}/libsudo_util.so.*.* |
206 |
%{_tmpfilesdir}/sudo.conf |
207 |
|
208 |
%files devel |
209 |
%doc plugins/{group_file,sample} |
210 |
%{_includedir}/sudo_plugin.h |
211 |
%{_mandir}/man8/sudo_plugin.8* |
212 |
%{_libdir}/libsudo_util.so |