]> git.pld-linux.org Git - projects/template-specs.git/commitdiff
update shebang also for py2 packages; update examples dir to be similar to py3
authorElan Ruusamäe <glen@delfi.ee>
Fri, 20 May 2016 12:39:24 +0000 (15:39 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 20 May 2016 12:39:24 +0000 (15:39 +0300)
python.spec

index d588fa9a7ba4147f63c9b2b5930bf82fc931831e..5106664513e257c4bcc78df67487272f9af9c7e1 100644 (file)
@@ -108,8 +108,10 @@ rm -rf $RPM_BUILD_ROOT
 
 # 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}
@@ -126,10 +128,8 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
 %{py_sitescriptdir}/%{module}
-%if "%{py_ver}" > "2.4"
 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
-%endif
-%{_examplesdir}/%{name}-%{version}
+%{_examplesdir}/python-%{module}-%{version}
 %endif
 
 %if %{with python3}
This page took 0.116977 seconds and 4 git commands to generate.