Skip to content

Instantly share code, notes, and snippets.

@yuchangyuan
Created May 30, 2017 11:54
Show Gist options
  • Save yuchangyuan/94f80768dfc8cdac523bc4393c9c6bb3 to your computer and use it in GitHub Desktop.
Save yuchangyuan/94f80768dfc8cdac523bc4393c9c6bb3 to your computer and use it in GitHub Desktop.
fix-pythonpath.patch for ceph v10
diff -uwr a/src/ceph-detect-init/Makefile.am b/src/ceph-detect-init/Makefile.am
--- a/src/ceph-detect-init/Makefile.am 2017-05-22 21:37:40.616023663 +0800
+++ b/src/ceph-detect-init/Makefile.am 2017-05-22 22:11:14.728173931 +0800
@@ -69,12 +69,13 @@
if test "$(DESTDIR)" ; then \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
- else \
- options=--prefix=/usr ; \
fi ; \
root="--root=$(DESTDIR)" ; \
fi ; \
- python setup.py install $$root $$options
+ if test "$(prefix)"; then \
+ prefix="--prefix=$(prefix)" ; \
+ fi ; \
+ python setup.py install $$prefix $$root $$options
LOCAL_ALL += ceph-detect-init-all
LOCAL_CLEAN += ceph-detect-init-clean
diff -uwr a/src/ceph-disk/Makefile.am b/src/ceph-disk/Makefile.am
--- a/src/ceph-disk/Makefile.am 2017-05-25 23:11:15.644410859 +0800
+++ b/src/ceph-disk/Makefile.am 2017-05-25 23:13:37.883167885 +0800
@@ -45,12 +45,13 @@
if test "$(DESTDIR)" ; then \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
- else \
- options=--prefix=/usr ; \
fi ; \
root="--root=$(DESTDIR) --install-script=/usr/sbin" ; \
fi ; \
- python setup.py install $$root $$options
+ if test "$(prefix)"; then \
+ prefix="--prefix=$(prefix) --install-script=$(prefix)/sbin" ; \
+ fi ; \
+ python setup.py install $$prefix $$root $$options
LOCAL_ALL += ceph-disk-all
LOCAL_CLEAN += ceph-disk-clean
diff -uwr a/src/Makefile-env.am b/src/Makefile-env.am
--- a/src/Makefile-env.am 2017-05-22 21:37:40.614023692 +0800
+++ b/src/Makefile-env.am 2017-05-22 22:07:02.196924196 +0800
@@ -41,7 +41,7 @@
export VERBOSE = true
# python unit tests need to know where the scripts are located
-export PYTHONPATH=$(top_srcdir)/src/pybind
+export PYTHONPATH+=:$(top_srcdir)/src/pybind
# when doing a debug build, make sure to make the targets
if WITH_DEBUG
diff -uwr a/src/pybind/cephfs/Makefile.am b/src/pybind/cephfs/Makefile.am
--- a/src/pybind/cephfs/Makefile.am 2017-05-22 21:37:40.679022740 +0800
+++ b/src/pybind/cephfs/Makefile.am 2017-05-25 23:18:27.833621681 +0800
@@ -17,13 +17,12 @@
if test "$(DESTDIR)" ; then \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
- else \
- options=--prefix=/usr ; \
fi ; \
root="--root=$(DESTDIR)" ; \
- else \
- options=--prefix=$(prefix) ; \
fi ; \
+ if test "$(lib)"; then \
+ options=--prefix=$(lib) ; \
+ fi ; \
cd $(srcdir)/pybind/cephfs; $(PY_DISTUTILS) build \
--build-base $(shell readlink -f $(builddir))/build \
install \
diff -uwr a/src/pybind/rados/Makefile.am b/src/pybind/rados/Makefile.am
--- a/src/pybind/rados/Makefile.am 2017-05-25 23:11:02.196623492 +0800
+++ b/src/pybind/rados/Makefile.am 2017-05-25 23:18:56.045180721 +0800
@@ -17,13 +17,12 @@
if test "$(DESTDIR)" ; then \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
- else \
- options=--prefix=/usr ; \
fi ; \
root="--root=$(DESTDIR)" ; \
- else \
- options=--prefix=$(prefix) ; \
fi ; \
+ if test "$(lib)"; then \
+ options=--prefix=$(lib) ; \
+ fi ; \
cd $(srcdir)/pybind/rados; $(PY_DISTUTILS) build \
--build-base $(shell readlink -f $(builddir))/build \
install \
diff -uwr a/src/pybind/rbd/Makefile.am b/src/pybind/rbd/Makefile.am
--- a/src/pybind/rbd/Makefile.am 2017-05-25 23:10:37.788009722 +0800
+++ b/src/pybind/rbd/Makefile.am 2017-05-25 23:19:21.764778879 +0800
@@ -17,13 +17,12 @@
if test "$(DESTDIR)" ; then \
if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
options=--install-layout=deb ; \
- else \
- options=--prefix=/usr ; \
fi ; \
root="--root=$(DESTDIR)" ; \
- else \
- options=--prefix=$(prefix) ; \
fi ; \
+ if test "$(lib)"; then \
+ options=--prefix=$(lib) ; \
+ fi ; \
cd $(srcdir)/pybind/rbd; $(PY_DISTUTILS) build \
--build-base $(shell readlink -f $(builddir))/build \
install \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment