]>
Commit | Line | Data |
---|---|---|
3c0ef626 | 1 | %define use-stable 1 |
2 | %if %{use-stable} | |
e9a17296 | 3 | %define version 3.1p1 |
3c0ef626 | 4 | %define cvs %{nil} |
5 | %define release 1 | |
6 | %else | |
7 | %define version 3.0p1 | |
8 | %define cvs cvs20011102 | |
9 | %define release 0r1 | |
10 | %endif | |
11 | %define xsa x11-ssh-askpass | |
12 | %define askpass %{xsa}-1.2.4.1 | |
13 | ||
14 | Name : openssh | |
15 | Version : %{version}%{cvs} | |
16 | Release : %{release} | |
17 | Group : System/Network | |
18 | ||
19 | Summary : OpenSSH free Secure Shell (SSH) implementation. | |
20 | ||
21 | Copyright : BSD | |
22 | Packager : Raymund Will <ray@caldera.de> | |
23 | URL : http://www.openssh.com/ | |
24 | ||
25 | Obsoletes : ssh, ssh-clients, openssh-clients | |
26 | ||
27 | BuildRoot : /tmp/%{Name}-%{Version} | |
28 | ||
29 | # %{use-stable}==1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable | |
30 | # %{use-stable}==0: :pserver:cvs@bass.directhit.com:/cvs/openssh_cvs | |
31 | Source0: see-above:/.../openssh-%{Version}.tar.gz | |
32 | %if %{use-stable} | |
33 | Source1: see-above:/.../openssh-%{Version}.tar.gz.sig | |
34 | %endif | |
35 | Source2: http://www.ntrnet.net/~jmknoble/software/%{xsa}/%{askpass}.tar.gz | |
36 | Source3: http://www.openssh.com/faq.html | |
37 | ||
38 | ||
39 | %Package server | |
40 | Group : System/Network | |
41 | Requires : openssh = %{Version} | |
42 | Obsoletes : ssh-server | |
43 | ||
44 | Summary : OpenSSH Secure Shell protocol server (sshd). | |
45 | ||
46 | ||
47 | %Package askpass | |
48 | Group : System/Network | |
49 | Requires : openssh = %{Version} | |
50 | URL : http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/ | |
51 | Obsoletes : ssh-extras | |
52 | ||
53 | Summary : OpenSSH X11 pass-phrase dialog. | |
54 | ||
55 | ||
56 | %Prep | |
57 | %setup %([ -z "%{cvs}" ] || echo "-n %{Name}_cvs") -a2 | |
58 | ||
59 | %if ! %{use-stable} | |
60 | autoreconf | |
61 | %endif | |
62 | ||
63 | ||
64 | %Build | |
65 | CFLAGS="$RPM_OPT_FLAGS" \ | |
66 | ./configure \ | |
67 | --prefix=/usr \ | |
68 | --sysconfdir=/etc/ssh \ | |
69 | --libexecdir=/usr/lib/ssh \ | |
70 | --with-pam \ | |
71 | --with-tcp-wrappers \ | |
72 | --with-ipv4-default \ | |
73 | ||
74 | make | |
75 | ||
76 | cd %{askpass} | |
77 | ./configure | |
78 | xmkmf | |
79 | make includes | |
80 | make | |
81 | ||
82 | ||
83 | %Install | |
84 | %{mkDESTDIR} | |
85 | ||
86 | make DESTDIR="$DESTDIR" install | |
87 | ||
88 | make -C %{askpass} BINDIR="/usr/lib/ssh" install | |
89 | ||
90 | # OpenLinux specific configuration | |
91 | mkdir -p $DESTDIR/{etc/pam.d,%{SVIcdir},%{SVIdir}} | |
92 | ||
93 | # enabling X11 forwarding on the server is convenient and okay, | |
94 | # on the client side we consider it a potential security risk! | |
95 | %{fixUP} -vT $DESTDIR/etc/ssh/sshd_config -e ' | |
96 | s/X11Forwarding no/X11Forwarding yes/i' | |
97 | ||
98 | install -m644 contrib/caldera/sshd.pam $DESTDIR/etc/pam.d/sshd | |
99 | # FIXME: disabled, find out why this doesn't work with NIS | |
100 | %{fixUP} -vT $DESTDIR/etc/pam.d/sshd -e 's/^(.*pam_limits.*)$/#$1/' | |
101 | ||
102 | install -m 0755 contrib/caldera/sshd.init $DESTDIR%{SVIdir}/sshd | |
103 | %{fixUP} -vT $DESTDIR/%{SVIdir} -e 's:\@SVIdir\@:%{SVIdir}: + | |
104 | s:\@sysconfdir\@:/etc/ssh:' | |
105 | ||
106 | cat <<-EoD > $DESTDIR%{SVIcdir}/sshd | |
107 | IDENT=sshd | |
108 | DESCRIPTIVE="OpenSSH secure shell daemon" | |
109 | # This service will be marked as 'skipped' on boot if there | |
110 | # is no host key. Use ssh-host-keygen to generate one. | |
111 | ONBOOT="yes" | |
112 | OPTIONS="" | |
113 | EoD | |
114 | ||
115 | SKG=$DESTDIR/usr/sbin/ssh-host-keygen | |
116 | install -m 0755 contrib/caldera/ssh-host-keygen $SKG | |
117 | %{fixUP} -T $SKG -e 's:\@sysconfdir\@:/etc/ssh: + | |
118 | s:\@sshkeygen\@:/usr/bin/ssh-keygen:' | |
119 | ||
120 | ||
121 | # install remaining docs | |
122 | DocD="$DESTDIR%{_defaultdocdir}/%{Name}-%{Version}"; mkdir -p $DocD/00-LEGAL | |
123 | cp -a LICENCE $DocD/00-LEGAL | |
124 | cp -a CREDITS ChangeLog OVERVIEW README* TODO $DocD | |
125 | install -p -m 0444 -o 0 -g 0 %{SOURCE3} $DocD/faq.html | |
126 | mkdir -p $DocD/%{askpass} | |
127 | cp -a %{askpass}/{README,ChangeLog,TODO,SshAskpass*.ad} $DocD/%{askpass} | |
128 | ||
129 | cp -p %{askpass}/%{xsa}.man $DESTDIR/usr/man/man1/%{xsa}.1 | |
130 | ln -s %{xsa}.1 $DESTDIR/usr/man/man1/ssh-askpass.1 | |
131 | ||
132 | %{fixManPages} | |
133 | ||
134 | ||
135 | # generate file lists | |
136 | %{mkLists} -c %{Name} | |
137 | %{mkLists} -d %{Name} << 'EOF' | |
138 | /etc/ssh base | |
139 | ^/etc/ IGNORED | |
140 | %{_defaultdocdir}/$ IGNORED | |
141 | askpass askpass | |
142 | * default | |
143 | EOF | |
144 | %{mkLists} -a -f %{Name} << 'EOF' | |
145 | ^/etc * prefix(%%config) | |
146 | /usr/X11R6/lib/X11/app-defaults IGNORED | |
147 | Ssh.bin IGNORED # for now | |
148 | [Aa]skpass askpass | |
149 | %{_defaultdocdir}/%{Name}-%{Version}/ base | |
150 | ssh-keygen base | |
151 | moduli server | |
152 | sshd server | |
153 | sftp-server server | |
154 | .* base | |
155 | EOF | |
156 | ||
157 | ||
158 | %Clean | |
159 | %{rmDESTDIR} | |
160 | ||
161 | ||
162 | %Post | |
163 | # Generate host key when none is present to get up and running, | |
164 | # both client and server require this for host-based auth! | |
165 | # ssh-host-keygen checks for existing keys. | |
166 | /usr/sbin/ssh-host-keygen | |
167 | : # to protect the rpm database | |
168 | ||
169 | ||
170 | %Post server | |
171 | if [ -x %{LSBinit}-install ]; then | |
172 | %{LSBinit}-install sshd | |
173 | else | |
174 | lisa --SysV-init install sshd S55 3:4:5 K45 0:1:2:6 | |
175 | fi | |
176 | ||
177 | ! %{SVIdir}/sshd status || %{SVIdir}/sshd restart | |
178 | : # to protect the rpm database | |
179 | ||
180 | ||
181 | %PreUn server | |
182 | [ "$1" = 0 ] || exit 0 | |
183 | ||
184 | ! %{SVIdir}/sshd status || %{SVIdir}/sshd stop | |
185 | : # to protect the rpm database | |
186 | ||
187 | ||
188 | %PostUn server | |
189 | if [ -x %{LSBinit}-remove ]; then | |
190 | %{LSBinit}-remove sshd | |
191 | else | |
192 | lisa --SysV-init remove sshd $1 | |
193 | fi | |
194 | : # to protect the rpm database | |
195 | ||
196 | ||
197 | %Files -f files-%{Name}-base | |
198 | %defattr(-,root,root) | |
199 | ||
200 | ||
201 | %Files server -f files-%{Name}-server | |
202 | %defattr(-,root,root) | |
203 | ||
204 | ||
205 | %Files askpass -f files-%{Name}-askpass | |
206 | %defattr(-,root,root) | |
207 | ||
208 | ||
209 | %Description | |
210 | OpenSSH (Secure Shell) provides access to a remote system. It replaces | |
211 | telnet, rlogin, rexec, and rsh, and provides secure encrypted | |
212 | communications between two untrusted hosts over an insecure network. | |
213 | X11 connections and arbitrary TCP/IP ports can also be forwarded over | |
214 | the secure channel. | |
215 | ||
216 | %Description server | |
217 | This package installs the sshd, the server portion of OpenSSH. | |
218 | ||
219 | %Description askpass | |
220 | This package contains an X11-based pass-phrase dialog used per | |
221 | default by ssh-add(1). It is based on %{askpass} | |
222 | by Jim Knoble <jmknoble@pobox.com>. | |
223 | ||
224 | %ChangeLog | |
225 | * Mon Jan 01 1998 ... | |
226 | ||
227 | $Id$ |