1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
Developers
==========
If you are a developer and use pyexiv2 in your project, you will find here
useful information.
Getting the code
################
pyexiv2's source code is versioned with
`bazaar <http://bazaar.canonical.com/>`_, and all the branches, including the
main development focus (sometimes referred to as *trunk*), are hosted on
`Launchpad <https://code.launchpad.net/pyexiv2>`_.
To get a working copy of the latest revision of the development branch, just
issue the following command in a terminal::
bzr branch lp:pyexiv2
If you need to get a specific revision identified by a tag (all releases of
pyexiv2 are tagged), use the following command::
bzr branch -r tag:tag_name lp:pyexiv2
A list of all the available tags can be obtained using the ``bzr tags``
command::
osomon@granuja:~/dev/pyexiv2$ bzr tags
release-0.1 60
release-0.1.1 73
release-0.1.2 99
release-0.1.3 99.1.6
release-0.2.0 296
release-0.2.1 306
release-0.2.2 318
release-0.3.0 349
Dependencies
############
You will need the following dependencies installed on your system to build and
use pyexiv2:
* `Python <http://python.org/download/>`_ ≥ 2.6
* `boost.python <http://www.boost.org/libs/python/doc/>`_ ≥ 1.35
* `libexiv2 <http://exiv2.org/>`_ ≥ 0.19
* `SCons <http://scons.org/>`_
For Python, boost.python and libexiv2, the development files are needed
(-dev packages).
A typical list of packages to install on a Debian/Ubuntu system is::
python-all-dev libboost-python-dev libexiv2-dev scons
Additionally, if you want to cross-compile pyexiv2 for Windows and generate a
Windows installer, you will need the following dependencies:
* `MinGW <http://www.mingw.org/>`_
* `7-Zip <http://7-zip.org/>`_
* `BJam <http://boost.org/boost-build2/doc/html/index.html>`_
* `NSIS <http://nsis.sourceforge.net/>`_
A typical list of packages to install on a Debian/Ubuntu system is::
mingw32 p7zip-full bjam nsis
Building and installing
#######################
Linux
+++++
Building pyexiv2 is as simple as invoking ``scons`` in the top-level directory::
osomon@granuja:~/dev/pyexiv2$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/exiv2wrapper.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper.cpp
g++ -o build/exiv2wrapper_python.os -c -fPIC -I/usr/include/python2.6 src/exiv2wrapper_python.cpp
g++ -o build/libexiv2python.so -shared build/exiv2wrapper.os build/exiv2wrapper_python.os -lboost_python -lexiv2
scons: done building targets.
The result of the build process is a shared library, ``libexiv2python.so``, in
the build directory::
osomon@granuja:~/dev/pyexiv2$ ls build/
exiv2wrapper.os exiv2wrapper_python.os libexiv2python.so
To install pyexiv2 system-wide, just invoke ``scons install``.
You will most likely need administrative privileges to proceed.
The ``--user`` switch will install pyexiv2 in the current
`user site directory <http://www.python.org/dev/peps/pep-0370/>`_
(Python ≥ 2.6 is required).
Note to packagers:
if `DESTDIR <http://www.gnu.org/prep/standards/html_node/DESTDIR.html>`_ is
specified on the command line when invoking ``scons install``, its value will be
prepended to each installed target file.
Windows
+++++++
The top-level directory of the development branch contains a shell script named
``cross-compile.sh`` that retrieves all the dependencies required and
cross-compiles pyexiv2 for Windows on a Linux host.
Read the comments in the header of the script to know the pre-requisites.
The result of the compilation is a DLL, ``libexiv2python.pyd``, in the build
directory. This file and the ``pyexiv2`` folder in ``src`` should be copied to
the system-wide site directory of a Python 2.7 setup
(typically ``C:\Python27\Lib\site-packages\``) or to the user site directory
(``%APPDATA%\Python\Python27\site-packages\``).
The top-level directory of the branch also contains an NSIS installer script
named ``win32-installer.nsi``.
From the top-level directory of the branch, run the following command::
makensis win32-installer.nsi
This will generate a ready-to-distribute installer executable named
``pyexiv2-0.2-setup.exe``.
Documentation
#############
The present documentation is generated using
`Sphinx <http://sphinx.pocoo.org/>`_ from reStructuredText sources found in the
doc/ directory. Invoke ``scons doc`` to (re)build the HTML documentation.
Alternatively, you can issue the following command::
sphinx-build -b html doc/ doc/_build/
The index of the documentation will then be found under doc/_build/index.html.
Unit tests
##########
pyexiv2's source comes with a battery of unit tests, in the test/ directory.
To run them, invoke ``scons test``.
Alternatively, you can execute the ``TestsRunner.py`` script.
Contributing
############
pyexiv2 is Free Software, meaning that you are encouraged to use it, modify it
to suit your needs, contribute back improvements, and redistribute it.
`Bugs <https://bugs.launchpad.net/pyexiv2>`_ are tracked on Launchpad.
There is a team called
`pyexiv2-developers <https://launchpad.net/~pyexiv2-developers>`_ open to anyone
interested in following development on pyexiv2. Don't hesitate to subscribe to
the team (you don't need to actually contribute!) and to the associated mailing
list.
There are several ways in which you can contribute to improve pyexiv2:
* Use it;
* Give your feedback and discuss issues and feature requests on the
mailing list;
* Report bugs, write patches;
* Package it for your favorite distribution/OS.
When reporting a bug, don't forget to include the following information in the
report:
* version of pyexiv2
* version of libexiv2 it was compiled against
* a minimal script that reliably reproduces the issue
* a sample image file with which the bug can reliably be reproduced
|