[rubygem-pg] Removed/fixed shebang in non-executables. Removed sources.

Vít Ondruch vondruch at fedoraproject.org
Fri Jun 3 14:40:08 UTC 2011


commit 3916c5aa6709aed7fadfb07d81723b256ac2447b
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Tue May 31 11:55:01 2011 +0200

    Removed/fixed shebang in non-executables.
    Removed sources.

 rubygem-pg.spec |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/rubygem-pg.spec b/rubygem-pg.spec
index 04000c1..95c5780 100644
--- a/rubygem-pg.spec
+++ b/rubygem-pg.spec
@@ -7,7 +7,7 @@
 Summary: A Ruby interface to the PostgreSQL RDBMS
 Name: rubygem-%{gemname}
 Version: 0.11.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Development/Languages
 # License is not that clear: https://bitbucket.org/ged/ruby-pg/issue/72/
 License: (GPLv2 or Ruby) and BSD
@@ -51,8 +51,21 @@ mkdir -p %{buildroot}%{gemdir}
 cp -a .%{gemdir}/* \
         %{buildroot}%{gemdir}/
 
-# Remove all build leftovers.
-rm %{buildroot}%{geminstdir}/ext/*.{so,o,log}
+# Remove the binary extension sources and build leftovers.
+rm -rf %{buildroot}%{geminstdir}/ext
+
+# Remove useless shebangs.
+sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{geminstdir}/lib/pg.rb
+sed -i -e '/^#!rake/d' %{buildroot}%{geminstdir}/Rakefile
+sed -i -e '/^#!rake/d' %{buildroot}%{geminstdir}/Rakefile.local
+
+# Fix spec shebangs.
+# https://bitbucket.org/ged/ruby-pg/issue/74/
+for file in `find %{buildroot}%{geminstdir}/spec -type f ! -perm /a+x -name "*.rb"`; do
+    [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] \
+        && sed -i -e 's/^#!\/usr\/bin\/env spec/#!\/usr\/bin\/env rspec/' $file \
+        && chmod -v 755 $file
+done
 
 %check
 pushd .%{geminstdir}
@@ -64,7 +77,6 @@ popd
 %doc %{geminstdir}/BSD
 %doc %{geminstdir}/GPL
 %doc %{geminstdir}/LICENSE
-%{geminstdir}/ext
 %{geminstdir}/lib
 %{gemdir}/cache/%{gemname}-%{version}.gem
 %{gemdir}/specifications/%{gemname}-%{version}.gemspec
@@ -84,5 +96,9 @@ popd
 
 
 %changelog
+* Mon May 30 2011 Vít Ondruch <vondruch at redhat.com> - 0.11.0-2
+- Removed/fixed shebang in non-executables.
+- Removed sources.
+
 * Thu May 26 2011 Vít Ondruch <vondruch at redhat.com> - 0.11.0-1
 - Initial package


More information about the scm-commits mailing list