aboutsummaryrefslogtreecommitdiffstats
path: root/build.macros.in
diff options
context:
space:
mode:
Diffstat (limited to 'build.macros.in')
-rw-r--r--build.macros.in35
1 files changed, 19 insertions, 16 deletions
diff --git a/build.macros.in b/build.macros.in
index 1488f3f..2b81ec3 100644
--- a/build.macros.in
+++ b/build.macros.in
@@ -480,22 +480,25 @@ popd
# Ruby gem macros
#
-%__gem_helper @RPMVENDORDIR@/gem_helper.rb
-
-%gem_build(f:j:) \
- export LC_CTYPE=UTF-8 \
- %__gem_helper build \\\
- %{-f:-f%{-f*}} \\\
- %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
-
-%gem_install(i:n:C) \
- export LC_CTYPE=UTF-8 \
- DESTDIR=${DESTDIR:-%{buildroot}} \\\
- %__gem_helper install \\\
- --env-shebang --rdoc --ri --force --ignore-dependencies \\\
- %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\
- %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\
- %{!-C:--fix-permissions}
+%__ruby_module_name %{?oname}%{!?oname: %(echo %{name}|cut -d\- -f2-)}
+
+%gem_build \
+ if [ ! -f %{__ruby_module_name}.gemspec ]; then \
+ %{_bindir}/gem specification -l --ruby %{SOURCE0} > %{__ruby_module_name}.gemspec \
+ fi \
+ %{_bindir}/gem build %{__ruby_module_name}.gemspec
+
+%gem_install \
+ %{_bindir}/gem install %{__ruby_module_name}-%{version}.gem --local \\\
+ --env-shebang --rdoc --ri --force --ignore-dependencies \\\
+ --install-dir %{buildroot}%{ruby_gemdir} \\\
+ --bindir %{buildroot}%{_bindir} \
+ rm -fr %{buildroot}%{ruby_gemdir}/{cache,gems/%{__ruby_module_name}-%{version}/ext,gems/%{__ruby_module_name}-%{version}/%{__ruby_module_name}.gemspec} \
+ find %{buildroot}%{ruby_gemdir}/gems/%{__ruby_module_name}-%{version} -maxdepth 1 -type f -delete \
+ if [ -f %{buildroot}%{ruby_gemdir}/gems/%{__ruby_module_name}-%{version}/lib/*.so ]; then \
+ mkdir -p %{buildroot}%{ruby_sitearchdir} \
+ mv %{buildroot}%{ruby_gemdir}/gems/%{__ruby_module_name}-%{version}/lib/*.so %{buildroot}%{ruby_sitearchdir}/ \
+ fi
#------------------------------------------------------------------------------
# Systemd and general service related macros