Magellan Linux

Contents of /branches/R11-stable/core/openssh/openssh-6.6p1-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21646 - (show annotations) (download)
Mon Jul 21 09:26:23 2014 UTC (9 years, 9 months ago) by niro
File size: 3179 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="openssh"
4 PVER="6.6p1"
5 PBUILD="r3"
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.1g
13 >= sys-libs/zlib-1.2.5
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 src_compile()
49 {
50 cd ${SRCDIR}
51
52 mconfigure \
53 --sysconfdir=/etc/ssh \
54 --libexecdir=/usr/$(mlibdir)/misc \
55 --datadir=/usr/share/openssh \
56 --disable-suid-ssh \
57 --with-privsep-path=/var/empty \
58 --with-privsep-user=sshd \
59 --with-md5-passwords \
60 --with-ipv4-default \
61 --without-zlib-version-check \
62 --with-pam \
63 || die
64
65 mmake || die
66 }
67
68 src_install()
69 {
70 cd ${SRCDIR}
71 mmake DESTDIR=${BINDIR} install-nokeys || die
72
73 # install systemd units
74 minstallunit sshd.service-${SVC_REV} sshd.service || die
75 # minstallunit sshd.socket || die
76 minstallunit ssh-keygen-dsa.service-${KEYGEN_DSA_REV} ssh-keygen-dsa.service || die
77 minstallunit ssh-keygen-ecdsa.service-${KEYGEN_ECDSA_REV} ssh-keygen-ecdsa.service || die
78 minstallunit ssh-keygen-rsa1.service-${KEYGEN_RSA1_REV} ssh-keygen-rsa1.service || die
79 minstallunit ssh-keygen-rsa.service-${KEYGEN_RSA_REV} ssh-keygen-rsa.service || die
80 minstallunit ssh-keygen-ed25519.service || die
81 minstalltmp sshd.conf.tempfile sshd.conf || die
82 minstallpam sshd.pam sshd || die
83
84 # fix sshd_config to enable pam support
85 sed -i -e '/^#PrintMotd yes$/c PrintMotd no # pam does that' \
86 -e '/^#UsePAM no$/c UsePAM yes' \
87 ${BINDIR}/etc/ssh/sshd_config || die
88
89 # needed to run sshd
90 mkeepdir /var/empty || die
91 mchown root:sys /var/empty || die
92
93 minstalldocs CREDITS ChangeLog LICENCE OVERVIEW \
94 README* RFC.nroff TODO WARNING.RNG || die
95 }
96
97 preinstall()
98 {
99 # adding ssh user
100 ${MLIBDIR}/mgroupadd -o "-g 22" sshd
101 ${MLIBDIR}/museradd -o "-u 22 -g sshd -d /var/empty -s /bin/false" sshd
102 }
103
104 postinstall()
105 {
106 # cleanup old symlinks
107 local i
108 for i in dsa ecdsa rsa1 rsa ed25519
109 do
110 if [ -L ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service ]
111 then
112 rm ${MROOT}/etc/systemd/system/multi-user.target.wants/ssh-keygen-${i}.service
113 fi
114 done
115
116 mstartunit sshd.service
117 # per socket connection not supported atm
118 #mstartunit sshd.socket
119 }
120
121 postremove()
122 {
123 mstopunit sshd.service
124 # per socket connection not supported atm
125 #mstopunit sshd.socket
126 }