Magellan Linux

Contents of /trunk/core/openssh/openssh-7.6p1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29835 - (show annotations) (download)
Fri Oct 13 12:24:10 2017 UTC (6 years, 6 months ago) by niro
File size: 2741 byte(s)
auto added: ver bump to 7.6p1-r1
1 # $Id$
2
3 PNAME="openssh"
4 PVER="7.6p1"
5 PBUILD="r1"
6
7 PCAT="net-misc"
8
9 DESCRIPTION="Port of OpenBSD's free SSH release."
10 HOMEPAGE="http://www.openssh.com/"
11
12 DEPEND=">= dev-libs/openssl-1.1.0f
13 >= sys-libs/zlib-1.2.8
14 >= sys-libs/pam-1.1
15 >= virtual/sed"
16
17 PROVIDE="virtual/ssh-server
18 virtual/ssh-client"
19
20 SRCFILE="${PNAME}-${PVER}.tar.gz"
21 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
22
23 sminclude mbuild mtools systemd
24 msetfeature "!check"
25
26 SVC_REV=1.6
27
28 SRC_URI=(
29 ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRCFILE}
30 ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/OpenSSH/portable/${SRCFILE}
31 mirror://${PNAME}/${SRCFILE}
32 mirror://${PNAME}/sshd.service-${SVC_REV}
33 # mirror://${PNAME}/sshd.socket
34 mirror://${PNAME}/ssh-keygen.service
35 mirror://${PNAME}/sshd.conf.tempfile
36 mirror://${PNAME}/sshd.pam
37 mirror://${PNAME}/${PNAME}-${PVER}-openssl-1.1.0.patch
38 )
39
40 UP2DATE="updatecmd http://ftp2.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/ | highesttarball gz"
41
42 pkg_setup()
43 {
44 preinstall
45 }
46
47 src_prepare()
48 {
49 munpack ${SRCFILE} || die
50 cd ${SRCDIR}
51
52 mpatch ${PNAME}-${PVER}-openssl-1.1.0.patch || die
53 }
54
55 src_compile()
56 {
57 cd ${SRCDIR}
58
59 mconfigure \
60 --sysconfdir=/etc/ssh \
61 --libexecdir=/usr/$(mlibdir)/misc \
62 --datadir=/usr/share/openssh \
63 --disable-suid-ssh \
64 --with-privsep-path=/var/empty \
65 --with-privsep-user=sshd \
66 --with-md5-passwords \
67 --with-ipv4-default \
68 --without-zlib-version-check \
69 --with-pam \
70 || die
71
72 mmake || die
73 }
74
75 src_install()
76 {
77 cd ${SRCDIR}
78 mmake DESTDIR=${BINDIR} install-nokeys || die
79
80 # install systemd units
81 minstallunit sshd.service-${SVC_REV} sshd.service || die
82 # minstallunit sshd.socket || die
83 minstallunit ssh-keygen.service || die
84 minstalltmp sshd.conf.tempfile sshd.conf || die
85 minstallpam sshd.pam sshd || die
86
87 # fix sshd_config to enable pam support
88 sed -i -e '/^#PrintMotd yes$/c PrintMotd no # pam does that' \
89 -e '/^#UsePAM no$/c UsePAM yes' \
90 ${BINDIR}/etc/ssh/sshd_config || die
91
92 # needed to run sshd
93 mkeepdir /var/empty || die
94 mchown root:sys /var/empty || die
95
96 minstalldocs CREDITS ChangeLog LICENCE OVERVIEW \
97 README* RFC.nroff TODO WARNING.RNG || die
98 }
99
100 preinstall()
101 {
102 # adding ssh user
103 mgroupadd -o "-g 22" sshd
104 museradd -o "-u 22 -g sshd -d /var/empty -s /bin/false" sshd
105 }
106
107 postinstall()
108 {
109 # cleanup old symlinks
110 local i
111 for i in dsa ecdsa rsa1 rsa ed25519
112 do
113 if [ -L ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service ]
114 then
115 rm ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service
116 fi
117 done
118
119 mstartunit sshd.service
120 # per socket connection not supported atm
121 #mstartunit sshd.socket
122 }
123
124 postremove()
125 {
126 mstopunit sshd.service
127 # per socket connection not supported atm
128 #mstopunit sshd.socket
129 }