]> git.donarmstrong.com Git - neurodebian.git/blob - sandbox/blog_vm_ndtools.rst
minor tune ups in nd_* blogpost
[neurodebian.git] / sandbox / blog_vm_ndtools.rst
1 :date: 2012-04-14 22:05:00
2 :tags: debian, neuroscience, software, development, packages, virtualization
3
4 .. _chap_ndtools_build:
5
6 NeuroDebian nd* tools
7 =====================
8
9 One of the goals of NeuroDebian_ is to provide recent versions of
10 scientific software on stable Debian (and Ubuntu) deployments.  That
11 is why we build (whenever possible) every new package not only for the
12 Debian unstable (the entry point of packages into Debian) but also for
13 Debian testing and stable, and Ubuntu releases.  To automate such
14 procedure we prepared few rudimentary wrappers around cowbuilder_
15 allowing to build packages in isolated environment.  Also we provide a
16 backport-dsc_ script to ease backporting with optional application
17 per-release patchsets.  In this blog post we would like to introduce
18 you to these tools.  They will be of use for anyone working on a
19 package intended to be uploaded to NeuroDebian_ repository.  With a
20 single command you will be able to build a given Debian source package
21 across distributions.  As a result it verifies that there are no
22 outstanding backport-ability issues or compatibility problems with
23 core components (e.g. supported versions of Python) if your source
24 package excercises test suites at build time.
25
26 .. _cowbuilder: http://packages.debian.org/sid/cowbuilder
27 .. _NeuroDebian: http://neuro.debian.net
28 .. _backport-dsc: https://github.com/neurodebian/neurodebian/blob/master/tools/backport-dsc
29
30
31 Procedure
32 ---------
33
34 - [1-20 min] If you are not running Debian-based distribution,
35   :ref:`Install NeuroDebian VM <chap_vm>`; otherwise just :ref:`add apt
36   sources for NeuroDebian repository <repository_howto>`.
37
38 - [<1 min] Install the neurodebian-dev package providing nd* tools::
39
40    sudo apt-get install neurodebian-dev
41
42 - [1-5 min] Adjust default configuration (``sudo vim
43   /etc/neurodebian/cmdsettings.sh``) used by nd commands to
44
45   - point ``cowbuilderroot`` variable to some directory under
46     ``brain`` account, e.g. ``~brain/debs`` (should be created by you)
47
48   - remove undesired releases (e.g. deprecated ``karmic``) from
49     allnddist and alldist
50
51   - adjust ``mirror`` entries to use the `Debian mirror`_ and `Ubuntu
52     mirror`_ of your choice or may be even point to your `approx
53     <http://packages.debian.org/sid/approx>`_ apt-caching server
54
55 .. _`Debian mirror`: http://www.debian.org/mirror/list
56 .. _`Ubuntu mirror`: https://launchpad.net/ubuntu/+archivemirrors
57
58 - [10-60 min] Create the COWs for all releases you left in the
59   configuration file::
60
61         sudo nd_adddistall
62
63
64 Building
65 --------
66
67 At this point you should be all set to build packages for all
68 distributions with a single command.  E.g.::
69
70    sudo nd_build4all blah_1-1.dsc
71
72 should take the .dsc file you provide, and build it for main Debian
73 sid and all ND-supported releases of Debian and Ubuntu.
74 ``nd_build4allnd`` would build only for the later omitting the vanilla
75 Debian sid.  The highlevel summary either builds succeed or failed get
76 reported in ``summary.log`` in the same directory, pointing to
77 ``.build`` log files for the corresponding architecture/release.
78
79
80 Troubleshooting Failing Build
81 -----------------------------
82
83 Provide ``--hookdir`` cmdline pbuilder argument to point to a hook
84 which would get kicked in by pbuilder upon failure, e.g.:
85
86    sudo apt-get install git
87    git clone https://github.com/neurodebian/neurodebian
88    sudo nd_build4debianmain *.dsc -- --hookdir $PWD/neurodebian/tools/hooks
89
90
91 If you have any comments (typos, improvements, etc) -- feel welcome to
92 leave a comment below, or `contact us`_ .
93
94 .. _contact us: http://neuro.debian.net/#contacts