1 |
## Do not apply any unauthorized patches to this package! |
2 |
## - vdanen 05/18/01 |
3 |
## |
4 |
|
5 |
# Version of ssh-askpass |
6 |
%define aversion 1.2.4.1 |
7 |
# Version of watchdog patch |
8 |
%define wversion 4.4p1 |
9 |
|
10 |
# Version of the hpn patch |
11 |
%define hpnver 13v6 |
12 |
|
13 |
# overrides |
14 |
%define build_skey 0 |
15 |
%define build_krb5 1 |
16 |
%define build_watchdog 0 |
17 |
%define build_x11askpass 1 |
18 |
%define build_gnomeaskpass 1 |
19 |
%define build_ldap 0 |
20 |
%define build_sftpcontrol 0 |
21 |
%define build_hpn 0 |
22 |
%define build_audit 0 |
23 |
%define build_libedit 1 |
24 |
|
25 |
%{?_with_skey: %{expand: %%global build_skey 1}} |
26 |
%{?_without_skey: %{expand: %%global build_skey 0}} |
27 |
%{?_with_krb5: %{expand: %%global build_krb5 1}} |
28 |
%{?_without_krb5: %{expand: %%global build_krb5 0}} |
29 |
%{?_with_watchdog: %{expand: %%global build_watchdog 1}} |
30 |
%{?_without_watchdog: %{expand: %%global build_watchdog 0}} |
31 |
%{?_with_x11askpass: %{expand: %%global build_x11askpass 1}} |
32 |
%{?_without_x11askpass: %{expand: %%global build_x11askpass 0}} |
33 |
%{?_with_gnomeaskpass: %{expand: %%global build_gnomeaskpass 1}} |
34 |
%{?_without_gnomeaskpass: %{expand: %%global build_gnomeaskpass 0}} |
35 |
%{?_with_ldap: %{expand: %%global build_ldap 1}} |
36 |
%{?_without_ldap: %{expand: %%global build_ldap 0}} |
37 |
%{?_with_sftpcontrol: %{expand: %%global build_sftpcontrol 1}} |
38 |
%{?_without_sftpcontrol: %{expand: %%global build_sftpcontrol 0}} |
39 |
%{?_with_hpn: %{expand: %%global build_hpn 1}} |
40 |
%{?_without_hpn: %{expand: %%global build_hpn 0}} |
41 |
%{?_with_audit: %{expand: %%global build_audit 1}} |
42 |
%{?_without_audit: %{expand: %%global build_audit 0}} |
43 |
%{?_with_libedit: %{expand: %%global build_libedit 1}} |
44 |
%{?_without_libedit: %{expand: %%global build_libedit 0}} |
45 |
|
46 |
%if %{mdkversion} < 200700 |
47 |
%define OPENSSH_PATH "/usr/local/bin:/bin:%{_bindir}:/usr/X11R6/bin" |
48 |
%define XAUTH /usr/X11R6/bin/xauth |
49 |
%else |
50 |
%define OPENSSH_PATH "/usr/local/bin:/bin:%{_bindir}" |
51 |
%define XAUTH %{_bindir}/xauth |
52 |
%endif |
53 |
|
54 |
Summary: OpenSSH free Secure Shell (SSH) implementation |
55 |
Name: openssh |
56 |
Version: 5.6p1 |
57 |
Release: %mkrel 2 |
58 |
License: BSD |
59 |
Group: Networking/Remote access |
60 |
URL: http://www.openssh.com/ |
61 |
Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz |
62 |
Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc |
63 |
Source2: http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.bz2 |
64 |
# ssh-copy-id taken from debian, with "usage" added |
65 |
Source3: ssh-copy-id |
66 |
Source7: openssh-xinetd |
67 |
Source9: README.sftpfilecontrol |
68 |
# this is never to be applied by default |
69 |
# http://www.sc.isc.tohoku.ac.jp/~hgot/sources/openssh-watchdog.html |
70 |
Source10: openssh-%{wversion}-watchdog.patch.tgz |
71 |
Source12: ssh_ldap_key.pl |
72 |
Source15: ssh-avahi-integration |
73 |
Source16: sshd.pam-0.77 |
74 |
Source17: sshd.pam |
75 |
Source18: sshd.init |
76 |
Source19: README.3.8p1.upgrade.urpmi |
77 |
Source20: README.3.9p1-3.upgrade.urpmi |
78 |
Source21: README.hpn |
79 |
Patch1: openssh-mdv_conf.diff |
80 |
# authorized by Damien Miller <djm@openbsd.com> |
81 |
Patch3: openssh-3.1p1-check-only-ssl-version.patch |
82 |
# rediffed from openssh-4.4p1-watchdog.patch.tgz |
83 |
Patch4: openssh-4.4p1-watchdog.diff |
84 |
# optional ldap support |
85 |
# http://dev.inversepath.com/trac/openssh-lpk |
86 |
#Patch6: http://dev.inversepath.com/openssh-lpk/openssh-lpk-4.6p1-0.3.9.patch |
87 |
# new location for the lpk patch. |
88 |
# rediffed from "svn checkout http://openssh-lpk.googlecode.com/svn/trunk/ openssh-lpk-read-only" |
89 |
Patch6: openssh-lpk-5.4p1-0.3.10.diff |
90 |
# http://sftpfilecontrol.sourceforge.net |
91 |
# Not applied by default |
92 |
# P7 is rediffed and slightly adjusted from http://sftplogging.sourceforge.net/download/v1.5/openssh-4.4p1.sftplogging-v1.5.patch |
93 |
Patch7: openssh-4.9p1.sftplogging-v1.5.diff |
94 |
# (tpg) http://www.psc.edu/networking/projects/hpn-ssh/ |
95 |
Patch11: http://www.psc.edu/networking/projects/hpn-ssh/openssh-5.2p1-hpn%{hpnver}.diff |
96 |
Patch12: http://www.psc.edu/networking/projects/hpn-ssh/openssh5.1-peaktput.diff |
97 |
#gw: from Fedora: |
98 |
#fix round-robin DNS with GSSAPI authentification |
99 |
Patch13: openssh-4.3p2-gssapi-canohost.patch |
100 |
Patch14: openssh-4.7p1-audit.patch |
101 |
Patch17: openssh-5.1p1-askpass-progress.patch |
102 |
Patch18: openssh-4.3p2-askpass-grab-info.patch |
103 |
Patch19: openssh-4.0p1-exit-deadlock.patch |
104 |
Patch21: openssh_tcp_wrappers.patch |
105 |
Obsoletes: ssh |
106 |
Provides: ssh |
107 |
Requires(post): openssl >= 0.9.7 |
108 |
Requires(post): makedev |
109 |
Requires(preun): openssl >= 0.9.7 |
110 |
Requires: tcp_wrappers |
111 |
BuildRequires: groff-for-man |
112 |
BuildRequires: openssl-devel >= 0.9.7 |
113 |
BuildRequires: pam-devel |
114 |
BuildRequires: tcp_wrappers-devel |
115 |
BuildRequires: zlib-devel |
116 |
%if %{build_skey} |
117 |
BuildRequires: skey-devel |
118 |
%endif |
119 |
%if %{build_krb5} |
120 |
BuildRequires: krb5-devel |
121 |
%endif |
122 |
%if %{build_x11askpass} |
123 |
%if %{mdkversion} < 200700 |
124 |
BuildRequires: X11-devel xorg-x11 |
125 |
%else |
126 |
BuildRequires: imake |
127 |
BuildRequires: rman |
128 |
# http://qa.mandriva.com/show_bug.cgi?id=22736 |
129 |
BuildRequires: x11-util-cf-files >= 1.0.2 |
130 |
BuildRequires: gccmakedep |
131 |
BuildRequires: libx11-devel |
132 |
BuildRequires: libxt-devel |
133 |
%endif |
134 |
%endif |
135 |
%if %{build_gnomeaskpass} |
136 |
BuildRequires: gtk+2-devel |
137 |
%endif |
138 |
%if %{build_ldap} |
139 |
BuildRequires: openldap-devel >= 2.0 |
140 |
%endif |
141 |
%if %{build_audit} |
142 |
BuildRequires: audit-devel |
143 |
%endif |
144 |
%if %{build_libedit} |
145 |
BuildRequires: edit-devel ncurses-devel |
146 |
%endif |
147 |
BuildConflicts: libgssapi-devel |
148 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
149 |
|
150 |
%description |
151 |
Ssh (Secure Shell) is a program for logging into a remote machine and for |
152 |
executing commands in a remote machine. It is intended to replace |
153 |
rlogin and rsh, and provide secure encrypted communications between |
154 |
two untrusted hosts over an insecure network. X11 connections and |
155 |
arbitrary TCP/IP ports can also be forwarded over the secure channel. |
156 |
|
157 |
OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it |
158 |
up to date in terms of security and features, as well as removing all |
159 |
patented algorithms to separate libraries (OpenSSL). |
160 |
|
161 |
This package includes the core files necessary for both the OpenSSH |
162 |
client and server. To make this package useful, you should also |
163 |
install openssh-clients, openssh-server, or both. |
164 |
|
165 |
You can build %{name} with some conditional build swithes; |
166 |
|
167 |
(ie. use with rpm --rebuild): |
168 |
|
169 |
--with[out] skey smartcard support (disabled) |
170 |
--with[out] krb5 kerberos support (enabled) |
171 |
--with[out] watchdog watchdog support (disabled) |
172 |
--with[out] x11askpass X11 ask pass support (enabled) |
173 |
--with[out] gnomeaskpass Gnome ask pass support (enabled) |
174 |
--with[out] ldap OpenLDAP support (disabled) |
175 |
--with[out] sftpcontrol sftp file control support (disabled) |
176 |
--with[out] hpn HPN ssh/scp support (disabled) |
177 |
--with[out] audit audit support (disabled) |
178 |
--with[out] libedit libedit support in sftp (enabled) |
179 |
|
180 |
%package clients |
181 |
Summary: OpenSSH Secure Shell protocol clients |
182 |
Group: Networking/Remote access |
183 |
Requires: %{name} = %{version}-%{release} |
184 |
Obsoletes: ssh-clients, sftp, ssh |
185 |
Provides: ssh-clients, sftp, ssh |
186 |
# scp was moved from openssh to openssh-clients |
187 |
# http://qa.mandriva.com/show_bug.cgi?id=17491 |
188 |
Conflicts: %{name} <= 4.1p1-6mdk |
189 |
|
190 |
%description clients |
191 |
Ssh (Secure Shell) is a program for logging into a remote machine and for |
192 |
executing commands in a remote machine. It is intended to replace |
193 |
rlogin and rsh, and provide secure encrypted communications between |
194 |
two untrusted hosts over an insecure network. X11 connections and |
195 |
arbitrary TCP/IP ports can also be forwarded over the secure channel. |
196 |
|
197 |
OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it |
198 |
up to date in terms of security and features, as well as removing all |
199 |
patented algorithms to separate libraries (OpenSSL). |
200 |
|
201 |
This package includes the clients necessary to make encrypted connections |
202 |
to SSH servers. |
203 |
|
204 |
%package server |
205 |
Summary: OpenSSH Secure Shell protocol server (sshd) |
206 |
Group: System/Servers |
207 |
Requires(pre): %{name} = %{version}-%{release} chkconfig >= 0.9 |
208 |
Requires(pre): pam >= 0.74 |
209 |
Requires(pre): rpm-helper |
210 |
Requires(post): rpm-helper |
211 |
Requires(preun): rpm-helper |
212 |
Requires(postun): rpm-helper |
213 |
Requires(post): openssl >= 0.9.7 |
214 |
Requires(post): makedev |
215 |
Requires: %{name}-clients = %{version}-%{release} |
216 |
%if %{build_skey} |
217 |
Requires: skey |
218 |
%endif |
219 |
%if %{build_audit} |
220 |
BuildRequires: audit |
221 |
%endif |
222 |
Obsoletes: ssh-server, sshd |
223 |
Provides: ssh-server, sshd |
224 |
|
225 |
%description server |
226 |
Ssh (Secure Shell) is a program for logging into a remote machine and for |
227 |
executing commands in a remote machine. It is intended to replace |
228 |
rlogin and rsh, and provide secure encrypted communications between |
229 |
two untrusted hosts over an insecure network. X11 connections and |
230 |
arbitrary TCP/IP ports can also be forwarded over the secure channel. |
231 |
|
232 |
OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it |
233 |
up to date in terms of security and features, as well as removing all |
234 |
patented algorithms to separate libraries (OpenSSL). |
235 |
|
236 |
This package contains the secure shell daemon. The sshd is the server |
237 |
part of the secure shell protocol and allows ssh clients to connect to |
238 |
your host. |
239 |
|
240 |
%package askpass-common |
241 |
Summary: OpenSSH X11 passphrase common scripts |
242 |
Group: Networking/Remote access |
243 |
|
244 |
%description askpass-common |
245 |
OpenSSH X11 passphrase common scripts |
246 |
|
247 |
%if %{build_x11askpass} |
248 |
%package askpass |
249 |
Summary: OpenSSH X11 passphrase dialog |
250 |
Group: Networking/Remote access |
251 |
Requires: %{name} = %{version}-%{release} |
252 |
Requires: %{name}-askpass-common |
253 |
Obsoletes: ssh-extras, ssh-askpass |
254 |
Provides: ssh-extras, ssh-askpass |
255 |
Requires(pre): update-alternatives |
256 |
|
257 |
%description askpass |
258 |
Ssh (Secure Shell) is a program for logging into a remote machine and for |
259 |
executing commands in a remote machine. It is intended to replace |
260 |
rlogin and rsh, and provide secure encrypted communications between |
261 |
two untrusted hosts over an insecure network. X11 connections and |
262 |
arbitrary TCP/IP ports can also be forwarded over the secure channel. |
263 |
|
264 |
OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it |
265 |
up to date in terms of security and features, as well as removing all |
266 |
patented algorithms to separate libraries (OpenSSL). |
267 |
|
268 |
This package contains Jim Knoble's <jmknoble@pobox.com> X11 passphrase |
269 |
dialog. |
270 |
%endif |
271 |
|
272 |
%if %{build_gnomeaskpass} |
273 |
%package askpass-gnome |
274 |
Summary: OpenSSH GNOME passphrase dialog |
275 |
Group: Networking/Remote access |
276 |
Requires: %{name} = %{version}-%{release} |
277 |
Requires: %{name}-askpass-common |
278 |
Obsoletes: ssh-extras |
279 |
Requires(pre): update-alternatives |
280 |
Provides: %{name}-askpass, ssh-askpass, ssh-extras |
281 |
|
282 |
%description askpass-gnome |
283 |
Ssh (Secure Shell) is a program for logging into a remote machine and for |
284 |
executing commands in a remote machine. It is intended to replace |
285 |
rlogin and rsh, and provide secure encrypted communications between |
286 |
two untrusted hosts over an insecure network. X11 connections and |
287 |
arbitrary TCP/IP ports can also be forwarded over the secure channel. |
288 |
|
289 |
OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it |
290 |
up to date in terms of security and features, as well as removing all |
291 |
patented algorithms to separate libraries (OpenSSL). |
292 |
|
293 |
This package contains the GNOME passphrase dialog. |
294 |
%endif |
295 |
|
296 |
%prep |
297 |
%if %{build_x11askpass} |
298 |
echo "Building with x11 askpass..." |
299 |
%endif |
300 |
%if %{build_gnomeaskpass} |
301 |
echo "Building with GNOME askpass..." |
302 |
%endif |
303 |
%if %{build_krb5} |
304 |
echo "Building with Kerberos5 support..." |
305 |
%endif |
306 |
%if %{build_skey} |
307 |
echo "Building with S/KEY support..." |
308 |
%endif |
309 |
%if %{build_watchdog} |
310 |
echo "Building with watchdog support..." |
311 |
%endif |
312 |
%if %{build_ldap} |
313 |
echo "Buiding with support for authenticating to public keys in ldap" |
314 |
%endif |
315 |
%if %{build_sftpcontrol} |
316 |
echo "Buiding with support for sftp file control" |
317 |
%endif |
318 |
%if %{build_hpn} |
319 |
echo "Buiding with support for High Performance Network SSH/SCP" |
320 |
%endif |
321 |
%if %{build_audit} |
322 |
echo "Buiding with audit support" |
323 |
%endif |
324 |
|
325 |
%setup -q -a2 -a10 |
326 |
|
327 |
%patch1 -p1 -b .mdkconf |
328 |
%patch3 -p1 -b .ssl_ver |
329 |
%if %{build_watchdog} |
330 |
#patch -p0 -s -z .wdog < %{name}-%{wversion}-watchdog.patch |
331 |
%patch4 -p1 -b .watchdog |
332 |
%endif |
333 |
%if %{build_ldap} |
334 |
sed -i 's|UsePrivilegeSeparation yes|#UsePrivilegeSeparation yes|' sshd_config |
335 |
%patch6 -p1 -b .lpk |
336 |
rm -f README.lpk.lpk |
337 |
%define _default_patch_fuzz 3 |
338 |
%else |
339 |
%define _default_patch_fuzz 2 |
340 |
%endif |
341 |
%if %{build_sftpcontrol} |
342 |
#cat %{SOURCE8} | patch -p1 -s -z .sftpcontrol |
343 |
echo "This patch is broken or needs to be updated/rediffed"; exit 1 |
344 |
%patch7 -p1 -b .sftplogging-v1.5 |
345 |
# README with license terms for this patch |
346 |
install -m 0644 %{SOURCE9} . |
347 |
%endif |
348 |
%if %{build_hpn} |
349 |
echo "This patch is broken or needs to be updated/rediffed"; exit 1 |
350 |
%patch11 -p1 -b .hpn |
351 |
%patch12 -p1 -b .peak |
352 |
install %{SOURCE21} . |
353 |
%endif |
354 |
%patch13 -p1 -b .canohost |
355 |
%if %{build_audit} |
356 |
%patch14 -p1 -b .audit |
357 |
%endif |
358 |
%patch17 -p1 -b .progress |
359 |
%patch18 -p1 -b .grab-info |
360 |
%patch19 -p1 -b .exit-deadlock |
361 |
%patch21 -p1 -b .tcp_wrappers_mips |
362 |
|
363 |
install %{SOURCE12} %{SOURCE19} %{SOURCE20} . |
364 |
|
365 |
# fix conditional pam config file |
366 |
%if %{mdkversion} < 200610 |
367 |
install -m 0644 %{SOURCE16} sshd.pam |
368 |
%else |
369 |
install -m 0644 %{SOURCE17} sshd.pam |
370 |
%endif |
371 |
|
372 |
install -m 0755 %{SOURCE18} sshd.init |
373 |
|
374 |
# fix attribs |
375 |
chmod 644 ChangeLog OVERVIEW README* INSTALL CREDITS LICENCE TODO ssh_ldap_key.pl |
376 |
|
377 |
# http://qa.mandriva.com/show_bug.cgi?id=22957 |
378 |
perl -pi -e "s|_OPENSSH_PATH_|%{OPENSSH_PATH}|g" sshd_config |
379 |
|
380 |
%build |
381 |
autoreconf |
382 |
|
383 |
%serverbuild |
384 |
%if %{mdkversion} == 200710 |
385 |
export CFLAGS="$CFLAGS -fstack-protector -fstack-protector-all --param=ssp-buffer-size=1" |
386 |
export CXXFLAGS="$CXXFLAGS -fstack-protector -fstack-protector-all --param=ssp-buffer-size=1" |
387 |
export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fstack-protector -fstack-protector-all --param=ssp-buffer-size=1" |
388 |
%endif |
389 |
|
390 |
%if %{build_x11askpass} |
391 |
pushd x11-ssh-askpass-%{aversion} |
392 |
%configure2_5x \ |
393 |
--prefix=%{_prefix} --libdir=%{_libdir} \ |
394 |
--mandir=%{_mandir} --libexecdir=%{_libdir}/ssh \ |
395 |
--with-app-defaults-dir=%{_sysconfdir}/X11/app-defaults \ |
396 |
%if %{build_libedit} |
397 |
--with-libedit \ |
398 |
%else |
399 |
--without-libedit \ |
400 |
%endif |
401 |
|
402 |
xmkmf -a |
403 |
|
404 |
%ifarch x86_64 |
405 |
perl -pi -e "s|/usr/lib\b|%{_libdir}|g" Makefile |
406 |
perl -pi -e "s|i586-mandriva-linux-gnu|x86_64-mandriva-linux-gnu|g" Makefile |
407 |
perl -pi -e "s|%{_libdir}/gcc/|/usr/lib/gcc/|g" Makefile |
408 |
perl -pi -e "s|-m32|-m64|g" Makefile |
409 |
perl -pi -e "s|__i386__|__x86_64__|g" Makefile |
410 |
%endif |
411 |
|
412 |
make \ |
413 |
BINDIR=%{_libdir}/ssh \ |
414 |
CDEBUGFLAGS="$RPM_OPT_FLAGS" \ |
415 |
CXXDEBUGFLAGS="$RPM_OPT_FLAGS" |
416 |
|
417 |
# For some reason the x11-ssh-askpass.1.html file is not created on 10.0/10.1 |
418 |
# x86_64, so we just do it manually here... (oden) |
419 |
rm -f x11-ssh-askpass.1x.html x11-ssh-askpass.1x-html |
420 |
rman -f HTML < x11-ssh-askpass._man > x11-ssh-askpass.1x-html && \ |
421 |
mv -f x11-ssh-askpass.1x-html x11-ssh-askpass.1.html |
422 |
popd |
423 |
%endif |
424 |
|
425 |
%if %{build_gnomeaskpass} |
426 |
pushd contrib |
427 |
make gnome-ssh-askpass2 CC="%__cc %optflags %ldflags" |
428 |
mv gnome-ssh-askpass2 gnome-ssh-askpass |
429 |
popd |
430 |
%endif |
431 |
|
432 |
%configure2_5x \ |
433 |
--prefix=%{_prefix} \ |
434 |
--sysconfdir=%{_sysconfdir}/ssh \ |
435 |
--mandir=%{_mandir} \ |
436 |
--libdir=%{_libdir} \ |
437 |
--libexecdir=%{_libdir}/ssh \ |
438 |
--datadir=%{_datadir}/ssh \ |
439 |
--disable-strip \ |
440 |
--with-tcp-wrappers \ |
441 |
--with-pam \ |
442 |
--with-default-path=%{OPENSSH_PATH} \ |
443 |
--with-xauth=%{XAUTH} \ |
444 |
--with-privsep-path=/var/empty \ |
445 |
--without-zlib-version-check \ |
446 |
%if %{build_krb5} |
447 |
--with-kerberos5=%{_prefix} \ |
448 |
%endif |
449 |
%if %{build_skey} |
450 |
--with-skey \ |
451 |
%endif |
452 |
%if %{build_ldap} |
453 |
--with-libs="-lldap -llber" \ |
454 |
--with-cppflags="-DWITH_LDAP_PUBKEY -DLDAP_DEPRECATED" \ |
455 |
%endif |
456 |
--with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:%{_sbindir}:%{_bindir} \ |
457 |
%if %{build_libedit} |
458 |
--with-libedit \ |
459 |
%else |
460 |
--without-libedit \ |
461 |
%endif |
462 |
%if %{build_audit} |
463 |
--with-linux-audit \ |
464 |
%endif |
465 |
|
466 |
%make |
467 |
|
468 |
%install |
469 |
rm -rf %{buildroot} |
470 |
|
471 |
%makeinstall_std |
472 |
|
473 |
install -d %{buildroot}%{_sysconfdir}/ssh |
474 |
install -d %{buildroot}%{_sysconfdir}/pam.d/ |
475 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
476 |
install -d %{buildroot}%{_initrddir} |
477 |
install -m644 sshd.pam %{buildroot}%{_sysconfdir}/pam.d/sshd |
478 |
install -m755 sshd.init %{buildroot}%{_initrddir}/sshd |
479 |
|
480 |
if [[ -f sshd_config.out ]]; then |
481 |
install -m600 sshd_config.out %{buildroot}%{_sysconfdir}/ssh/sshd_config |
482 |
else |
483 |
install -m600 sshd_config %{buildroot}%{_sysconfdir}/ssh/sshd_config |
484 |
fi |
485 |
echo "root" > %{buildroot}%{_sysconfdir}/ssh/denyusers |
486 |
|
487 |
if [[ -f ssh_config.out ]]; then |
488 |
install -m644 ssh_config.out %{buildroot}%{_sysconfdir}/ssh/ssh_config |
489 |
else |
490 |
install -m644 ssh_config %{buildroot}%{_sysconfdir}/ssh/ssh_config |
491 |
fi |
492 |
echo " StrictHostKeyChecking no" >> %{buildroot}%{_sysconfdir}/ssh/ssh_config |
493 |
|
494 |
mkdir -p %{buildroot}%{_libdir}/ssh |
495 |
%if %{build_x11askpass} |
496 |
pushd x11-ssh-askpass-%{aversion} |
497 |
#make DESTDIR=%{buildroot} install |
498 |
#make DESTDIR=%{buildroot} install.man |
499 |
#install -d %{buildroot}%{_prefix}/X11R6/lib/X11/doc/html |
500 |
#install -m0644 x11-ssh-askpass.1.html %{buildroot}%{_prefix}/X11R6/lib/X11/doc/html/ |
501 |
install -d %{buildroot}%{_libdir}/ssh |
502 |
install -d %{buildroot}%{_sysconfdir}/X11/app-defaults |
503 |
install -m0644 SshAskpass.ad %{buildroot}%{_sysconfdir}/X11/app-defaults/SshAskpass |
504 |
install -m0755 x11-ssh-askpass %{buildroot}%{_libdir}/ssh/ |
505 |
install -m0644 x11-ssh-askpass.man %{buildroot}%{_mandir}/man1/x11-ssh-askpass.1 |
506 |
popd |
507 |
%endif |
508 |
|
509 |
install -d %{buildroot}%{_sysconfdir}/profile.d/ |
510 |
%if %{build_gnomeaskpass} |
511 |
install -m 755 contrib/gnome-ssh-askpass %{buildroot}%{_libdir}/ssh/gnome-ssh-askpass |
512 |
%endif |
513 |
|
514 |
cat > %{buildroot}%{_sysconfdir}/profile.d/90ssh-askpass.csh <<EOF |
515 |
setenv SSH_ASKPASS %{_libdir}/ssh/ssh-askpass |
516 |
EOF |
517 |
|
518 |
cat > %{buildroot}%{_sysconfdir}/profile.d/90ssh-askpass.sh <<EOF |
519 |
export SSH_ASKPASS=%{_libdir}/ssh/ssh-askpass |
520 |
EOF |
521 |
|
522 |
cat > %{buildroot}%{_sysconfdir}/profile.d/90ssh-client.sh <<'EOF' |
523 |
# fix hanging ssh clients on exit |
524 |
if [ -n "$BASH_VERSION" ]; then |
525 |
shopt -s huponexit |
526 |
elif [ -n "$ZSH_VERSION" ]; then |
527 |
setopt hup |
528 |
fi |
529 |
EOF |
530 |
|
531 |
install -m 0755 %{SOURCE3} %{buildroot}/%{_bindir}/ssh-copy-id |
532 |
chmod a+x %{buildroot}/%{_bindir}/ssh-copy-id |
533 |
install -m 644 contrib/ssh-copy-id.1 %{buildroot}/%{_mandir}/man1/ |
534 |
|
535 |
# create pre-authentication directory |
536 |
mkdir -p %{buildroot}/var/empty |
537 |
|
538 |
# remove unwanted files |
539 |
rm -f %{buildroot}%{_libdir}/ssh/ssh-askpass |
540 |
|
541 |
# xinetd support (tv) |
542 |
mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d/ |
543 |
install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/xinetd.d/sshd-xinetd |
544 |
|
545 |
cat > %{buildroot}%{_sysconfdir}/sysconfig/sshd << EOF |
546 |
#SSHD="%{_sbindir}/sshd" |
547 |
#PID_FILE="/var/run/sshd.pid" |
548 |
#OPTIONS="" |
549 |
EOF |
550 |
|
551 |
# avahi integration support (misc) |
552 |
mkdir -p %{buildroot}%{_sysconfdir}/avahi/services/ |
553 |
install -m 0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/avahi/services/%{name}.service |
554 |
|
555 |
# make sure strip can touch it |
556 |
chmod 755 %{buildroot}%{_libdir}/ssh/ssh-keysign |
557 |
|
558 |
%clean |
559 |
rm -rf %{buildroot} |
560 |
|
561 |
%pre server |
562 |
%_pre_useradd sshd /var/empty /bin/true |
563 |
|
564 |
%post server |
565 |
# do some key management; taken from the initscript |
566 |
|
567 |
KEYGEN=/usr/bin/ssh-keygen |
568 |
RSA1_KEY=/etc/ssh/ssh_host_key |
569 |
RSA_KEY=/etc/ssh/ssh_host_rsa_key |
570 |
DSA_KEY=/etc/ssh/ssh_host_dsa_key |
571 |
|
572 |
do_rsa1_keygen() { |
573 |
if [ ! -s $RSA1_KEY ]; then |
574 |
echo -n "Generating SSH1 RSA host key... " |
575 |
if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then |
576 |
chmod 600 $RSA1_KEY |
577 |
chmod 644 $RSA1_KEY.pub |
578 |
echo "done" |
579 |
echo |
580 |
else |
581 |
echo "failed" |
582 |
echo |
583 |
exit 1 |
584 |
fi |
585 |
fi |
586 |
} |
587 |
|
588 |
do_rsa_keygen() { |
589 |
if [ ! -s $RSA_KEY ]; then |
590 |
echo "Generating SSH2 RSA host key... " |
591 |
if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then |
592 |
chmod 600 $RSA_KEY |
593 |
chmod 644 $RSA_KEY.pub |
594 |
echo "done" |
595 |
echo |
596 |
else |
597 |
echo "failed" |
598 |
echo |
599 |
exit 1 |
600 |
fi |
601 |
fi |
602 |
} |
603 |
|
604 |
do_dsa_keygen() { |
605 |
if [ ! -s $DSA_KEY ]; then |
606 |
echo "Generating SSH2 DSA host key... " |
607 |
if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then |
608 |
chmod 600 $DSA_KEY |
609 |
chmod 644 $DSA_KEY.pub |
610 |
echo "done" |
611 |
echo |
612 |
else |
613 |
echo "failed" |
614 |
echo |
615 |
exit 1 |
616 |
fi |
617 |
fi |
618 |
} |
619 |
|
620 |
do_rsa1_keygen |
621 |
do_rsa_keygen |
622 |
do_dsa_keygen |
623 |
%_post_service sshd |
624 |
|
625 |
%preun server |
626 |
%_preun_service sshd |
627 |
|
628 |
%postun server |
629 |
%_postun_userdel sshd |
630 |
|
631 |
%if %{build_x11askpass} |
632 |
%post askpass |
633 |
update-alternatives --install %{_libdir}/ssh/ssh-askpass ssh-askpass %{_libdir}/ssh/x11-ssh-askpass 10 |
634 |
update-alternatives --install %{_bindir}/ssh-askpass bssh-askpass %{_libdir}/ssh/x11-ssh-askpass 10 |
635 |
|
636 |
%postun askpass |
637 |
[ $1 = 0 ] || exit 0 |
638 |
update-alternatives --remove ssh-askpass %{_libdir}/ssh/x11-ssh-askpass |
639 |
update-alternatives --remove bssh-askpass %{_libdir}/ssh/x11-ssh-askpass |
640 |
%endif |
641 |
|
642 |
%if %{build_gnomeaskpass} |
643 |
%post askpass-gnome |
644 |
update-alternatives --install %{_libdir}/ssh/ssh-askpass ssh-askpass %{_libdir}/ssh/gnome-ssh-askpass 20 |
645 |
update-alternatives --install %{_bindir}/ssh-askpass bssh-askpass %{_libdir}/ssh/gnome-ssh-askpass 20 |
646 |
|
647 |
%postun askpass-gnome |
648 |
[ $1 = 0 ] || exit 0 |
649 |
update-alternatives --remove ssh-askpass %{_libdir}/ssh/gnome-ssh-askpass |
650 |
update-alternatives --remove bssh-askpass %{_libdir}/ssh/gnome-ssh-askpass |
651 |
%endif |
652 |
|
653 |
%triggerpostun server -- openssh-server < 3.8p1 |
654 |
if grep -qE "^\W*auth\W+\w+\W+.*pam_(ldap|winbind|mysql)" /etc/pam.d/system-auth /etc/pam.d/sshd; then |
655 |
perl -pi -e 's|^#UsePAM no|UsePAM yes|' /etc/ssh/sshd_config |
656 |
fi |
657 |
|
658 |
%files |
659 |
%defattr(-,root,root) |
660 |
%doc ChangeLog OVERVIEW README* INSTALL CREDITS LICENCE TODO ssh_ldap_key.pl |
661 |
%if %{build_ldap} |
662 |
%doc *.schema |
663 |
%endif |
664 |
%if %{build_watchdog} |
665 |
%doc CHANGES-openssh-watchdog openssh-watchdog.html |
666 |
%endif |
667 |
%if %{build_sftpcontrol} |
668 |
%doc README.sftpfilecontrol |
669 |
%endif |
670 |
%{_bindir}/ssh-keygen |
671 |
%dir %{_sysconfdir}/ssh |
672 |
%{_bindir}/ssh-keyscan |
673 |
%attr(4711,root,root) %{_libdir}/ssh/ssh-keysign |
674 |
%{_libdir}/ssh/ssh-pkcs11-helper |
675 |
%{_mandir}/man1/ssh-keygen.1* |
676 |
%{_mandir}/man1/ssh-keyscan.1* |
677 |
%{_mandir}/man8/ssh-keysign.8* |
678 |
%{_mandir}/man8/ssh-pkcs11-helper.8* |
679 |
|
680 |
%files clients |
681 |
%defattr(-,root,root) |
682 |
%{_bindir}/scp |
683 |
%{_bindir}/ssh |
684 |
%{_bindir}/ssh-agent |
685 |
%{_bindir}/ssh-add |
686 |
%{_bindir}/ssh-copy-id |
687 |
%{_bindir}/slogin |
688 |
%{_bindir}/sftp |
689 |
%{_mandir}/man1/scp.1* |
690 |
%{_mandir}/man1/ssh-copy-id.1* |
691 |
%{_mandir}/man1/slogin.1* |
692 |
%{_mandir}/man1/ssh.1* |
693 |
%{_mandir}/man1/ssh-agent.1* |
694 |
%{_mandir}/man1/ssh-add.1* |
695 |
%{_mandir}/man1/sftp.1* |
696 |
%{_mandir}/man5/ssh_config.5* |
697 |
%config(noreplace) %{_sysconfdir}/ssh/ssh_config |
698 |
%{_sysconfdir}/profile.d/90ssh-client.sh |
699 |
|
700 |
%files server |
701 |
%defattr(-,root,root) |
702 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/sshd |
703 |
%{_sbindir}/sshd |
704 |
%dir %{_libdir}/ssh |
705 |
%{_libdir}/ssh/sftp-server |
706 |
%{_mandir}/man5/sshd_config.5* |
707 |
%{_mandir}/man5/moduli.5* |
708 |
%{_mandir}/man8/sshd.8* |
709 |
%{_mandir}/man8/sftp-server.8* |
710 |
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config |
711 |
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/denyusers |
712 |
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd |
713 |
%config(noreplace) %_sysconfdir/xinetd.d/sshd-xinetd |
714 |
%config(noreplace) %{_sysconfdir}/avahi/services/%{name}.service |
715 |
%config(noreplace) %{_sysconfdir}/ssh/moduli |
716 |
%attr(0755,root,root) %{_initrddir}/sshd |
717 |
%dir %attr(0755,root,root) /var/empty |
718 |
|
719 |
%files askpass-common |
720 |
%defattr(-,root,root) |
721 |
%{_sysconfdir}/profile.d/90ssh-askpass.* |
722 |
|
723 |
%if %{build_x11askpass} |
724 |
%files askpass |
725 |
%defattr(-,root,root) |
726 |
%doc x11-ssh-askpass-%{aversion}/README |
727 |
%doc x11-ssh-askpass-%{aversion}/ChangeLog |
728 |
%doc x11-ssh-askpass-%{aversion}/SshAskpass*.ad |
729 |
%doc x11-ssh-askpass-%{aversion}/x11-ssh-askpass.1.html |
730 |
%{_libdir}/ssh/x11-ssh-askpass |
731 |
%{_sysconfdir}/X11/app-defaults/SshAskpass |
732 |
#%{_prefix}/X11R6/lib/X11/doc/html/x11-ssh-askpass.1.html |
733 |
%{_mandir}/man1/x11-ssh-askpass.1* |
734 |
%endif |
735 |
|
736 |
%if %{build_gnomeaskpass} |
737 |
%files askpass-gnome |
738 |
%defattr(-,root,root) |
739 |
%{_libdir}/ssh/gnome-ssh-askpass |
740 |
%endif |
741 |
|
742 |
|