recipes: xorg/driver/xf86-video-r128: upgraded to version 6.12.0
[dragora.git] / recipes / networking / openssh / recipe
blob3e95f1f996ef18d45af0ba59c51238acdf0abfbd
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.
17 program=openssh
18 version=7.8p1
19 release=2
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      --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 \
70      --with-tcp-wrappers \
71      --with-md5-passwords \
72      --with-pie \
73      --without-zlib-version-check \
74      --disable-strip \
75      --build="$(cc -dumpmachine)"
77     make -j${jobs} V=1
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"
110     then
111         (
112             cd "${destdir}/$mandir"
113             find . -type f -exec lzip -9 '{}' +
114             find . -type l | while read -r file
115             do
116                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
117                 rm -- "$file"
118             done
119         )
120     fi
122     # Copy documentation
123     mkdir -p "${destdir}${docsdir}"
124     cp -p $docs "${destdir}${docsdir}"