1 # Build recipe for openssh.
3 # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/networking"
24 tarname=${program}-${version}.tar.gz
27 fetch=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$tarname
32 OpenSSH is the premier connectivity tool for remote login with the SSH
33 protocol. It encrypts all traffic to eliminate eavesdropping,
34 connection hijacking, and other attacks. In addition, OpenSSH provides
35 a large suite of secure tunneling capabilities, several authentication
36 methods, and sophisticated configuration options.
39 homepage=http://www.openssh.com
42 # Source documentation
43 docs="CREDITS ChangeLog LICENCE OVERVIEW PROTOCOL* README* TODO"
44 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # Set sane permissions
55 chmod -R u+w,go-w,a+rX-s .
57 # A patch from Dragora to include a missing header at md5crypt.c file
58 patch -p1 < "${worktree}/patches/openssh/openssh-include-stdio.h.patch"
60 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" LIBS=-ledit \
62 --libdir=/usr/lib${libSuffix} \
63 --sysconfdir=/etc/ssh \
66 --with-default-path='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin' \
67 --with-privsep-path=/var/lib/sshd \
68 --with-privsep-user=sshd \
69 --with-pid-dir=/var/run/sshd \
71 --with-md5-passwords \
73 --without-zlib-version-check \
75 --build="$(cc -dumpmachine)"
78 make -j${jobs} DESTDIR="$destdir" install
80 # Make empty directories for the package
81 mkdir -p "${destdir}/var/run/sshd" "${destdir}/var/lib/sshd"
83 # Copy additional utilities
85 cp -p contrib/ssh-copy-id "${destdir}/usr/bin"
86 chmod 755 "${destdir}/usr/bin/ssh-copy-id"
88 mkdir -p "${destdir}/${mandir}/man1"
89 cp -p contrib/ssh-copy-id.1 "${destdir}/${mandir}/man1"
91 # Install sshd perp service(s)
93 mkdir -p "${destdir}/etc/perp/sshd"
95 cp -p "${worktree}/archive/openssh/rc.log" \
96 "${worktree}/archive/openssh/rc.main" \
97 "${destdir}/etc/perp/sshd/"
99 chmod 755 "${destdir}"/etc/perp/sshd/rc.*
101 # THIS SERVICE IS DISABLED BY DEFAULT
102 chmod -t "${destdir}/etc/perp/sshd"
104 # Manage (dot) new files via graft(1)
105 touch "${destdir}/etc/ssh/.graft-config" \
106 "${destdir}/etc/perp/sshd/.graft-config"
108 # Compress and link man pages (if needed)
109 if test -d "${destdir}/$mandir"
112 cd "${destdir}/$mandir"
113 find . -type f -exec lzip -9 '{}' +
114 find . -type l | while read -r file
116 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
123 mkdir -p "${destdir}${docsdir}"
124 cp -p $docs "${destdir}${docsdir}"