blob: 17eaf79bd796b8633f346c8ab609b783453f8d53 [file] [log] [blame]
Damien Miller36884401999-12-26 12:26:21 +11001# Version of OpenSSH
Ben Lindstrombb346252001-04-27 02:15:00 +00002%define oversion 2.9p1
Damien Miller36884401999-12-26 12:26:21 +11003
4# Version of ssh-askpass
Damien Miller01ebad02001-09-17 15:07:23 +10005%define aversion 1.2.4
Damien Miller36884401999-12-26 12:26:21 +11006
Damien Miller5a119bc2000-07-12 14:34:11 +10007# Do we want to disable building of x11-askpass? (1=yes 0=no)
8%define no_x11_askpass 0
9
10# Do we want to disable building of gnome-askpass? (1=yes 0=no)
11%define no_gnome_askpass 0
12
Damien Miller3e292fa2001-03-12 14:47:30 +110013# Do we want to link against a static libcrypto? (1=yes 0=no)
14%define static_libcrypto 0
15
Damien Miller070ca312001-02-12 09:34:17 +110016# Use Redhat 7.0 pam control file
17%define redhat7 0
18
19# Reserve options to override askpass settings with:
20# rpm -ba|--rebuild --define 'skip_xxx 1'
21%{?skip_x11_askpass:%define no_x11_askpass 1}
22%{?skip_gnome_askpass:%define no_gnome_askpass 1}
23
24# Options for Redhat version:
25# rpm -ba|--rebuild --define "rh7 1"
26%{?rh7:%define redhat7 1}
27
Damien Miller3e292fa2001-03-12 14:47:30 +110028# Options for static OpenSSL link:
29# rpm -ba|--rebuild --define "static_openssl 1"
30%{?static_openssl:%define static_libcrypto 1}
31
Ben Lindstrom379f2052001-02-23 04:55:46 +000032%define exact_openssl_version %(rpm -q openssl | cut -d - -f 2)
33
Damien Miller0c217b72001-09-15 21:01:41 +100034Summary: The OpenSSH implementation of SSH.
Damien Millerd4a8b7e1999-10-27 13:42:43 +100035Name: openssh
Damien Miller36884401999-12-26 12:26:21 +110036Version: %{oversion}
Damien Millerd4a8b7e1999-10-27 13:42:43 +100037Release: 1
Damien Millerab8d1922000-08-08 16:53:28 +100038Packager: Damien Miller <djm@mindrot.org>
Damien Miller0c217b72001-09-15 21:01:41 +100039URL: http://www.openssh.com/portable.html
Damien Millerab8d1922000-08-08 16:53:28 +100040Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{oversion}.tar.gz
Damien Miller969c07e2000-11-06 13:06:43 +110041%if ! %{no_x11_askpass}
Damien Miller0c217b72001-09-15 21:01:41 +100042Source1: http://www.pobox.com/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz
Damien Miller969c07e2000-11-06 13:06:43 +110043%endif
Damien Miller0c217b72001-09-15 21:01:41 +100044License: BSD
Damien Millerd4a8b7e1999-10-27 13:42:43 +100045Group: Applications/Internet
Ben Lindstrom65981152001-02-24 00:05:29 +000046BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Damien Millerc6d5ce81999-11-15 16:01:07 +110047Obsoletes: ssh
Damien Miller969c07e2000-11-06 13:06:43 +110048BuildPreReq: perl, openssl-devel, tcp_wrappers
Damien Miller3e292fa2001-03-12 14:47:30 +110049BuildPreReq: /bin/login, /usr/include/security/pam_appl.h
Damien Miller070ca312001-02-12 09:34:17 +110050BuildPreReq: rpm >= 3.0.5
Damien Miller0c217b72001-09-15 21:01:41 +100051%if ! %{no_x11_askpass}
52BuildPreReq: XFree86-devel
53%endif
Damien Millerab8d1922000-08-08 16:53:28 +100054%if ! %{no_gnome_askpass}
Damien Miller36884401999-12-26 12:26:21 +110055BuildPreReq: gnome-libs-devel
Damien Miller5a119bc2000-07-12 14:34:11 +100056%endif
Damien Miller3e292fa2001-03-12 14:47:30 +110057%if ! %{static_libcrypto}
58PreReq: openssl >= 0.9.5a
59PreReq: openssl = %{exact_openssl_version}
60Requires: openssl >= 0.9.5a
61%endif
62Requires: rpm >= 3.0.5
Damien Miller36682061999-11-15 17:19:24 +110063
64%package clients
Damien Miller0c217b72001-09-15 21:01:41 +100065Summary: OpenSSH clients.
Damien Millerff649d82000-10-16 13:35:19 +110066Requires: openssh = %{version}-%{release}
Damien Millerab8d1922000-08-08 16:53:28 +100067Group: Applications/Internet
Damien Millerc6d5ce81999-11-15 16:01:07 +110068Obsoletes: ssh-clients
Damien Millerd4a8b7e1999-10-27 13:42:43 +100069
Damien Miller3f51bf51999-11-09 14:46:02 +110070%package server
Damien Miller0c217b72001-09-15 21:01:41 +100071Summary: The OpenSSH server daemon.
Damien Miller3f51bf51999-11-09 14:46:02 +110072Group: System Environment/Daemons
Damien Millerc6d5ce81999-11-15 16:01:07 +110073Obsoletes: ssh-server
Damien Millerff649d82000-10-16 13:35:19 +110074PreReq: openssh = %{version}-%{release}, chkconfig >= 0.9
Ben Lindstrom65981152001-02-24 00:05:29 +000075%if %{redhat7}
76Requires: /etc/pam.d/system-auth
77%endif
Damien Miller3f51bf51999-11-09 14:46:02 +110078
79%package askpass
Damien Miller0c217b72001-09-15 21:01:41 +100080Summary: A passphrase dialog for OpenSSH and X.
Damien Miller36884401999-12-26 12:26:21 +110081Group: Applications/Internet
Damien Millerff649d82000-10-16 13:35:19 +110082Requires: openssh = %{version}-%{release}
Damien Miller36884401999-12-26 12:26:21 +110083Obsoletes: ssh-extras
Damien Miller36884401999-12-26 12:26:21 +110084
Damien Miller36884401999-12-26 12:26:21 +110085%package askpass-gnome
Damien Miller0c217b72001-09-15 21:01:41 +100086Summary: A passphrase dialog for OpenSSH, X, and GNOME.
Damien Miller3f51bf51999-11-09 14:46:02 +110087Group: Applications/Internet
Damien Millerff649d82000-10-16 13:35:19 +110088Requires: openssh = %{version}-%{release}
Damien Miller36682061999-11-15 17:19:24 +110089Obsoletes: ssh-extras
Damien Miller3f51bf51999-11-09 14:46:02 +110090
Damien Millerd4a8b7e1999-10-27 13:42:43 +100091%description
Damien Miller85085cb2001-09-15 21:23:11 +100092OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. SSH
93replaces rlogin and rsh, to provide secure encrypted communications
94between two untrusted hosts over an insecure network. X11 connections
95and arbitrary TCP/IP ports can also be forwarded over the secure
96channel. Public key authentication may be used for "passwordless"
97access to servers.
Damien Millerd4a8b7e1999-10-27 13:42:43 +100098
Damien Miller36682061999-11-15 17:19:24 +110099This package includes the core files necessary for both the OpenSSH
Damien Miller0c217b72001-09-15 21:01:41 +1000100client and server. To make this package useful, you should also
Damien Miller36682061999-11-15 17:19:24 +1100101install openssh-clients, openssh-server, or both.
102
103%description clients
Damien Miller85085cb2001-09-15 21:23:11 +1000104OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
105
106This package includes the clients necessary to make encrypted
107connections to SSH protocol servers. You'll also need to install the
108openssh package on OpenSSH clients.
Damien Miller3f51bf51999-11-09 14:46:02 +1100109
110%description server
Damien Miller85085cb2001-09-15 21:23:11 +1000111OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
112
113This package contains the secure shell daemon (sshd). The sshd daemon
114allows SSH clients to securely connect to your SSH server. You also
115need to have the openssh package installed.
Damien Miller3f51bf51999-11-09 14:46:02 +1100116
Damien Miller36884401999-12-26 12:26:21 +1100117%description askpass
Damien Miller85085cb2001-09-15 21:23:11 +1000118OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
119
120This package contains an X11 passphrase dialog for OpenSSH.
Damien Miller36884401999-12-26 12:26:21 +1100121
Damien Millerf6adfa91999-12-26 13:08:15 +1100122%description askpass-gnome
Damien Miller85085cb2001-09-15 21:23:11 +1000123OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
124
125This package contains an X11 passphrase dialog for OpenSSH and the
126GNOME GUI desktop environment.
Damien Miller3f51bf51999-11-09 14:46:02 +1100127
Damien Millerff649d82000-10-16 13:35:19 +1100128%prep
129
Damien Miller969c07e2000-11-06 13:06:43 +1100130%if ! %{no_x11_askpass}
Damien Millerff649d82000-10-16 13:35:19 +1100131%setup -q -a 1
Damien Miller969c07e2000-11-06 13:06:43 +1100132%else
133%setup -q
134%endif
Damien Millerff649d82000-10-16 13:35:19 +1100135
136%build
137
Damien Millerafeaca92000-11-11 09:09:57 +1100138%define _sysconfdir /etc/ssh
139
Damien Millerff649d82000-10-16 13:35:19 +1100140%configure \
Damien Millerff649d82000-10-16 13:35:19 +1100141 --libexecdir=%{_libexecdir}/openssh \
Damien Miller01fa6382001-01-17 11:23:39 +1100142 --with-pam \
Damien Millerff649d82000-10-16 13:35:19 +1100143 --with-tcp-wrappers \
144 --with-ipv4-default \
145 --with-rsh=/usr/bin/rsh \
Damien Miller01fa6382001-01-17 11:23:39 +1100146 --with-default-path=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
Damien Millerff649d82000-10-16 13:35:19 +1100147
Damien Miller3e292fa2001-03-12 14:47:30 +1100148%if %{static_libcrypto}
149perl -pi -e "s|-lcrypto|/usr/lib/libcrypto.a|g" Makefile
150%endif
151
Damien Millerff649d82000-10-16 13:35:19 +1100152make
153
154%if ! %{no_x11_askpass}
155pushd x11-ssh-askpass-%{aversion}
Damien Miller500c7902001-09-17 15:43:46 +1000156%configure \
Damien Millerc3bd7ec2001-09-17 15:49:36 +1000157 --libexecdir=%{_libexecdir}/openssh
Damien Miller01ebad02001-09-17 15:07:23 +1000158xmkmf -a
Damien Millerff649d82000-10-16 13:35:19 +1100159make
160popd
161%endif
162
163%if ! %{no_gnome_askpass}
164pushd contrib
165gcc -O -g `gnome-config --cflags gnome gnomeui` \
166 gnome-ssh-askpass.c -o gnome-ssh-askpass \
167 `gnome-config --libs gnome gnomeui`
168popd
169%endif
170
171%install
172rm -rf $RPM_BUILD_ROOT
173%{makeinstall} \
Damien Millerff649d82000-10-16 13:35:19 +1100174 libexecdir=$RPM_BUILD_ROOT%{_libexecdir}/openssh \
175 DESTDIR=/ # Hack to disable key generation
176
177
178install -d $RPM_BUILD_ROOT/etc/pam.d/
179install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
180install -d $RPM_BUILD_ROOT%{_libexecdir}/openssh
Damien Miller070ca312001-02-12 09:34:17 +1100181%if %{redhat7}
Damien Miller070ca312001-02-12 09:34:17 +1100182install -m644 contrib/redhat/sshd.pam-7.x $RPM_BUILD_ROOT/etc/pam.d/sshd
Ben Lindstrom008e2912001-02-23 04:45:15 +0000183%else
184install -m644 contrib/redhat/sshd.pam $RPM_BUILD_ROOT/etc/pam.d/sshd
Damien Miller070ca312001-02-12 09:34:17 +1100185%endif
Damien Millerff649d82000-10-16 13:35:19 +1100186install -m755 contrib/redhat/sshd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd
187
188%if ! %{no_x11_askpass}
Damien Miller73bb0582001-02-25 09:36:29 +1100189install -s x11-ssh-askpass-%{aversion}/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/x11-ssh-askpass
190ln -s /usr/libexec/openssh/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass
Damien Millerff649d82000-10-16 13:35:19 +1100191%endif
192
193%if ! %{no_gnome_askpass}
Damien Miller73bb0582001-02-25 09:36:29 +1100194install -s contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome-ssh-askpass
Damien Millerff649d82000-10-16 13:35:19 +1100195%endif
196
197perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
198
199%clean
200rm -rf $RPM_BUILD_ROOT
201
202%post server
203/sbin/chkconfig --add sshd
204if test -r /var/run/sshd.pid ; then
205 /etc/rc.d/init.d/sshd restart >&2
206fi
207
208%preun server
209if [ "$1" = 0 ] ; then
210 /etc/rc.d/init.d/sshd stop >&2
211 /sbin/chkconfig --del sshd
212fi
213
214%files
215%defattr(-,root,root)
Damien Miller0c217b72001-09-15 21:01:41 +1000216%doc CREDITS ChangeLog INSTALL LICENCE OVERVIEW README* RFC* TODO WARNING*
Damien Millerff649d82000-10-16 13:35:19 +1100217%attr(0755,root,root) %{_bindir}/ssh-keygen
218%attr(0755,root,root) %{_bindir}/scp
219%attr(0644,root,root) %{_mandir}/man1/ssh-keygen.1*
220%attr(0644,root,root) %{_mandir}/man1/scp.1*
Damien Milleree188d32000-11-13 23:13:55 +1100221%attr(0755,root,root) %dir %{_sysconfdir}
Damien Miller407548b2001-06-27 17:07:16 +1000222%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/moduli
Damien Millerff649d82000-10-16 13:35:19 +1100223%attr(0755,root,root) %dir %{_libexecdir}/openssh
224
225%files clients
226%defattr(-,root,root)
227%attr(4755,root,root) %{_bindir}/ssh
228%attr(0755,root,root) %{_bindir}/ssh-agent
229%attr(0755,root,root) %{_bindir}/ssh-add
Damien Miller33804262001-02-04 23:20:18 +1100230%attr(0755,root,root) %{_bindir}/ssh-keyscan
231%attr(0755,root,root) %{_bindir}/sftp
Damien Millerff649d82000-10-16 13:35:19 +1100232%attr(0644,root,root) %{_mandir}/man1/ssh.1*
233%attr(0644,root,root) %{_mandir}/man1/ssh-agent.1*
234%attr(0644,root,root) %{_mandir}/man1/ssh-add.1*
Damien Miller33804262001-02-04 23:20:18 +1100235%attr(0644,root,root) %{_mandir}/man1/ssh-keyscan.1*
236%attr(0644,root,root) %{_mandir}/man1/sftp.1*
Damien Milleree188d32000-11-13 23:13:55 +1100237%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh_config
Damien Millerff649d82000-10-16 13:35:19 +1100238%attr(-,root,root) %{_bindir}/slogin
239%attr(-,root,root) %{_mandir}/man1/slogin.1*
240
241%files server
242%defattr(-,root,root)
243%attr(0755,root,root) %{_sbindir}/sshd
244%attr(0755,root,root) %{_libexecdir}/openssh/sftp-server
245%attr(0644,root,root) %{_mandir}/man8/sshd.8*
246%attr(0644,root,root) %{_mandir}/man8/sftp-server.8*
Damien Miller9b405802001-02-27 10:53:00 +1100247#%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sshd_config
248%attr(0600,root,root) %config %{_sysconfdir}/sshd_config
Damien Millerff649d82000-10-16 13:35:19 +1100249%attr(0600,root,root) %config(noreplace) /etc/pam.d/sshd
250%attr(0755,root,root) %config /etc/rc.d/init.d/sshd
251
252%if ! %{no_x11_askpass}
253%files askpass
254%defattr(-,root,root)
255%doc x11-ssh-askpass-%{aversion}/README
256%doc x11-ssh-askpass-%{aversion}/ChangeLog
257%doc x11-ssh-askpass-%{aversion}/SshAskpass*.ad
258%attr(0755,root,root) %{_libexecdir}/openssh/ssh-askpass
259%attr(0755,root,root) %{_libexecdir}/openssh/x11-ssh-askpass
260%endif
261
262%if ! %{no_gnome_askpass}
263%files askpass-gnome
264%defattr(-,root,root)
265%attr(0755,root,root) %{_libexecdir}/openssh/gnome-ssh-askpass
266%endif
267
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000268%changelog
Damien Millerff649d82000-10-16 13:35:19 +1100269* Mon Oct 18 2000 Damien Miller <djm@mindrot.org>
270- Merge some of Nalin Dahyabhai <nalin@redhat.com> changes from the
271 Redhat 7.0 spec file
Damien Miller676092f2000-09-05 14:16:18 +1100272* Tue Sep 05 2000 Damien Miller <djm@mindrot.org>
273- Use RPM configure macro
Damien Millerab8d1922000-08-08 16:53:28 +1000274* Tue Aug 08 2000 Damien Miller <djm@mindrot.org>
275- Some surgery to sshd.init (generate keys at runtime)
276- Cleanup of groups and removal of keygen calls
Damien Miller5a119bc2000-07-12 14:34:11 +1000277* Wed Jul 12 2000 Damien Miller <djm@mindrot.org>
278- Make building of X11-askpass and gnome-askpass optional
Damien Millere69f18c2000-06-12 16:38:54 +1000279* Mon Jun 12 2000 Damien Miller <djm@mindrot.org>
280- Glob manpages to catch compressed files
Damien Millerddaffa42000-03-15 12:31:18 +1100281* Wed Mar 15 2000 Damien Miller <djm@ibs.com.au>
282- Updated for new location
283- Updated for new gnome-ssh-askpass build
Damien Miller36884401999-12-26 12:26:21 +1100284* Sun Dec 26 1999 Damien Miller <djm@mindrot.org>
285- Added Jim Knoble's <jmknoble@pobox.com> askpass
Damien Miller36682061999-11-15 17:19:24 +1100286* Mon Nov 15 1999 Damien Miller <djm@mindrot.org>
287- Split subpackages further based on patch from jim knoble <jmknoble@pobox.com>
Damien Miller38c60881999-11-13 13:09:31 +1100288* Sat Nov 13 1999 Damien Miller <djm@mindrot.org>
Damien Millerc6d5ce81999-11-15 16:01:07 +1100289- Added 'Obsoletes' directives
Damien Miller742d2cb1999-11-09 14:28:26 +1100290* Tue Nov 09 1999 Damien Miller <djm@ibs.com.au>
291- Use make install
Damien Miller3f51bf51999-11-09 14:46:02 +1100292- Subpackages
Damien Miller356a0b01999-11-08 15:30:59 +1100293* Mon Nov 08 1999 Damien Miller <djm@ibs.com.au>
294- Added links for slogin
295- Fixed perms on manpages
Damien Miller2bbb9d01999-10-30 09:46:20 +1000296* Sat Oct 30 1999 Damien Miller <djm@ibs.com.au>
297- Renamed init script
Damien Miller070f7a11999-10-29 10:29:29 +1000298* Fri Oct 29 1999 Damien Miller <djm@ibs.com.au>
299- Back to old binary names
Damien Miller06230761999-10-28 14:03:14 +1000300* Thu Oct 28 1999 Damien Miller <djm@ibs.com.au>
301- Use autoconf
302- New binary names
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000303* Wed Oct 27 1999 Damien Miller <djm@ibs.com.au>
304- Initial RPMification, based on Jan "Yenya" Kasprzak's <kas@fi.muni.cz> spec.
305