1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=(python2_7)
6 PYTHON_REQ_USE="ipv6(+)?"
8 inherit user autotools bash-completion-r1 python-single-r1
11 MY_PV="${MY_PV/_beta/~beta}"
13 SERIES="$(ver_cut 1-2)"
17 http://downloads.ganeti.org/releases/${SERIES}/${MY_P}.tar.gz
18 mirror://debian/pool/main/g/ganeti-${SERIES}/ganeti-${SERIES}_${PV}-${DEBIAN_PATCH}.debian.tar.xz
20 KEYWORDS="~amd64 ~x86"
22 "${FILESDIR}"/ganeti-2.15-use-balloon-device.patch
23 "${WORKDIR}"/debian/patches/do-not-backup-export-dir.patch
24 "${WORKDIR}"/debian/patches/Makefile.am-use-C.UTF-8
25 "${WORKDIR}"/debian/patches/relax-deps
26 "${WORKDIR}"/debian/patches/zlib-0.6-compatibility
27 "${WORKDIR}"/debian/patches/fix_FTBFS_with_sphinx-1.3.5
28 "${WORKDIR}"/debian/patches/fix_ftbfs_with_sphinx_1.4
29 "${WORKDIR}"/debian/patches/use-proper-cabal-dev.patch
30 "${WORKDIR}"/debian/patches/0001-Drop-dependency-on-MonadCatchIO-transformers.patch
31 "${WORKDIR}"/debian/patches/0001-GHC-8-support.patch
32 "${WORKDIR}"/debian/patches/ghc8-fixes
33 "${WORKDIR}"/debian/patches/snap-server-1.0-compat
34 "${WORKDIR}"/debian/patches/non-DSA-SSH-key-support.patch
35 "${WORKDIR}"/debian/patches/fix-ssh-key-renewal-on-single-node-clusters.patch
36 "${WORKDIR}"/debian/patches/set-defaults-for-ssh-type-bits.patch
37 "${WORKDIR}"/debian/patches/use-hv-class-to-check-for-migration.patch
38 "${WORKDIR}"/debian/patches/do-not-specify-socat-ssl-method.patch
39 "${WORKDIR}"/debian/patches/fix-ftbfs-with-sphinx-1.5.patch
40 "${WORKDIR}"/debian/patches/fix-failover-from-dead-node.patch
41 "${WORKDIR}"/debian/patches/fix-cpu-affinity.patch
42 "${WORKDIR}"/debian/patches/fix-fcntl-i386.patch
43 "${WORKDIR}"/debian/patches/fix-ovf-test-path.patch
44 "${WORKDIR}"/debian/patches/fix-qa-ssconf-race.patch
45 "${WORKDIR}"/debian/patches/relax-sphinx-version-check.patch
46 #"${WORKDIR}"/debian/patches/THH-2.12.patch
47 "${WORKDIR}"/debian/patches/sphinx-1.7.patch
48 "${WORKDIR}"/debian/patches/ca-use-sha256-md.patch
49 "${WORKDIR}"/debian/patches/impexpd-fix-certificate-verification-with-new-socat.patch
50 "${WORKDIR}"/debian/patches/impexpd-fix-certificate-verification-with-new-socat-2.patch
53 DESCRIPTION="Ganeti is a virtual server management software tool"
54 HOMEPAGE="http://www.ganeti.org/"
58 IUSE="drbd experimental haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen restricted-commands"
59 RESTRICT="!test? ( test )"
61 REQUIRED_USE="|| ( kvm xen lxc )
63 kvm? ( || ( amd64 x86 ) )
64 ${PYTHON_REQUIRED_USE}"
66 USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
67 GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
71 $(python_gen_cond_dep '
72 dev-python/paramiko[${PYTHON_MULTI_USEDEP}]
73 dev-python/pyopenssl[${PYTHON_MULTI_USEDEP}]
74 dev-python/simplejson[${PYTHON_MULTI_USEDEP}]
75 dev-python/pyparsing[${PYTHON_MULTI_USEDEP}]
76 dev-python/pyinotify[${PYTHON_MULTI_USEDEP}]
77 dev-python/pycurl[${PYTHON_MULTI_USEDEP}]
78 dev-python/ipaddr[${PYTHON_MULTI_USEDEP}]
79 dev-python/bitarray[${PYTHON_MULTI_USEDEP}]
80 dev-python/docutils[${PYTHON_MULTI_USEDEP}]
81 dev-python/fdsend[${PYTHON_MULTI_USEDEP}]
84 net-misc/iputils[arping]
93 >=sys-fs/lvm2-2.02.181
94 >=sys-apps/baselayout-2.0
98 dev-haskell/cabal-install:0=
99 !<app-emulation/ganeti-instance-image-0.6-r1
100 >=dev-haskell/mtl-2.1.1:0=
101 >=dev-haskell/old-time-1.1.0.0:0=
102 >=dev-haskell/random-1.0.1.1:0=
103 haskell-daemons? ( >=dev-haskell/text-0.11.1.13:0= )
104 >=dev-haskell/transformers-0.3.0.0:0=
106 >=dev-haskell/attoparsec-0.10.1.1:0=
107 <dev-haskell/attoparsec-0.14:0
108 >=dev-haskell/base64-bytestring-1.0.0.1:0=
109 <dev-haskell/base64-bytestring-1.1:0=
110 >=dev-haskell/crypto-4.2.4:0=
111 <dev-haskell/crypto-4.3:0=
112 >=dev-haskell/curl-1.3.7:0=
113 <dev-haskell/curl-1.4:0=
114 >=dev-haskell/hinotify-0.3.2:0=
115 <dev-haskell/hinotify-0.4:0=
116 >=dev-haskell/hslogger-1.1.4:0=
117 <dev-haskell/hslogger-1.3:0=
118 >=dev-haskell/json-0.5:0=
119 >=dev-haskell/lens-3.10:0=
120 >=dev-haskell/lifted-base-0.2.0.3:0=
121 <dev-haskell/lifted-base-0.3:0=
122 >=dev-haskell/monad-control-1.0.1.0:0=
123 <dev-haskell/monad-control-1.0.2:0=
124 >=dev-haskell/network-2.3.0.13:0=
125 <dev-haskell/network-2.7:0=
126 >=dev-haskell/parallel-3.2.0.2:3=
127 <dev-haskell/parallel-3.3:3=
128 >=dev-haskell/temporary-1.1.2.3:0=
129 <dev-haskell/temporary-1.3:0=
130 >=dev-haskell/regex-pcre-0.94.2:0=
131 <dev-haskell/regex-pcre-0.95:0=
132 >=dev-haskell/transformers-base-0.4:0=
133 <dev-haskell/transformers-base-0.5:0=
134 >=dev-haskell/utf8-string-0.3.7:0=
135 >=dev-haskell/zlib-0.5.3.3:0=
136 <dev-haskell/zlib-0.7:0=
138 >=dev-haskell/psqueue-1.1:0=
139 <dev-haskell/psqueue-1.2:0=
140 >=dev-haskell/snap-core-1.0.1:0=
141 <dev-haskell/snap-core-1.1:0=
142 >=dev-haskell/snap-server-1.0.1:0=
143 <dev-haskell/snap-server-1.1:0=
144 >=dev-haskell/case-insensitive-0.4.0.1
146 dev-haskell/vector:0=
147 xen? ( >=app-emulation/xen-3.0 )
152 lxc? ( app-emulation/lxc )
153 drbd? ( sys-cluster/drbd-utils )
154 rbd? ( sys-cluster/ceph )
155 ipv6? ( net-misc/ndisc6 )
158 !app-emulation/ganeti-htools"
162 $(python_gen_cond_dep '
163 dev-python/sphinx[${PYTHON_MULTI_USEDEP}]
165 media-fonts/urw-fonts
167 >=dev-haskell/test-framework-0.6:0=
168 <dev-haskell/test-framework-0.9:0=
169 >=dev-haskell/test-framework-hunit-0.2.7:0=
170 <dev-haskell/test-framework-hunit-0.4:0=
171 >=dev-haskell/test-framework-quickcheck2-0.2.12.1:0=
172 <dev-haskell/test-framework-quickcheck2-0.4:0=
176 dev-haskell/haddock:0=
177 >=dev-haskell/hunit-1.2.4.2:0=
178 <dev-haskell/hunit-1.3:0=
179 >=dev-haskell/quickcheck-2.4.2:2=
180 <dev-haskell/quickcheck-2.8.3:2=
183 dev-util/shelltestrunner
187 "${FILESDIR}/${PN}-2.12-start-stop-daemon-args.patch"
188 "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
189 "${FILESDIR}/${PN}-2.15-daemon-util.patch"
190 "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
191 "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
192 "${FILESDIR}/${PN}-2.10-rundir.patch"
193 "${FILESDIR}/${PN}-2.12-qemu-enable-kvm.patch"
194 "${FILESDIR}/${PN}-2.11-tests.patch"
195 "${FILESDIR}/${PN}-lockdir.patch"
196 "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
197 "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
198 "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
199 "${FILESDIR}/${PN}-2.13-process_unittest.patch"
200 "${FILESDIR}/${PN}-2.15-python-mock.patch"
201 "${FILESDIR}/${PN}-2.15.2-remove-sandbox-failing-tests.patch"
202 "${FILESDIR}/${PN}-2.15-noded-must-run-as-root.patch"
203 "${FILESDIR}/${PN}-2.15-kvmd-run-as-daemon-user.patch"
204 "${FILESDIR}/${PN}-2.15-dont-invert-return-values-for-man-warnings.patch"
205 "${FILESDIR}/${PN}-2.15-respect-HFLAGS.patch"
206 "${FILESDIR}/ganeti-2.15.2-bdev_py.patch"
207 "${FILESDIR}/ganeti-2.15.2-check-man-warnings.patch"
208 "${FILESDIR}/ganeti-2.15.2-ftbfs-sphinx-warning.patch"
209 "${FILESDIR}/ganeti-2.15.2-pyopenssl.patch"
212 S="${WORKDIR}/${MY_P}"
215 usr/lib*/${PN}/${SERIES}/usr/sbin/ganeti-*d
216 usr/lib*/${PN}/${SERIES}/usr/bin/htools
220 /usr/lib64/ganeti/2.15/usr/sbin/ganeti-metad
221 /usr/lib64/ganeti/2.15/usr/sbin/ganeti-wconfd
222 /usr/lib64/ganeti/2.15/usr/sbin/ganeti-confd
223 /usr/lib64/ganeti/2.15/usr/sbin/ganeti-luxid
224 /usr/lib64/ganeti/2.15/usr/sbin/ganeti-kvmd
225 /usr/lib64/ganeti/2.15/usr/bin/htools
230 python-single-r1_pkg_setup
232 if use multiple-users; then
233 for user in gnt-{masterd,confd,luxid,rapi,daemons,admin}; do
235 enewuser ${user} -1 -1 -1 ${user}
242 if has_version '>=dev-lang/ghc-7.10'; then
243 # Breaks the build on 7.8
245 "${WORKDIR}"/debian/patches/ghc-7.10-compatibility.patch
248 if use experimental; then
249 ewarn "Experimental patches have been applied! RPC between daemons with different patches applied may cause breakage!"
251 # QEMU Agent accepted upstream for 2.16, not yet in a tagged release
252 # backport available for 2.15, but refused upstream due to RPC breakage.
253 "${FILESDIR}"/0001-kvm-use_guest_agent-QEMU-Guest-Agent-sup.stable-2.15.patch
256 eapply "${PATCHES[@]}"
258 # 4c3c2ca2a97a69c0287a3d23e064bc17978105eb
259 # 24618882737fd7c189adf99f4acc767d48f572c3
261 -e '/QuickCheck/s,< 2.8,< 2.8.3,g' \
262 cabal/ganeti.template.cabal
265 -e '/^if DEVELOPER_MODE/,/^endif/s/-Werror//' \
268 # not sure why these tests are failing
269 # should remove this on next version bump if possible
270 for testfile in test/py/import-export_unittest.bash; do
271 printf '#!/bin/bash\ntrue\n' > "${testfile}"
274 # take the sledgehammer approach to bug #526270
275 grep -lr '/bin/sh' "${S}" | xargs -r -- sed -i 's:/bin/sh:/bin/bash:g'
277 sed "s:%LIBDIR%:$(get_libdir):g" "${FILESDIR}/ganeti.initd-r4" \
278 > "${T}/ganeti.initd"
282 [[ ${PV} =~ [9]{4,} ]] && ./autogen.sh
288 # this is kind of a hack to work around the removal of the qemu-kvm wrapper
296 die "Could not determine qemu system to use for kvm"
299 econf --localstatedir=/var \
300 --sharedstatedir=/var \
302 --with-ssh-initscript=/etc/init.d/sshd \
303 --with-export-dir=/var/lib/ganeti-storage/export \
304 --with-os-search-path=/usr/share/${PN}/os \
305 $(use_enable restricted-commands) \
306 $(use_enable test haskell-tests) \
307 $(usex multiple-users "--with-default-user=" "" "gnt-daemons" "") \
308 $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
309 $(usex multiple-users "--with-default-group=" "" "gnt-daemons" "") \
310 $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
311 $(use_enable syslog) \
312 $(use_enable monitoring) \
313 $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
314 $(usex haskell-daemons "--enable-confd=haskell" '' '' '') \
315 --with-haskell-flags="-optl -Wl,-z,relro -optl -Wl,--as-needed" \
316 --enable-socat-escape \
317 --enable-socat-compress
321 emake V=1 DESTDIR="${D}" install
323 newinitd "${T}"/ganeti.initd ${PN}
324 newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
327 newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
328 newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
331 # ganeti installs it's own docs in a generic location
332 rm -rf "${D}"/{usr/share/doc/${PN},run}
334 sed -i "s:/usr/$(get_libdir)/${PN}/tools/burnin:burnin:" doc/examples/bash_completion
335 newbashcomp doc/examples/bash_completion gnt-instance
336 bashcomp_alias gnt-instance burnin ganeti-{cleaner,confd} \
337 h{space,check,scan,info,ail,arep,roller,squeeze,bal} \
338 gnt-{os,job,filter,debug,storage,group,node,network,backup,cluster}
340 use monitoring && bashcomp_alias gnt-instance mon-collector
342 dodoc INSTALL UPGRADE NEWS README doc/*.rst
345 dodoc -r doc/html/* doc/css/*.css
348 dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
350 docinto examples/hooks
351 dodoc doc/examples/hooks/{ipsec,ethers}
354 newins doc/examples/ganeti.cron ${PN}
356 insinto /etc/logrotate.d
357 newins doc/examples/ganeti.logrotate ${PN}
359 # need to dodir rather than keepdir here (bug #552482)
362 keepdir /var/log/${PN}/
363 keepdir /usr/share/${PN}/${SERIES}/os/
364 keepdir /var/lib/ganeti-storage/{export,file,shared}/
366 dosym ${SERIES} "/usr/share/${PN}/default"
367 dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
369 python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
373 if use multiple-users; then
374 elog "You have enable multiple user support, the users for this must"
375 elog "be created. You can use the provided tool for this, which is"
377 elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
382 PATH="${S}/scripts:${S}/src:${PATH}" \
384 GANETI_MASTER="$(hostname -f)" \