[Pkg-ganeti-devel] [SCM] Ganeti packaging branch, for-review, updated. debian/2.7.0-1-23-gf0feb68
Apollon Oikonomopoulos
apoikos at gmail.com
Mon Jul 15 09:58:32 UTC 2013
The following commit has been merged in the for-review branch:
commit 6178b07d59ad87e272c86b0f672be4d1c54c137b
Author: Apollon Oikonomopoulos <apoikos at gmail.com>
Date: Mon Jul 15 11:58:43 2013 +0300
Introduce private module layout
Since the only stable API intended for public use is the RAPI, the rest of the
python code should really not live under sys.path. This commit ships the whole
application under /usr/share/ganeti2, symlinking all python executables from
there.
It would be best if this was supported by the upstream build system itself,
since we would avoid hard-coding executable names in debian/rules.
diff --git a/debian/changelog b/debian/changelog
index 1de3fae..77a2bc8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ ganeti (2.7.0-2) UNRELEASED; urgency=low
- Use the dh sequencer and cleanup debian/rules
- Switch from dh_pysupport to dh_python2
- Run the upstream test suite during build
+ * Ship the majority of the Python code in a private module under
+ /usr/share/ganeti2
* Ship the HTML documentation as ganeti2-doc
- Depend on libjs-underscore instead of embedding a copy
* Update standards version to 3.9.4 and compat to 9
diff --git a/debian/ganeti2.dirs b/debian/ganeti2.dirs
index 815d80c..c1ba56e 100644
--- a/debian/ganeti2.dirs
+++ b/debian/ganeti2.dirs
@@ -2,3 +2,4 @@ etc/ganeti
etc/bash_completion.d
usr/lib/ganeti/iallocators
usr/share/lintian/overrides
+usr/share/ganeti2
diff --git a/debian/rules b/debian/rules
index aa6fc98..35a9360 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,7 @@
GANETI_DIR=$(CURDIR)/debian/ganeti2
HTOOLS_DIR=$(CURDIR)/debian/ganeti-htools
HASKELL_DIR=$(CURDIR)/debian/ganeti-haskell
+PRIVATE_DIR=$(GANETI_DIR)/usr/share/ganeti2
%:
dh $@ --with python2
@@ -66,6 +67,24 @@ override_dh_auto_install:
mv $(GANETI_DIR)/usr/share/man/man8/ganeti-confd.8 $(HASKELL_DIR)/usr/share/man/man8/
mv $(GANETI_DIR)/usr/share/man/man7/mon-collector.7 $(HASKELL_DIR)/usr/share/man/man7/
+ # move the python libraries to the private module path
+ mv $(GANETI_DIR)/usr/lib/$$(pyversions -d)/dist-packages/ganeti $(GANETI_DIR)/usr/share/ganeti2/
+ for file in $(GANETI_DIR)/usr/sbin/*; do \
+ mv $$file $(PRIVATE_DIR); \
+ ln -s ../share/ganeti2/$$(basename $$file) $$file; \
+ done
+
+ # ditto for all python tools needing internal APIs
+ for file in burnin cfgshell cfgupgrade cfgupgrade12 cluster-merge confd-client lvmstrap move-instance ovfconverter sanitize-config; do \
+ mv $(GANETI_DIR)/usr/lib/ganeti/tools/$$file $(PRIVATE_DIR); \
+ ln -s ../../../share/ganeti2/$$file $(GANETI_DIR)/usr/lib/ganeti/tools/$$file; \
+ done
+
+ for file in check-cert-expired ensure-dirs import-export node-daemon-setup prepare-node-join; do \
+ mv $(GANETI_DIR)/usr/lib/ganeti/$$file $(PRIVATE_DIR); \
+ ln -s ../../share/ganeti2/$$file $(GANETI_DIR)/usr/lib/ganeti/$$file; \
+ done
+
override_dh_installinit:
dh_installinit --name=ganeti --error-handler=true -i -- defaults 20 80
--
Ganeti packaging
More information about the Pkg-ganeti-devel
mailing list