1 %define _appdefdir %{_prefix}/share/X11/app-defaults
2 %define xversion 1.2.4.1
7 Summary: Secure Shell Client and Server (Remote Login Program)
8 License: BSD-3-Clause and MIT
10 Url: http://www.openssh.com/
11 Source: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
14 Source11: sshd-gen-keys-start
15 Source12: sshd.service
17 Source14: sshd@.service
18 Source1001: openssh.manifest
20 BuildRequires: systemd
21 BuildRequires: autoconf
22 BuildRequires: openssl-devel
23 BuildRequires: pam-devel
24 Requires: /usr/bin/netstat
25 Requires: pam-modules-extra
26 Requires(pre): pwdutils coreutils
28 %{!?_initddir:%global _initddir %{_initrddir}}
31 SSH (Secure Shell) is a program for logging into and executing commands
32 on a remote machine. It is intended to replace rsh (rlogin and rsh) and
33 provides openssl (secure encrypted communication) between two untrusted
34 hosts over an insecure network.
36 xorg-x11 (X Window System) connections and arbitrary TCP/IP ports can
37 also be forwarded over the secure channel.
46 export CFLAGS="%{optflags} $PIEFLAGS -fstack-protector"
47 export CXXFLAGS="%{optflags} $PIEFLAGS -fstack-protector"
51 --sysconfdir=%{_sysconfdir}/ssh \
52 --libexecdir=%{_libexecdir}/ssh \
54 --with-privsep-path=%{_localstatedir}/lib/empty \
55 --with-sandbox=rlimit \
57 --with-xauth=%{_prefix}/bin/xauth \
58 --target=%{_target_cpu}-tizen-linux
59 %__make %{?_smp_mflags}
62 make DESTDIR=%{buildroot}/ install
63 install -d -m 755 %{buildroot}%{_sysconfdir}/pam.d
64 install -d -m 755 %{buildroot}%{_localstatedir}/lib/sshd
65 install -m 644 %{S:2} %{buildroot}%{_sysconfdir}/pam.d/sshd
66 # install shell script to automate the process of adding your public key to a remote machine
67 install -m 755 contrib/ssh-copy-id %{buildroot}%{_bindir}
68 install -m 644 contrib/ssh-copy-id.1 %{buildroot}%{_mandir}/man1
69 sed -e "s,@LIBEXEC@,%{_libexecdir},g" < %{S:8} > %{buildroot}%{_libexecdir}/ssh/ssh-askpass
70 rm -f %{buildroot}%{_datadir}/Ssh.bin
71 sed -i -e s@/usr/libexec@%{_libexecdir}@g %{buildroot}%{_sysconfdir}/ssh/sshd_config
73 install -D -m 0755 %{SOURCE11} %{buildroot}%{_sbindir}/sshd-gen-keys-start
75 install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/sshd.service
76 install -D -m 0644 %{SOURCE13} %{buildroot}%{_unitdir}/sshd.socket
77 install -D -m 0644 %{SOURCE14} %{buildroot}%{_unitdir}/sshd@.service
79 mkdir -p %{buildroot}/%{_unitdir}/sockets.target.wants
80 ln -s ../sshd.socket %{buildroot}/%{_unitdir}/sockets.target.wants/sshd.socket
82 rm -rf %{buildroot}/%{_mandir}/cat*
83 rm -rf %{buildroot}/%{_mandir}/man*
86 getent group sshd >/dev/null || %{_sbindir}/groupadd -o -r sshd
87 getent passwd sshd >/dev/null || %{_sbindir}/useradd -r -g sshd -d %{_localstatedir}/lib/sshd -s /bin/false -c "SSH daemon" sshd
90 %manifest %{name}.manifest
92 %dir %attr(755,root,root) %{_localstatedir}/lib/sshd
93 %attr(0755,root,root) %dir %{_sysconfdir}/ssh
94 %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/moduli
95 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config
96 %attr(0640,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config
97 %attr(0644,root,root) %config %{_sysconfdir}/pam.d/sshd
98 %attr(0755,root,root) %{_bindir}/ssh
104 %attr(0755,root,root) %dir %{_libexecdir}/ssh
105 %attr(0755,root,root) %{_libexecdir}/ssh/sftp-server
106 %attr(0755,root,root) %{_libexecdir}/ssh/ssh-keysign
107 %attr(0755,root,root) %{_libexecdir}/ssh/ssh-pkcs11-helper
108 %attr(0755,root,root) %{_libexecdir}/ssh/ssh-askpass
109 %{_sbindir}/sshd-gen-keys-start
110 %{_unitdir}/sshd.service
111 %{_unitdir}/sshd@.service
112 %{_unitdir}/sockets.target.wants/*.socket
113 %{_unitdir}/sshd.socket