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