aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ganeti-disable-version-symlinks.patch
blob: a5f347cfc665cdf766396b3dfaba650d24f49421 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
This patch adds a new "--disable-version-links" configuration option
that allows installing to the standard GNU installation directories
instead of having to add symlinks in /etc/ganeti/{lib,share} that
points to the right $ganeti/{lib,share}/$version.  Mainly to reduce
service complexity, and because Guix users can install as many versions
of Ganeti they can muster without resorting to such hacks.

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,11 +66,16 @@ SHELL_ENV_INIT = autotools/shell-env-init
 # so, if some currently architecture-independent executable is replaced by an
 # architecture-dependent one (and hence has to go under $(versiondir)), add a link
 # under $(versionedsharedir) but do not change the external links.
+#
+# As of Ganeti 3.0, it is possible to disable this behavior by passing
+# --disable-version-links, in which case the standard GNU installation
+# directories are used.
 if USE_VERSION_FULL
 DIRVERSION=$(VERSION_FULL)
 else
 DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
 endif
+if USE_VERSION_LINKS
 versiondir = $(libdir)/ganeti/$(DIRVERSION)
 defaultversiondir = $(libdir)/ganeti/default
 versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION)
@@ -90,6 +95,18 @@ gntpythondir = $(versionedsharedir)
 pkgpython_bindir = $(versionedsharedir)
 gnt_python_sbindir = $(versionedsharedir)
 tools_pythondir = $(versionedsharedir)
+else
+myexeclibdir = $(pkglibdir)
+pkgpython_rpc_stubdir = $(pkgpythondir)/rpc/stub
+gntpythondir = $(sbindir)
+pkgpython_bindir = $(pkglibdir)
+gnt_python_sbindir = $(sbindir)
+tools_pythondir = $(pkglibdir)
+versionedsharedir = $(pkglibdir)
+# This is a hack but works because the only user does $(versiondir)$(datadir).
+versiondir =
+endif !USE_VERSION_LINKS
+
 
 clientdir = $(pkgpythondir)/client
 cmdlibdir = $(pkgpythondir)/cmdlib
@@ -2356,6 +2373,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
 	    -DVERSION_SUFFIX="$(VERSION_SUFFIX)" \
 	    -DVERSION_FULL="$(VERSION_FULL)" \
 	    -DDIRVERSION="$(DIRVERSION)" \
+	    -DUSE_VERSION_LINKS="$(USE_VERSION_LINKS)" \
 	    -DLOCALSTATEDIR="$(localstatedir)" \
 	    -DSYSCONFDIR="$(sysconfdir)" \
 	    -DSSH_CONFIG_DIR="$(SSH_CONFIG_DIR)" \
@@ -2857,6 +2875,7 @@ install-exec-local:
 	@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
 	  "$(DESTDIR)${localstatedir}/log/ganeti" \
 	  "$(DESTDIR)${localstatedir}/run/ganeti"
+if USE_VERSION_LINKS
 	for dir in $(SYMLINK_TARGET_DIRS); do \
 	  @mkdir_p@  $(DESTDIR)$$dir; \
 	done
