Skip to content

Commit

Permalink
Update rubygem-radcli to support SCL
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Sep 23, 2019
1 parent 344d2f6 commit 172820d
Showing 1 changed file with 41 additions and 17 deletions.
58 changes: 41 additions & 17 deletions packages/plugins/rubygem-radcli/rubygem-radcli.spec
@@ -1,60 +1,79 @@
# template: scl
%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}

%global gem_name radcli

Name: rubygem-%{gem_name}
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 1.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A Ruby interface for the adcli library
Group: Development/Languages
License: Artistic-2.0
URL: https://github.com/martencassel/radcli
Source0: https://rubygems.org/downloads/%{gem_name}-%{version}.gem
Requires: ruby(release)
Requires: ruby
Requires: ruby(rubygems)
BuildRequires: ruby(release)
BuildRequires: ruby-devel
BuildRequires: rubygems-devel
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem

BuildRequires: %{?scl_prefix}rubygem(rake-compiler)
BuildRequires: krb5-devel
BuildRequires: openldap-devel
BuildRequires: cyrus-sasl-devel
Provides: rubygem(%{gem_name}) = %{version}

# start specfile generated dependencies
Requires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby
Requires: %{?scl_prefix_ruby}ruby(rubygems)
BuildRequires: %{?scl_prefix_ruby}ruby(release)
BuildRequires: %{?scl_prefix_ruby}ruby-devel
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
# end specfile generated dependencies

%description
The radcli library provides a Ruby interface for performing actions on
a Active Directory domain using the realmd/adcli tool library.


%package doc
Summary: Documentation for %{name}
Summary: Documentation for %{pkg_name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.
Documentation for %{pkg_name}.

%prep
%{?scl:scl enable %{scl} - << \EOF}
gem unpack %{SOURCE0}
%{?scl:EOF}
%setup -q -D -T -n %{gem_name}-%{version}
%{?scl:scl enable %{scl} - << \EOF}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%{?scl:EOF}
%build
# Create the gem as gem install only works on a gem file
%{?scl:scl enable %{scl} - << \EOF}
gem build %{gem_name}.gemspec
%{?scl:EOF}
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%{?scl:scl enable %{scl} - << \EOF}
%gem_install
%{?scl:EOF}
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%if 0%{!?scl:1}
mkdir -p %{buildroot}%{gem_extdir_mri}/lib
cp -a %{buildroot}%{gem_instdir}/lib/radcli.so %{buildroot}%{gem_extdir_mri}/lib/
%endif
# rake-compiler isn't needed on the system itself
sed -i '/rake-compiler/ s/runtime/development/' %{buildroot}/%{gem_spec}
Expand All @@ -64,24 +83,29 @@ rm -rf %{buildroot}%{gem_instdir}/ext/
%files
%dir %{gem_instdir}
%{gem_extdir_mri}
%{gem_instdir}/CHANGES
%license %{gem_instdir}/LICENSE
%{gem_instdir}/MANIFEST
%{gem_instdir}/build_adcli.sh
%exclude %{gem_instdir}/radcli.gemspec
%{gem_instdir}/scripts
%{gem_instdir}/lib
%exclude %{gem_cache}
%{gem_spec}
%exclude %{gem_instdir}/radcli.gemspec
%if 0%{!?scl:1}
%{gem_extdir_mri}
%{gem_libdir}
%endif
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/CHANGES
%{gem_instdir}/Rakefile
%{gem_instdir}/test
%changelog
* Tue Sep 17 2019 Eric D. Helms <ericdhelms@gmail.com> 1.0.0-2
- Update to support building for SCL
* Tue Jan 02 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> 1.0.0-1
- new package built with tito

0 comments on commit 172820d

Please sign in to comment.