+# write .gemspec
+%__gem_helper spec
+
+# make gemspec self-contained
+ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
+ File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
+ file.puts spec.to_ruby_for_cache
+end'
+
+#'
+
+# binary pkgs:
+cd ext/%{pkgname}
+%{__ruby} extconf.rb
+%{__make} \
+ CC="%{__cc}" \
+ LDFLAGS="%{rpmldflags}" \
+ CFLAGS="%{rpmcflags} -fPIC"
+
+# with rdoc/ri:
+# optional locale force, see BR above as well
+# UTF8 locale needed for doc generation
+#export LC_ALL=en_US.UTF-8
+