1 |
blino |
17466 |
# use fakeroot -ba sudo.spec to build! |
2 |
oden |
814841 |
%define _disable_ld_no_undefined 1 |
3 |
blino |
17466 |
|
4 |
shlomif |
152774 |
Name: sudo |
5 |
oden |
814841 |
Version: 1.8.12 |
6 |
|
|
Release: %mkrel 0 |
7 |
shlomif |
152774 |
Epoch: 1 |
8 |
|
|
Summary: Allows command execution as root for specified users |
9 |
|
|
License: GPLv2+ |
10 |
|
|
Group: System/Base |
11 |
|
|
URL: http://www.sudo.ws/sudo |
12 |
luigiwalser |
400679 |
Source0: http://www.sudo.ws/sudo/dist/%{name}-%{version}%{?pre}.tar.gz |
13 |
|
|
Source1: http://www.sudo.ws/sudo/dist/%{name}-%{version}%{?pre}.tar.gz.sig |
14 |
shlomif |
152774 |
Source2: sudo.pamd |
15 |
|
|
Source3: sudo-1.7.2p2-sudoers |
16 |
|
|
Patch1: sudo-1.6.7p5-strip.patch |
17 |
|
|
Patch2: sudo-1.7.2p1-envdebug.patch |
18 |
|
|
BuildRequires: audit-devel |
19 |
|
|
BuildRequires: bison |
20 |
|
|
BuildRequires: groff-for-man |
21 |
|
|
BuildRequires: libcap-devel |
22 |
|
|
BuildRequires: openldap-devel |
23 |
|
|
BuildRequires: pam-devel |
24 |
|
|
Requires(pre): openldap |
25 |
blino |
17466 |
|
26 |
|
|
%description |
27 |
luigiwalser |
275808 |
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 |
blino |
17466 |
|
36 |
boklm |
74479 |
%package devel |
37 |
shlomif |
152774 |
Summary: Development files for sudo plugins |
38 |
|
|
Group: Development/C |
39 |
luigiwalser |
275808 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
40 |
boklm |
74479 |
|
41 |
shlomif |
152774 |
%description devel |
42 |
boklm |
74479 |
Development files for compiling sudo plugins. |
43 |
|
|
|
44 |
blino |
17466 |
%prep |
45 |
|
|
%setup -q -n %{name}-%{version}%{?pre} |
46 |
|
|
%patch1 -p1 -b .strip |
47 |
|
|
%patch2 -p1 -b .envdebug |
48 |
|
|
|
49 |
luigiwalser |
275808 |
# fix attribs |
50 |
|
|
find -name "Makefile.*" | xargs perl -pi -e "s|-m 0444|-m 0644|g" |
51 |
|
|
|
52 |
|
|
|
53 |
blino |
17466 |
%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 |
|
|
%configure2_5x \ |
63 |
shlomif |
152774 |
--without-rpath \ |
64 |
|
|
--with-logging=both \ |
65 |
blino |
17466 |
--with-logfac=authpriv \ |
66 |
shlomif |
152774 |
--with-logpath=%{_logdir}/sudo.log \ |
67 |
|
|
--with-editor=/bin/vi \ |
68 |
|
|
--enable-log-host \ |
69 |
|
|
--with-pam \ |
70 |
|
|
--with-pam-login \ |
71 |
|
|
--with-env-editor \ |
72 |
|
|
--with-noexec=no \ |
73 |
|
|
--with-linux-audit \ |
74 |
blino |
17466 |
--with-ignore-dot \ |
75 |
|
|
--with-tty-tickets \ |
76 |
shlomif |
152774 |
--with-ldap \ |
77 |
|
|
--with-ldap-conf-file=%{_sysconfdir}/ldap.conf \ |
78 |
|
|
--with-secure-path="/sbin:%{_sbindir}:/bin:%{_bindir}:/usr/local/bin:/usr/local/sbin" \ |
79 |
pterjan |
340151 |
--with-passprompt="[sudo] password for %p: " \ |
80 |
|
|
--with-plugindir=%{_libdir}/sudo |
81 |
blino |
17466 |
|
82 |
|
|
%make |
83 |
|
|
|
84 |
|
|
%install |
85 |
|
|
install -d %{buildroot}/usr |
86 |
|
|
install -d %{buildroot}%{_sysconfdir}/logrotate.d |
87 |
|
|
install -d %{buildroot}%{_sysconfdir}/sudoers.d |
88 |
|
|
install -d %{buildroot}%{_sysconfdir}/pam.d |
89 |
|
|
install -d %{buildroot}%{_var}/db/sudo |
90 |
|
|
install -d %{buildroot}%{_logdir}/sudo |
91 |
|
|
install -d %{buildroot}%{_logdir}/sudo-io |
92 |
|
|
|
93 |
|
|
%makeinstall_std install_uid=$UID install_gid=$(id -g) sudoers=uid=$UID sudoers_gid=$(id -g) |
94 |
|
|
|
95 |
|
|
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pam.d/sudo |
96 |
|
|
install -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers |
97 |
boklm |
74479 |
install -m0755 plugins/sudoers/sudoers2ldif %{buildroot}%{_bindir} |
98 |
blino |
17466 |
|
99 |
|
|
# Installing logrotated file |
100 |
|
|
cat <<END >%{buildroot}%{_sysconfdir}/logrotate.d/sudo |
101 |
|
|
%{_logdir}/sudo.log { |
102 |
|
|
missingok |
103 |
|
|
monthly |
104 |
|
|
compress |
105 |
|
|
} |
106 |
|
|
END |
107 |
|
|
|
108 |
|
|
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo << EOF |
109 |
|
|
#%PAM-1.0 |
110 |
shlomif |
152774 |
auth include system-auth |
111 |
|
|
account include system-auth |
112 |
|
|
password include system-auth |
113 |
|
|
session optional pam_keyinit.so revoke |
114 |
|
|
session required pam_limits.so |
115 |
blino |
17466 |
EOF |
116 |
|
|
|
117 |
|
|
cat > %{buildroot}%{_sysconfdir}/pam.d/sudo-i << EOF |
118 |
|
|
#%PAM-1.0 |
119 |
shlomif |
152774 |
auth include sudo |
120 |
|
|
account include sudo |
121 |
|
|
password include sudo |
122 |
|
|
session optional pam_keyinit.so force revoke |
123 |
|
|
session required pam_limits.so |
124 |
blino |
17466 |
EOF |
125 |
|
|
|
126 |
|
|
# so that strip can touch it... |
127 |
|
|
chmod 755 %{buildroot}%{_bindir}/* |
128 |
|
|
chmod 755 %{buildroot}%{_sbindir}/* |
129 |
|
|
|
130 |
|
|
# (tpg) create the missing log file |
131 |
|
|
touch %{buildroot}%{_logdir}/sudo.log |
132 |
|
|
|
133 |
oden |
814841 |
# move the lib to a common place |
134 |
|
|
mv %{buildroot}%{_libexecdir}/sudo/* %{buildroot}%{_libdir}/ |
135 |
|
|
rm -rf %{buildroot}%{_libexecdir}/sudo |
136 |
|
|
|
137 |
|
|
# cleanup |
138 |
|
|
rm -rf %{buildroot}%{_datadir}/examples samples |
139 |
|
|
cp -rp examples samples |
140 |
|
|
rm -f samples/Makefile* |
141 |
|
|
|
142 |
|
|
find %{buildroot} -type f -name "*.la" | xargs rm |
143 |
|
|
|
144 |
luigiwalser |
275808 |
%find_lang sudo |
145 |
|
|
%find_lang sudoers |
146 |
|
|
|
147 |
|
|
cat sudo.lang sudoers.lang > sudo_all.lang |
148 |
|
|
rm sudo.lang sudoers.lang |
149 |
|
|
|
150 |
fwang |
160282 |
%check |
151 |
|
|
make check |
152 |
|
|
|
153 |
blino |
17466 |
%post |
154 |
|
|
/bin/chmod 0440 %{_sysconfdir}/sudoers || : |
155 |
|
|
%create_ghostfile %{_logdir}/sudo.log root root 600 |
156 |
|
|
|
157 |
luigiwalser |
275808 |
%files -f sudo_all.lang |
158 |
oden |
814841 |
%doc doc/HISTORY README README.LDAP samples |
159 |
|
|
%doc doc/TROUBLESHOOTING doc/UPGRADE doc/schema.* |
160 |
blino |
17466 |
%attr(0440,root,root) %config(noreplace) %{_sysconfdir}/sudoers |
161 |
|
|
%attr(0750,root,root) %dir %{_sysconfdir}/sudoers.d/ |
162 |
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/sudo |
163 |
|
|
%config(noreplace) %{_sysconfdir}/pam.d/sudo |
164 |
|
|
%config(noreplace) %{_sysconfdir}/pam.d/sudo-i |
165 |
|
|
%attr(0755,root,root) %{_bindir}/sudoers2ldif |
166 |
|
|
%attr(4111,root,root) %{_bindir}/sudo |
167 |
|
|
%attr(4111,root,root) %{_bindir}/sudoedit |
168 |
|
|
%attr(0111,root,root) %{_bindir}/sudoreplay |
169 |
|
|
%attr(0755,root,root) %{_sbindir}/visudo |
170 |
|
|
%ghost %{_logdir}/sudo.log |
171 |
|
|
%{_mandir}/*/* |
172 |
|
|
%attr(0700,root,root) %dir %{_var}/db/sudo |
173 |
|
|
%attr(0750,root,root) %dir %{_logdir}/sudo-io |
174 |
oden |
814841 |
%attr(0755,root,root) %{_libdir}/sudo/group_file.so |
175 |
|
|
%attr(0755,root,root) %{_libdir}/sudo/sudoers.so |
176 |
|
|
%attr(0755,root,root) %{_libdir}/sudo/system_group.so |
177 |
|
|
%attr(0755,root,root) %{_libdir}/libsudo_util.so.* |
178 |
blino |
17466 |
|
179 |
luigiwalser |
275808 |
%files devel |
180 |
luigiwalser |
451036 |
%doc plugins/{group_file,sample} |
181 |
boklm |
74479 |
%{_includedir}/sudo_plugin.h |
182 |
luigiwalser |
275808 |
%{_mandir}/man8/sudo_plugin.8* |
183 |
oden |
814841 |
%{_libdir}/libsudo_util.so |