source: spec/trunk/SPECS/openssh.spec@ 1567

Last change on this file since 1567 was 1531, checked in by Silvan Scherrer, 7 years ago

spec: openssh: Release version 7.7p1-4.

File size: 15.8 KB
Line 
1# Note: this .spec is borrowed from:
2# https://src.fedoraproject.org/cgit/rpms/openssh.git/tree/openssh.spec
3
4# Do we want SELinux & Audit
5%global WITH_SELINUX 0
6
7%global _hardened_build 1
8
9# OpenSSH privilege separation requires a user & group ID
10%global sshd_uid 74
11%global sshd_gid 74
12
13# Do we want to disable building of gnome-askpass? (1=yes 0=no)
14%global no_gnome_askpass 1
15
16# Do we want to link against a static libcrypto? (1=yes 0=no)
17%global static_libcrypto 0
18
19# Use GTK2 instead of GNOME in gnome-ssh-askpass
20%global gtk2 0
21
22# Build position-independent executables (requires toolchain support)?
23%global pie 0
24
25# Do we want kerberos5 support (1=yes 0=no)
26%global kerberos5 0
27
28# Do we want libedit support
29%global libedit 0
30
31# Do we want LDAP support
32%global ldap 0
33
34# Whether to build pam_ssh_agent_auth
35%global pam_ssh_agent 0
36
37# Reserve options to override askpass settings with:
38# rpm -ba|--rebuild --define 'skip_xxx 1'
39%{?skip_gnome_askpass:%global no_gnome_askpass 1}
40
41# Add option to build without GTK2 for older platforms with only GTK+.
42# Red Hat Linux <= 7.2 and Red Hat Advanced Server 2.1 are examples.
43# rpm -ba|--rebuild --define 'no_gtk2 1'
44%{?no_gtk2:%global gtk2 0}
45
46# Options for static OpenSSL link:
47# rpm -ba|--rebuild --define "static_openssl 1"
48%{?static_openssl:%global static_libcrypto 1}
49
50# Is this a build for the rescue CD (without PAM, with MD5)? (1=yes 0=no)
51%define rescue 0
52%{?build_rescue:%global rescue 1}
53%{?build_rescue:%global rescue_rel rescue}
54
55# Turn off some stuff for resuce builds
56%if %{rescue}
57%global kerberos5 0
58%global libedit 0
59%global pam_ssh_agent 0
60%endif
61
62# Do we want keycat package enabled
63%global keycat 0
64
65# Do we want cavs package enabled
66%global cavs 0
67
68# Do not forget to bump pam_ssh_agent_auth release if you rewind the main package release to 1
69%global openssh_ver 7.7p1
70%global openssh_rel 4
71%global pam_ssh_agent_ver 0.10.3
72%global pam_ssh_agent_rel 4
73
74Summary: An open source implementation of SSH protocol versions 2
75Name: openssh
76Version: %{openssh_ver}
77Release: %{openssh_rel}%{?dist}%{?rescue_rel}
78URL: http://www.openssh.com/portable.html
79Vendor: bww bitwise works GmbH
80
81#scm_source github http://github.com/bitwiseworks/%{name}-os2 master-os2
82%scm_source git e:/Trees/%{name}/git master-os2
83
84License: BSD
85Group: Applications/Internet
86#Requires: /sbin/nologin
87
88#Requires: initscripts >= 5.20
89
90%if ! %{no_gnome_askpass}
91%if %{gtk2}
92BuildRequires: gtk2-devel
93BuildRequires: libX11-devel
94%else
95BuildRequires: gnome-libs-devel
96%endif
97%endif
98
99%if %{ldap}
100BuildRequires: openldap-devel
101%endif
102BuildRequires: autoconf, automake, perl-generators, zlib-devel
103#BuildRequires: perl-interpretor
104#BuildRequires: audit-libs-devel >= 2.0.5
105#BuildRequires: util-linux, groff
106#BuildRequires: pam-devel
107#BuildRequires: fipscheck-devel >= 1.3.0
108BuildRequires: openssl-devel >= 0.9.8j
109#BuildRequires: perl-podlators
110#BuildRequires: systemd-devel
111BuildRequires: gcc
112#BuildRequires: p11-kit-devel
113#Recommends: p11-kit
114
115%if %{kerberos5}
116BuildRequires: krb5-devel
117%endif
118
119%if %{libedit}
120BuildRequires: libedit-devel ncurses-devel
121%endif
122
123%if %{WITH_SELINUX}
124Requires: libselinux >= 2.3-5
125BuildRequires: libselinux-devel >= 2.3-5
126Requires: audit-libs >= 1.0.8
127BuildRequires: audit-libs >= 1.0.8
128%endif
129
130#BuildRequires: xauth
131# for tarball signature verification
132#BuildRequires: gnupg2
133
134%package clients
135Summary: An open source SSH client applications
136Requires: openssh = %{version}-%{release}
137Group: Applications/Internet
138#Requires: fipscheck-lib%{_isa} >= 1.3.0
139#Requires: crypto-policies >= 20180306-1
140
141%package server
142Summary: An open source SSH server daemon
143Group: System Environment/Daemons
144Requires: openssh = %{version}-%{release}
145Requires: klusrmgr >= 1.2.0
146#Requires: pam >= 1.0.1-3
147#Requires: fipscheck-lib%{_isa} >= 1.3.0
148#Requires: crypto-policies >= 20180306-1
149#%{?systemd_requires}
150
151%if %{ldap}
152%package ldap
153Summary: A LDAP support for open source SSH server daemon
154Requires: openssh = %{version}-%{release}
155Group: System Environment/Daemons
156%endif
157
158%if %{keycat}
159%package keycat
160Summary: A mls keycat backend for openssh
161Requires: openssh = %{version}-%{release}
162Group: System Environment/Daemons
163%endif
164
165%package askpass
166Summary: A passphrase dialog for OpenSSH and X
167Group: Applications/Internet
168Requires: openssh = %{version}-%{release}
169Obsoletes: openssh-askpass-gnome
170Provides: openssh-askpass-gnome
171
172%if %{cavs}
173%package cavs
174Summary: CAVS tests for FIPS validation
175Group: Applications/Internet
176Requires: openssh = %{version}-%{release}
177%endif
178
179%if %{pam_ssh_agent}
180%package -n pam_ssh_agent_auth
181Summary: PAM module for authentication with ssh-agent
182Group: System Environment/Base
183Version: %{pam_ssh_agent_ver}
184Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{?dist}%{?rescue_rel}
185License: BSD
186%endif
187
188%description
189SSH (Secure SHell) is a program for logging into and executing
190commands on a remote machine. SSH is intended to replace rlogin and
191rsh, and to provide secure encrypted communications between two
192untrusted hosts over an insecure network. X11 connections and
193arbitrary TCP/IP ports can also be forwarded over the secure channel.
194
195OpenSSH is OpenBSD's version of the last free version of SSH, bringing
196it up to date in terms of security and features.
197
198This package includes the core files necessary for both the OpenSSH
199client and server. To make this package useful, you should also
200install openssh-clients, openssh-server, or both.
201
202%description clients
203OpenSSH is a free version of SSH (Secure SHell), a program for logging
204into and executing commands on a remote machine. This package includes
205the clients necessary to make encrypted connections to SSH servers.
206
207%description server
208OpenSSH is a free version of SSH (Secure SHell), a program for logging
209into and executing commands on a remote machine. This package contains
210the secure shell daemon (sshd). The sshd daemon allows SSH clients to
211securely connect to your SSH server.
212
213%if %{ldap}
214%description ldap
215OpenSSH LDAP backend is a way how to distribute the authorized tokens
216among the servers in the network.
217%endif
218
219%if %{keycat}
220%description keycat
221OpenSSH mls keycat is backend for using the authorized keys in the
222openssh in the mls mode.
223%endif
224
225%description askpass
226OpenSSH is a free version of SSH (Secure SHell), a program for logging
227into and executing commands on a remote machine. This package contains
228an X11 passphrase dialog for OpenSSH.
229
230%if %{cavs}
231%description cavs
232This package contains test binaries and scripts to make FIPS validation
233easier. Now contains CTR and KDF CAVS test driver.
234%endif
235
236%if %{pam_ssh_agent}
237%description -n pam_ssh_agent_auth
238This package contains a PAM module which can be used to authenticate
239users using ssh keys stored in a ssh-agent. Through the use of the
240forwarding of ssh-agent connection it also allows to authenticate with
241remote ssh-agent instance.
242
243The module is most useful for su and sudo service stacks.
244%endif
245
246%debug_package
247
248%prep
249%scm_setup
250
251autoreconf -fvi
252
253%build
254export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
255export LIBS="-lcx"
256
257%if %{rescue}
258CFLAGS="$CFLAGS -Os"
259%endif
260%if %{pie}
261%ifarch s390 s390x sparc sparcv9 sparc64
262CFLAGS="$CFLAGS -fPIC"
263%else
264CFLAGS="$CFLAGS -fpic"
265%endif
266SAVE_LDFLAGS="$LDFLAGS"
267LDFLAGS="$LDFLAGS -pie -z relro -z now"
268
269export CFLAGS
270export LDFLAGS
271
272%endif
273%if %{kerberos5}
274if test -r /@unixroot/etc/profile.d/krb5-devel.sh ; then
275 source /@unixroot/etc/profile.d/krb5-devel.sh
276fi
277krb5_prefix=`krb5-config --prefix`
278if test "$krb5_prefix" != "%{_prefix}" ; then
279 CPPFLAGS="$CPPFLAGS -I${krb5_prefix}/include -I${krb5_prefix}/include/gssapi"; export CPPFLAGS
280 CFLAGS="$CFLAGS -I${krb5_prefix}/include -I${krb5_prefix}/include/gssapi"
281 LDFLAGS="$LDFLAGS -L${krb5_prefix}/%{_lib}"; export LDFLAGS
282else
283 krb5_prefix=
284 CPPFLAGS="-I%{_includedir}/gssapi"; export CPPFLAGS
285 CFLAGS="$CFLAGS -I%{_includedir}/gssapi"
286fi
287%endif
288
289# not used configure switches
290# --with-systemd \
291# --with-default-pkcs11-provider=yes \
292
293%configure \
294 --sysconfdir=%{_sysconfdir}/ssh \
295 --libexecdir=%{_libexecdir}/openssh \
296 --datadir=%{_datadir}/openssh \
297 --with-pid-dir=%{_var}/run \
298 --with-default-path=/@unixroot/usr/local/bin:/@unixroot/bin:/@unixroot/usr/bin \
299 --with-superuser-path=/@unixroot/usr/local/sbin:/@unixroot/usr/local/bin:/@unixroot/sbin:/@unixroot/bin:/@unixroot/usr/sbin:/@unixroot/usr/bin \
300 --with-privsep-path=%{_var}/empty/sshd \
301 --disable-strip \
302 --without-zlib-version-check \
303 --with-ssl-engine \
304 --with-ipaddr-display \
305 --with-pie=no \
306 --disable-utmp \
307 --disable-utmpx \
308 --disable-wtmp \
309 --disable-wtmpx \
310 --with-mantype=man \
311%if %{ldap}
312 --with-ldap \
313%endif
314%if %{rescue}
315 --without-pam \
316%else
317 --without-pam \
318%endif
319%if %{WITH_SELINUX}
320 --with-selinux --with-linux-audit \
321 --with-sandbox=seccomp_filter \
322%endif
323%if %{kerberos5}
324 --with-kerberos5${krb5_prefix:+=${krb5_prefix}} \
325%else
326 --without-kerberos5 \
327%endif
328%if %{libedit}
329 --with-libedit
330%else
331 --without-libedit
332%endif
333
334%if %{static_libcrypto}
335perl -pi -e "s|-lcrypto|%{_libdir}/libcrypto.a|g" Makefile
336%endif
337
338make
339
340# Define a variable to toggle gnome1/gtk2 building. This is necessary
341# because RPM doesn't handle nested %if statements.
342%if %{gtk2}
343 gtk2=yes
344%else
345 gtk2=no
346%endif
347
348%if ! %{no_gnome_askpass}
349pushd contrib
350if [ $gtk2 = yes ] ; then
351 CFLAGS="$CFLAGS %{?__global_ldflags}" \
352 make gnome-ssh-askpass2
353 mv gnome-ssh-askpass2 gnome-ssh-askpass
354else
355 CFLAGS="$CFLAGS %{?__global_ldflags}"
356 make gnome-ssh-askpass1
357 mv gnome-ssh-askpass1 gnome-ssh-askpass
358fi
359popd
360%endif
361
362# Add generation of HMAC checksums of the final stripped binaries
363#%global __spec_install_post \
364# %{?__debug_package:%{__debug_install_post}} \
365# %{__arch_install_post} \
366# %{__os_install_post} \
367# fipshmac -d $RPM_BUILD_ROOT%{_libdir}/fipscheck $RPM_BUILD_ROOT%{_bindir}/ssh $RPM_BUILD_ROOT%{_sbindir}/sshd \
368#%{nil}
369
370%check
371#to run tests use "--with check"
372%if %{?_with_check:1}%{!?_with_check:0}
373make tests
374%endif
375
376%install
377rm -rf $RPM_BUILD_ROOT
378mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/ssh
379mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/ssh/ssh_config.d
380mkdir -p -m755 $RPM_BUILD_ROOT%{_libexecdir}/openssh
381mkdir -p -m755 $RPM_BUILD_ROOT%{_var}/empty/sshd
382make install DESTDIR=$RPM_BUILD_ROOT
383rm -f $RPM_BUILD_ROOT%{_sysconfdir}/ssh/ldap.conf
384
385install -d $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/
386install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
387install -d $RPM_BUILD_ROOT%{_libexecdir}/openssh
388install -m755 contrib/ssh-copy-id $RPM_BUILD_ROOT%{_bindir}/
389install contrib/ssh-copy-id.1 $RPM_BUILD_ROOT%{_mandir}/man1/
390
391%if ! %{no_gnome_askpass}
392install contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome-ssh-askpass
393%endif
394
395%if ! %{no_gnome_askpass}
396ln -s gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass
397install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
398install -m 755 contrib/redhat/gnome-ssh-askpass.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
399install -m 755 contrib/redhat/gnome-ssh-askpass.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
400%endif
401
402%if %{no_gnome_askpass}
403rm -f $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/gnome-ssh-askpass.*
404%endif
405
406sed -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
407
408%if %{pam_ssh_agent}
409pushd pam_ssh_agent_auth-%{pam_ssh_agent_ver}
410make install DESTDIR=$RPM_BUILD_ROOT
411popd
412%endif
413
414%pre
415#getent group ssh_keys >/dev/null || groupadd -r ssh_keys || :
416groupadd -r ssh_keys || :
417
418%pre server
419#getent group sshd >/dev/null || groupadd -g %{sshd_uid} -r sshd || :
420groupadd -g %{sshd_uid} -r sshd || :
421#getent passwd sshd >/dev/null || \
422useradd -c "Privilege-separated SSH" -u %{sshd_uid} -g sshd \
423 -s /usr/sbin/nologin -r -d /@unixroot/var/empty/sshd sshd 2> /dev/null || :
424
425%post server
426#%systemd_post sshd.service sshd.socket
427
428%preun server
429#%systemd_preun sshd.service sshd.socket
430
431%postun server
432#%systemd_postun_with_restart sshd.service
433
434%files
435%license LICENCE
436%doc CREDITS INSTALL OVERVIEW PROTOCOL* README* TODO
437#doc ChangeLog
438%attr(0755,root,root) %dir %{_sysconfdir}/ssh
439%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/moduli
440%if ! %{rescue}
441%attr(0755,root,root) %{_bindir}/ssh-keygen.exe
442%attr(0644,root,root) %{_mandir}/man1/ssh-keygen.1*
443%attr(0755,root,root) %dir %{_libexecdir}/openssh
444%attr(2555,root,ssh_keys) %{_libexecdir}/openssh/ssh-keysign.exe
445%attr(0644,root,root) %{_mandir}/man8/ssh-keysign.8*
446%endif
447
448%files clients
449%attr(0755,root,root) %{_bindir}/ssh.exe
450#%attr(0644,root,root) %{_bindir}/.ssh.hmac
451%attr(0644,root,root) %{_mandir}/man1/ssh.1*
452%attr(0755,root,root) %{_bindir}/scp.exe
453%attr(0644,root,root) %{_mandir}/man1/scp.1*
454%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config
455%dir %attr(0755,root,root) %{_sysconfdir}/ssh/ssh_config.d/
456%attr(0644,root,root) %{_mandir}/man5/ssh_config.5*
457%if ! %{rescue}
458%attr(0755,root,root) %{_bindir}/ssh-agent.exe
459%attr(0755,root,root) %{_bindir}/ssh-add.exe
460%attr(0755,root,root) %{_bindir}/ssh-keyscan.exe
461%attr(0755,root,root) %{_bindir}/sftp.exe
462%attr(0755,root,root) %{_bindir}/ssh-copy-id
463%attr(0755,root,root) %{_libexecdir}/openssh/ssh-pkcs11-helper.exe
464%attr(0644,root,root) %{_mandir}/man1/ssh-agent.1*
465%attr(0644,root,root) %{_mandir}/man1/ssh-add.1*
466%attr(0644,root,root) %{_mandir}/man1/ssh-keyscan.1*
467%attr(0644,root,root) %{_mandir}/man1/sftp.1*
468%attr(0644,root,root) %{_mandir}/man1/ssh-copy-id.1*
469%attr(0644,root,root) %{_mandir}/man8/ssh-pkcs11-helper.8*
470%endif
471
472%if ! %{rescue}
473%files server
474%dir %attr(0711,root,root) %{_var}/empty/sshd
475%attr(0755,root,root) %{_sbindir}/sshd.exe
476#%attr(0644,root,root) %{_libdir}/fipscheck/.sshd.hmac
477%attr(0755,root,root) %{_libexecdir}/openssh/sftp-server.exe
478#%attr(0755,root,root) %{_libexecdir}/openssh/sshd-keygen.exe
479%attr(0644,root,root) %{_mandir}/man5/sshd_config.5*
480%attr(0644,root,root) %{_mandir}/man5/moduli.5*
481%attr(0644,root,root) %{_mandir}/man8/sshd.8*
482%attr(0644,root,root) %{_mandir}/man8/sftp-server.8*
483%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config
484#%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/sshd
485#%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/sshd
486#%attr(0644,root,root) %{_unitdir}/sshd.service
487#%attr(0644,root,root) %{_unitdir}/sshd@.service
488#%attr(0644,root,root) %{_unitdir}/sshd.socket
489#%attr(0644,root,root) %{_unitdir}/sshd-keygen@.service
490#%attr(0644,root,root) %{_unitdir}/sshd-keygen.target
491#%attr(0644,root,root) %{_tmpfilesdir}/openssh.conf
492%endif
493
494%if %{ldap}
495%files ldap
496%doc HOWTO.ldap-keys openssh-lpk-openldap.schema openssh-lpk-sun.schema ldap.conf
497%doc openssh-lpk-openldap.ldif openssh-lpk-sun.ldif
498%attr(0755,root,root) %{_libexecdir}/openssh/ssh-ldap-helper
499%attr(0755,root,root) %{_libexecdir}/openssh/ssh-ldap-wrapper
500%attr(0644,root,root) %{_mandir}/man8/ssh-ldap-helper.8*
501%attr(0644,root,root) %{_mandir}/man5/ssh-ldap.conf.5*
502%endif
503
504%if %{keycat}
505%files keycat
506%doc HOWTO.ssh-keycat
507%attr(0755,root,root) %{_libexecdir}/openssh/ssh-keycat.exe
508%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/ssh-keycat
509%endif
510
511%if ! %{no_gnome_askpass}
512%files askpass
513%attr(0644,root,root) %{_sysconfdir}/profile.d/gnome-ssh-askpass.*
514%attr(0755,root,root) %{_libexecdir}/openssh/gnome-ssh-askpass
515%attr(0755,root,root) %{_libexecdir}/openssh/ssh-askpass
516%endif
517
518%if %{cavs}
519%files cavs
520%attr(0755,root,root) %{_libexecdir}/openssh/ctr-cavstest.exe
521%attr(0755,root,root) %{_libexecdir}/openssh/ssh-cavs.exe
522%attr(0755,root,root) %{_libexecdir}/openssh/ssh-cavs_driver.pl
523%endif
524
525%if %{pam_ssh_agent}
526%files -n pam_ssh_agent_auth
527%license pam_ssh_agent_auth-%{pam_ssh_agent_ver}/OPENSSH_LICENSE
528%attr(0755,root,root) /%{_lib}/security/pam_ssh_agent_auth.so
529%attr(0644,root,root) %{_mandir}/man8/pam_ssh_agent_auth.8*
530%endif
531
532%changelog
533* Tue Nov 27 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 7.7p1-4
534- don't echo password
535- handle stdin/stdout in select()
536
537* Fri Aug 17 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 7.7p1-3
538- use socketpair() instead of pipe()
539
540* Thu Aug 16 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 7.7p1-2
541- create the needed user and group
542
543* Fri Jul 27 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 7.7p1-1
544- Update to version 7.7.p1.
545- moved source to github
Note: See TracBrowser for help on using the repository browser.