[packages/rethinkdb] omit shell wrappers, install .py scripts directly with shebang

glen glen at pld-linux.org
Wed Aug 28 20:54:19 CEST 2013


commit 7285179acb3022ea1372057e91434391b68fee06
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Aug 28 21:53:41 2013 +0300

    omit shell wrappers, install .py scripts directly with shebang

 rethinkdb.spec | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/rethinkdb.spec b/rethinkdb.spec
index 7f93cd7..9e92241 100644
--- a/rethinkdb.spec
+++ b/rethinkdb.spec
@@ -20,6 +20,7 @@ BuildRequires:	npm
 BuildRequires:	openssl-devel
 BuildRequires:	protobuf-devel
 #BuildRequires:	python-pip
+BuildRequires:	sed >= 4.0
 BuildRequires:	v8-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -31,6 +32,8 @@ administration.
 %prep
 %setup -q
 
+%{__sed} -i -e '1s,^#!.*python,#!%{__python},' scripts/backup/*.py
+
 %build
 CXX="%{__cxx}"
 if [ "$CXX" != "${CXX#ccache }" ]; then
@@ -60,6 +63,12 @@ rm -rf $RPM_BUILD_ROOT
 	STRIP_ON_INSTALL=0 \
 	DESTDIR=$RPM_BUILD_ROOT
 
+# omit the .py suffix, invoke tools directly without shell wrapper
+for a in $RPM_BUILD_ROOT%{_bindir}/rethinkdb-*.py; do
+	f=${a%.py}
+	mv -f $a $f
+done
+
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/etc/bash_completion.d/rethinkdb.bash
 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}/copyright
 
@@ -76,13 +85,9 @@ install -d $RPM_BUILD_ROOT/var/lib/rethinkdb/instances.d
 %attr(754,root,root) /etc/rc.d/init.d/rethinkdb
 %attr(755,root,root) %{_bindir}/rethinkdb
 %attr(755,root,root) %{_bindir}/rethinkdb-dump
-%attr(755,root,root) %{_bindir}/rethinkdb-dump.py
 %attr(755,root,root) %{_bindir}/rethinkdb-export
-%attr(755,root,root) %{_bindir}/rethinkdb-export.py
 %attr(755,root,root) %{_bindir}/rethinkdb-import
-%attr(755,root,root) %{_bindir}/rethinkdb-import.py
 %attr(755,root,root) %{_bindir}/rethinkdb-restore
-%attr(755,root,root) %{_bindir}/rethinkdb-restore.py
 %{_mandir}/man1/rethinkdb.1*
 
 /etc/bash_completion.d/rethinkdb.bash
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rethinkdb.git/commitdiff/7285179acb3022ea1372057e91434391b68fee06



More information about the pld-cvs-commit mailing list