]> git.pld-linux.org Git - packages/sudo.git/blame_incremental - sudo.spec
add trigger to ensure includedir sudoers.d (added in d110a738) is in config
[packages/sudo.git] / sudo.spec
... / ...
CommitLineData
1# TODO: SSSD support?
2#
3# Conditional build:
4%bcond_without audit # Linux audit support
5%bcond_with kerberos5 # enable Kerberos V support (conflicts with PAM)
6%bcond_without ldap # disable LDAP support
7%bcond_without pam # disable PAM support
8%bcond_without selinux # build without SELinux support
9%bcond_with skey # enable skey (onetime passwords) support (conflicts with PAM)
10%bcond_without tests # do not perform "make check"
11
12%if "%{pld_release}" == "ac"
13%define pam_ver 0.80.1
14%else
15%define pam_ver 0.99.7.1
16%endif
17
18Summary: Allows command execution as root for specified users
19Summary(es.UTF-8): Permite que usuarios específicos ejecuten comandos como se fueran el root
20Summary(ja.UTF-8): 指定ユーザに制限付のroot権限を許可する
21Summary(pl.UTF-8): Umożliwia wykonywanie poleceń jako root dla konkretnych użytkowników
22Summary(pt_BR.UTF-8): Permite que usuários específicos executem comandos como se fossem o root
23Summary(ru.UTF-8): Позволяет определенным пользователям исполнять команды от имени root
24Summary(uk.UTF-8): Дозволяє вказаним користувачам виконувати команди від імені root
25Name: sudo
26Version: 1.8.7
27Release: 1
28Epoch: 1
29License: BSD
30Group: Applications/System
31Source0: ftp://ftp.sudo.ws/pub/sudo/%{name}-%{version}.tar.gz
32# Source0-md5: a02367090e1dac8d0c1747de1127b6bf
33Source1: %{name}.pamd
34Source2: %{name}-i.pamd
35Source3: %{name}.logrotate
36Patch0: %{name}-libtool.patch
37Patch1: %{name}-env.patch
38Patch2: config.patch
39URL: http://www.sudo.ws/sudo/
40%{?with_audit:BuildRequires: audit-libs-devel}
41BuildRequires: autoconf >= 2.53
42BuildRequires: automake
43BuildRequires: bison
44BuildRequires: flex
45BuildRequires: gettext-devel
46%{?with_kerberos5:BuildRequires: heimdal-devel}
47%{?with_selinux:BuildRequires: libselinux-devel}
48BuildRequires: libtool >= 2:2.2.6b
49%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
50%{?with_pam:BuildRequires: pam-devel}
51BuildRequires: rpm >= 4.4.9-56
52BuildRequires: rpmbuild(macros) >= 1.595
53%{?with_skey:BuildRequires: skey-devel >= 2.2-11}
54BuildRequires: zlib-devel
55Requires: pam >= %{pam_ver}
56Obsoletes: cu-sudo
57BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59%define schemadir /usr/share/openldap/schema
60
61%description
62Sudo (superuser do) allows a permitted user to execute a command as
63the superuser (real and effective uid and gid are set to 0 and root's
64group as set in the passwd file respectively).
65
66Sudo determines who is an authorized user by consulting the file
67/etc/sudoers. By giving sudo the -v flag a user can update the time
68stamp without running a command. The password prompt itself will also
69time out if the password is not entered with N minutes (again, this is
70defined at installation time and defaults to 5 minutes).
71
72%description -l es.UTF-8
73Sudo (superuser do) permite que el administrador del sistema otorga a
74ciertos usuarios (o grupos de usuarios) la habilidad para ejecutar
75algunos (o todos) comandos como root, registrando todos los comandos y
76argumentos. Sudo opera en una base por comando, no siendo un
77substituto para la shell.
78
79%description -l ja.UTF-8
80sudo (superuser do)
81とはシステム管理者が、信用できるユーザ(またはグループ)に対
82して、いくつか(もしくは全て)のコマンドを root
83として実行できるよう、そのコマン
84ドの実行履歴のログをとりつつ許可する仕組みです。sudo
85はコマンド一行単位で動作
86します。シェルの置き換えではありません。以下の機能を内蔵しています。ホスト単位
87で、そのコマンドを実行可能なユーザを制限する機能、各コマンドについての(誰がな
88にを実行したかの痕跡を残すための)豊富なロギング機能、sudo
89コマンドのタイムアウ
90ト時間を設定可能、複数のマシンで同一の設定ファイル(sudoers)を共有する機能、が
91あります。
92
93%description -l pl.UTF-8
94Sudo (superuser do) umożliwia wykonywanie konkretnych poleceń jako
95root dla wyspecyfikowanych użytkowników (rzeczywiste i efektywne
96uid/gid podczas wykonywania tych programów jest 0). To kto może
97wykonywać konkretne polecenia i w jaki sposób ma być autoryzowany jest
98opisane w pliku /etc/sudoers.
99
100%description -l pt_BR.UTF-8
101Sudo (superuser do) permite que o administrador do sistema dê a certos
102usuários (ou grupos de usuários) a habilidade para rodar alguns (ou
103todos) comandos como root, registrando todos os comandos e argumentos.
104Sudo opera numa base por comando, não sendo um substituto para a
105shell.
106
107%description -l ru.UTF-8
108Sudo (superuser do) позволяет системному администратору предоставлять
109определенным пользователям (или их группам) возможность исполнять
110некоторые (или все) команды с правами root, при этом протоколируя все
111команды и аргументы. Sudo работает с отдельными командами, это не
112замена командной оболочки (shell). Некоторые из возможностей sudo:
113ограничение того, какие команды пользователь может запускать в
114зависимости от хоста; полное протоколирование каждой команды;
115настраиваемое время, на протяжении которого sudo помнит пароль;
116использование одного конфигурационного файла (sudoers) на многих
117машинах.
118
119%description -l uk.UTF-8
120Sudo (superuser do) дозволяє системному адміністраторові надати певним
121користувачам (чи їх групам) можливість виконувати деякі (чи всі)
122команди з правами root, при цьому протоколюючи всі команди та
123аргументи. Sudo працює з окремими командами, це не заміна командної
124оболонки (shell). Деякі з можливостей sudo: обмеження того, які
125команди користувач може запускати в залежності від хоста; повне
126протоколювання кожної команди; настроюваний час, на протязі якого sudo
127пам'ятає пароль; використання одного конфігураційного файлу (sudoers)
128на багатьох машинах.
129
130%package devel
131Summary: Header file for sudo plugins development
132Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek dla sudo
133Group: Development/Libraries
134
135%description devel
136Header file for sudo plugins development.
137
138%description devel -l pl.UTF-8
139Plik nagłówkowy do tworzenia wtyczek dla sudo.
140
141%package -n openldap-schema-sudo
142Summary: Sudo LDAP schema
143Summary(pl.UTF-8): Schemat bazy sudo dla LDAP
144Group: Networking/Daemons
145Requires(post,postun): sed >= 4.0
146Requires: openldap-servers
147Requires: sed >= 4.0
148%if "%{_rpmversion}" >= "5"
149BuildArch: noarch
150%endif
151
152%description -n openldap-schema-sudo
153This package contains sudo.schema for openldap.
154
155%description -n openldap-schema-sudo -l pl.UTF-8
156Ten pakiet zawiera sudo.schema dla pakietu openldap.
157
158%prep
159%setup -q
160# only local macros
161mv aclocal.m4 acinclude.m4
162# do not load libtool macros from acinclude
163cp -p acinclude.m4 acinclude.m4.orig
164%{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4
165
166%patch0 -p1
167%patch1 -p1
168%patch2 -p1
169
170%build
171%{__mv} install-sh install-custom-sh
172%{__libtoolize}
173%{__mv} install-custom-sh install-sh
174cp -f /usr/share/automake/config.sub .
175%{__aclocal} -I m4
176%{__autoconf}
177%configure \
178 NROFFPROG=nroff \
179 --enable-zlib=system \
180 --with-env-editor \
181 --with-ignore-dot \
182 --with-incpath=/usr/include/security \
183 %{?with_kerberos5:--with-kerb5} \
184 %{?with_ldap:--with-ldap} \
185 %{?with_audit:--with-linux-audit} \
186 --with-logfac=auth \
187 --with-logging=both \
188 --with-loglen=320 \
189 --with-logpath=/var/log/sudo \
190 --with-long-otp-prompt \
191 --with-pam \
192 --with-pam-login \
193 --with-passprompt="[sudo] password for %%p: " \
194 --with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \
195 %{?with_selinux:--with-selinux} \
196 %{?with_skey:--with-skey}
197
198%{__make}
199
200%{?with_tests:%{__make} check}
201
202%install
203rm -rf $RPM_BUILD_ROOT
204install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{sudoers.d,pam.d,logrotate.d},/var/log/sudo-io,%{_mandir}/man8}
205
206%{__make} -j1 install \
207 DESTDIR=$RPM_BUILD_ROOT \
208 install_uid=$(id -u) \
209 install_gid=$(id -g) \
210 sudoers_uid=$(id -u) \
211 sudoers_gid=$(id -g)
212
213cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo
214cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
215cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/sudo
216
217touch $RPM_BUILD_ROOT/var/log/sudo
218
219%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
220
221%if %{with ldap}
222install -d $RPM_BUILD_ROOT%{schemadir}
223cp -p doc/schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema
224%endif
225
226# sudo,sudoers domains
227%find_lang %{name} --all-name
228
229%clean
230rm -rf $RPM_BUILD_ROOT
231
232%post -n openldap-schema-sudo
233%openldap_schema_register %{schemadir}/sudo.schema -d core
234%service -q ldap restart
235%banner -o -e openldap-schema-sudo <<'EOF'
236NOTE:
237In order for sudoRole LDAP queries to be efficient, the server must index
238the attribute 'sudoUser', e.g.
239
240 # Indices to maintain
241 index sudoUser eq
242EOF
243
244%postun -n openldap-schema-sudo
245if [ "$1" = "0" ]; then
246 %openldap_schema_unregister %{schemadir}/sudo.schema
247 %service -q ldap restart
248fi
249
250%triggerpostun -- %{name} < 1:1.7.4p3-2
251# add include statement to sudoers
252if ! grep -q '#includedir %{_sysconfdir}/sudoers.d' /etc/sudoers; then
253 echo 'Adding includedir %{_sysconfdir}/sudoers.d to /etc/sudoers'
254 cat <<-EOF >> /etc/sudoers
255 ## Read drop-in files from %{_sysconfdir}/sudoers.d
256 ## (the '#' here does not indicate a comment)
257 #includedir %{_sysconfdir}/sudoers.d
258 EOF
259fi
260
261%triggerpostun -- %{name} < 1:1.7.8p2-5
262mv -f /var/run/sudo/* /var/db/sudo 2>/dev/null
263rmdir /var/run/sudo 2>/dev/null || :
264
265%files -f %{name}.lang
266%defattr(644,root,root,755)
267%doc ChangeLog NEWS README doc/{CONTRIBUTORS,HISTORY,LICENSE,TROUBLESHOOTING,UPGRADE,sample.*}
268%{?with_ldap:%doc README.LDAP plugins/sudoers/sudoers2ldif}
269%attr(550,root,root) %dir %{_sysconfdir}/sudoers.d
270%attr(440,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudoers
271%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo
272%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo-i
273%attr(4755,root,root) %{_bindir}/sudo
274%attr(4755,root,root) %{_bindir}/sudoedit
275%attr(755,root,root) %{_bindir}/sudoreplay
276%attr(755,root,root) %{_sbindir}/visudo
277%dir %{_libdir}/sudo
278%{?with_selinux:%attr(755,root,root) %{_libdir}/sudo/sesh}
279%attr(755,root,root) %{_libdir}/sudo/group_file.so
280%attr(755,root,root) %{_libdir}/sudo/sudo_noexec.so
281%attr(755,root,root) %{_libdir}/sudo/sudoers.so
282%attr(755,root,root) %{_libdir}/sudo/system_group.so
283%{_mandir}/man5/sudoers.5*
284%{_mandir}/man5/sudo.conf.5*
285%{?with_ldap:%{_mandir}/man5/sudoers.ldap.5*}
286%{_mandir}/man8/sudo.8*
287%{_mandir}/man8/sudo_plugin.8*
288%{_mandir}/man8/sudoedit.8*
289%{_mandir}/man8/sudoreplay.8*
290%{_mandir}/man8/visudo.8*
291%attr(600,root,root) %ghost /var/log/sudo
292%attr(700,root,root) /var/log/sudo-io
293%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/sudo
294%attr(700,root,root) %dir /var/db/sudo
295
296%files devel
297%defattr(644,root,root,755)
298%{_includedir}/sudo_plugin.h
299
300%if %{with ldap}
301%files -n openldap-schema-sudo
302%defattr(644,root,root,755)
303%{schemadir}/sudo.schema
304%endif
This page took 0.033034 seconds and 4 git commands to generate.