Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

For example: I build numpy with Intel MKL libraries and it's available in Python shell, but if I want to install some package from repository that depends on numpy, my build is not considered.

What would be easiest way to include my Python build package in Ubuntu, so that packages from repository can find it, preferably without building again?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use checkinstall to build a deb file and install it.

Checkinstall will replace de 'make install' part of the standard compilation. Instead of just copying the files to their target directories it will build and install a deb file.

If you can't use checkinstall, you could create a dummy package using equivs. Note that this can create problems when updating or uninstalling and it's only recommended for expert users. It has a known tendency to grow out of control, so use it with care.

Install equivs:

sudo apt-get install equivs

Create the control file:

equivs-control python-numpy

This will create a template control file called python-numpy (the name doesn't matter)edit it python-numpy so it looks like this:

### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2

Package: python-numpy
Version: 9.9
# Maintainer: Your Name <yourname@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: <short description; defaults to some wise words> 
 long description and info
 .
 second paragraph

The more data that you give to it, the better the deb will be. I have only modified 2 fields:

  • Package: The name of the package that you want to build. For a dirty solution use python-pynum
  • Version: Use a number high enough to keep apt-get from updating it.

A better (but untested by me) solution could be to create a different package name, something link python-pynum-dummy, and use in the Provides line put python-numpy. This should be cleaner.

Finally build the deb.

equivs-build python-numpy 

And install it.

share|improve this answer
    
checkinstall can't handle packages which change easy-install.pth –  zetah Apr 30 '12 at 7:08
    
Umm... I'm lost. A package installed by a deb file shouldn't touch easy-install.pth. Only packages installed with easy-install should. –  Javier Rivera Apr 30 '12 at 11:35
    
I used checkinstall before, and if setup system by arbitrary python package writes to easy-install.pth (read: use setuptools), checkinstall fails. Not all packages write to easy-install.pth, but many do, and I'm not aware of workaround –  zetah Apr 30 '12 at 12:14
    
Then you can must use debbuild to build a proper .deb file. You can also make a dummy package to trick apt-get, but it could cause problems with updates or when uninstalling. I will try to expand it later. –  Javier Rivera Apr 30 '12 at 13:50
    
OK, thanks. Dummy package sounds great. Right now, I'm not interested in proper debs as that is too complicated to make for every package I install –  zetah Apr 30 '12 at 13:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.