Magellan Linux

Contents of /branches/R11-unstable/core/openssh/openssh-6.8p1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25037 - (show annotations) (download)
Tue Nov 25 02:52:04 2014 UTC (9 years, 5 months ago) by niro
File size: 3186 byte(s)
-release branches/R11-unstable
1 # $Id$
2
3 PNAME="openssh"
4 PVER="6.8p1"
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.0.1k
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.5
27 KEYGEN_DSA_REV=1.2
28 KEYGEN_ECDSA_REV=1.2
29 KEYGEN_RSA1_REV=1.2
30 KEYGEN_RSA_REV=1.2
31
32 SRC_URI=(
33 ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRCFILE}
34 mirror://${PNAME}/${SRCFILE}
35 mirror://${PNAME}/sshd.service-${SVC_REV}
36 # mirror://${PNAME}/sshd.socket
37 mirror://${PNAME}/ssh-keygen-dsa.service-${KEYGEN_DSA_REV}
38 mirror://${PNAME}/ssh-keygen-ecdsa.service-${KEYGEN_ECDSA_REV}
39 mirror://${PNAME}/ssh-keygen-rsa1.service-${KEYGEN_RSA1_REV}
40 mirror://${PNAME}/ssh-keygen-rsa.service-${KEYGEN_RSA_REV}
41 mirror://${PNAME}/ssh-keygen-ed25519.service
42 mirror://${PNAME}/sshd.conf.tempfile
43 mirror://${PNAME}/sshd.pam
44 )
45
46 UP2DATE="updatecmd http://ftp2.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/ | lasttarball gz"
47
48 pkg_setup()
49 {
50 preinstall
51 }
52
53 src_compile()
54 {
55 cd ${SRCDIR}
56
57 mconfigure \
58 --sysconfdir=/etc/ssh \
59 --libexecdir=/usr/$(mlibdir)/misc \
60 --datadir=/usr/share/openssh \
61 --disable-suid-ssh \
62 --with-privsep-path=/var/empty \
63 --with-privsep-user=sshd \
64 --with-md5-passwords \
65 --with-ipv4-default \
66 --without-zlib-version-check \
67 --with-pam \
68 || die
69
70 mmake || die
71 }
72
73 src_install()
74 {
75 cd ${SRCDIR}
76 mmake DESTDIR=${BINDIR} install-nokeys || die
77
78 # install systemd units
79 minstallunit sshd.service-${SVC_REV} sshd.service || die
80 # minstallunit sshd.socket || die
81 minstallunit ssh-keygen-dsa.service-${KEYGEN_DSA_REV} ssh-keygen-dsa.service || die
82 minstallunit ssh-keygen-ecdsa.service-${KEYGEN_ECDSA_REV} ssh-keygen-ecdsa.service || die
83 minstallunit ssh-keygen-rsa1.service-${KEYGEN_RSA1_REV} ssh-keygen-rsa1.service || die
84 minstallunit ssh-keygen-rsa.service-${KEYGEN_RSA_REV} ssh-keygen-rsa.service || die
85 minstallunit ssh-keygen-ed25519.service || die
86 minstalltmp sshd.conf.tempfile sshd.conf || die
87 minstallpam sshd.pam sshd || die
88
89 # fix sshd_config to enable pam support
90 sed -i -e '/^#PrintMotd yes$/c PrintMotd no # pam does that' \
91 -e '/^#UsePAM no$/c UsePAM yes' \
92 ${BINDIR}/etc/ssh/sshd_config || die
93
94 # needed to run sshd
95 mkeepdir /var/empty || die
96 mchown root:sys /var/empty || die
97
98 minstalldocs CREDITS ChangeLog LICENCE OVERVIEW \
99 README* RFC.nroff TODO WARNING.RNG || die
100 }
101
102 preinstall()
103 {
104 # adding ssh user
105 mgroupadd -o "-g 22" sshd
106 museradd -o "-u 22 -g sshd -d /var/empty -s /bin/false" sshd
107 }
108
109 postinstall()
110 {
111 # cleanup old symlinks
112 local i
113 for i in dsa ecdsa rsa1 rsa ed25519
114 do
115 if [ -L ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service ]
116 then
117 rm ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service
118 fi
119 done
120
121 mstartunit sshd.service
122 # per socket connection not supported atm
123 #mstartunit sshd.socket
124 }
125
126 postremove()
127 {
128 mstopunit sshd.service
129 # per socket connection not supported atm
130 #mstopunit sshd.socket
131 }