blob: 60461f29c80bd0d5f61bfd2ab780c8cb0762ee9c [file] [log] [blame]
Damien Miller36884401999-12-26 12:26:21 +11001# Version of OpenSSH
Damien Miller353f6082001-11-14 00:05:57 +11002%define oversion 3.0.1p1
Damien Miller36884401999-12-26 12:26:21 +11003
4# Version of ssh-askpass
Damien Millerbccb5a92001-09-28 20:03:25 +10005%define aversion 1.2.4.1
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 Millerf2bd06c2001-09-18 15:33:07 +100016# Do we want smartcard support (1=yes 0=no)
17%define scard 0
18
Damien Miller070ca312001-02-12 09:34:17 +110019# Use Redhat 7.0 pam control file
20%define redhat7 0
21
Damien Miller1c613242001-10-30 22:03:51 +110022# Disable IPv6 (avoids DNS hangs on some glibc versions)
23%define noip6 0
24
Damien Miller070ca312001-02-12 09:34:17 +110025# Reserve options to override askpass settings with:
26# rpm -ba|--rebuild --define 'skip_xxx 1'
27%{?skip_x11_askpass:%define no_x11_askpass 1}
28%{?skip_gnome_askpass:%define no_gnome_askpass 1}
29
30# Options for Redhat version:
31# rpm -ba|--rebuild --define "rh7 1"
32%{?rh7:%define redhat7 1}
33
Damien Miller3e292fa2001-03-12 14:47:30 +110034# Options for static OpenSSL link:
35# rpm -ba|--rebuild --define "static_openssl 1"
36%{?static_openssl:%define static_libcrypto 1}
37
Damien Millerf2bd06c2001-09-18 15:33:07 +100038# Options for Smartcard support: (needs libsectok and openssl-engine)
39# rpm -ba|--rebuild --define "smartcard 1"
40%{?smartcard:%define scard 1}
41
Damien Miller1c613242001-10-30 22:03:51 +110042# Option to disable ipv6
43# rpm -ba|--rebuild --define "noipv6 1"
44%{?noipv6:%define noip6 1}
45
Ben Lindstrom379f2052001-02-23 04:55:46 +000046%define exact_openssl_version %(rpm -q openssl | cut -d - -f 2)
47
Damien Millercf7635c2001-09-27 00:24:21 +100048Summary: The OpenSSH implementation of SSH protocol versions 1 and 2
Damien Millerd4a8b7e1999-10-27 13:42:43 +100049Name: openssh
Damien Miller36884401999-12-26 12:26:21 +110050Version: %{oversion}
Damien Millerd4a8b7e1999-10-27 13:42:43 +100051Release: 1
Damien Millerab8d1922000-08-08 16:53:28 +100052Packager: Damien Miller <djm@mindrot.org>
Damien Miller0c217b72001-09-15 21:01:41 +100053URL: http://www.openssh.com/portable.html
Damien Millerab8d1922000-08-08 16:53:28 +100054Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{oversion}.tar.gz
Damien Miller969c07e2000-11-06 13:06:43 +110055%if ! %{no_x11_askpass}
Damien Miller0c217b72001-09-15 21:01:41 +100056Source1: http://www.pobox.com/~jmknoble/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz
Damien Miller969c07e2000-11-06 13:06:43 +110057%endif
Damien Miller0c217b72001-09-15 21:01:41 +100058License: BSD
Damien Millerd4a8b7e1999-10-27 13:42:43 +100059Group: Applications/Internet
Ben Lindstrom65981152001-02-24 00:05:29 +000060BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Damien Millerc6d5ce81999-11-15 16:01:07 +110061Obsoletes: ssh
Damien Miller969c07e2000-11-06 13:06:43 +110062BuildPreReq: perl, openssl-devel, tcp_wrappers
Damien Miller3e292fa2001-03-12 14:47:30 +110063BuildPreReq: /bin/login, /usr/include/security/pam_appl.h
Damien Miller070ca312001-02-12 09:34:17 +110064BuildPreReq: rpm >= 3.0.5
Damien Miller0c217b72001-09-15 21:01:41 +100065%if ! %{no_x11_askpass}
66BuildPreReq: XFree86-devel
67%endif
Damien Millerab8d1922000-08-08 16:53:28 +100068%if ! %{no_gnome_askpass}
Damien Miller36884401999-12-26 12:26:21 +110069BuildPreReq: gnome-libs-devel
Damien Miller5a119bc2000-07-12 14:34:11 +100070%endif
Damien Miller3e292fa2001-03-12 14:47:30 +110071%if ! %{static_libcrypto}
72PreReq: openssl >= 0.9.5a
73PreReq: openssl = %{exact_openssl_version}
74Requires: openssl >= 0.9.5a
75%endif
76Requires: rpm >= 3.0.5
Damien Miller36682061999-11-15 17:19:24 +110077
78%package clients
Damien Miller0c217b72001-09-15 21:01:41 +100079Summary: OpenSSH clients.
Damien Millerff649d82000-10-16 13:35:19 +110080Requires: openssh = %{version}-%{release}
Damien Millerab8d1922000-08-08 16:53:28 +100081Group: Applications/Internet
Damien Millerc6d5ce81999-11-15 16:01:07 +110082Obsoletes: ssh-clients
Damien Millerd4a8b7e1999-10-27 13:42:43 +100083
Damien Miller3f51bf51999-11-09 14:46:02 +110084%package server
Damien Miller0c217b72001-09-15 21:01:41 +100085Summary: The OpenSSH server daemon.
Damien Miller3f51bf51999-11-09 14:46:02 +110086Group: System Environment/Daemons
Damien Millerc6d5ce81999-11-15 16:01:07 +110087Obsoletes: ssh-server
Damien Millerff649d82000-10-16 13:35:19 +110088PreReq: openssh = %{version}-%{release}, chkconfig >= 0.9
Ben Lindstrom65981152001-02-24 00:05:29 +000089%if %{redhat7}
90Requires: /etc/pam.d/system-auth
91%endif
Damien Miller3f51bf51999-11-09 14:46:02 +110092
93%package askpass
Damien Miller0c217b72001-09-15 21:01:41 +100094Summary: A passphrase dialog for OpenSSH and X.
Damien Miller36884401999-12-26 12:26:21 +110095Group: Applications/Internet
Damien Millerff649d82000-10-16 13:35:19 +110096Requires: openssh = %{version}-%{release}
Damien Miller36884401999-12-26 12:26:21 +110097Obsoletes: ssh-extras
Damien Miller36884401999-12-26 12:26:21 +110098
Damien Miller36884401999-12-26 12:26:21 +110099%package askpass-gnome
Damien Miller0c217b72001-09-15 21:01:41 +1000100Summary: A passphrase dialog for OpenSSH, X, and GNOME.
Damien Miller3f51bf51999-11-09 14:46:02 +1100101Group: Applications/Internet
Damien Millerff649d82000-10-16 13:35:19 +1100102Requires: openssh = %{version}-%{release}
Damien Miller36682061999-11-15 17:19:24 +1100103Obsoletes: ssh-extras
Damien Miller3f51bf51999-11-09 14:46:02 +1100104
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000105%description
Damien Miller85085cb2001-09-15 21:23:11 +1000106OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation. SSH
107replaces rlogin and rsh, to provide secure encrypted communications
108between two untrusted hosts over an insecure network. X11 connections
109and arbitrary TCP/IP ports can also be forwarded over the secure
110channel. Public key authentication may be used for "passwordless"
111access to servers.
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000112
Damien Miller36682061999-11-15 17:19:24 +1100113This package includes the core files necessary for both the OpenSSH
Damien Miller0c217b72001-09-15 21:01:41 +1000114client and server. To make this package useful, you should also
Damien Miller36682061999-11-15 17:19:24 +1100115install openssh-clients, openssh-server, or both.
116
117%description clients
Damien Miller85085cb2001-09-15 21:23:11 +1000118OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
119
120This package includes the clients necessary to make encrypted
121connections to SSH protocol servers. You'll also need to install the
122openssh package on OpenSSH clients.
Damien Miller3f51bf51999-11-09 14:46:02 +1100123
124%description server
Damien Miller85085cb2001-09-15 21:23:11 +1000125OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
126
127This package contains the secure shell daemon (sshd). The sshd daemon
128allows SSH clients to securely connect to your SSH server. You also
129need to have the openssh package installed.
Damien Miller3f51bf51999-11-09 14:46:02 +1100130
Damien Miller36884401999-12-26 12:26:21 +1100131%description askpass
Damien Miller85085cb2001-09-15 21:23:11 +1000132OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
133
134This package contains an X11 passphrase dialog for OpenSSH.
Damien Miller36884401999-12-26 12:26:21 +1100135
Damien Millerf6adfa91999-12-26 13:08:15 +1100136%description askpass-gnome
Damien Miller85085cb2001-09-15 21:23:11 +1000137OpenSSH is OpenBSD's SSH (Secure SHell) protocol implementation.
138
139This package contains an X11 passphrase dialog for OpenSSH and the
140GNOME GUI desktop environment.
Damien Miller3f51bf51999-11-09 14:46:02 +1100141
Damien Millerff649d82000-10-16 13:35:19 +1100142%prep
143
Damien Miller969c07e2000-11-06 13:06:43 +1100144%if ! %{no_x11_askpass}
Damien Millerff649d82000-10-16 13:35:19 +1100145%setup -q -a 1
Damien Miller969c07e2000-11-06 13:06:43 +1100146%else
147%setup -q
148%endif
Damien Millerff649d82000-10-16 13:35:19 +1100149
150%build
151
Damien Millerafeaca92000-11-11 09:09:57 +1100152%define _sysconfdir /etc/ssh
153
Damien Millerf2bd06c2001-09-18 15:33:07 +1000154EXTRA_OPTS=""
155
Damien Millercf8cadf2001-09-18 15:35:04 +1000156%if %{scard}
Damien Millerf2bd06c2001-09-18 15:33:07 +1000157 EXTRA_OPTS="$EXTRA_OPTS --with-smartcard"
158%endif
159
Damien Miller1c613242001-10-30 22:03:51 +1100160%if %{noip6}
161 EXTRA_OPTS="$EXTRA_OPTS --with-ipv4-default "
162%endif
163
Damien Millerff649d82000-10-16 13:35:19 +1100164%configure \
Damien Millerff649d82000-10-16 13:35:19 +1100165 --libexecdir=%{_libexecdir}/openssh \
Damien Miller7948d932001-09-18 15:12:10 +1000166 --datadir=%{_datadir}/openssh \
Damien Miller01fa6382001-01-17 11:23:39 +1100167 --with-pam \
Damien Millerff649d82000-10-16 13:35:19 +1100168 --with-tcp-wrappers \
Damien Millerff649d82000-10-16 13:35:19 +1100169 --with-rsh=/usr/bin/rsh \
Damien Millerf2bd06c2001-09-18 15:33:07 +1000170 --with-default-path=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin \
171 $EXTRA_OPTS
Damien Millerff649d82000-10-16 13:35:19 +1100172
Damien Miller3e292fa2001-03-12 14:47:30 +1100173%if %{static_libcrypto}
174perl -pi -e "s|-lcrypto|/usr/lib/libcrypto.a|g" Makefile
175%endif
176
Damien Millerff649d82000-10-16 13:35:19 +1100177make
178
179%if ! %{no_x11_askpass}
180pushd x11-ssh-askpass-%{aversion}
Damien Miller500c7902001-09-17 15:43:46 +1000181%configure \
Damien Millerc3bd7ec2001-09-17 15:49:36 +1000182 --libexecdir=%{_libexecdir}/openssh
Damien Miller01ebad02001-09-17 15:07:23 +1000183xmkmf -a
Damien Millerff649d82000-10-16 13:35:19 +1100184make
185popd
186%endif
187
188%if ! %{no_gnome_askpass}
189pushd contrib
190gcc -O -g `gnome-config --cflags gnome gnomeui` \
191 gnome-ssh-askpass.c -o gnome-ssh-askpass \
192 `gnome-config --libs gnome gnomeui`
193popd
194%endif
195
196%install
197rm -rf $RPM_BUILD_ROOT
198%{makeinstall} \
Damien Millerff649d82000-10-16 13:35:19 +1100199 libexecdir=$RPM_BUILD_ROOT%{_libexecdir}/openssh \
Damien Miller2c1e1cb2001-09-18 15:23:58 +1000200 datadir=$RPM_BUILD_ROOT%{_datadir}/openssh \
Damien Millerff649d82000-10-16 13:35:19 +1100201 DESTDIR=/ # Hack to disable key generation
202
203
204install -d $RPM_BUILD_ROOT/etc/pam.d/
205install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
206install -d $RPM_BUILD_ROOT%{_libexecdir}/openssh
Damien Miller070ca312001-02-12 09:34:17 +1100207%if %{redhat7}
Damien Miller070ca312001-02-12 09:34:17 +1100208install -m644 contrib/redhat/sshd.pam-7.x $RPM_BUILD_ROOT/etc/pam.d/sshd
Ben Lindstrom008e2912001-02-23 04:45:15 +0000209%else
210install -m644 contrib/redhat/sshd.pam $RPM_BUILD_ROOT/etc/pam.d/sshd
Damien Miller070ca312001-02-12 09:34:17 +1100211%endif
Damien Millerff649d82000-10-16 13:35:19 +1100212install -m755 contrib/redhat/sshd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd
213
214%if ! %{no_x11_askpass}
Damien Miller73bb0582001-02-25 09:36:29 +1100215install -s x11-ssh-askpass-%{aversion}/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/x11-ssh-askpass
216ln -s /usr/libexec/openssh/x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass
Damien Millerff649d82000-10-16 13:35:19 +1100217%endif
218
219%if ! %{no_gnome_askpass}
Damien Miller73bb0582001-02-25 09:36:29 +1100220install -s contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome-ssh-askpass
Damien Millerff649d82000-10-16 13:35:19 +1100221%endif
222
223perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
224
225%clean
226rm -rf $RPM_BUILD_ROOT
227
228%post server
229/sbin/chkconfig --add sshd
230if test -r /var/run/sshd.pid ; then
231 /etc/rc.d/init.d/sshd restart >&2
232fi
233
234%preun server
235if [ "$1" = 0 ] ; then
236 /etc/rc.d/init.d/sshd stop >&2
237 /sbin/chkconfig --del sshd
238fi
239
240%files
241%defattr(-,root,root)
Damien Miller0c217b72001-09-15 21:01:41 +1000242%doc CREDITS ChangeLog INSTALL LICENCE OVERVIEW README* RFC* TODO WARNING*
Damien Millerff649d82000-10-16 13:35:19 +1100243%attr(0755,root,root) %{_bindir}/ssh-keygen
244%attr(0755,root,root) %{_bindir}/scp
245%attr(0644,root,root) %{_mandir}/man1/ssh-keygen.1*
246%attr(0644,root,root) %{_mandir}/man1/scp.1*
Damien Milleree188d32000-11-13 23:13:55 +1100247%attr(0755,root,root) %dir %{_sysconfdir}
Damien Miller12eceb22001-10-31 10:31:13 +1100248%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/moduli
Damien Millerff649d82000-10-16 13:35:19 +1100249%attr(0755,root,root) %dir %{_libexecdir}/openssh
Damien Miller99b8feb2001-09-18 15:37:50 +1000250%if %{scard}
Damien Miller7948d932001-09-18 15:12:10 +1000251%attr(0755,root,root) %dir %{_datadir}/openssh
252%attr(0644,root,root) %{_datadir}/openssh/Ssh.bin
Damien Millerf2bd06c2001-09-18 15:33:07 +1000253%endif
Damien Millerff649d82000-10-16 13:35:19 +1100254
255%files clients
256%defattr(-,root,root)
257%attr(4755,root,root) %{_bindir}/ssh
258%attr(0755,root,root) %{_bindir}/ssh-agent
259%attr(0755,root,root) %{_bindir}/ssh-add
Damien Miller33804262001-02-04 23:20:18 +1100260%attr(0755,root,root) %{_bindir}/ssh-keyscan
261%attr(0755,root,root) %{_bindir}/sftp
Damien Millerff649d82000-10-16 13:35:19 +1100262%attr(0644,root,root) %{_mandir}/man1/ssh.1*
263%attr(0644,root,root) %{_mandir}/man1/ssh-agent.1*
264%attr(0644,root,root) %{_mandir}/man1/ssh-add.1*
Damien Miller33804262001-02-04 23:20:18 +1100265%attr(0644,root,root) %{_mandir}/man1/ssh-keyscan.1*
266%attr(0644,root,root) %{_mandir}/man1/sftp.1*
Damien Miller12eceb22001-10-31 10:31:13 +1100267%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/ssh_config
Damien Millerff649d82000-10-16 13:35:19 +1100268%attr(-,root,root) %{_bindir}/slogin
269%attr(-,root,root) %{_mandir}/man1/slogin.1*
270
271%files server
272%defattr(-,root,root)
273%attr(0755,root,root) %{_sbindir}/sshd
274%attr(0755,root,root) %{_libexecdir}/openssh/sftp-server
275%attr(0644,root,root) %{_mandir}/man8/sshd.8*
276%attr(0644,root,root) %{_mandir}/man8/sftp-server.8*
Damien Miller12eceb22001-10-31 10:31:13 +1100277#%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sshd_config
278%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sshd_config
279%attr(0600,root,root) %config(noreplace) /etc/pam.d/sshd
Damien Millerff649d82000-10-16 13:35:19 +1100280%attr(0755,root,root) %config /etc/rc.d/init.d/sshd
281
282%if ! %{no_x11_askpass}
283%files askpass
284%defattr(-,root,root)
285%doc x11-ssh-askpass-%{aversion}/README
286%doc x11-ssh-askpass-%{aversion}/ChangeLog
287%doc x11-ssh-askpass-%{aversion}/SshAskpass*.ad
288%attr(0755,root,root) %{_libexecdir}/openssh/ssh-askpass
289%attr(0755,root,root) %{_libexecdir}/openssh/x11-ssh-askpass
290%endif
291
292%if ! %{no_gnome_askpass}
293%files askpass-gnome
294%defattr(-,root,root)
295%attr(0755,root,root) %{_libexecdir}/openssh/gnome-ssh-askpass
296%endif
297
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000298%changelog
Damien Millerff649d82000-10-16 13:35:19 +1100299* Mon Oct 18 2000 Damien Miller <djm@mindrot.org>
300- Merge some of Nalin Dahyabhai <nalin@redhat.com> changes from the
301 Redhat 7.0 spec file
Damien Miller676092f2000-09-05 14:16:18 +1100302* Tue Sep 05 2000 Damien Miller <djm@mindrot.org>
303- Use RPM configure macro
Damien Millerab8d1922000-08-08 16:53:28 +1000304* Tue Aug 08 2000 Damien Miller <djm@mindrot.org>
305- Some surgery to sshd.init (generate keys at runtime)
306- Cleanup of groups and removal of keygen calls
Damien Miller5a119bc2000-07-12 14:34:11 +1000307* Wed Jul 12 2000 Damien Miller <djm@mindrot.org>
308- Make building of X11-askpass and gnome-askpass optional
Damien Millere69f18c2000-06-12 16:38:54 +1000309* Mon Jun 12 2000 Damien Miller <djm@mindrot.org>
310- Glob manpages to catch compressed files
Damien Millerddaffa42000-03-15 12:31:18 +1100311* Wed Mar 15 2000 Damien Miller <djm@ibs.com.au>
312- Updated for new location
313- Updated for new gnome-ssh-askpass build
Damien Miller36884401999-12-26 12:26:21 +1100314* Sun Dec 26 1999 Damien Miller <djm@mindrot.org>
315- Added Jim Knoble's <jmknoble@pobox.com> askpass
Damien Miller36682061999-11-15 17:19:24 +1100316* Mon Nov 15 1999 Damien Miller <djm@mindrot.org>
317- Split subpackages further based on patch from jim knoble <jmknoble@pobox.com>
Damien Miller38c60881999-11-13 13:09:31 +1100318* Sat Nov 13 1999 Damien Miller <djm@mindrot.org>
Damien Millerc6d5ce81999-11-15 16:01:07 +1100319- Added 'Obsoletes' directives
Damien Miller742d2cb1999-11-09 14:28:26 +1100320* Tue Nov 09 1999 Damien Miller <djm@ibs.com.au>
321- Use make install
Damien Miller3f51bf51999-11-09 14:46:02 +1100322- Subpackages
Damien Miller356a0b01999-11-08 15:30:59 +1100323* Mon Nov 08 1999 Damien Miller <djm@ibs.com.au>
324- Added links for slogin
325- Fixed perms on manpages
Damien Miller2bbb9d01999-10-30 09:46:20 +1000326* Sat Oct 30 1999 Damien Miller <djm@ibs.com.au>
327- Renamed init script
Damien Miller070f7a11999-10-29 10:29:29 +1000328* Fri Oct 29 1999 Damien Miller <djm@ibs.com.au>
329- Back to old binary names
Damien Miller06230761999-10-28 14:03:14 +1000330* Thu Oct 28 1999 Damien Miller <djm@ibs.com.au>
331- Use autoconf
332- New binary names
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000333* Wed Oct 27 1999 Damien Miller <djm@ibs.com.au>
334- Initial RPMification, based on Jan "Yenya" Kasprzak's <kas@fi.muni.cz> spec.
335