@@ -2892,7 +2911,8 @@ install-exec-local:
 if INSTALL_SYMLINKS
 	$(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share
 	$(LN_S) -f $(versiondir) $(DESTDIR)$(sysconfdir)/ganeti/lib
-endif
+endif INSTALL_SYMLINKS
+endif USE_VERSION_LINKS
 
 .PHONY: apidoc
 if WANT_HSAPIDOC
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,23 @@ AC_SUBST([BINDIR], $bindir)
 AC_SUBST([SBINDIR], $sbindir)
 AC_SUBST([MANDIR], $mandir)
 
+# --enable-version-links
+AC_ARG_ENABLE([version-links],
+  [AS_HELP_STRING([--enable-version-links],
+                  m4_normalize([install ganeti to version-specific
+                  subdirectories to allow installing multiple versions
+                  in parallel (default: enabled)]))],
+  [[if test "$enableval" != no; then
+      USE_VERSION_LINKS=True
+    else
+      USE_VERSION_LINKS=False
+    fi
+  ]],
+  [USE_VERSION_LINKS=True
+  ])
+AC_SUBST(USE_VERSION_LINKS, $USE_VERSION_LINKS)
+AM_CONDITIONAL([USE_VERSION_LINKS], [test "$USE_VERSION_LINKS" = True])
+
 # --enable-versionfull
 AC_ARG_ENABLE([versionfull],
   [AS_HELP_STRING([--enable-versionfull],
diff --git a/lib/bootstrap.py b/lib/bootstrap.py
--- a/lib/bootstrap.py
+++ b/lib/bootstrap.py
@@ -944,7 +944,7 @@ def SetupNodeDaemon(opts, cluster_name, node, ssh_port):
                          debug=opts.debug, verbose=opts.verbose,
                          use_cluster_key=True, ask_key=opts.ssh_key_check,
                          strict_host_check=opts.ssh_key_check,
-                         ensure_version=True)
+                         ensure_version=constants.USE_VERSION_LINKS)
 
   _WaitForSshDaemon(node, ssh_port)
   _WaitForNodeDaemon(node)
diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in
--- a/src/AutoConf.hs.in
+++ b/src/AutoConf.hs.in
@@ -64,6 +64,9 @@ versionFull = "VERSION_FULL"
 dirVersion :: String
 dirVersion = "DIRVERSION"
 
+useVersionLinks :: Bool
+useVersionLinks = USE_VERSION_LINKS
+
 localstatedir :: String
 localstatedir = "LOCALSTATEDIR"
 
diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
--- a/src/Ganeti/Constants.hs
+++ b/src/Ganeti/Constants.hs
@@ -164,5 +164,8 @@ versionRevision = AutoConf.versionRevision
 dirVersion :: String
 dirVersion = AutoConf.dirVersion
 
+useVersionLinks :: Bool
+useVersionLinks = AutoConf.useVersionLinks
+
 osApiV10 :: Int
 osApiV10 = 10
t) (schismtracker, midicsv, midicsv, qmidiarp, qmidiroute, dssi, tap-lv2) (shiru-lv2)[home-page]: Likewise. * gnu/packages/ncurses.scm (stfl)[home-page]: Likewise. * gnu/packages/networking.scm (lksctp-tools, mbuffer, ifstatus, bird) (tunctl, traceroute)[home-page]: Likewise. * gnu/packages/node-xyz.scm (node-mersenne)[home-page]: Likewise. * gnu/packages/ntp.scm (openntpd)[home-page]: Likewise. * gnu/packages/ocaml.scm (opam, hevea, ocaml-menhir, ocaml-piqilib) (ocaml-graph, cubicle)[home-page]: Likewise. * gnu/packages/opencl.scm (python-pyopencl)[home-page]: Likewise. * gnu/packages/package-management.scm (xstow, modules)[home-page]: Likewise. * gnu/packages/parallel.scm (xjobs)[home-page]: Likewise. * gnu/packages/pdf.scm (podofo, qpdf, xournal, impressive)[home-page]: Likewise. * gnu/packages/perl.scm (perl-math-vecstat, perltidy)[home-page]: Likewise. * gnu/packages/photo.scm (libpano13, enblend-enfuse, hugin)[home-page]: Likewise. * gnu/packages/plan9.scm (drawterm)[home-page]: Likewise. * gnu/packages/plotutils.scm (guile-charting, ploticus)[home-page]: Likewise. * gnu/packages/popt.scm (argtable, popt)[home-page]: Likewise. * gnu/packages/profiling.scm (otf2)[home-page]: Likewise. * gnu/packages/pulseaudio.scm (pulseaudio)[home-page]: Likewise. * gnu/packages/python-check.scm (python-mypy)[home-page]: Likewise. * gnu/packages/python-web.scm (python-cssutils) (python-translationstring)[home-page]: Likewise. * gnu/packages/python-xyz.scm (python-diskcache, python-doxyqml) (python-docutils, python-pexpect, python-importlib-resources) (python-simplegeneric, python-urwid, python-xlrd, python-xlwt) (python-pyasn1, python-pythondialog, python-tftpy, python-random2) (python-arcp, python-pyopengl, python-sortedcollections) (python-sortedcontainers, python-yapsy, python-pydispatcher) (python-posix-ipc)[home-page]: Likewise. * gnu/packages/qt.scm (qwt, libqglviewer, signond)[home-page]: Likewise. * gnu/packages/radio.scm (unixcw, gnuais)[home-page]: Likewise. * gnu/packages/raspberry-pi.scm (bcm2835)[home-page]: Likewise. * gnu/packages/rdf.scm (clucene, rasqal, redland)[home-page]: Likewise. * gnu/packages/regex.scm (tre)[home-page]: Likewise. * gnu/packages/rsync.scm (librsync)[home-page]: Likewise. * gnu/packages/ruby.scm (ruby-packnga, ruby-nokogiri, ruby-oj, ruby-ox) (ruby-sinatra, ruby-citrus, ruby-cbor, ruby-roda)[home-page]: Likewise. * gnu/packages/scheme.scm (scheme48, tinyscheme)[home-page]: Likewise. * gnu/packages/screen.scm (dtach)[home-page]: Likewise. * gnu/packages/scsi.scm (sg3-utils)[home-page]: Likewise. * gnu/packages/sdl.scm (libmikmod, sdl-pango)[home-page]: Likewise. * gnu/packages/shellutils.scm (hstr, rig)[home-page]: Likewise. * gnu/packages/simulation.scm (python-dolfin-adjoint)[home-page]: Likewise. * gnu/packages/smalltalk.scm (smalltalk)[home-page]: Likewise. * gnu/packages/speech.scm (espeak)[home-page]: Likewise. * gnu/packages/stalonetray.scm (stalonetray)[home-page]: Likewise. * gnu/packages/statistics.scm (jags, r-mass, r-class, r-lattice) (r-matrix, r-nnet, r-spatial, r-bit, r-bit64, r-digest, r-xtable) (python-statsmodels, r-ade4, r-latticeextra, r-rcurl, r-xml, r-mvtnorm) (r-robustbase, r-minqa, r-fdrtool, java-jdistlib, xlispstat)[home-page]: Likewise. * gnu/packages/swig.scm (swig)[home-page]: Likewise. * gnu/packages/task-management.scm (wtime)[home-page]: Likewise. * gnu/packages/tcl.scm (itcl, tclxml, tclx)[home-page]: Likewise. * gnu/packages/terminals.scm (libtermkey, mlterm, libvterm) (libvterm)[home-page]: Likewise. * gnu/packages/tex.scm (texlive-lm, texlive-lm-math, texlive-cs) (texlive-csplain, biber, texmaker)[home-page]: Likewise. * gnu/packages/text-editors.scm (joe)[home-page]: Likewise. * gnu/packages/textutils.scm (drm-tools, docx2txt)[home-page]: Likewise. * gnu/packages/tv.scm (tvtime)[home-page]: Likewise. * gnu/packages/unicode.scm (libunibreak)[home-page]: Likewise. * gnu/packages/upnp.scm (libupnp)[home-page]: Likewise. * gnu/packages/version-control.scm (cvs)[home-page]: Likewise. * gnu/packages/video.scm (transcode, libquicktime, mjpegtools, aalib) (liba52, libmpeg2, x265, libdv, dvdauthor, aegisub, pitivi, gavl) (dvdbackup, guvcview, video-contact-sheet)[home-page]: Likewise. * gnu/packages/virtualization.scm (bochs)[home-page]: Likewise. * gnu/packages/w3m.scm (w3m)[home-page]: Likewise. * gnu/packages/web.scm (qjson, libquvi-scripts, libquvi, quvi) (tidy-html, htmlcxx)[home-page]: Likewise. * gnu/packages/wm.scm (evilwm, menumaker)[home-page]: Likewise. * gnu/packages/wv.scm (wv)[home-page]: Likewise. * gnu/packages/wxwidgets.scm (wxsvg)[home-page]: Likewise. * gnu/packages/xdisorg.scm (mtdev, xsel)[home-page]: Likewise. * gnu/packages/xfig.scm (xfig, transfig)[home-page]: Likewise. * gnu/packages/xml.scm (openjade, python-pyxb, xmlstarlet, xmlrpc-c) (opensp)[home-page]: Likewise. * gnu/packages/xorg.scm (xf86-video-qxl)[home-page]: Likewise. Tobias Geerinckx-Rice 2022-07-31gnu: qttools: Rename to qttools-5....Automated with: git grep -l qttools | xargs sed 's/\bqttools\b/\0-5/g' -i git checkout NEWS Maxim Cournoyer 2022-05-31gnu: pdf2djvu: Disable tests to avoid Python 2 dependencies....* gnu/packages/djvu.scm (pdf2djvu)[tests]: Set to #f. [test-target]: Delete argument. [native-inputs]: Use new style. Delete python-2 and python2-nose. [inputs]: Use new style. Maxim Cournoyer 2022-05-31gnu: didjvu: Switch to a Python 3 compatible fork....* gnu/packages/djvu.scm (didjvu)[source]: Switch to a Python 3 compatible fork. [native-inputs, inputs]: Move below arguments field. Use new style. Replace the Python 2 inputs by their Python 3 equivalents. Maxim Cournoyer