[projects/template-specs] update shebang also for py2 packages; update examples dir to be similar to py3

glen glen at pld-linux.org
Fri May 20 14:39:26 CEST 2016


commit c7887ed10f7df2c8a8cd8e2cd4bcc60987298014
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri May 20 15:39:24 2016 +0300

    update shebang also for py2 packages; update examples dir to be similar to py3

 python.spec | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/python.spec b/python.spec
index d588fa9..5106664 100644
--- a/python.spec
+++ b/python.spec
@@ -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}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/c7887ed10f7df2c8a8cd8e2cd4bcc60987298014



More information about the pld-cvs-commit mailing list