rpms/rubygem-extlib/devel rubygem-extlib.spec,1.1,1.2

Matthew Kent mkent at fedoraproject.org
Fri Oct 30 05:29:29 UTC 2009


Author: mkent

Update of /cvs/pkgs/rpms/rubygem-extlib/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7047

Modified Files:
	rubygem-extlib.spec 
Log Message:
* Mon Oct 29 2009 Matthew Kent <mkent at magoazul.com> - 0.9.13-5
- Provide non gem support package.



Index: rubygem-extlib.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rubygem-extlib/devel/rubygem-extlib.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- rubygem-extlib.spec	15 Oct 2009 05:43:45 -0000	1.1
+++ rubygem-extlib.spec	30 Oct 2009 05:29:28 -0000	1.2
@@ -1,4 +1,5 @@
 # Generated from extlib-0.9.13.gem by gem2rpm -*- rpm-spec -*-
+%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
 %global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
 %global gemname extlib
 %global geminstdir %{gemdir}/gems/%{gemname}-%{version}
@@ -8,7 +9,7 @@
 Summary: Support library for DataMapper and Merb
 Name: rubygem-%{gemname}
 Version: 0.9.13
-Release: 4%{?dist}
+Release: 5%{?dist}
 Group: Development/Languages
 License: MIT
 URL: http://rubyforge.org/projects/extlib/
@@ -34,6 +35,16 @@ Requires: %{name} = %{version}-%{release
 %description doc
 This package contains documentation for %{name}.
 
+%package -n ruby-%{gemname}
+Summary: Non-Gem support package for %{gemname}
+Group: Development/Languages
+
+Requires: %{name} = %{version}-%{release}
+Provides: ruby(%{gemname}) = %{version}-%{release}
+
+%description -n ruby-%{gemname}
+This package provides non-Gem support for %{gemname}.
+
 %prep
 %setup -q -c -T
 
@@ -58,6 +69,56 @@ find %{buildroot}%{geminstdir}/{Rakefile
 find %{buildroot}%{geminstdir}/{Rakefile,lib,spec} -type f | \
   xargs chmod 0644
 
+# Provide non-gem support. Thanks rubygem-json!
+create_symlink_rec(){
+
+ORIGBASEDIR=$1
+TARGETBASEDIR=$2
+
+## First calculate relative path of ORIGBASEDIR 
+## from TARGETBASEDIR
+TMPDIR=$TARGETBASEDIR
+BACKDIR=
+DOWNDIR=
+num=0
+nnum=0
+while true
+do
+        num=$((num+1))
+        TMPDIR=$(echo $TMPDIR | %{__sed} -e 's|/[^/][^/]*$||')
+        DOWNDIR=$(echo $ORIGBASEDIR | %{__sed} -e "s|^$TMPDIR||")
+        if [ x$DOWNDIR != x$ORIGBASEDIR ]
+        then
+                nnum=0
+                while [ $nnum -lt $num ]
+                do
+                        BACKDIR="../$BACKDIR"
+                        nnum=$((nnum+1))
+                done
+                break
+        fi
+done
+
+RELBASEDIR=$( echo $BACKDIR/$DOWNDIR | %{__sed} -e 's|//*|/|g' )
+
+## Next actually create symlink
+pushd %{buildroot}/$ORIGBASEDIR
+find . -type f | while read f
+do
+        DIRNAME=$(dirname $f)
+        BACK2DIR=$(echo $DIRNAME | %{__sed} -e 's|/[^/][^/]*|/..|g')
+        %{__mkdir_p} %{buildroot}${TARGETBASEDIR}/$DIRNAME
+        LNNAME=$(echo $BACK2DIR/$RELBASEDIR/$f | \
+                %{__sed} -e 's|^\./||' | %{__sed} -e 's|//|/|g' | \
+                %{__sed} -e 's|/\./|/|' )
+        %{__ln_s} -f $LNNAME %{buildroot}${TARGETBASEDIR}/$f
+done
+popd
+
+}
+
+create_symlink_rec %{geminstdir}/lib %{ruby_sitelib}
+
 %clean
 rm -rf %{buildroot}
 
@@ -81,7 +142,15 @@ rake spec || :
 %{geminstdir}/spec
 %{gemdir}/doc/%{gemname}-%{version}
 
+%files -n ruby-%{gemname}
+%defattr(-,root,root,-)
+%{ruby_sitelib}/%{gemname}
+%{ruby_sitelib}/%{gemname}.rb
+
 %changelog
+* Mon Oct 29 2009 Matthew Kent <mkent at magoazul.com> - 0.9.13-5
+- Provide non gem support package.
+
 * Mon Oct 5 2009 Matthew Kent <mkent at magoazul.com> - 0.9.13-4
 - Remove redundant doc Requires on rubygems.
 




More information about the fedora-extras-commits mailing list