]>
Commit | Line | Data |
---|---|---|
bfb698a3 ER |
1 | %define module gflags |
2 | Summary: Commandline flags module for Python | |
03123136 | 3 | Summary(pl.UTF-8): Moduł flag linii poleceń dla Pythona |
bfb698a3 | 4 | Name: python-%{module} |
4e2de2ad | 5 | Version: 2.0 |
285b5b26 | 6 | Release: 2 |
bfb698a3 ER |
7 | License: BSD |
8 | Group: Development/Languages/Python | |
03123136 JB |
9 | #Source0Download: http://code.google.com/p/python-gflags/downloads/list |
10 | Source0: http://python-gflags.googlecode.com/files/%{name}-%{version}.tar.gz | |
4e2de2ad | 11 | # Source0-md5: c3ab70218dbf945cc32c0cd64c51d162 |
bfb698a3 | 12 | URL: http://code.google.com/p/python-gflags/ |
bfb698a3 ER |
13 | BuildRequires: python-devel |
14 | BuildRequires: python-distribute | |
15 | BuildRequires: rpmbuild(macros) >= 1.219 | |
16 | BuildRequires: sed >= 4.0 | |
17 | BuildArch: noarch | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
20 | %description | |
03123136 | 21 | This project is the Python equivalent of google-gflags, a Google |
bfb698a3 ER |
22 | commandline flag implementation for C++. It is intended to be used in |
23 | situations where a project wants to mimic the command-line flag | |
24 | handling of a C++ app that uses google-gflags, or for a Python app | |
25 | that, via swig or some other means, is linked with a C++ app that uses | |
26 | google-gflags. | |
27 | ||
28 | The gflags package contains a library that implements commandline | |
29 | flags processing. As such it's a replacement for getopt(). It has | |
30 | increased flexibility, including built-in support for Python types, | |
31 | and the ability to define flags in the source file in which they're | |
32 | used. (This last is its major difference from OptParse.) | |
33 | ||
03123136 JB |
34 | %description -l pl.UTF-8 |
35 | Ten projekt jest pythonowym odpowiednikiem google-gflags - | |
36 | implementacji C++ flag linii poleceń autorstwa Google. Jego | |
37 | zastosowaniem są projekty, które mają naśladować obsługę flag linii | |
38 | poleceń aplikacji C++ wykorzystujących google-gflags oraz aplikacje | |
39 | Pythona, które poprzez swig lub w inny sposób są zlinkowane z | |
40 | aplikacją C++ wykorzystującą google-gflags. | |
41 | ||
42 | Pakiet gflags zawiera bibliotekę implementującą przetwarzanie flag | |
43 | linii poleceń. Jako taka jest zamiennikiem getopt(). Ma większą | |
44 | elastyczność, w tym wbudowaną obsługę typów pythonowych oraz możliwość | |
45 | definiowania flag w plikach źródłowych, w których są używane (to | |
46 | ostatnie to główna różnica względem OptParse). | |
47 | ||
bfb698a3 ER |
48 | %prep |
49 | %setup -q | |
50 | # Fix non-executable-script error | |
4e2de2ad | 51 | %{__sed} -i '/^#!\%{_prefix}\/bin\/env python$/,+1 d' %{module}.py |
bfb698a3 ER |
52 | |
53 | %build | |
54 | %{__python} setup.py build | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | %{__python} setup.py install \ | |
59 | --skip-build \ | |
60 | --optimize=2 \ | |
61 | --root=$RPM_BUILD_ROOT | |
62 | ||
63 | %py_postclean | |
64 | ||
65 | # Remove ext from name | |
285b5b26 | 66 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/gflags2man.py $RPM_BUILD_ROOT%{_bindir}/gflags2man |
bfb698a3 ER |
67 | |
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc AUTHORS ChangeLog COPYING README | |
74 | %attr(755,root,root) %{_bindir}/gflags2man | |
75 | %{py_sitescriptdir}/%{module}.py[co] | |
76 | %{py_sitescriptdir}/%{module}_validators.py[co] | |
bfb698a3 | 77 | %{py_sitescriptdir}/python_gflags-%{version}-py*.egg-info |