]> git.pld-linux.org Git - packages/python-power.git/blob - python-power.spec
3f28120b45032402362ca33af61f8c37c86ed02c
[packages/python-power.git] / python-power.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  power
8 Summary:        Cross-platform system power status information
9 Name:           python-%{module}
10 Version:        1.4
11 Release:        7
12 License:        MIT
13 Group:          Libraries/Python
14 Source0:        https://pypi.python.org/packages/source/p/power/power-%{version}.tar.gz
15 # Source0-md5:  7346e84338da5478c598c5639a484070
16 URL:            https://github.com/Kentzo/Power
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.710
19 %if %{with python2}
20 BuildRequires:  python-devel
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-devel
25 BuildRequires:  python3-modules
26 BuildRequires:  python3-setuptools
27 %endif
28 Requires:       python-modules
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 Python module that allows you to get power and battery status of the
34 system.
35
36 %package -n python3-%{module}
37 Summary:        Cross-platform system power status information
38 Group:          Libraries/Python
39 Requires:       python3-modules
40
41 %description -n python3-%{module}
42 Python module that allows you to get power and battery status of the
43 system.
44
45 %prep
46 %setup -q -n %{module}-%{version}
47
48 %build
49 %if %{with python2}
50 %py_build %{?with_tests:test}
51 %endif
52
53 %if %{with python3}
54 %py3_build %{?with_tests:test}
55 %endif
56
57 %if %{with doc}
58 cd docs
59 %{__make} -j1 html
60 rm -rf _build/html/_sources
61 %endif
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65
66 %if %{with python2}
67 %py_install
68
69 %py_postclean
70 %endif
71
72 %if %{with python3}
73 %py3_install
74 %endif
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{with python2}
80 %files
81 %defattr(644,root,root,755)
82 %{py_sitescriptdir}/%{module}
83 %if "%{py_ver}" > "2.4"
84 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
85 %endif
86 %endif
87
88 %if %{with python3}
89 %files -n python3-%{module}
90 %defattr(644,root,root,755)
91 %{py3_sitescriptdir}/%{module}
92 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
93 %endif
This page took 0.040277 seconds and 2 git commands to generate.