[packages/python-power] - initial
arekm
arekm at pld-linux.org
Thu May 14 23:06:13 CEST 2015
commit 73f66065403ecb32a31a28eb6c12da06a7404e2f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu May 14 23:05:59 2015 +0200
- initial
python-power.spec | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 101 insertions(+)
---
diff --git a/python-power.spec b/python-power.spec
new file mode 100644
index 0000000..65feb21
--- /dev/null
+++ b/python-power.spec
@@ -0,0 +1,101 @@
+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+%define module power
+Summary: Cross-platform system power status information
+Name: python-%{module}
+Version: 1.4
+Release: 1
+License: MIT
+Group: Libraries/Python
+Source0: https://pypi.python.org/packages/source/p/power/power-%{version}.tar.gz
+# Source0-md5: 7346e84338da5478c598c5639a484070
+URL: https://github.com/Kentzo/Power
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.219
+%if %{with python2}
+BuildRequires: python-devel
+BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-modules
+BuildRequires: python3-setuptools
+%endif
+Requires: python-modules
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Python module that allows you to get power and battery status of the
+system.
+
+%package -n python3-%{module}
+Summary: Cross-platform system power status information
+Group: Libraries/Python
+Requires: python3-modules
+
+%description -n python3-%{module}
+Python module that allows you to get power and battery status of the
+system.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%if %{with doc}
+cd docs
+%{__make} -j1 html
+rm -rf _build/html/_sources
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%{__python} setup.py \
+ build --build-base build-2 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+ build --build-base build-3 \
+ install --skip-build \
+ --optimize=2 \
+ --root=$RPM_BUILD_ROOT
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%{py_sitescriptdir}/%{module}
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-power.git/commitdiff/73f66065403ecb32a31a28eb6c12da06a7404e2f
More information about the pld-cvs-commit
mailing list