recipes: networking/openssh: upgraded to version 8.1p1
[dragora.git] / recipes / networking / openssh / recipe
blob8a2e8792bcac3704da39c729869ca331ae865e90
1 # Build recipe for openssh.
3 # Copyright (c) 2018-2019 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.
17 program=openssh
18 version=8.1p1
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/networking"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$tarname
29 description="
30 The OpenSSH suite.
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
40 license=Custom
42 # Source documentation
43 docs="CREDITS ChangeLog LICENCE OVERVIEW PROTOCOL* README* TODO"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
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" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --sysconfdir=/etc/ssh \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --enable-strip \
67      --with-default-path='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin' \
68      --with-privsep-path=/var/lib/sshd \
69      --with-privsep-user=sshd \
70      --with-pid-dir=/var/run/sshd \
71      --with-md5-passwords \
72      --with-pie \
73      --without-zlib-version-check \
74      --build="$(cc -dumpmachine)"
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install
79     # Make empty directories for the package
80     mkdir -p "${destdir}/var/run/sshd" "${destdir}/var/lib/sshd"
82     # Copy additional utilities
84     cp -p contrib/ssh-copy-id "${destdir}/usr/bin"
85     chmod 755 "${destdir}/usr/bin/ssh-copy-id"
87     mkdir -p "${destdir}/${mandir}/man1"
88     cp -p contrib/ssh-copy-id.1 "${destdir}/${mandir}/man1"
90     # Install sshd perp service(s)
92     mkdir -p "${destdir}/etc/perp/sshd"
94     cp -p "${worktree}/archive/openssh/rc.log" \
95           "${worktree}/archive/openssh/rc.main" \
96           "${destdir}/etc/perp/sshd/"
98     chmod 755 "${destdir}"/etc/perp/sshd/rc.*
100     # THIS SERVICE IS DISABLED BY DEFAULT
101     chmod -t "${destdir}/etc/perp/sshd"
103     # Manage (dot) new files via graft(1)
104     touch "${destdir}/etc/ssh/.graft-config" \
105           "${destdir}/etc/perp/sshd/.graft-config"
107     # Compress and link man pages (if needed)
108     if test -d "${destdir}/$mandir"
109     then
110         (
111             cd "${destdir}/$mandir"
112             find . -type f -exec lzip -9 '{}' +
113             find . -type l | while read -r file
114             do
115                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
116                 rm -- "$file"
117             done
118         )
119     fi
121     # Copy documentation
122     mkdir -p "${destdir}${docsdir}"
123     cp -p $docs "${destdir}${docsdir}"