rubygem-iconv.spec 2.48 KB
Newer Older
mh's avatar
mh committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Generated from iconv-1.0.4.gem by gem2rpm -*- rpm-spec -*-
%global gem_name iconv

Name: rubygem-%{gem_name}
Version: 1.0.8
Release: 1%{?dist}
Summary: iconv wrapper library
Group: Development/Languages
License: BSDL
URL: https://github.com/nurse/iconv
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: rubygems-devel
BuildRequires: ruby(release)
BuildRequires: ruby
BuildRequires: ruby-devel

%description
iconv wrapper library

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

%description doc
Documentation for %{name}.

%prep
%setup -q -c -T
%gem_install -n %{SOURCE0}


%build

%install
mkdir -p %{buildroot}%{gem_dir}
mh's avatar
mh committed
38
mkdir -p %{buildroot}%{gem_extdir_mri}
mh's avatar
mh committed
39
40

cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/
mh's avatar
mh committed
41

mh's avatar
mh committed
42
if [ -d .%{gem_extdir_mri}/%{gem_name} ]; then
mh's avatar
mh committed
43
44
45
46
47
48
49
  cp -a .%{gem_extdir_mri}/{gem.build_complete,%{gem_name}} %{buildroot}%{gem_extdir_mri}

  mkdir -p %{buildroot}%{ruby_libdir}
  mkdir -p %{buildroot}%{ruby_libarchdir}
  ln -s %{gem_libdir}/%{gem_name}.rb %{buildroot}%{ruby_libdir}/%{gem_name}.rb
  ln -s %{gem_libdir}/%{gem_name} %{buildroot}%{ruby_libdir}/%{gem_name}
  ln -s %{gem_extdir_mri}/%{gem_name}/ %{buildroot}%{ruby_libarchdir}/%{gem_name}
mh's avatar
mh committed
50
51
else
  mkdir -p %{buildroot}%{gem_extdir_mri}/lib/%{gem_name}
mh's avatar
mh committed
52
  cp -a %{buildroot}%{gem_libdir}/%{gem_name}/*.so %{buildroot}%{gem_extdir_mri}/lib/%{gem_name}
mh's avatar
mh committed
53
fi
mh's avatar
mh committed
54
55
56
57
58
59
60
61
62
63
64
65

# Remove the binary extension sources and build leftovers.
rm -rf %{buildroot}%{gem_instdir}/ext

# Fix spec shebangs.
# https://bitbucket.org/ged/ruby-pg/issue/74/
for file in `find %{buildroot}%{gem_instdir}/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

mh's avatar
mh committed
66
find %{buildroot}%{gem_instdir} -name \*.rb -print0 | xargs --null chmod 0644
mh's avatar
mh committed
67
68
69
70
71
72
73
74
75
76
77

%check
#pushd .%{gem_instdir}
#tar xzvf %{SOURCE1}
#rspec spec
#popd

%files
%dir %{gem_instdir}
%{gem_libdir}
%{gem_extdir_mri}
mh's avatar
mh committed
78
79
%{ruby_libdir}/%{gem_name}*
%{ruby_libarchdir}/%{gem_name}*
mh's avatar
mh committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
%exclude %{gem_cache}
%{gem_spec}
%{gem_instdir}/%{gem_name}.gemspec
%license %{gem_instdir}/LICENSE.txt
%license %{gem_instdir}/BSDL
%exclude %{gem_instdir}/.gitignore
%exclude %{gem_instdir}/.travis.yml

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/Gemfile*
%{gem_instdir}/Rakefile
%{gem_instdir}/test


%changelog
* Wed Sep 23 2015 mh <mh@immerda.ch> - 1.0.4-1
- Initial package