summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2012-06-22 04:25:09 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2012-06-22 04:25:09 +0000
commit9e27cff59ed810967ad1b9390076298615a30230 (patch)
tree787f9d3d5c5a055414e8abeaafb6ec3e84b8df55
parente78f2d4c54fece25e7d9192e00f89522dd17051c (diff)
Bring back python-ethumb for kuuko.
SVN revision: 72683
-rw-r--r--AUTHORS1
-rw-r--r--COPYING504
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL365
-rw-r--r--Makefile.am150
-rw-r--r--NEWS0
-rw-r--r--README42
-rwxr-xr-xautogen.sh7
-rw-r--r--configure.ac191
-rw-r--r--ethumb/__init__.py22
-rw-r--r--ethumb/ethumb.c_ethumb.pyx45
-rw-r--r--ethumb/ethumb.client.pyx616
-rwxr-xr-xexamples/01-simple.py49
-rw-r--r--include/ethumb/__init__.py0
-rw-r--r--include/ethumb/c_ethumb.pxd29
-rw-r--r--include/ethumb/client.pxd79
-rw-r--r--m4/cython.m477
-rw-r--r--m4/filter-var.m410
-rw-r--r--m4/python.m471
-rw-r--r--m4/pythonpath.m481
-rw-r--r--python-ethumb.pc.in12
-rw-r--r--python-ethumb_client.pc.in12
22 files changed, 2363 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..cfc62b6
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Rafael Antognolli <antognolli@profusion.mobi>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..5ab7695
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,504 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9[This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16freedom to share and change it. By contrast, the GNU General Public
17Licenses are intended to guarantee your freedom to share and change
18free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21specially designated software packages--typically libraries--of the
22Free Software Foundation and other authors who decide to use it. You
23can use it too, but we suggest you first think carefully about whether
24this license or the ordinary General Public License is the better
25strategy to use in any particular case, based on the explanations below.
26
27 When we speak of free software, we are referring to freedom of use,
28not price. Our General Public Licenses are designed to make sure that
29you have the freedom to distribute copies of free software (and charge
30for this service if you wish); that you receive source code or can get
31it if you want it; that you can change the software and use pieces of
32it in new free programs; and that you are informed that you can do
33these things.
34
35 To protect your rights, we need to make restrictions that forbid
36distributors to deny you these rights or to ask you to surrender these
37rights. These restrictions translate to certain responsibilities for
38you if you distribute copies of the library or if you modify it.
39
40 For example, if you distribute copies of the library, whether gratis
41or for a fee, you must give the recipients all the rights that we gave
42you. You must make sure that they, too, receive or can get the source
43code. If you link other code with the library, you must provide
44complete object files to the recipients, so that they can relink them
45with the library after making changes to the library and recompiling
46it. And you must show them these terms so they know their rights.
47
48 We protect your rights with a two-step method: (1) we copyright the
49library, and (2) we offer you this license, which gives you legal
50permission to copy, distribute and/or modify the library.
51
52 To protect each distributor, we want to make it very clear that
53there is no warranty for the free library. Also, if the library is
54modified by someone else and passed on, the recipients should know
55that what they have is not the original version, so that the original
56author's reputation will not be affected by problems that might be
57introduced by others.
58
59 Finally, software patents pose a constant threat to the existence of
60any free program. We wish to make sure that a company cannot
61effectively restrict the users of a free program by obtaining a
62restrictive license from a patent holder. Therefore, we insist that
63any patent license obtained for a version of the library must be
64consistent with the full freedom of use specified in this license.
65
66 Most GNU software, including some libraries, is covered by the
67ordinary GNU General Public License. This license, the GNU Lesser
68General Public License, applies to certain designated libraries, and
69is quite different from the ordinary General Public License. We use
70this license for certain libraries in order to permit linking those
71libraries into non-free programs.
72
73 When a program is linked with a library, whether statically or using
74a shared library, the combination of the two is legally speaking a
75combined work, a derivative of the original library. The ordinary
76General Public License therefore permits such linking only if the
77entire combination fits its criteria of freedom. The Lesser General
78Public License permits more lax criteria for linking other code with
79the library.
80
81 We call this license the "Lesser" General Public License because it
82does Less to protect the user's freedom than the ordinary General
83Public License. It also provides other free software developers Less
84of an advantage over competing non-free programs. These disadvantages
85are the reason we use the ordinary General Public License for many
86libraries. However, the Lesser license provides advantages in certain
87special circumstances.
88
89 For example, on rare occasions, there may be a special need to
90encourage the widest possible use of a certain library, so that it becomes
91a de-facto standard. To achieve this, non-free programs must be
92allowed to use the library. A more frequent case is that a free
93library does the same job as widely used non-free libraries. In this
94case, there is little to gain by limiting the free library to free
95software only, so we use the Lesser General Public License.
96
97 In other cases, permission to use a particular library in non-free
98programs enables a greater number of people to use a large body of
99free software. For example, permission to use the GNU C Library in
100non-free programs enables many more people to use the whole GNU
101operating system, as well as its variant, the GNU/Linux operating
102system.
103
104 Although the Lesser General Public License is Less protective of the
105users' freedom, it does ensure that the user of a program that is
106linked with the Library has the freedom and the wherewithal to run
107that program using a modified version of the Library.
108
109 The precise terms and conditions for copying, distribution and
110modification follow. Pay close attention to the difference between a
111"work based on the library" and a "work that uses the library". The
112former contains code derived from the library, whereas the latter must
113be combined with the library in order to run.
114
115 GNU LESSER GENERAL PUBLIC LICENSE
116 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
118 0. This License Agreement applies to any software library or other
119program which contains a notice placed by the copyright holder or
120other authorized party saying it may be distributed under the terms of
121this Lesser General Public License (also called "this License").
122Each licensee is addressed as "you".
123
124 A "library" means a collection of software functions and/or data
125prepared so as to be conveniently linked with application programs
126(which use some of those functions and data) to form executables.
127
128 The "Library", below, refers to any such software library or work
129which has been distributed under these terms. A "work based on the
130Library" means either the Library or any derivative work under
131copyright law: that is to say, a work containing the Library or a
132portion of it, either verbatim or with modifications and/or translated
133straightforwardly into another language. (Hereinafter, translation is
134included without limitation in the term "modification".)
135
136 "Source code" for a work means the preferred form of the work for
137making modifications to it. For a library, complete source code means
138all the source code for all modules it contains, plus any associated
139interface definition files, plus the scripts used to control compilation
140and installation of the library.
141
142 Activities other than copying, distribution and modification are not
143covered by this License; they are outside its scope. The act of
144running a program using the Library is not restricted, and output from
145such a program is covered only if its contents constitute a work based
146on the Library (independent of the use of the Library in a tool for
147writing it). Whether that is true depends on what the Library does
148and what the program that uses the Library does.
149
150 1. You may copy and distribute verbatim copies of the Library's
151complete source code as you receive it, in any medium, provided that
152you conspicuously and appropriately publish on each copy an
153appropriate copyright notice and disclaimer of warranty; keep intact
154all the notices that refer to this License and to the absence of any
155warranty; and distribute a copy of this License along with the
156Library.
157
158 You may charge a fee for the physical act of transferring a copy,
159and you may at your option offer warranty protection in exchange for a
160fee.
161
162 2. You may modify your copy or copies of the Library or any portion
163of it, thus forming a work based on the Library, and copy and
164distribute such modifications or work under the terms of Section 1
165above, provided that you also meet all of these conditions:
166
167 a) The modified work must itself be a software library.
168
169 b) You must cause the files modified to carry prominent notices
170 stating that you changed the files and the date of any change.
171
172 c) You must cause the whole of the work to be licensed at no
173 charge to all third parties under the terms of this License.
174
175 d) If a facility in the modified Library refers to a function or a
176 table of data to be supplied by an application program that uses
177 the facility, other than as an argument passed when the facility
178 is invoked, then you must make a good faith effort to ensure that,
179 in the event an application does not supply such function or
180 table, the facility still operates, and performs whatever part of
181 its purpose remains meaningful.
182
183 (For example, a function in a library to compute square roots has
184 a purpose that is entirely well-defined independent of the
185 application. Therefore, Subsection 2d requires that any
186 application-supplied function or table used by this function must
187 be optional: if the application does not supply it, the square
188 root function must still compute square roots.)
189
190These requirements apply to the modified work as a whole. If
191identifiable sections of that work are not derived from the Library,
192and can be reasonably considered independent and separate works in
193themselves, then this License, and its terms, do not apply to those
194sections when you distribute them as separate works. But when you
195distribute the same sections as part of a whole which is a work based
196on the Library, the distribution of the whole must be on the terms of
197this License, whose permissions for other licensees extend to the
198entire whole, and thus to each and every part regardless of who wrote
199it.
200
201Thus, it is not the intent of this section to claim rights or contest
202your rights to work written entirely by you; rather, the intent is to
203exercise the right to control the distribution of derivative or
204collective works based on the Library.
205
206In addition, mere aggregation of another work not based on the Library
207with the Library (or with a work based on the Library) on a volume of
208a storage or distribution medium does not bring the other work under
209the scope of this License.
210
211 3. You may opt to apply the terms of the ordinary GNU General Public
212License instead of this License to a given copy of the Library. To do
213this, you must alter all the notices that refer to this License, so
214that they refer to the ordinary GNU General Public License, version 2,
215instead of to this License. (If a newer version than version 2 of the
216ordinary GNU General Public License has appeared, then you can specify
217that version instead if you wish.) Do not make any other change in
218these notices.
219
220 Once this change is made in a given copy, it is irreversible for
221that copy, so the ordinary GNU General Public License applies to all
222subsequent copies and derivative works made from that copy.
223
224 This option is useful when you wish to copy part of the code of
225the Library into a program that is not a library.
226
227 4. You may copy and distribute the Library (or a portion or
228derivative of it, under Section 2) in object code or executable form
229under the terms of Sections 1 and 2 above provided that you accompany
230it with the complete corresponding machine-readable source code, which
231must be distributed under the terms of Sections 1 and 2 above on a
232medium customarily used for software interchange.
233
234 If distribution of object code is made by offering access to copy
235from a designated place, then offering equivalent access to copy the
236source code from the same place satisfies the requirement to
237distribute the source code, even though third parties are not
238compelled to copy the source along with the object code.
239
240 5. A program that contains no derivative of any portion of the
241Library, but is designed to work with the Library by being compiled or
242linked with it, is called a "work that uses the Library". Such a
243work, in isolation, is not a derivative work of the Library, and
244therefore falls outside the scope of this License.
245
246 However, linking a "work that uses the Library" with the Library
247creates an executable that is a derivative of the Library (because it
248contains portions of the Library), rather than a "work that uses the
249library". The executable is therefore covered by this License.
250Section 6 states terms for distribution of such executables.
251
252 When a "work that uses the Library" uses material from a header file
253that is part of the Library, the object code for the work may be a
254derivative work of the Library even though the source code is not.
255Whether this is true is especially significant if the work can be
256linked without the Library, or if the work is itself a library. The
257threshold for this to be true is not precisely defined by law.
258
259 If such an object file uses only numerical parameters, data
260structure layouts and accessors, and small macros and small inline
261functions (ten lines or less in length), then the use of the object
262file is unrestricted, regardless of whether it is legally a derivative
263work. (Executables containing this object code plus portions of the
264Library will still fall under Section 6.)
265
266 Otherwise, if the work is a derivative of the Library, you may
267distribute the object code for the work under the terms of Section 6.
268Any executables containing that work also fall under Section 6,
269whether or not they are linked directly with the Library itself.
270
271 6. As an exception to the Sections above, you may also combine or
272link a "work that uses the Library" with the Library to produce a
273work containing portions of the Library, and distribute that work
274under terms of your choice, provided that the terms permit
275modification of the work for the customer's own use and reverse
276engineering for debugging such modifications.
277
278 You must give prominent notice with each copy of the work that the
279Library is used in it and that the Library and its use are covered by
280this License. You must supply a copy of this License. If the work
281during execution displays copyright notices, you must include the
282copyright notice for the Library among them, as well as a reference
283directing the user to the copy of this License. Also, you must do one
284of these things:
285
286 a) Accompany the work with the complete corresponding
287 machine-readable source code for the Library including whatever
288 changes were used in the work (which must be distributed under
289 Sections 1 and 2 above); and, if the work is an executable linked
290 with the Library, with the complete machine-readable "work that
291 uses the Library", as object code and/or source code, so that the
292 user can modify the Library and then relink to produce a modified
293 executable containing the modified Library. (It is understood
294 that the user who changes the contents of definitions files in the
295 Library will not necessarily be able to recompile the application
296 to use the modified definitions.)
297
298 b) Use a suitable shared library mechanism for linking with the
299 Library. A suitable mechanism is one that (1) uses at run time a
300 copy of the library already present on the user's computer system,
301 rather than copying library functions into the executable, and (2)
302 will operate properly with a modified version of the library, if
303 the user installs one, as long as the modified version is
304 interface-compatible with the version that the work was made with.
305
306 c) Accompany the work with a written offer, valid for at
307 least three years, to give the same user the materials
308 specified in Subsection 6a, above, for a charge no more
309 than the cost of performing this distribution.
310
311 d) If distribution of the work is made by offering access to copy
312 from a designated place, offer equivalent access to copy the above
313 specified materials from the same place.
314
315 e) Verify that the user has already received a copy of these
316 materials or that you have already sent this user a copy.
317
318 For an executable, the required form of the "work that uses the
319Library" must include any data and utility programs needed for
320reproducing the executable from it. However, as a special exception,
321the materials to be distributed need not include anything that is
322normally distributed (in either source or binary form) with the major
323components (compiler, kernel, and so on) of the operating system on
324which the executable runs, unless that component itself accompanies
325the executable.
326
327 It may happen that this requirement contradicts the license
328restrictions of other proprietary libraries that do not normally
329accompany the operating system. Such a contradiction means you cannot
330use both them and the Library together in an executable that you
331distribute.
332
333 7. You may place library facilities that are a work based on the
334Library side-by-side in a single library together with other library
335facilities not covered by this License, and distribute such a combined
336library, provided that the separate distribution of the work based on
337the Library and of the other library facilities is otherwise
338permitted, and provided that you do these two things:
339
340 a) Accompany the combined library with a copy of the same work
341 based on the Library, uncombined with any other library
342 facilities. This must be distributed under the terms of the
343 Sections above.
344
345 b) Give prominent notice with the combined library of the fact
346 that part of it is a work based on the Library, and explaining
347 where to find the accompanying uncombined form of the same work.
348
349 8. You may not copy, modify, sublicense, link with, or distribute
350the Library except as expressly provided under this License. Any
351attempt otherwise to copy, modify, sublicense, link with, or
352distribute the Library is void, and will automatically terminate your
353rights under this License. However, parties who have received copies,
354or rights, from you under this License will not have their licenses
355terminated so long as such parties remain in full compliance.
356
357 9. You are not required to accept this License, since you have not
358signed it. However, nothing else grants you permission to modify or
359distribute the Library or its derivative works. These actions are
360prohibited by law if you do not accept this License. Therefore, by
361modifying or distributing the Library (or any work based on the
362Library), you indicate your acceptance of this License to do so, and
363all its terms and conditions for copying, distributing or modifying
364the Library or works based on it.
365
366 10. Each time you redistribute the Library (or any work based on the
367Library), the recipient automatically receives a license from the
368original licensor to copy, distribute, link with or modify the Library
369subject to these terms and conditions. You may not impose any further
370restrictions on the recipients' exercise of the rights granted herein.
371You are not responsible for enforcing compliance by third parties with
372this License.
373
374 11. If, as a consequence of a court judgment or allegation of patent
375infringement or for any other reason (not limited to patent issues),
376conditions are imposed on you (whether by court order, agreement or
377otherwise) that contradict the conditions of this License, they do not
378excuse you from the conditions of this License. If you cannot
379distribute so as to satisfy simultaneously your obligations under this
380License and any other pertinent obligations, then as a consequence you
381may not distribute the Library at all. For example, if a patent
382license would not permit royalty-free redistribution of the Library by
383all those who receive copies directly or indirectly through you, then
384the only way you could satisfy both it and this License would be to
385refrain entirely from distribution of the Library.
386
387If any portion of this section is held invalid or unenforceable under any
388particular circumstance, the balance of the section is intended to apply,
389and the section as a whole is intended to apply in other circumstances.
390
391It is not the purpose of this section to induce you to infringe any
392patents or other property right claims or to contest validity of any
393such claims; this section has the sole purpose of protecting the
394integrity of the free software distribution system which is
395implemented by public license practices. Many people have made
396generous contributions to the wide range of software distributed
397through that system in reliance on consistent application of that
398system; it is up to the author/donor to decide if he or she is willing
399to distribute software through any other system and a licensee cannot
400impose that choice.
401
402This section is intended to make thoroughly clear what is believed to
403be a consequence of the rest of this License.
404
405 12. If the distribution and/or use of the Library is restricted in
406certain countries either by patents or by copyrighted interfaces, the
407original copyright holder who places the Library under this License may add
408an explicit geographical distribution limitation excluding those countries,
409so that distribution is permitted only in or among countries not thus
410excluded. In such case, this License incorporates the limitation as if
411written in the body of this License.
412
413 13. The Free Software Foundation may publish revised and/or new
414versions of the Lesser General Public License from time to time.
415Such new versions will be similar in spirit to the present version,
416but may differ in detail to address new problems or concerns.
417
418Each version is given a distinguishing version number. If the Library
419specifies a version number of this License which applies to it and
420"any later version", you have the option of following the terms and
421conditions either of that version or of any later version published by
422the Free Software Foundation. If the Library does not specify a
423license version number, you may choose any version ever published by
424the Free Software Foundation.
425
426 14. If you wish to incorporate parts of the Library into other free
427programs whose distribution conditions are incompatible with these,
428write to the author to ask for permission. For software which is
429copyrighted by the Free Software Foundation, write to the Free
430Software Foundation; we sometimes make exceptions for this. Our
431decision will be guided by the two goals of preserving the free status
432of all derivatives of our free software and of promoting the sharing
433and reuse of software generally.
434
435 NO WARRANTY
436
437 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
447 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456DAMAGES.
457
458 END OF TERMS AND CONDITIONS
459
460 How to Apply These Terms to Your New Libraries
461
462 If you develop a new library, and you want it to be of the greatest
463possible use to the public, we recommend making it free software that
464everyone can redistribute and change. You can do so by permitting
465redistribution under these terms (or, alternatively, under the terms of the
466ordinary General Public License).
467
468 To apply these terms, attach the following notices to the library. It is
469safest to attach them to the start of each source file to most effectively
470convey the exclusion of warranty; and each file should have at least the
471"copyright" line and a pointer to where the full notice is found.
472
473 <one line to give the library's name and a brief idea of what it does.>
474 Copyright (C) <year> <name of author>
475
476 This library is free software; you can redistribute it and/or
477 modify it under the terms of the GNU Lesser General Public
478 License as published by the Free Software Foundation; either
479 version 2.1 of the License, or (at your option) any later version.
480
481 This library is distributed in the hope that it will be useful,
482 but WITHOUT ANY WARRANTY; without even the implied warranty of
483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 Lesser General Public License for more details.
485
486 You should have received a copy of the GNU Lesser General Public
487 License along with this library; if not, write to the Free Software
488 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489
490Also add information on how to contact you by electronic and paper mail.
491
492You should also get your employer (if you work as a programmer) or your
493school, if any, to sign a "copyright disclaimer" for the library, if
494necessary. Here is a sample; alter the names:
495
496 Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
499 <signature of Ty Coon>, 1 April 1990
500 Ty Coon, President of Vice
501
502That's all there is to it!
503
504
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..7d1c323
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,365 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
52006, 2007, 2008, 2009 Free Software Foundation, Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended
232to try
233
234 ./configure CC="cc"
235
236and if that doesn't work, try
237
238 ./configure CC="cc -nodtk"
239
240 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
241directory contains several dysfunctional programs; working variants of
242these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
243in your `PATH', put it _after_ `/usr/bin'.
244
245 On Haiku, software installed for all users goes in `/boot/common',
246not `/usr/local'. It is recommended to use the following options:
247
248 ./configure --prefix=/boot/common
249
250Specifying the System Type
251==========================
252
253 There may be some features `configure' cannot figure out
254automatically, but needs to determine by the type of machine the package
255will run on. Usually, assuming the package is built to be run on the
256_same_ architectures, `configure' can figure that out, but if it prints
257a message saying it cannot guess the machine type, give it the
258`--build=TYPE' option. TYPE can either be a short name for the system
259type, such as `sun4', or a canonical name which has the form:
260
261 CPU-COMPANY-SYSTEM
262
263where SYSTEM can have one of these forms:
264
265 OS
266 KERNEL-OS
267
268 See the file `config.sub' for the possible values of each field. If
269`config.sub' isn't included in this package, then this package doesn't
270need to know the machine type.
271
272 If you are _building_ compiler tools for cross-compiling, you should
273use the option `--target=TYPE' to select the type of system they will
274produce code for.
275
276 If you want to _use_ a cross compiler, that generates code for a
277platform different from the build platform, you should specify the
278"host" platform (i.e., that on which the generated programs will
279eventually be run) with `--host=TYPE'.
280
281Sharing Defaults
282================
283
284 If you want to set default values for `configure' scripts to share,
285you can create a site shell script called `config.site' that gives
286default values for variables like `CC', `cache_file', and `prefix'.
287`configure' looks for `PREFIX/share/config.site' if it exists, then
288`PREFIX/etc/config.site' if it exists. Or, you can set the
289`CONFIG_SITE' environment variable to the location of the site script.
290A warning: not all `configure' scripts look for a site script.
291
292Defining Variables
293==================
294
295 Variables not defined in a site shell script can be set in the
296environment passed to `configure'. However, some packages may run
297configure again during the build, and the customized values of these
298variables may be lost. In order to avoid this problem, you should set
299them in the `configure' command line, using `VAR=value'. For example:
300
301 ./configure CC=/usr/local2/bin/gcc
302
303causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script).
305
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround:
308
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
310
311`configure' Invocation
312======================
313
314 `configure' recognizes the following options to control how it
315operates.
316
317`--help'
318`-h'
319 Print a summary of all of the options to `configure', and exit.
320
321`--help=short'
322`--help=recursive'
323 Print a summary of the options unique to this package's
324 `configure', and exit. The `short' variant lists options used
325 only in the top level, while the `recursive' variant lists options
326 also present in any nested packages.
327
328`--version'
329`-V'
330 Print the version of Autoconf used to generate the `configure'
331 script, and exit.
332
333`--cache-file=FILE'
334 Enable the cache: use and save the results of the tests in FILE,
335 traditionally `config.cache'. FILE defaults to `/dev/null' to
336 disable caching.
337
338`--config-cache'
339`-C'
340 Alias for `--cache-file=config.cache'.
341
342`--quiet'
343`--silent'
344`-q'
345 Do not print messages saying which checks are being made. To
346 suppress all normal output, redirect it to `/dev/null' (any error
347 messages will still be shown).
348
349`--srcdir=DIR'
350 Look for the package's source code in directory DIR. Usually
351 `configure' can determine that directory automatically.
352
353`--prefix=DIR'
354 Use DIR as the installation prefix. *note Installation Names::
355 for more details, including other options available for fine-tuning
356 the installation locations.
357
358`--no-create'
359`-n'
360 Run the configure checks, but stop before creating any output
361 files.
362
363`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details.
365
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..22c3eb3
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,150 @@
1ACLOCAL_AMFLAGS = -I m4
2
3cython_dist = ethumb/ethumb.c_ethumb.pyx ethumb/ethumb.client.pyx
4
5cython_ins = ethumb/ethumb.c_ethumb.pyx
6cython_outs = ethumb/ethumb.c_ethumb.c
7doc_modules = c_ethumb
8
9if WANT_ETHUMB_CLIENT
10cython_ins += ethumb/ethumb.client.pyx
11cython_outs += ethumb/ethumb.client.c
12doc_modules += client
13endif
14
15CYTHONFLAGS = @CYTHONFLAGS@
16CYTHON_ETHUMB_CLIENT_FLAGS = -I@CYTHON_ETHUMB_CLIENT_INCLUDEDIR@
17EPYDOC = @EPYDOC@
18
19c_ethumb_includes = include/ethumb/c_ethumb.pxd include/ethumb/__init__.py
20c_ethumb_deps =
21c_ethumb_client_includes = include/ethumb/client.pxd
22c_ethumb_client_deps =
23
24examples_files =
25examples_ethumb_client_files = examples/01-simple.py
26
27tests_files =
28tests_ethumb_client_files =
29
30MAINTAINERCLEANFILES = \
31 m4/libtool.m4 \
32 m4/lt~obsolete.m4 \
33 m4/ltoptions.m4 \
34 m4/ltsugar.m4 \
35 m4/ltversion.m4 \
36 m4/libtool.m4 \
37 ltmain.sh \
38 depcomp \
39 aclocal.m4 \
40 config.guess \
41 config.sub \
42 configure \
43 install-sh \
44 Makefile.in \
45 missing \
46 py-compile \
47 config.h.in \
48 $(cython_outs)
49
50EXTRA_DIST = \
51 AUTHORS \
52 COPYING \
53 README \
54 autogen.sh \
55 python-ethumb.pc.in \
56 python-ethumb_client.pc.in \
57 $(cython_dist) $(cython_outs) \
58 $(c_ethumb_includes) \
59 $(c_ethumb_deps) \
60 $(c_ethumb_client_includes) \
61 $(c_ethumb_client_deps) \
62 $(examples_files) \
63 $(examples_ethumb_client_files) \
64 $(tests_files) \
65 $(tests_ethumb_client_files)
66
67# do not distcleancheck for generated ethumb.c_ethumb.[ch]
68distcleancheck_listfiles = \
69 find . -type f \
70 \( -not -name 'ethumb.c_ethumb.c' -a \
71 -not -name 'ethumb.client.c' \)
72
73pkgconfigdir = $(libdir)/pkgconfig
74pkgconfig_DATA = python-ethumb.pc
75
76if HAVE_CYTHON
77BUILT_SOURCES = $(cython_outs)
78$(top_builddir)/ethumb/ethumb.c_ethumb.c $(top_builddir)/ethumb/ethumb.c_ethumb.h: $(top_srcdir)/ethumb/ethumb.c_ethumb.pyx $(c_ethumb_deps) $(c_ethumb_includes) Makefile
79 @$(MKDIR_P) $(top_builddir)/ethumb
80 $(AM_V_GEN)cd $(top_builddir) && $(PYTHON) -m cython -I$(top_srcdir)/include $(CYTHONFLAGS) -o $@ $<
81
82$(top_builddir)/ethumb/ethumb.client.c: $(top_srcdir)/ethumb/ethumb.client.pyx $(c_ethumb_client_deps) $(c_ethumb_client_includes) Makefile
83 @$(MKDIR_P) $(top_builddir)/ethumb
84 $(AM_V_GEN)cd $(top_builddir) && $(PYTHON) -m cython -I$(top_srcdir)/include $(CYTHONFLAGS) -o $@ $<
85
86else
87$(top_builddir)/ethumb/ethumb.c_ethumb.c $(top_builddir)/ethumb/ethumb.client.c: Makefile
88 @echo "NOTE: No cython, using pre-generated ethumb.c_ethumb.[ch]"
89 @$(MKDIR_P) $(top_builddir)/ethumb
90 $(AM_V_GEN)for f in ethumb/ethumb.c_ethumb.c ethumb/ethumb.client.c; do if ! test -f $(top_srcdir)/$$f; then continue; elif ! cmp $(top_srcdir)/$$f $(top_srcdir)/$$f >/dev/null; then cp $(top_srcdir)/$$f $(top_builddir)/$$f; fi; done
91endif
92
93AM_CPPFLAGS = \
94 -I$(top_srcdir) \
95 -I$(top_srcdir)/ethumb \
96 -I$(top_srcdir)/include \
97 @PYTHON_INCLUDES@ \
98 @ETHUMB_CFLAGS@ \
99 @ETHUMB_CLIENT_CFLAGS@
100
101pyexecethumbdir = $(pyexecdir)/ethumb
102pyexecethumb_LTLIBRARIES = c_ethumb.la
103c_ethumb_la_LIBADD = @ETHUMB_LIBS@
104c_ethumb_la_LDFLAGS = -module -avoid-version
105c_ethumb_la_LIBTOOLFLAGS = --tag=disable-static
106c_ethumb_la_SOURCES = \
107 $(top_builddir)/ethumb/ethumb.c_ethumb.c
108
109pyethumbdir = $(pythondir)/ethumb
110pyethumb_PYTHON = ethumb/__init__.py
111
112if WANT_ETHUMB_CLIENT
113pyexecethumbclientdir = $(pyexecdir)/ethumb/
114pyexecethumbclient_LTLIBRARIES = client.la
115client_la_LIBADD = @ETHUMB_CLIENT_LIBS@
116client_la_LDFLAGS = -module -avoid-version
117client_la_LIBTOOLFLAGS = --tag=disable-static
118client_la_SOURCES = $(top_builddir)/ethumb/ethumb.client.c
119
120pkgconfig_DATA += python-ethumb_client.pc
121endif
122
123
124if WANT_EXAMPLES
125examplesdir = $(pkgdatadir)/examples
126examples_DATA = $(examples_files)
127
128if WANT_ETHUMB_CLIENT
129examplesethumbclientdir = $(pkgdatadir)/examples/ethumb-client
130examplesethumbclient_DATA = $(examples_ethumb_client_files)
131endif
132endif
133
134
135.PHONY: doc doc-clean
136if HAVE_EPYDOC
137clean-local: doc-clean
138doc-clean:
139 rm -fr doc/api/html
140doc: $(pkgpyexec_LTLIBRARIES) $(pkgpython_PYTHON)
141 $(AM_V_GEN)PYTHONPATH="$$PWD:$$PWD/.libs:$$PYTHONPATH" \
142 $(EPYDOC) --html -o doc/api/html \
143 -n "@PACKAGE@ @VERSION@ API" \
144 $(doc_modules)
145else
146doc-clean:
147 @echo "Install epydoc then run ./configure again"
148doc:
149 @echo "Install epydoc then run ./configure again"
150endif
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..c9397a9
--- /dev/null
+++ b/README
@@ -0,0 +1,42 @@
1 PYTHON BINDINGS FOR ETHUMB
2
3REQUIREMENTS
4============
5
6 * Ethumb >= 0.1.0
7 * Evas >= 1.0.0 (indirect, Ethumb dependency)
8 * Ecore >= 1.0.0 (indirect, Ethumb dependency)
9 * E_Dbus >= 1.0.0 (indirect, Ethumb dependency if client is compiled)
10 * Cython >= 0.13
11 * Python-Evas
12 * Python >= 2.4
13
14
15BUILDING AND INSTALLING
16=======================
17
18This package uses automake, so execute:
19
20Build::
21
22 ./configure --prefix=/usr
23 make all
24
25Install::
26
27 make install
28
29If you wish to install at alternative locations, then make sure to
30configure your PYTHONPATH to be able to access this location!
31
32If you have Cython dependencies that are installed in alternative
33locations and want Cython to find them, please specify CYTHONFLAGS
34variable to ./configure.
35
36The discovery of dependencies is done with pkg-config, thus all your
37packages must be properly accessible with such tool. Ensure your
38PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR (cross-compiles) are configured!
39
40When cross-compiling, if your target's Python headers differ from your
41host's headers, specify PYTHON_INCLUDES variable containing the
42directory of the correct version of Python.h!
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..8610825
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3autoreconf -f -i
4
5if [ -z "$NOCONFIGURE" ]; then
6 ./configure "$@"
7fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..89ab386
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,191 @@
1##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3m4_define([v_maj], [0])
4m4_define([v_min], [7])
5m4_define([v_mic], [3])
6m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8##-- When released, remove the dnl on the below line
9dnl m4_undefine([v_rev])
10##-- When doing snapshots - change soname. remove dnl on below line
11m4_define([relname], [ver-pre-svn-08])
12m4_define([v_rel], [-release relname])
13##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15[m4_define([v_ver], [v_maj.v_min.v_mic])])
16m4_define([lt_rev], m4_eval(v_maj + v_min))
17m4_define([lt_cur], v_mic)
18m4_define([lt_age], v_min)
19##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22AC_INIT([python-ethumb], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23AC_PREREQ([2.65])
24AC_CONFIG_SRCDIR([configure.ac])
25AC_CONFIG_MACRO_DIR([m4])
26AC_CANONICAL_BUILD
27AC_CANONICAL_HOST
28AC_ISC_POSIX
29
30AM_INIT_AUTOMAKE([1.6 dist-bzip2])
31m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
32
33AC_LIBTOOL_WIN32_DLL
34define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
35define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
36AC_PROG_LIBTOOL
37
38##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
39##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
41m4_ifdef([v_rel], , [m4_define([v_rel], [])])
42AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
43AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
44AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
45AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
46version_info="lt_rev:lt_cur:lt_age"
47release_info="v_rel"
48AC_SUBST(version_info)
49AC_SUBST(release_info)
50##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
51##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52VMAJ=v_maj
53AC_SUBST(VMAJ)
54
55AC_PROG_CC
56
57PKG_PROG_PKG_CONFIG
58if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
59 pkgconfig_requires_private="Requires.private"
60else
61 pkgconfig_requires_private="Requires"
62fi
63AC_SUBST(pkgconfig_requires_private)
64
65pkgconfig_ethumb_requires_libs="ethumb >= 0.1.0"
66AC_SUBST(pkgconfig_ethumb_requires_libs)
67PKG_CHECK_MODULES([ETHUMB], [$pkgconfig_ethumb_requires_libs])
68wanted_cython_files="${srcdir}/ethumb/ethumb.c_ethumb.pyx"
69
70have_ethumb_client="no"
71want_ethumb_client="auto"
72pkgconfig_ethumb_client_requires_libs="ethumb_client >= 0.1.0"
73AC_SUBST(pkgconfig_ethumb_client_requires_libs)
74AC_ARG_ENABLE([ethumb-client],
75 [AC_HELP_STRING([--disable-ethumb-client],
76 [disable ethumb-client support. @<:@default=detect@:>@])],
77 [want_ethumb_client=$enableval], [])
78
79if test "x$want_ethumb_client" != "xno"; then
80 PKG_CHECK_MODULES([ETHUMB_CLIENT],
81 [$pkgconfig_ethumb_client_requires_libs],
82 [have_ethumb_client="yes"], [have_ethumb_client="no"]
83 )
84else
85 have_ethumb_client="no"
86fi
87if test "x$want_ethumb_client" = "xyes" -a "x$have_ethumb_client" = "xno"; then
88 AC_MSG_ERROR([ethumb-client support requested, but not found by pkg-config: $pkgconfig_ethumb_client_requires_libs])
89fi
90if test "x$want_ethumb_client" != "xno" -a "x${have_ethumb_client}" = "xyes"; then
91 wanted_cython_files="${wanted_cython_files} ${srcdir}/ethumb/ethumb.client.pyx"
92fi
93AM_CONDITIONAL(WANT_ETHUMB_CLIENT,
94 [test "x$want_ethumb_client" != "xno" -a "x${have_ethumb_client}" = "xyes"])
95
96AM_PATH_PYTHON(2.5)
97AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
98
99cython_required_version=0.13
100AM_CHECK_CYTHON([$cython_required_version], [:], [:])
101
102have_cython_precompiled=no
103AM_CHECK_CYTHON_PRECOMPILED([$wanted_cython_files],
104 [have_cython_precompiled=yes], [have_cython_precompiled=no])
105if test "x$CYTHON_FOUND" != "xyes"; then
106 if test v_rev -ne 0; then
107 if test "x$have_cython_precompiled" = "xyes"; then
108 AC_MSG_WARN([Cannot find Cython>=${cython_required_version}, however found a pre-generated file. YOU MAY FIND PROBLEMS, USE A RELEASE TARBALL OR INSTALL CYTHON>=${cython_required_version}])
109 else
110 AC_MSG_ERROR([Cannot find Cython>=${cython_required_version}, and not a release build])
111 fi
112 else
113 if test "x$have_cython_precompiled" = "xyes"; then
114 AC_MSG_NOTICE([Using pre-generated files from release tarball. Install Cython>=${cython_required_version} if you want to re-generate them.])
115 else
116 AC_MSG_ERROR([PACKAGING ERROR RELEASE BUILD WITHOUT PRE-GENERATED FILES])
117 fi
118 fi
119fi
120AM_CONDITIONAL(HAVE_CYTHON, [test "x$CYTHON_FOUND" = "xyes"])
121
122FILTER_VAR_REGEXP([CFLAGS], [-fvisibility=hidden])
123FILTER_VAR_REGEXP([LDFLAGS], [-fvisibility=hidden])
124
125# Install everything into $pyexecdir
126if test "x$pythondir" != "x$pyexecdir"; then
127 AC_SUBST([pythondir], [$pyexecdir])
128fi
129
130AM_CHECK_PYTHONPATH
131
132AC_PATH_PROG([EPYDOC], [epydoc], [no])
133AC_SUBST(EPYDOC)
134AM_CONDITIONAL(HAVE_EPYDOC, [test "x$EPYDOC" != "xno"])
135
136AC_ARG_ENABLE([examples],
137 [AC_HELP_STRING([--disable-examples], [Do not install examples])],
138 [if test "x${enableval}" != "xno"; then
139 want_examples=yes
140 else
141 want_examples=no
142 fi
143 ], [want_examples=yes])
144AM_CONDITIONAL([WANT_EXAMPLES], [test "x${want_examples}" != "xno"])
145
146AC_OUTPUT([
147Makefile
148python-ethumb.pc
149python-ethumb_client.pc
150])
151
152if test "x$CYTHON_FOUND" = "xyes"; then
153 cython_info="$CYTHON_VERSION (CYTHONFLAGS=$CYTHONFLAGS)"
154else
155 cython_info="no"
156fi
157AC_SUBST(CYTHONFLAGS)
158
159echo
160echo
161echo
162echo "------------------------------------------------------------------------"
163echo "$PACKAGE $VERSION"
164echo "------------------------------------------------------------------------"
165echo
166echo "Configuration Options Summary:"
167echo
168echo " Python...............: $PYTHON ($PYTHON_VERSION)"
169echo " Cython...............: $cython_info"
170echo
171echo "Compilation............: make (or gmake)"
172echo " CPPFLAGS.............: $CPPFLAGS"
173echo " CFLAGS...............: $CFLAGS"
174echo " LDFLAGS..............: $LDFLAGS"
175echo " PYTHONPATH...........: $PYTHONPATH"
176echo
177echo "Modules:"
178echo " Client...............: ${want_ethumb_client} (found: ${have_ethumb_client})"
179echo
180echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
181echo " prefix...............: $prefix"
182echo " pythondir............: $pythondir"
183echo " pyexecdir............: $pyexecdir"
184echo
185echo
186
187if test "x$PYTHONPATH_CORRECT" != "xyes"; then
188 AC_MSG_WARN([your \$PYTHONPATH does not contains the required directories to support your desired installation. Please check warnings above.])
189fi
190
191
diff --git a/ethumb/__init__.py b/ethumb/__init__.py
new file mode 100644
index 0000000..8898d9b
--- /dev/null
+++ b/ethumb/__init__.py
@@ -0,0 +1,22 @@
1# Copyright (C) 2009 by ProFUSION embedded systems
2#
3# This file is part of Python-Ethumb.
4#
5# Python-Ethumb is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17
18from c_ethumb import shutdown, Ethumb, ETHUMB_THUMB_NORMAL, \
19 ETHUMB_THUMB_LARGE, ETHUMB_THUMB_FDO, ETHUMB_THUMB_JPEG, \
20 ETHUMB_THUMB_EET, \
21 ETHUMB_THUMB_KEEP_ASPECT, ETHUMB_THUMB_IGNORE_ASPECT, \
22 ETHUMB_THUMB_CROP
diff --git a/ethumb/ethumb.c_ethumb.pyx b/ethumb/ethumb.c_ethumb.pyx
new file mode 100644
index 0000000..dfd9d1a
--- /dev/null
+++ b/ethumb/ethumb.c_ethumb.pyx
@@ -0,0 +1,45 @@
1# Copyright (C) 2009 by ProFUSION embedded systems
2#
3# This file is part of Python-Ethumb.
4#
5# Python-Ethumb is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17
18__extra_epydoc_fields__ = (
19 ("parm", "Parameter", "Parameters"), # epydoc don't support pyrex properly
20 )
21
22def init():
23 return ethumb_init()
24
25def shutdown():
26 ethumb_shutdown()
27
28ETHUMB_THUMB_NORMAL = 0
29ETHUMB_THUMB_LARGE = 1
30
31ETHUMB_THUMB_FDO = 0
32ETHUMB_THUMB_JPEG = 1
33ETHUMB_THUMB_EET = 2
34
35ETHUMB_THUMB_KEEP_ASPECT = 0
36ETHUMB_THUMB_IGNORE_ASPECT = 1
37ETHUMB_THUMB_CROP = 2
38
39cdef class Ethumb:
40 """Ethumb thumbnail generator"""
41 def __init__(self):
42 """Ethumb constructor."""
43
44
45init()
diff --git a/ethumb/ethumb.client.pyx b/ethumb/ethumb.client.pyx
new file mode 100644
index 0000000..63f05d0
--- /dev/null
+++ b/ethumb/ethumb.client.pyx
@@ -0,0 +1,616 @@
1# Copyright (C) 2009 by ProFUSION embedded systems
2#
3# This file is part of Python-Ethumb.
4#
5# Python-Ethumb is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17
18from cpython cimport PyObject, Py_INCREF, Py_DECREF
19import traceback
20
21__extra_epydoc_fields__ = (
22 ("parm", "Parameter", "Parameters"), # epydoc don't support pyrex properly
23 )
24
25def shutdown():
26 ethumb_client_shutdown()
27
28def init():
29 return ethumb_client_init()
30
31cdef void _connect_cb(void *data, Ethumb_Client *client, Eina_Bool success) with gil:
32 cdef Client self = <Client>data
33 s = bool(<unsigned int>success)
34 try:
35 func, args, kargs = self._on_connect_callback
36 func(self, s, *args, **kargs)
37 except Exception, e:
38 traceback.print_exc()
39
40 if not s and self.obj != NULL:
41 ethumb_client_disconnect(self.obj)
42 self.obj = NULL
43 self._on_connect_callback = None
44
45
46cdef void _on_server_die_cb(void *data, Ethumb_Client *client) with gil:
47 cdef Client self = <Client>data
48 if self._on_server_die_callback is not None:
49 try:
50 func, args, kargs = self._on_server_die_callback
51 func(self, *args, **kargs)
52 except Exception, e:
53 traceback.print_exc()
54
55 if self.obj != NULL:
56 ethumb_client_disconnect(self.obj)
57 self.obj = NULL
58 self._on_server_die_callback = None
59
60
61cdef void _generated_cb(void *data, Ethumb_Client *client, int id, const_char_ptr file, const_char_ptr key, const_char_ptr thumb_path, const_char_ptr thumb_key, Eina_Bool success) with gil:
62 obj = <object>data
63 (self, func, args, kargs) = obj
64 f = str_from_c(file)
65 k = str_from_c(key)
66 tp = str_from_c(thumb_path)
67 tk = str_from_c(thumb_key)
68 s = bool(success != 0)
69 try:
70 func(self, id, f, k, tp, tk, s, *args, **kargs)
71 except Exception, e:
72 traceback.print_exc()
73
74cdef void _generated_cb_free_data(void *data) with gil:
75 obj = <object>data
76 Py_DECREF(obj)
77
78cdef char *str_to_c(object s):
79 cdef char *mystr
80 if s is None:
81 mystr = NULL
82 else:
83 mystr = s
84 return mystr
85
86cdef object str_from_c(const_char_ptr mystr):
87 if mystr != NULL:
88 return mystr
89
90cdef class Client:
91 """Client for Ethumbd server.
92
93 This client is the recommended way to generate thumbnails with
94 Ethumb. All you have to do is create a client instance, wait it to
95 be connected to server, configure thumbnail parameters and then
96 start feed it with file_set(), exists() generate(). Basic steps are:
97
98 - instantiate Client, wait for func to be called with success.
99 - set various parameters, like format and size.
100 - loop on original files:
101 - C{c.file_set(file)}
102 - C{if not c.exists(): c.generate(generated_cb)}
103
104 When the last reference to client is released, server is
105 automatically disconnected. Since callback may contain references
106 to server itself, it is recommended explicit call to
107 L{disconnect()} function.
108 """
109
110 def __init__(self, func, *args, **kargs):
111 """Ethumb Client constructor.
112
113 Server is ready to receive requests just after B{func} is
114 called back with C{status == True}.
115
116 @parm: B{func} function to call when connection with server is
117 established. Function signature is:
118 C{func(client, status, *args, **kargs)}
119 with status being True for successful connection or False
120 on error.
121
122 @raise TypeError: if B{func} is not callable.
123 @raise SystemError: if it was not possible to connect to
124 server, allocate memory or use DBus.
125 """
126 if not callable(func):
127 raise TypeError("Parameter 'func' must be callable")
128 if self.obj == NULL:
129 self._on_connect_callback = (func, args, kargs)
130 self._on_server_die_callback = None
131 self.obj = ethumb_client_connect(_connect_cb, <void*>self, NULL)
132 if self.obj == NULL:
133 raise SystemError("Error connecting to server.")
134 else:
135 ethumb_client_on_server_die_callback_set(
136 self.obj, _on_server_die_cb, <void*>self, NULL)
137
138 def __dealloc__(self):
139 if self.obj != NULL:
140 ethumb_client_disconnect(self.obj)
141
142 def disconnect(self):
143 """Explicitly request server disconnection.
144
145 After this call object becomes shallow, that is operations
146 will be void.
147 """
148 if self.obj != NULL:
149 ethumb_client_disconnect(self.obj)
150 self.obj = NULL
151 self._on_connect_callback = None
152 self._on_server_die_callback = None
153
154 def __str__(self):
155 f, k = self.file
156 tf, tk = self.thumb_path
157 w, h = self.size
158
159 format = ("FDO", "JPEG", "EET")[self.format]
160 aspect = ("KEEP", "IGNORE", "CROP")[self.aspect]
161 if self.aspect == 2:
162 aspect = "CROP[%f, %f]" % self.crop
163 return ("%s(file=(%r, %r), thumb=(%r, %r), exists=%s, size=%dx%d, "
164 "format=%s, aspect=%s, quality=%d, compress=%d, "
165 "directory=%r, category=%r)") % \
166 (self.__class__.__name__, f, k, tf, tk, self.exists(),
167 w, h, format, aspect, self.quality, self.compress,
168 self.directory, self.category)
169
170 def __repr__(self):
171 f, k = self.file
172 tf, tk = self.thumb_path
173 return "%s(obj=%#x, file=(%r, %r), thumb=(%r, %r), exists=%s)" % \
174 (self.__class__.__name__, f, k, tf, tk, self.exists())
175
176 def on_server_die_callback_set(self, func, *args, **kargs):
177 """Function to call when server dies.
178
179 When server is dead there is nothing to do with this client
180 anymore, just create a new one and start over, hope that
181 server could be started and you could generate more
182 thumbnails.
183
184 @parm: B{func} function to call when server dies. Signature:
185 C{func(client, *args, **kargs)
186
187 @raise TypeError: if B{func} is not callable or None.
188 """
189 if func is None:
190 self._on_server_die_callback = None
191 elif callable(func):
192 self._on_server_die_callback = (func, args, kargs)
193 else:
194 raise TypeError("Parameter 'func' must be callable or None")
195
196 def fdo_set(self, int s):
197 """Configure future requests to use FreeDesktop.Org preset.
198
199 This is a preset to provide freedesktop.org (fdo) standard
200 compliant thumbnails. That is, files are stored as JPEG under
201 ~/.thumbnails/SIZE, with size being either normal (128x128) or
202 large (256x256).
203
204 @parm: B{s} size identifier, either ETHUMB_THUMB_NORMAL (0) or
205 ETHUMB_THUMB_LARGE.
206
207 @see: L{size_set()}, L{format_set()}, L{aspect_set()}, L{crop_set()},
208 L{category_set()}, L{directory_set()}.
209 """
210 ethumb_client_fdo_set(self.obj, s)
211
212 def size_set(self, int w, int h):
213 """Configure future request to use custom size.
214
215 @parm: B{w} width, default is 128.
216 @parm: B{h} height, default is 128.
217 """
218 ethumb_client_size_set(self.obj, w, h)
219
220 def size_get(self):
221 """Get current size being used by requests.
222
223 @rtype: tuple of int.
224 """
225 cdef int w, h
226 ethumb_client_size_get(self.obj, &w, &h)
227 return (w, h)
228
229 property size:
230 def __set__(self, value):
231 cdef int w, h
232 w, h = value
233 self.size_set(w, h)
234
235 def __get__(self):
236 return self.size_get()
237
238 def format_set(self, int f):
239 """Configure format to use for future requests.
240
241 @parm: B{f} format identifier to use, either ETHUMB_THUMB_FDO (0),
242 ETHUMB_THUMB_JPEG (1) or ETHUMB_THUMB_EET (2). Default is FDO.
243 """
244 ethumb_client_format_set(self.obj, f)
245
246 def format_get(self):
247 """Get current format in use for requests.
248
249 @rtype: int
250 """
251 return ethumb_client_format_get(self.obj)
252
253 property format:
254 def __set__(self, value):
255 self.format_set(value)
256
257 def __get__(self):
258 return self.format_get()
259
260 def aspect_set(self, int a):
261 """Configure aspect mode to use.
262
263 If aspect is kept (ETHUMB_THUMB_KEEP_ASPECT), then image will
264 be rescaled so the largest dimension is not bigger than it's
265 specified size (see L{size_get()}) and the other dimension is
266 resized in the same proportion. Example: size is 256x256,
267 image is 1000x500, resulting thumbnail is 256x128.
268
269 If aspect is ignored (ETHUMB_THUMB_IGNORE_ASPECT), then image
270 will be distorted to match required thumbnail size. Example:
271 size is 256x256, image is 1000x500, resulting thumbnail is
272 256x256.
273
274 If crop is required (ETHUMB_THUMB_CROP), then image will be
275 cropped so the smallest dimension is not bigger than its
276 specified size (see L{size_get()}) and the other dimension
277 will overflow, not being visible in the final image. How it
278 will overflow is speficied by L{crop_set()}
279 alignment. Example: size is 256x256, image is 1000x500, crop
280 alignment is 0.5, 0.5, resulting thumbnail is 256x256 with 250
281 pixels from left and 250 pixels from right being lost, that is
282 just the 500x500 central pixels of image will be considered
283 for scaling.
284
285 @parm: B{a} aspect mode identifier, either ETHUMB_THUMB_KEEP_ASPECT (0),
286 ETHUMB_THUMB_IGNORE_ASPECT (1) or ETHUMB_THUMB_CROP (2).
287
288 """
289 ethumb_client_aspect_set(self.obj, a)
290
291 def aspect_get(self):
292 """Get current aspect in use for requests.
293
294 @rtype: int
295 """
296 return ethumb_client_aspect_get(self.obj)
297
298 property aspect:
299 def __set__(self, value):
300 self.aspect_set(value)
301
302 def __get__(self):
303 return self.aspect_get()
304
305 def crop_set(self, float x, float y):
306 """Configure crop alignment in use for future requests.
307
308 @parm: B{x} horizontal alignment. 0.0 means left side will be
309 visible or right side is being lost. 1.0 means right
310 side will be visible or left side is being lost. 0.5
311 means just center is visible, both sides will be lost.
312 Default is 0.5.
313 @parm: B{y} vertical alignment. 0.0 is top visible, 1.0 is
314 bottom visible, 0.5 is center visible. Default is 0.5
315 """
316 ethumb_client_crop_align_set(self.obj, x, y)
317
318 def crop_get(self):
319 """Get current crop alignment in use for requests.
320
321 @rtype: tuple of float
322 """
323 cdef float x, y
324 ethumb_client_crop_align_get(self.obj, &x, &y)
325 return (x, y)
326
327 property crop:
328 def __set__(self, value):
329 cdef float x, y
330 x, y = value
331 self.crop_set(x, y)
332
333 def __get__(self):
334 return self.crop_get()
335
336 def quality_set(self, int quality):
337 """Configure quality to be used in thumbnails.
338
339 @parm: B{quality} value from 0 to 100, default is 80. The
340 effect depends on the format being used, PNG will not
341 use it.
342 """
343 ethumb_client_quality_set(self.obj, quality)
344
345 def quality_get(self):
346 """Get current quality in use for requests.
347
348 @rtype: int
349 """
350 return ethumb_client_quality_get(self.obj)
351
352 property quality:
353 def __set__(self, value):
354 self.quality_set(value)
355
356 def __get__(self):
357 return self.quality_get()
358
359 def compress_set(self, int compress):
360 """Configure compression level used in requests.
361
362 @parm: B{compress} value from 0 to 9, default is 9. The effect
363 depends on the format being used, JPEG will not use it.
364 """
365 ethumb_client_compress_set(self.obj, compress)
366
367 def compress_get(self):
368 """Get current compression level in use for requests.
369
370 @rtype: int
371 """
372 return ethumb_client_compress_get(self.obj)
373
374 property compress:
375 def __set__(self, value):
376 self.compress_set(value)
377
378 def __get__(self):
379 return self.compress_get()
380
381 def directory_set(self, path):
382 """Configure where to store thumbnails in future requests.
383
384 Note that this is the base, a category is added to this path
385 as a sub directory.
386
387 @parm: B{path} base directory where to store
388 thumbnails. Default is ~/.thumbnails
389 """
390 ethumb_client_dir_path_set(self.obj, str_to_c(path))
391
392 def directory_get(self):
393 """Get current base directory to store thumbnails.
394
395 @rtype: str or None
396 """
397 return str_from_c(ethumb_client_dir_path_get(self.obj))
398
399 property directory:
400 def __set__(self, value):
401 self.directory_set(value)
402
403 def __get__(self):
404 return self.directory_get()
405
406 def category_set(self, category):
407 """Category directory to store thumbnails.
408
409 @parm: B{category} category sub directory to store
410 thumbnail. Default is either "normal" or "large" for FDO
411 compliant thumbnails or
412 WIDTHxHEIGHT-ASPECT[-FRAMED]-FORMAT. It can be a string or
413 None to use auto generated names.
414 """
415 ethumb_client_category_set(self.obj, str_to_c(category))
416
417 def category_get(self):
418 """Get current category sub directory to store thumbnails.
419
420 @rtype: str or None
421 """
422 return str_from_c(ethumb_client_category_get(self.obj))
423
424 property category:
425 def __set__(self, value):
426 self.category_set(value)
427
428 def __get__(self):
429 return self.category_get()
430
431 def frame_set(self, file, group, swallow):
432 """Set frame to apply to future thumbnails.
433
434 This will create an edje object that will have image swallowed
435 in. This can be used to simulate Polaroid or wood frames in
436 the generated image. Remeber it is bad to modify the original
437 contents of thumbnails, but sometimes it's useful to have it
438 composited and avoid runtime overhead.
439
440 @parm: B{file} file path to edje.
441 @parm: B{group} group inside edje to use.
442 @parm: B{swallow} name of swallow part.
443 """
444 cdef char *f, *g, *s
445 f = str_to_c(file)
446 g = str_to_c(group)
447 s = str_to_c(swallow)
448 return ethumb_client_frame_set(self.obj, f, g, s)
449
450 def file_set(self, path, key=None):
451 """Set file to thumbnail.
452
453 Calling this function will zero L{thumb_set()}
454 specifications. This is done to avoid one using the last thumb
455 path for new images.
456
457 @parm: B{path} path to thumbnail subject.
458 @parm: B{key} path to key inside B{path}, this is used to
459 generate thumbnail of edje groups or images inside EET.
460 """
461 cdef char *p, *k
462 p = str_to_c(path)
463 k = str_to_c(key)
464 ethumb_client_file_set(self.obj, p, k)
465
466 def file_get(self):
467 """Get current file to thumbnail.
468
469 @rtype: tuple of str
470 """
471 cdef const_char_ptr p, k
472 ethumb_client_file_get(self.obj, &p, &k)
473 return (str_from_c(p), str_from_c(k))
474
475 property file:
476 def __set__(self, value):
477 p, k = value
478 self.file_set(p, k)
479
480 def __get__(self):
481 return self.file_get()
482
483 def file_free(self):
484 """Zero/Reset file parameters.
485
486 This call will reset file and thumb specifications.
487
488 @see: L{file_set()} and L{thumb_set()}
489 """
490 ethumb_client_file_free(self.obj)
491
492 def thumb_set(self, path, key=None):
493 """Set thumbnail path and key.
494
495 Note that these parameters are forgotten (reset) after
496 L{file_set()}.
497
498 @parm: B{path} path to generated thumbnail to use, this is an
499 absolute path to file, overriding directory and category.
500 @parm: B{key} path to key inside B{path}, this is used to
501 generate thumbnail inside EET files.
502 """
503 cdef const_char_ptr p, k
504 p = str_to_c(path)
505 k = str_to_c(key)
506 ethumb_client_thumb_path_set(self.obj, p, k)
507
508 def thumb_get(self):
509 """Get current path and key of thumbnail.
510
511 Note that if no explicit L{thumb_set()} was called, it will
512 auto generate path based on existing parameters such as
513 directory, category and others.
514
515 @rtype: tuple of str
516 """
517 cdef const_char_ptr p, k
518 ethumb_client_thumb_path_get(self.obj, &p, &k)
519 return (str_from_c(p), str_from_c(k))
520
521 property thumb_path:
522 def __set__(self, value):
523 p, k = value
524 self.thumb_set(p, k)
525 def __get__(self):
526 return self.thumb_get()
527
528 def video_time_set(self, float time):
529 ethumb_client_video_time_set(self.obj, time)
530
531 def video_start_set(self, float start):
532 ethumb_client_video_start_set(self.obj, start)
533
534 def video_interval_set(self, float interval):
535 ethumb_client_video_interval_set(self.obj, interval)
536
537 def video_ntimes_set(self, int ntimes):
538 ethumb_client_video_ntimes_set(self.obj, ntimes)
539
540 def video_fps_set(self, int fps):
541 ethumb_client_video_fps_set(self.obj, fps)
542
543 # document_page
544 def document_page_set(self, int page):
545 ethumb_client_document_page_set(self.obj, page)
546
547 def exists(self):
548 """Checks if thumbnail already exists.
549
550 If you want to avoid regenerating thumbnails, check if they
551 already exist with this function.
552 """
553 return bool(ethumb_client_thumb_exists(self.obj))
554
555 def generate(self, func, *args, **kargs):
556 """Ask EThumb server to generate the specified thumbnail.
557
558 Thumbnail generation is asynchronous and depend on ecore main
559 loop running. Given function will be called back with
560 generation status if True is returned by this call. If False
561 is returned, given function will not be called.
562
563 Existing thumbnails will be overwritten with this call. Check
564 if they already exist with L{exists()} before calling.
565
566 @parm: B{func} function to call on generation completion, even
567 if failed or succeeded. Signature is:
568 C{func(self, id, file, key, thumb_path, thumb_key, status, *args, **kargs)}
569 with status being True for successful generation or
570 False on failure.
571
572 @return: request identifier. Request can be canceled calling
573 L{cancel()} with given id. If an identifier is returned (>=
574 0), then func is guaranteed to be called unless it is
575 explicitly canceled.
576
577 @raise TypeError: if B{func} is not callable.
578 @raise SystemError: if could not generate thumbnail, probably
579 no L{file_set()}.
580
581 @see: L{cancel()}, L{clear()}, L{exists()}
582 """
583 if not callable(func):
584 raise TypeError("func must be callable")
585
586 targs = (self, func, args, kargs)
587 r = ethumb_client_generate(self.obj, _generated_cb, <void*>targs,
588 _generated_cb_free_data)
589 if r >= 0:
590 Py_INCREF(targs)
591 return r
592 else:
593 raise SystemError("could not generate thumbnail. "
594 "Did you set the file?")
595
596 def generate_cancel(self, int id):
597 """Cancel thumbnail request given its id.
598
599 Calling this function aborts thumbnail generation and B{func}
600 given to L{generate()} will not be called!
601
602 @parm: B{id} identifier returned by L{generate()}
603 """
604 ethumb_client_generate_cancel(self.obj, id, NULL, NULL, NULL)
605
606 def generate_cancel_all(self):
607 """Clear request queue, canceling all generation requests.
608
609 This will abort all existing requests, no B{func} given to
610 L{generate()} will be called.
611
612 Same as calling L{cancel()} in all exising requests.
613 """
614 ethumb_client_generate_cancel_all(self.obj)
615
616init()
diff --git a/examples/01-simple.py b/examples/01-simple.py
new file mode 100755
index 0000000..4ecc7e9
--- /dev/null
+++ b/examples/01-simple.py
@@ -0,0 +1,49 @@
1#!/usr/bin/env python
2
3import sys
4import os
5import ethumb.client
6import ecore
7
8if len(sys.argv) < 2:
9 raise SystemExit("missing file names.")
10
11def pop_existent(client, files):
12 while files:
13 f = files.pop()
14 client.file_set(f)
15 print client
16 if not client.exists():
17 return f
18 tf, tk = client.thumb_path
19 print "%s already thumbnailed %s, %s" % (f, tf, tk)
20 return None
21
22def request_next(client, files):
23 if pop_existent(client, files):
24 id = client.generate(generated_cb, files)
25 print "generating id=%d" % id
26 else:
27 print "nothing left to generate."
28 ecore.main_loop_quit()
29
30def generated_cb(client, id, file, key, tpath, tkey, success, files):
31 if success:
32 print "id=%d (%s, %s) successfully generated %s, %s" % \
33 (id, file, key, tpath, tkey)
34 else:
35 print "id=%d (%s, %s) failed to generate" % (id, file, key)
36
37 request_next(client, files)
38
39
40def connected_cb(client, success, files):
41 if not success:
42 print "could not connect to server."
43 ecore.main_loop_quit()
44 return
45 request_next(client, files)
46
47c = ethumb.client.Client(connected_cb, sys.argv[1:])
48ecore.main_loop_begin()
49del c
diff --git a/include/ethumb/__init__.py b/include/ethumb/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/ethumb/__init__.py
diff --git a/include/ethumb/c_ethumb.pxd b/include/ethumb/c_ethumb.pxd
new file mode 100644
index 0000000..6ae6883
--- /dev/null
+++ b/include/ethumb/c_ethumb.pxd
@@ -0,0 +1,29 @@
1# Copyright (C) 2009 by ProFUSION embedded systems
2#
3# This file is part of Python-Ethumb.
4#
5# Python-Ethumb is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17
18cdef extern from "Ethumb.h":
19 cdef struct _Ethumb:
20 int tw
21 int th
22 int format
23 int aspect
24
25 int ethumb_init()
26 void ethumb_shutdown()
27
28cdef class Ethumb:
29 cdef _Ethumb *obj
diff --git a/include/ethumb/client.pxd b/include/ethumb/client.pxd
new file mode 100644
index 0000000..02d4dfc
--- /dev/null
+++ b/include/ethumb/client.pxd
@@ -0,0 +1,79 @@
1# Copyright (C) 2009 by ProFUSION embedded systems
2#
3# This file is part of Python-Ethumb.
4#
5# Python-Ethumb is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Lesser General Public
7# License as published by the Free Software Foundation; either
8# version 2.1 of the License, or (at your option) any later version.
9#
10# Python-Ethumb is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17
18cdef extern from *:
19 ctypedef char* const_char_ptr "const char *"
20
21cdef extern from "Eina.h":
22 ctypedef int Eina_Bool
23
24cdef extern from "Ethumb_Client.h":
25 ctypedef struct Ethumb_Client
26 ctypedef void (*Ethumb_Client_Connect_Cb)(void *data, Ethumb_Client *client, Eina_Bool success)
27 ctypedef void (*Ethumb_Client_Die_Cb)(void *data, Ethumb_Client *client)
28 ctypedef void (*Ethumb_Client_Generate_Cb)(void *data, Ethumb_Client *client, int id, char *file, char *key, char *thumb_path, char *thumb_key, Eina_Bool success)
29 ctypedef void (*Ethumb_Client_Generate_Cancel_Cb)(void *data, Eina_Bool success)
30 ctypedef void (*Eina_Free_Cb)(void *data)
31
32 int ethumb_client_init()
33 int ethumb_client_shutdown()
34
35 Ethumb_Client *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data)
36 void ethumb_client_disconnect(Ethumb_Client *client)
37 void ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb_Client_Die_Cb server_die_cb, void *data, Eina_Free_Cb free_data)
38
39 void ethumb_client_fdo_set(Ethumb_Client *client, int s)
40
41 void ethumb_client_size_set(Ethumb_Client *client, int tw, int th)
42 void ethumb_client_size_get(Ethumb_Client *client, int *tw, int *th)
43 void ethumb_client_format_set(Ethumb_Client *client, int f)
44 int ethumb_client_format_get(Ethumb_Client *client)
45 void ethumb_client_aspect_set(Ethumb_Client *client, int a)
46 int ethumb_client_aspect_get(Ethumb_Client *client)
47 void ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y)
48 void ethumb_client_crop_align_get(Ethumb_Client *client, float *x, float *y)
49 void ethumb_client_quality_set(Ethumb_Client *client, int quality)
50 int ethumb_client_quality_get(Ethumb_Client *client)
51 void ethumb_client_compress_set(Ethumb_Client *client, int compress)
52 int ethumb_client_compress_get(Ethumb_Client *client)
53 Eina_Bool ethumb_client_frame_set(Ethumb_Client *client, char *file, char *group, char *swallow)
54 void ethumb_client_dir_path_set(Ethumb_Client *client, char *path)
55 char * ethumb_client_dir_path_get(Ethumb_Client *client)
56 void ethumb_client_category_set(Ethumb_Client *client, char *category)
57 char * ethumb_client_category_get(Ethumb_Client *client)
58 void ethumb_client_video_time_set(Ethumb_Client *client, float time)
59 void ethumb_client_video_start_set(Ethumb_Client *client, float start)
60 void ethumb_client_video_interval_set(Ethumb_Client *client, float interval)
61 void ethumb_client_video_ntimes_set(Ethumb_Client *client, int ntimes)
62 void ethumb_client_video_fps_set(Ethumb_Client *client, int fps)
63 void ethumb_client_document_page_set(Ethumb_Client *client, int page)
64
65 Eina_Bool ethumb_client_file_set(Ethumb_Client *client, char *path, char *key)
66 void ethumb_client_file_get(Ethumb_Client *client, char **path, char **key)
67 void ethumb_client_file_free(Ethumb_Client *client)
68
69 void ethumb_client_thumb_path_set(Ethumb_Client *client, char *path, char *key)
70 void ethumb_client_thumb_path_get(Ethumb_Client *client, char **path, char **key)
71 Eina_Bool ethumb_client_thumb_exists(Ethumb_Client *client)
72 int ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, void *data, Eina_Free_Cb free_data)
73 void ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, void *data, Eina_Free_Cb free_data)
74 void ethumb_client_generate_cancel_all(Ethumb_Client *client)
75
76cdef class Client:
77 cdef Ethumb_Client *obj
78 cdef object _on_connect_callback
79 cdef object _on_server_die_callback
diff --git a/m4/cython.m4 b/m4/cython.m4
new file mode 100644
index 0000000..ba1d432
--- /dev/null
+++ b/m4/cython.m4
@@ -0,0 +1,77 @@
1dnl AM_CHECK_CYTHON([VERSION [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
2dnl Check if a Cython version is installed
3dnl Defines CYTHON_VERSION and CYTHON_FOUND
4AC_DEFUN([AM_CHECK_CYTHON],
5[
6AC_REQUIRE([AM_PATH_PYTHON])
7ifelse([$1], [], [_msg=""], [_msg=" >= $1"])
8AC_MSG_CHECKING(for Cython$_msg)
9AC_CACHE_VAL(py_cv_cython, [
10
11prog="import Cython.Compiler.Version; print Cython.Compiler.Version.version"
12CYTHON_VERSION=`$PYTHON -c "$prog" 2>&AC_FD_CC`
13
14py_cv_cython=no
15if test "x$CYTHON_VERSION" != "x"; then
16 py_cv_cython=yes
17fi
18
19if test "x$py_cv_cython" = "xyes"; then
20 ifelse([$1], [], [:],
21 AS_VERSION_COMPARE([$CYTHON_VERSION], [$1], [py_cv_cython=no]))
22fi
23])
24
25AC_MSG_RESULT([$py_cv_cython])
26
27if test "x$py_cv_cython" = "xyes"; then
28 CYTHON_FOUND=yes
29 ifelse([$2], [], [:], [$2])
30else
31 CYTHON_FOUND=no
32 ifelse([$3], [], [AC_MSG_ERROR([Could not find usable Cython$_msg])], [$3])
33fi
34])
35
36dnl AM_CHECK_CYTHON_PRECOMPILED(FILE-LIST [, ACTION-IF-ALL [, ACTION-IF-NOT-ALL]])
37dnl given a list of files ending in .pyx (FILE-LIST), check if their .c
38dnl counterpart exists and is not older than the source.
39dnl ACTION-IF-ALL is called only if no files failed the check and thus
40dnl all pre-generated files are usable.
41dnl ACTION-IF-NOT-ALL is called if some or all failed. If not provided,
42dnl an error will be issued.
43AC_DEFUN([AM_CHECK_CYTHON_PRECOMPILED],
44[
45_to_check_list="$1"
46_failed_list=""
47_exists_list=""
48
49for inf in $_to_check_list; do
50 outf=`echo "$inf" | sed -e 's/^\(.*\)[.]pyx$/\1.c/'`
51 if test "$outf" = "$inf"; then
52 AC_MSG_WARN([File to check must end in .pyx, but got: $inf -- Skip])
53 continue
54 fi
55
56 AC_MSG_CHECKING([for pre-generated $outf for $inf])
57 if ! test -f "$outf"; then
58 _res=no
59 _failed_list="${_failed_list} $outf"
60 elif ! test "$outf" -nt "$inf"; then
61 _res="no (older)"
62 _failed_list="${_failed_list} $outf"
63 else
64 _res=yes
65 _exists_list="${_exists_list} $outf"
66 fi
67 AC_MSG_RESULT($_res)
68done
69
70if test -z "$_failed_list" -a -n "$_exists_list"; then
71 ifelse([$2], [], [:], [$2])
72else
73 ifelse([$3], [],
74 [AC_MSG_ERROR([Missing pre-generated files: $_failed_list])],
75 [$3])
76fi
77])
diff --git a/m4/filter-var.m4 b/m4/filter-var.m4
new file mode 100644
index 0000000..9c970e4
--- /dev/null
+++ b/m4/filter-var.m4
@@ -0,0 +1,10 @@
1dnl FILTER_VAR_REGEXP(VARIABLE, REGEXP-TO-DELETE [, ACTION-IF-REMOVED])
2dnl Applies "sed" regular expression to remove REGEXP-TO-DELETE from $VARIABLE
3AC_DEFUN([FILTER_VAR_REGEXP],
4[
5_tmp_[]$1=`echo "$[]$1" | sed -e 's/$2//g'`
6if test "x$_tmp_[]$1" != "x$[]$1"; then
7 ifelse([$3], [], [AC_MSG_WARN([Removed $2 from \$[]$1])], [$3])
8 $1="$_tmp_[]$1"
9fi
10])
diff --git a/m4/python.m4 b/m4/python.m4
new file mode 100644
index 0000000..02acac8
--- /dev/null
+++ b/m4/python.m4
@@ -0,0 +1,71 @@
1dnl code from pygtk-2.16.0
2## this one is commonly used with AM_PATH_PYTHONDIR ...
3dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
4dnl Check if a module containing a given symbol is visible to python.
5AC_DEFUN([AM_CHECK_PYMOD],
6[AC_REQUIRE([AM_PATH_PYTHON])
7py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
8AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
9AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
10ifelse([$2],[], [prog="
11import sys
12try:
13 import $1
14except ImportError:
15 sys.exit(1)
16except:
17 sys.exit(0)
18sys.exit(0)"], [prog="
19import $1
20$1.$2"])
21if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
22 then
23 eval "py_cv_mod_$py_mod_var=yes"
24 else
25 eval "py_cv_mod_$py_mod_var=no"
26 fi
27])
28py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
29if test "x$py_val" != xno; then
30 AC_MSG_RESULT(yes)
31 ifelse([$3], [],, [$3
32])dnl
33else
34 AC_MSG_RESULT(no)
35 ifelse([$4], [],, [$4
36])dnl
37fi
38])
39
40dnl a macro to check for ability to create python extensions
41dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
42dnl function also defines PYTHON_INCLUDES
43AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
44[AC_REQUIRE([AM_PATH_PYTHON])
45AC_MSG_CHECKING(for headers required to compile python extensions)
46if test -x "$PYTHON_INCLUDES"; then
47PYTHON_INCLUDES="-I$PYTHON_INCLUDES"
48else
49dnl deduce PYTHON_INCLUDES
50py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
51py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
52if test -x "$PYTHON-config"; then
53PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
54else
55PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
56if test "$py_prefix" != "$py_exec_prefix"; then
57 PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
58fi
59fi
60fi
61AC_SUBST(PYTHON_INCLUDES)
62dnl check if the headers exist:
63save_CPPFLAGS="$CPPFLAGS"
64CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
65AC_TRY_CPP([#include <Python.h>],dnl
66[AC_MSG_RESULT(found)
67$1],dnl
68[AC_MSG_RESULT(not found)
69$2])
70CPPFLAGS="$save_CPPFLAGS"
71])
diff --git a/m4/pythonpath.m4 b/m4/pythonpath.m4
new file mode 100644
index 0000000..7dc5a1a
--- /dev/null
+++ b/m4/pythonpath.m4
@@ -0,0 +1,81 @@
1dnl _CHECK_PYTHONPATH(PATH, ACTION-YES, ACTION-NO)
2AC_DEFUN([_CHECK_PYTHONPATH],
3[
4m4_define([pyprog], [import sys; sys.exit(not ('$1' in sys.path))])
5
6changequote(, )
7_cachevar=`echo "$1" | sed -e "s/[^a-zA-Z0-9_]/_0123_/g" `
8changequote([, ])
9_cachevar="py_cv_path_${_cachevar}"
10
11AC_CACHE_CHECK([for $1 in \$PYTHONPATH], [$_cachevar],
12 [
13 _res=no
14 if AC_RUN_LOG([$PYTHON -c "pyprog"]); then
15 _res=yes
16 fi
17 eval "${_cachevar}=$_res"
18 unset _res
19 ])
20eval "_res=\${${_cachevar}}"
21if test "$_res" = "yes"; then
22 $2
23else
24 $3
25fi
26])
27
28dnl a macro to check if install location is in $PYTHONPATH or builtin locations
29dnl AM_CHECK_PYTHONPATH([ACTION-YES [, ACTION-NO]])
30dnl defines PYTHONPATH_CORRECT=yes/no
31AC_DEFUN([AM_CHECK_PYTHONPATH],
32[AC_REQUIRE([AM_PATH_PYTHON])
33
34_orig_exec_prefix="$exec_prefix"
35if test -z "$exec_prefix" -o "$exec_prefix" = "NONE"; then
36 exec_prefix="$prefix"
37fi
38_pythondir=`eval "echo $pythondir"`
39_pyexecdir=`eval "echo $pyexecdir"`
40exec_prefix="${_orig_exec_prefix}"
41unset _orig_exec_prefix
42
43PYTHONPATH_CORRECT=yes
44
45_CHECK_PYTHONPATH([$_pythondir],
46 [ifelse([$1], [], [:], [$1])],
47 [PYTHONPATH_CORRECT=no
48 ifelse([$2], [],
49 [AC_MSG_WARN([\$PYTHONPATH does not include $_pythondir, this may result in runtime problems with python that uses this module.])],
50 [$2])])
51
52if test "$_pythondir" != "$_pyexecdir"; then
53_CHECK_PYTHONPATH([$_pyexecdir],
54 [ifelse([$1], [], [:], [$1])],
55 [PYTHONPATH_CORRECT=no
56 ifelse([$2], [],
57 [AC_MSG_WARN([\$PYTHONPATH does not include $_pyexecdir, this may result in runtime problems with python that uses this module.])],
58 [$2])])
59fi
60
61unset _pythondir
62unset _pyexecdir
63])
64
65dnl a macro to check if given directory is in $PYTHONPATH or builtin locations
66dnl AM_CHECK_PYTHONPATH_CONTAINS(DIRECTORY [, ACTION-YES [, ACTION-NO]])
67dnl defines PYTHONPATH_CORRECT=yes/no
68AC_DEFUN([AM_CHECK_PYTHONPATH_CONTAINS],
69[AC_REQUIRE([AM_PATH_PYTHON])
70
71_dir="$1"
72_dir=`expr "X$_dir" : 'X\(.*[^/]\)' \| "X$_dir" : 'X\(.*\)'`
73
74_CHECK_PYTHONPATH([$_dir],
75 [ifelse([$2], [], [:], [$2])],
76 [ifelse([$3], [],
77 [AC_MSG_WARN([\$PYTHONPATH does not include $_dir, this may result in runtime problems with python that uses this module.])],
78 [$3])])
79
80unset _dir
81])
diff --git a/python-ethumb.pc.in b/python-ethumb.pc.in
new file mode 100644
index 0000000..47b202c
--- /dev/null
+++ b/python-ethumb.pc.in
@@ -0,0 +1,12 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4datarootdir=@datarootdir@
5datadir=@datarootdir@/@PACKAGE@
6pythondir=@pythondir@
7pyexecdir=@pyexecdir@
8
9Name: @PACKAGE@
10Description: Python bindings for Ethumb
11@pkgconfig_requires_private@: @pkgconfig_ethumb_requires_libs@
12Version: @VERSION@
diff --git a/python-ethumb_client.pc.in b/python-ethumb_client.pc.in
new file mode 100644
index 0000000..5ec56a1
--- /dev/null
+++ b/python-ethumb_client.pc.in
@@ -0,0 +1,12 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4datarootdir=@datarootdir@
5datadir=@datarootdir@/python-ethumb
6pythondir=@pythondir@
7pyexecdir=@pyexecdir@
8
9Name: Python Ethumb Client
10Description: Python bindings for Ethumb Client
11@pkgconfig_requires_private@: @pkgconfig_ethumb_client_requires_libs@
12Version: @VERSION@