[01/11] Fix installation of python libs
diff mbox

Message ID 1489937044-30856-2-git-send-email-geza.gemes@gmail.com
State New, archived
Headers show

Commit Message

Gémes Géza March 19, 2017, 3:23 p.m. UTC
Change deb package build in order to symlink the files installed
to site-packages to dist-packages to have them inluded in the
default PYTHONPATH

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 scripts/mkdeb | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stefano Stabellini March 20, 2017, 11:54 p.m. UTC | #1
On Sun, 19 Mar 2017, Géza Gémes wrote:
> Change deb package build in order to symlink the files installed
> to site-packages to dist-packages to have them inluded in the
> default PYTHONPATH
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
> ---
>  scripts/mkdeb | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/scripts/mkdeb b/scripts/mkdeb
> index 3796300..23bcc2a 100755
> --- a/scripts/mkdeb
> +++ b/scripts/mkdeb
> @@ -46,6 +46,15 @@ then
>      rm -rf deb/usr/lib64
>  fi
>  
> +# Make sure that python libs will be in the path
> +mkdir -p deb/usr/lib/python2.7/dist-packages/
> +cd deb/usr/lib/python2.7/dist-packages/
> +for file in `ls ../site-packages`
> +do
> +    ln -s ../site-packages/$file .
> +done
> +cd -

Actually for Debian I think it makes sense to move (not link) the files
to dist-packages, what do you think?


>  # Fill in the debian boilerplate
>  mkdir -p deb/DEBIAN
>  cat >deb/DEBIAN/control <<EOF
> -- 
> 2.7.4
>
Gémes Géza March 21, 2017, 6:27 a.m. UTC | #2
2017. márc. 21. 0:54 ezt írta ("Stefano Stabellini" <sstabellini@kernel.org
>):

On Sun, 19 Mar 2017, Géza Gémes wrote:
> Change deb package build in order to symlink the files installed
> to site-packages to dist-packages to have them inluded in the
> default PYTHONPATH
>
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
> ---
>  scripts/mkdeb | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/scripts/mkdeb b/scripts/mkdeb
> index 3796300..23bcc2a 100755
> --- a/scripts/mkdeb
> +++ b/scripts/mkdeb
> @@ -46,6 +46,15 @@ then
>      rm -rf deb/usr/lib64
>  fi
>
> +# Make sure that python libs will be in the path
> +mkdir -p deb/usr/lib/python2.7/dist-packages/
> +cd deb/usr/lib/python2.7/dist-packages/
> +for file in `ls ../site-packages`
> +do
> +    ln -s ../site-packages/$file .
> +done
> +cd -

Actually for Debian I think it makes sense to move (not link) the files
to dist-packages, what do you think?


As I haven't tried on anything else than ubuntu 14.04 I was afraid of
breaking it elsewhere. But if you are aware that Debian and forks are using
dist-packages, I will change the symlink to a move.



>  # Fill in the debian boilerplate
>  mkdir -p deb/DEBIAN
>  cat >deb/DEBIAN/control <<EOF
> --
> 2.7.4
>


Cheers

Géza
Stefano Stabellini March 21, 2017, 5:04 p.m. UTC | #3
On Tue, 21 Mar 2017, Géza Gémes wrote:
> 2017. márc. 21. 0:54 ezt írta ("Stefano Stabellini" <sstabellini@kernel.org>):
>       On Sun, 19 Mar 2017, Géza Gémes wrote:
>       > Change deb package build in order to symlink the files installed
>       > to site-packages to dist-packages to have them inluded in the
>       > default PYTHONPATH
>       >
>       > Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
>       > ---
>       >  scripts/mkdeb | 9 +++++++++
>       >  1 file changed, 9 insertions(+)
>       >
>       > diff --git a/scripts/mkdeb b/scripts/mkdeb
>       > index 3796300..23bcc2a 100755
>       > --- a/scripts/mkdeb
>       > +++ b/scripts/mkdeb
>       > @@ -46,6 +46,15 @@ then
>       >      rm -rf deb/usr/lib64
>       >  fi
>       >
>       > +# Make sure that python libs will be in the path
>       > +mkdir -p deb/usr/lib/python2.7/dist-packages/
>       > +cd deb/usr/lib/python2.7/dist-packages/
>       > +for file in `ls ../site-packages`
>       > +do
>       > +    ln -s ../site-packages/$file .
>       > +done
>       > +cd -
> 
> Actually for Debian I think it makes sense to move (not link) the files
> to dist-packages, what do you think?
> 
> 
> As I haven't tried on anything else than ubuntu 14.04 I was afraid of breaking it elsewhere. But if you are aware that Debian and forks are using dist-packages, I will change
> the symlink to a move.

Yes, I think that's the case.




>       >  # Fill in the debian boilerplate
>       >  mkdir -p deb/DEBIAN
>       >  cat >deb/DEBIAN/control <<EOF
>       > --
>       > 2.7.4
>       >

Patch
diff mbox

diff --git a/scripts/mkdeb b/scripts/mkdeb
index 3796300..23bcc2a 100755
--- a/scripts/mkdeb
+++ b/scripts/mkdeb
@@ -46,6 +46,15 @@  then
     rm -rf deb/usr/lib64
 fi
 
+# Make sure that python libs will be in the path
+mkdir -p deb/usr/lib/python2.7/dist-packages/
+cd deb/usr/lib/python2.7/dist-packages/
+for file in `ls ../site-packages`
+do
+    ln -s ../site-packages/$file .
+done
+cd -
+
 # Fill in the debian boilerplate
 mkdir -p deb/DEBIAN
 cat >deb/DEBIAN/control <<EOF