]> git.pld-linux.org Git - projects/template-specs.git/blobdiff - python-ext.spec
dokuwiki: cleanup tests
[projects/template-specs.git] / python-ext.spec
index 1f8fe0b21a2895b9afb38cd303b9feb667c5b353..0e845e20a609e222aa94804ca1eaffb244f2e1c8 100644 (file)
@@ -11,7 +11,7 @@
 %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
@@ -23,7 +23,7 @@ Source0:      https://pypi.python.org/packages/source/M/MODULE/%{module}-%{version}.t
 URL:           -
 BuildRequires: rpm-pythonprov
 # for the py_build, py_install macros
-BuildRequires: rpmbuild(macros) >= 1.713
+BuildRequires: rpmbuild(macros) >= 1.714
 %if %{with python2}
 BuildRequires: python-devel
 #BuildRequires:        python-setuptools
@@ -86,10 +86,8 @@ rm -rf _build/html/_sources
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 %if %{with python2}
 %py_install
-
 %py_postclean
 %endif
 
@@ -97,10 +95,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,9 +118,7 @@ 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
 
This page took 0.027569 seconds and 4 git commands to generate.