openssh.spec 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # Default values for additional components
  2. %define build_x11_askpass 1
  3. # Define the UID/GID to use for privilege separation
  4. %define sshd_gid 65
  5. %define sshd_uid 71
  6. # The version of x11-ssh-askpass to use
  7. %define xversion 1.2.4.1
  8. # Allow the ability to override defaults with -D skip_xxx=1
  9. %{?skip_x11_askpass:%define build_x11_askpass 0}
  10. Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
  11. Name: openssh
  12. Version: 8.4p1
  13. URL: https://www.openssh.com/
  14. Release: 1
  15. Source0: openssh-%{version}.tar.gz
  16. Source1: x11-ssh-askpass-%{xversion}.tar.gz
  17. License: BSD
  18. Group: Productivity/Networking/SSH
  19. BuildRoot: %{_tmppath}/openssh-%{version}-buildroot
  20. PreReq: openssl
  21. Obsoletes: ssh
  22. Provides: ssh
  23. #
  24. # (Build[ing] Prereq[uisites] only work for RPM 2.95 and newer.)
  25. # building prerequisites -- stuff for
  26. # OpenSSL (openssl-devel),
  27. # and Gnome (glibdev, gtkdev, and gnlibsd)
  28. #
  29. BuildPrereq: openssl
  30. BuildPrereq: zlib-devel
  31. #BuildPrereq: glibdev
  32. #BuildPrereq: gtkdev
  33. #BuildPrereq: gnlibsd
  34. %package askpass
  35. Summary: A passphrase dialog for OpenSSH and the X window System.
  36. Group: Productivity/Networking/SSH
  37. Requires: openssh = %{version}
  38. Obsoletes: ssh-extras
  39. Provides: openssh:${_libdir}/ssh/ssh-askpass
  40. %if %{build_x11_askpass}
  41. BuildPrereq: XFree86-devel
  42. %endif
  43. %description
  44. Ssh (Secure Shell) is a program for logging into a remote machine and for
  45. executing commands in a remote machine. It is intended to replace
  46. rlogin and rsh, and provide secure encrypted communications between
  47. two untrusted hosts over an insecure network. X11 connections and
  48. arbitrary TCP/IP ports can also be forwarded over the secure channel.
  49. OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it
  50. up to date in terms of security and features, as well as removing all
  51. patented algorithms to separate libraries (OpenSSL).
  52. This package includes all files necessary for both the OpenSSH
  53. client and server.
  54. %description askpass
  55. Ssh (Secure Shell) is a program for logging into a remote machine and for
  56. executing commands in a remote machine. It is intended to replace
  57. rlogin and rsh, and provide secure encrypted communications between
  58. two untrusted hosts over an insecure network. X11 connections and
  59. arbitrary TCP/IP ports can also be forwarded over the secure channel.
  60. OpenSSH is OpenBSD's rework of the last free version of SSH, bringing it
  61. up to date in terms of security and features, as well as removing all
  62. patented algorithms to separate libraries (OpenSSL).
  63. This package contains an X Window System passphrase dialog for OpenSSH.
  64. %changelog
  65. * Mon Jul 20 2020 Damien Miller <djm@mindrto.org>
  66. - Add ssh-sk-helper and corresponding manual page.
  67. * Wed Oct 26 2005 Iain Morgan <imorgan@nas.nasa.gov>
  68. - Removed accidental inclusion of --without-zlib-version-check
  69. * Tue Oct 25 2005 Iain Morgan <imorgan@nas.nasa.gov>
  70. - Overhaul to deal with newer versions of SuSE and OpenSSH
  71. * Mon Jun 12 2000 Damien Miller <djm@mindrot.org>
  72. - Glob manpages to catch compressed files
  73. * Wed Mar 15 2000 Damien Miller <djm@ibs.com.au>
  74. - Updated for new location
  75. - Updated for new gnome-ssh-askpass build
  76. * Sun Dec 26 1999 Chris Saia <csaia@wtower.com>
  77. - Made symlink to gnome-ssh-askpass called ssh-askpass
  78. * Wed Nov 24 1999 Chris Saia <csaia@wtower.com>
  79. - Removed patches that included /etc/pam.d/sshd, /sbin/init.d/rc.sshd, and
  80. /var/adm/fillup-templates/rc.config.sshd, since Damien merged these into
  81. his released tarfile
  82. - Changed permissions on ssh_config in the install procedure to 644 from 600
  83. even though it was correct in the %files section and thus right in the RPMs
  84. - Postinstall script for the server now only prints "Generating SSH host
  85. key..." if we need to actually do this, in order to eliminate a confusing
  86. message if an SSH host key is already in place
  87. - Marked all manual pages as %doc(umentation)
  88. * Mon Nov 22 1999 Chris Saia <csaia@wtower.com>
  89. - Added flag to configure daemon with TCP Wrappers support
  90. - Added building prerequisites (works in RPM 3.0 and newer)
  91. * Thu Nov 18 1999 Chris Saia <csaia@wtower.com>
  92. - Made this package correct for SuSE.
  93. - Changed instances of pam_pwdb.so to pam_unix.so, since it works more properly
  94. with SuSE, and lib_pwdb.so isn't installed by default.
  95. * Mon Nov 15 1999 Damien Miller <djm@mindrot.org>
  96. - Split subpackages further based on patch from jim knoble <jmknoble@pobox.com>
  97. * Sat Nov 13 1999 Damien Miller <djm@mindrot.org>
  98. - Added 'Obsoletes' directives
  99. * Tue Nov 09 1999 Damien Miller <djm@ibs.com.au>
  100. - Use make install
  101. - Subpackages
  102. * Mon Nov 08 1999 Damien Miller <djm@ibs.com.au>
  103. - Added links for slogin
  104. - Fixed perms on manpages
  105. * Sat Oct 30 1999 Damien Miller <djm@ibs.com.au>
  106. - Renamed init script
  107. * Fri Oct 29 1999 Damien Miller <djm@ibs.com.au>
  108. - Back to old binary names
  109. * Thu Oct 28 1999 Damien Miller <djm@ibs.com.au>
  110. - Use autoconf
  111. - New binary names
  112. * Wed Oct 27 1999 Damien Miller <djm@ibs.com.au>
  113. - Initial RPMification, based on Jan "Yenya" Kasprzak's <kas@fi.muni.cz> spec.
  114. %prep
  115. %if %{build_x11_askpass}
  116. %setup -q -a 1
  117. %else
  118. %setup -q
  119. %endif
  120. %build
  121. CFLAGS="$RPM_OPT_FLAGS" \
  122. %configure --prefix=/usr \
  123. --sysconfdir=%{_sysconfdir}/ssh \
  124. --mandir=%{_mandir} \
  125. --with-privsep-path=/var/lib/empty \
  126. --with-pam \
  127. --libexecdir=%{_libdir}/ssh
  128. make
  129. %if %{build_x11_askpass}
  130. cd x11-ssh-askpass-%{xversion}
  131. %configure --mandir=/usr/X11R6/man \
  132. --libexecdir=%{_libdir}/ssh
  133. xmkmf -a
  134. make
  135. cd ..
  136. %endif
  137. %install
  138. rm -rf $RPM_BUILD_ROOT
  139. make install DESTDIR=$RPM_BUILD_ROOT/
  140. install -d $RPM_BUILD_ROOT/etc/pam.d/
  141. install -d $RPM_BUILD_ROOT/etc/init.d/
  142. install -d $RPM_BUILD_ROOT/var/adm/fillup-templates
  143. install -m644 contrib/sshd.pam.generic $RPM_BUILD_ROOT/etc/pam.d/sshd
  144. install -m744 contrib/suse/rc.sshd $RPM_BUILD_ROOT/etc/init.d/sshd
  145. install -m744 contrib/suse/sysconfig.ssh \
  146. $RPM_BUILD_ROOT/var/adm/fillup-templates
  147. %if %{build_x11_askpass}
  148. cd x11-ssh-askpass-%{xversion}
  149. make install install.man BINDIR=%{_libdir}/ssh DESTDIR=$RPM_BUILD_ROOT/
  150. rm -f $RPM_BUILD_ROOT/usr/share/Ssh.bin
  151. %endif
  152. %clean
  153. rm -rf $RPM_BUILD_ROOT
  154. %pre
  155. /usr/sbin/groupadd -g %{sshd_gid} -o -r sshd 2> /dev/null || :
  156. /usr/sbin/useradd -r -o -g sshd -u %{sshd_uid} -s /bin/false -c "SSH Privilege Separation User" -d /var/lib/sshd sshd 2> /dev/null || :
  157. %post
  158. /usr/bin/ssh-keygen -A
  159. %{fillup_and_insserv -n -y ssh sshd}
  160. %run_permissions
  161. %verifyscript
  162. %verify_permissions -e /etc/ssh/sshd_config -e /etc/ssh/ssh_config -e /usr/bin/ssh
  163. %preun
  164. %stop_on_removal sshd
  165. %postun
  166. %restart_on_update sshd
  167. %{insserv_cleanup}
  168. %files
  169. %defattr(-,root,root)
  170. %doc ChangeLog OVERVIEW README* PROTOCOL*
  171. %doc TODO CREDITS LICENCE
  172. %attr(0755,root,root) %dir %{_sysconfdir}/ssh
  173. %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh/ssh_config
  174. %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/sshd_config
  175. %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/ssh/moduli
  176. %attr(0644,root,root) %config(noreplace) /etc/pam.d/sshd
  177. %attr(0755,root,root) %config /etc/init.d/sshd
  178. %attr(0755,root,root) %{_bindir}/ssh-keygen
  179. %attr(0755,root,root) %{_bindir}/scp
  180. %attr(0755,root,root) %{_bindir}/ssh
  181. %attr(0755,root,root) %{_bindir}/ssh-agent
  182. %attr(0755,root,root) %{_bindir}/ssh-add
  183. %attr(0755,root,root) %{_bindir}/ssh-keyscan
  184. %attr(0755,root,root) %{_bindir}/sftp
  185. %attr(0755,root,root) %{_sbindir}/sshd
  186. %attr(0755,root,root) %dir %{_libdir}/ssh
  187. %attr(0755,root,root) %{_libdir}/ssh/sftp-server
  188. %attr(4711,root,root) %{_libdir}/ssh/ssh-keysign
  189. %attr(0755,root,root) %{_libdir}/ssh/ssh-pkcs11-helper
  190. %attr(0755,root,root) %{_libdir}/ssh/ssh-sk-helper
  191. %attr(0644,root,root) %doc %{_mandir}/man1/scp.1*
  192. %attr(0644,root,root) %doc %{_mandir}/man1/sftp.1*
  193. %attr(0644,root,root) %doc %{_mandir}/man1/ssh.1*
  194. %attr(0644,root,root) %doc %{_mandir}/man1/ssh-add.1*
  195. %attr(0644,root,root) %doc %{_mandir}/man1/ssh-agent.1*
  196. %attr(0644,root,root) %doc %{_mandir}/man1/ssh-keygen.1*
  197. %attr(0644,root,root) %doc %{_mandir}/man1/ssh-keyscan.1*
  198. %attr(0644,root,root) %doc %{_mandir}/man5/moduli.5*
  199. %attr(0644,root,root) %doc %{_mandir}/man5/ssh_config.5*
  200. %attr(0644,root,root) %doc %{_mandir}/man5/sshd_config.5*
  201. %attr(0644,root,root) %doc %{_mandir}/man8/sftp-server.8*
  202. %attr(0644,root,root) %doc %{_mandir}/man8/ssh-keysign.8*
  203. %attr(0644,root,root) %doc %{_mandir}/man8/ssh-pkcs11-helper.8*
  204. %attr(0644,root,root) %doc %{_mandir}/man8/ssh-sk-helper.8*
  205. %attr(0644,root,root) %doc %{_mandir}/man8/sshd.8*
  206. %attr(0644,root,root) /var/adm/fillup-templates/sysconfig.ssh
  207. %if %{build_x11_askpass}
  208. %files askpass
  209. %defattr(-,root,root)
  210. %doc x11-ssh-askpass-%{xversion}/README
  211. %doc x11-ssh-askpass-%{xversion}/ChangeLog
  212. %doc x11-ssh-askpass-%{xversion}/SshAskpass*.ad
  213. %attr(0755,root,root) %{_libdir}/ssh/ssh-askpass
  214. %attr(0755,root,root) %{_libdir}/ssh/x11-ssh-askpass
  215. %attr(0644,root,root) %doc /usr/X11R6/man/man1/ssh-askpass.1x*
  216. %attr(0644,root,root) %doc /usr/X11R6/man/man1/x11-ssh-askpass.1x*
  217. %attr(0644,root,root) %config /usr/X11R6/lib/X11/app-defaults/SshAskpass
  218. %endif