1 |
blino |
17466 |
# use fakeroot -ba sudo.spec to build! |
2 |
|
|
|
3 |
shlomif |
152774 |
Name: sudo |
4 |
luigiwalser |
296897 |
Version: 1.8.6p3 |
5 |
pterjan |
340151 |
Release: %mkrel 2 |
6 |
shlomif |
152774 |
Epoch: 1 |
7 |
|
|
Summary: Allows command execution as root for specified users |
8 |
|
|
License: GPLv2+ |
9 |
|
|
Group: System/Base |
10 |
|
|
URL: http://www.sudo.ws/sudo |
11 |
|
|
Source0: http://www.sudo.ws/sudo/dist/%name-%version%{?pre}.tar.gz |
12 |
|
|
Source1: http://www.sudo.ws/sudo/dist/%name-%version%{?pre}.tar.gz.sig |
13 |
|
|
Source2: sudo.pamd |
14 |
|
|
Source3: sudo-1.7.2p2-sudoers |
15 |
|
|
Patch1: sudo-1.6.7p5-strip.patch |
16 |
|
|
Patch2: sudo-1.7.2p1-envdebug.patch |
17 |
luigiwalser |
294256 |
Patch3: sudo-1.8.6p1-m4path.patch |
18 |
luigiwalser |
275808 |
Patch4: sudo-1.8.5-pipelist.patch |
19 |
shlomif |
152774 |
BuildRequires: audit-devel |
20 |
|
|
BuildRequires: bison |
21 |
|
|
BuildRequires: groff-for-man |
22 |
|
|
BuildRequires: libcap-devel |
23 |
|
|
BuildRequires: openldap-devel |
24 |
|
|
BuildRequires: pam-devel |
25 |
|
|
Requires(pre): openldap |
26 |
blino |
17466 |
|
27 |
|
|
%description |
28 |
luigiwalser |
275808 |
Sudo (superuser do) allows a system administrator to give certain users (or |
29 |
|
|
groups of users) the ability to run some (or all) commands as root while |
30 |
|
|
logging all commands and arguments. Sudo operates on a per-command basis. |
31 |
|
|
It is not a replacement for the shell. Features include: the ability to |
32 |
|
|
restrict what commands a user may run on a per-host basis, copious logging |
33 |
|
|
of each command (providing a clear audit trail of who did what), a |
34 |
|
|
configurable timeout of the sudo command, and the ability to use the same |
35 |
|
|
configuration file (sudoers) on many different machines. |
36 |
blino |
17466 |
|
37 |
boklm |
74479 |
%package devel |
38 |
shlomif |
152774 |
Summary: Development files for sudo plugins |
39 |
|
|
Group: Development/C |
40 |
luigiwalser |
275808 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
41 |
boklm |
74479 |
|
42 |
shlomif |
152774 |
%description devel |
43 |
boklm |
74479 |
Development files for compiling sudo plugins. |
44 |
|
|
|
45 |
blino |
17466 |
%prep |
46 |
|
|
%setup -q -n %{name}-%{version}%{?pre} |
47 |
|
|
%patch1 -p1 -b .strip |
48 |
|
|
%patch2 -p1 -b .envdebug |
49 |
|
|
%patch3 -p1 -b .m4path |
50 |
luigiwalser |
275808 |
%patch4 -p1 -b .pipelist |
51 |
blino |
17466 |
|
52 |
luigiwalser |
275808 |
# fix attribs |
53 |
|
|
find -name "Makefile.*" | xargs perl -pi -e "s|-m 0444|-m 0644|g" |
54 |
|
|
|
55 |
|
|
|
56 |
blino |
17466 |
%build |
57 |
|
|
# handle newer autoconf |
58 |
|
|
rm -f acsite.m4 |
59 |
|
|
mv aclocal.m4 acinclude.m4 |
60 |
|
|
autoreconf -fv --install |
61 |
|
|
|
62 |
|
|
%serverbuild |
63 |
|
|
export CFLAGS="%{optflags} -D_GNU_SOURCE" |
64 |
|
|
|
65 |
|
|
%configure2_5x \ |
66 |
shlomif |
152774 |
--without-rpath \ |
67 |
|
|
--with-logging=both \ |
68 |
blino |
17466 |
--with-logfac=authpriv \ |
69 |
shlomif |
152774 |
--with-logpath=%{_logdir}/sudo.log \ |
70 |
|
|
--with-editor=/bin/vi \ |
71 |
|
|
--enable-log-host \ |
72 |
|
|
--with-pam \ |
73 |
|
|
--with-pam-login \ |
74 |
|
|
--with-env-editor \ |
75 |
|
|
--with-noexec=no \ |
76 |
|
|
--with-linux-audit \ |
77 |
blino |
17466 |
--with-ignore-dot \ |
78 |
|
|
--with-tty-tickets \ |
79 |
shlomif |
152774 |
--with-ldap \ |
80 |
|
|
--with-ldap-conf-file=%{_sysconfdir}/ldap.conf \ |
81 |
|
|
--with-secure-path="/sbin:%{_sbindir}:/bin:%{_bindir}:/usr/local/bin:/usr/local/sbin" \ |
82 |
pterjan |
340151 |
--with-passprompt="[sudo] password for %p: " \ |
83 |
|
|
--with-plugindir=%{_libdir}/sudo |
84 |
blino |
17466 |
|
85 |
|
|
%make |
86 |
|
|
|
87 |
|
|
%install |
88 |
|
|
rm -rf %{buildroot} |
89 |
|
|
|
90 |
|
|
install -d %{buildroot}/usr |
91 |
|
|
install -d %{buildroot}%{_sysconfdir}/logrotate.d |
92 |
|
|
install -d %{buildroot}%{_sysconfdir}/sudoers.d |
93 |
|
|
install -d %{buildroot}%{_sysconfdir}/pam.d |
94 |
|
|
install -d %{buildroot}%{_var}/db/sudo |
95 |
|
|
install -d %{buildroot}%{_logdir}/sudo |
96 |
|
|
install -d %{buildroot}%{_logdir}/sudo-io |
97 |
|
|
|
98 |
|
|
%makeinstall_std 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 |
boklm |
74479 |
install -m0755 plugins/sudoers/sudoers2ldif %{buildroot}%{_bindir} |
103 |
blino |
17466 |
|
104 |
|
|
# Installing logrotated file |
105 |
|
|
cat <<END >%{buildroot}%{_sysconfdir}/logrotate.d/sudo |
106 |
|
|
%{_logdir}/sudo.log { |
107 |
|
|
missingok |
108 |
|
|
monthly |
109 |
|
|
compress |
110 |
|
|
} |
111 |
|
|
END |
112 |
|
|
|
113 |
|
|
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo << EOF |
114 |
|
|
#%PAM-1.0 |
115 |
shlomif |
152774 |
auth include system-auth |
116 |
|
|
account include system-auth |
117 |
|
|
password include system-auth |
118 |
|
|
session optional pam_keyinit.so revoke |
119 |
|
|
session required pam_limits.so |
120 |
blino |
17466 |
EOF |
121 |
|
|
|
122 |
|
|
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo-i << EOF |
123 |
|
|
#%PAM-1.0 |
124 |
shlomif |
152774 |
auth include sudo |
125 |
|
|
account include sudo |
126 |
|
|
password include sudo |
127 |
|
|
session optional pam_keyinit.so force revoke |
128 |
|
|
session required pam_limits.so |
129 |
blino |
17466 |
EOF |
130 |
|
|
|
131 |
|
|
# so that strip can touch it... |
132 |
|
|
chmod 755 %{buildroot}%{_bindir}/* |
133 |
|
|
chmod 755 %{buildroot}%{_sbindir}/* |
134 |
|
|
|
135 |
|
|
# (tpg) create the missing log file |
136 |
|
|
touch %{buildroot}%{_logdir}/sudo.log |
137 |
|
|
|
138 |
luigiwalser |
275808 |
%find_lang sudo |
139 |
|
|
%find_lang sudoers |
140 |
|
|
|
141 |
|
|
cat sudo.lang sudoers.lang > sudo_all.lang |
142 |
|
|
rm sudo.lang sudoers.lang |
143 |
|
|
|
144 |
fwang |
160282 |
%check |
145 |
|
|
make check |
146 |
|
|
|
147 |
blino |
17466 |
%post |
148 |
|
|
/bin/chmod 0440 %{_sysconfdir}/sudoers || : |
149 |
|
|
%create_ghostfile %{_logdir}/sudo.log root root 600 |
150 |
|
|
|
151 |
luigiwalser |
275808 |
%files -f sudo_all.lang |
152 |
boklm |
74479 |
%doc doc/HISTORY README README.LDAP |
153 |
luigiwalser |
275808 |
%doc doc/TROUBLESHOOTING doc/UPGRADE doc/sample.* doc/schema.* |
154 |
blino |
17466 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudoers |
155 |
|
|
%attr(0750,root,root) %dir %{_sysconfdir}/sudoers.d/ |
156 |
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/sudo |
157 |
|
|
%config(noreplace) %{_sysconfdir}/pam.d/sudo |
158 |
|
|
%config(noreplace) %{_sysconfdir}/pam.d/sudo-i |
159 |
|
|
%attr(0755,root,root) %{_bindir}/sudoers2ldif |
160 |
|
|
%attr(4111,root,root) %{_bindir}/sudo |
161 |
|
|
%attr(4111,root,root) %{_bindir}/sudoedit |
162 |
|
|
%attr(0111,root,root) %{_bindir}/sudoreplay |
163 |
|
|
%attr(0755,root,root) %{_sbindir}/visudo |
164 |
|
|
%ghost %{_logdir}/sudo.log |
165 |
|
|
%{_mandir}/*/* |
166 |
|
|
%attr(0700,root,root) %dir %{_var}/db/sudo |
167 |
|
|
%attr(0750,root,root) %dir %{_logdir}/sudo-io |
168 |
pterjan |
340151 |
%{_libdir}/sudo/sudoers.so |
169 |
blino |
17466 |
|
170 |
luigiwalser |
275808 |
%files devel |
171 |
|
|
%doc plugins/{sample,sample_group} |
172 |
boklm |
74479 |
%{_includedir}/sudo_plugin.h |
173 |
luigiwalser |
275808 |
%{_mandir}/man8/sudo_plugin.8* |