]> git.pld-linux.org Git - projects/template-specs.git/blobdiff - python-ext.spec
- updated URLs, noarch apidocs
[projects/template-specs.git] / python-ext.spec
index 4e6144bb94f002ba527155c0e8f1bfe2133b6899..bc9bf398dfbb13260bdea2512c33ba5c76f42c90 100644 (file)
 %define        module  template
 Summary:       -
 Summary(pl.UTF-8):     -
-# Name must match the python module/package name (as in 'import' statement)
+# Name must match the python module/package name (as on pypi or in 'import' statement)
 Name:          python-%{module}
 Version:       _
 Release:       0.1
 License:       - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
 Group:         Libraries/Python
-Source0:       https://pypi.python.org/packages/source/M/MODULE/%{module}-%{version}.tar.gz
+# if pypi:
+#Source0Download: https://pypi.org/simple/MODULE/
+Source0:       https://files.pythonhosted.org/packages/source/M/MODULE/%{module}-%{version}.tar.gz
 # Source0-md5: -
-#URL:          https://pypi.python.org/pypi/MODULE
+#URL:          https://pypi.org/project/MODULE/
 URL:           -
 BuildRequires: rpm-pythonprov
 # for the py_build, py_install macros
@@ -56,6 +58,9 @@ Requires:     python3-modules
 Summary:       %{module} API documentation
 Summary(pl.UTF-8):     Dokumentacja API %{module}
 Group:         Documentation
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
 
 %description apidocs
 API documentation for %{module}.
@@ -97,10 +102,11 @@ rm -rf $RPM_BUILD_ROOT
 %py3_install
 %endif
 
-# in case there are examples provided
 %if %{with python2}
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
+       | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
 %endif
 %if %{with python3}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
@@ -119,16 +125,14 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{py_sitedir}/%{module}
 %{py_sitedir}/%{module}/*.py[co]
 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
-%if "%{py_ver}" > "2.4"
 %{py_sitedir}/%{module}-%{version}-py*.egg-info
-%endif
 %{_examplesdir}/%{name}-%{version}
 %endif
 
 %if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
-%doc AUTHORS CHANGES LICENSE
+# copy %doc from python2 package here
 %dir %{py3_sitedir}/%{module}
 %{py3_sitedir}/%{module}/*.py
 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
This page took 0.068641 seconds and 4 git commands to generate.