]> git.pld-linux.org Git - packages/python-charade.git/blob - python-charade.spec
71858db801f922b128d7bec2d7dacbae3d82950b
[packages/python-charade.git] / python-charade.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # build CPython 2.x module
4 %bcond_without  python3 # build CPython 3.x module
5 #
6 %define         module  charade
7 Summary:        Charade - The Universal character encoding detector for Python
8 Summary(pl.UTF-8):      Charade - uniwersalny moduł Pythona wykrywający kodowanie znaków
9 Name:           python-%{module}
10 Version:        1.0.3
11 Release:        1
12 License:        LGPL v2.1+
13 Group:          Development/Languages/Python
14 Source0:        https://pypi.python.org/packages/source/c/charade/%{module}-%{version}.tar.gz
15 # Source0-md5:  79ac701a147705c09bdce31b79dfa12e
16 URL:            https://github.com/sigmavirus24/charade
17 %if %{with python2}
18 BuildRequires:  python-modules >= 1:2.6
19 %endif
20 %if %{with python3}
21 BuildRequires:  python3-modules >= 1:3.2
22 %endif
23 BuildRequires:  rpm-pythonprov
24 BuildRequires:  rpmbuild(macros) >= 1.219
25 Requires:       python-modules >= 1:2.6
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 Charade: The Universal character encoding detector. This is a port of
31 Mark Pilgrim's excellent chardet, modified to share codebase for both
32 Python 2.x and 3.x.
33
34 This package contains module built for Python 2.x.
35
36 %description -l pl.UTF-8
37 Moduł Pythona Charade służy do automatycznego wykrywania kodowania
38 znaków. Jest to port znakomitego modułu chardet Marka Pilgrima,
39 zmodyfikowany pod kątem współdzielenia kodu między wersjami Pythona
40 2.x oraz 3.x.
41
42 Ten pakiet zawiera moduł zbudowany dla Pythona 2.x.
43
44 %package -n python3-charade
45 Summary:        Charade - The Universal character encoding detector
46 Summary(pl.UTF-8):      Charade - uniwersalny moduł Pythona wykrywający kodowanie znaków
47 Group:          Development/Languages/Python
48 Requires:       python3-modules >= 1:3.2
49
50 %description -n python3-charade
51 Charade: The Universal character encoding detector. This is a port of
52 Mark Pilgrim's excellent chardet, modified to share codebase for both
53 Python 2.x and 3.x.
54
55 This package contains module built for Python 3.x.
56
57 %description -n python3-charade -l pl.UTF-8
58 Moduł Pythona Charade służy do automatycznego wykrywania kodowania
59 znaków. Jest to port znakomitego modułu chardet Marka Pilgrima,
60 zmodyfikowany pod kątem współdzielenia kodu między wersjami Pythona
61 2.x oraz 3.x.
62
63 Ten pakiet zawiera moduł zbudowany dla Pythona 3.x.
64
65 %prep
66 %setup -q -n %{module}-%{version}
67
68 %build
69 %if %{with python2}
70 %{__python} setup.py build -b py2
71 %endif
72
73 %if %{with python3}
74 %{__python3} setup.py build -b py3
75 %endif
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79
80 %if %{with python3}
81 %{__python3} setup.py \
82         build -b py3 \
83         install \
84         --skip-build \
85         --optimize=2 \
86         --root=$RPM_BUILD_ROOT
87
88 %{__mv} $RPM_BUILD_ROOT%{_bindir}/charade{,3}
89 %endif
90
91 %if %{with python2}
92 %{__python} setup.py \
93         build -b py2 \
94         install \
95         --skip-build \
96         --optimize=2 \
97         --root=$RPM_BUILD_ROOT
98 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
99 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
100 %py_postclean
101 %endif
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %files
108 %defattr(644,root,root,755)
109 %doc HISTORY.rst README.rst
110 %attr(755,root,root) %{_bindir}/charade
111 %{py_sitescriptdir}/%{module}
112 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
113 %endif
114
115 %if %{with python3}
116 %files -n python3-charade
117 %defattr(644,root,root,755)
118 %doc HISTORY.rst README.rst
119 %attr(755,root,root) %{_bindir}/charade3
120 %{py3_sitescriptdir}/%{module}
121 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
122 %endif
This page took 0.063366 seconds and 2 git commands to generate.