]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | %bcond_without doc # don't build ri/rdoc | |
5 | ||
6 | %define pkgname RMagick | |
7 | Summary: Graphics Processing library for Ruby | |
8 | Summary(pl.UTF-8): Biblioteka przetwarzania grafiki dla języka Ruby | |
9 | Name: ruby-%{pkgname} | |
10 | Version: 2.16.0 | |
11 | Release: 3 | |
12 | License: Ruby-alike | |
13 | Group: Development/Languages | |
14 | Source0: http://rubygems.org/downloads/rmagick-%{version}.gem | |
15 | # Source0-md5: d03bb84d342b0a78f9c6262acb451dc8 | |
16 | Patch0: no-gem.patch | |
17 | Patch1: disable-tests.patch | |
18 | Patch2: no-git.patch | |
19 | Patch3: magick6.patch | |
20 | URL: https://github.com/gemhome/rmagick | |
21 | BuildRequires: ImageMagick6-devel >= 1:6.7.0.7-2 | |
22 | BuildRequires: ruby-test-unit | |
23 | BuildRequires: gmp-devel | |
24 | BuildRequires: rpm-rubyprov | |
25 | BuildRequires: rpmbuild(macros) >= 1.484 | |
26 | BuildRequires: ruby >= 1:1.8.6 | |
27 | BuildRequires: ruby-devel | |
28 | BuildRequires: ruby-modules | |
29 | BuildRequires: ruby-rake | |
30 | BuildRequires: ruby-rake-compiler | |
31 | BuildRequires: ruby-simplecov | |
32 | BuildRequires: ruby-rspec-core | |
33 | BuildRequires: ruby-rspec-expectations | |
34 | BuildRequires: ruby-rspec-mocks | |
35 | %if %{with tests} | |
36 | BuildRequires: ImageMagick6-coder-dot | |
37 | BuildRequires: ImageMagick6-coder-fpx | |
38 | BuildRequires: ImageMagick6-coder-jbig | |
39 | BuildRequires: ImageMagick6-coder-jpeg | |
40 | BuildRequires: ImageMagick6-coder-jpeg2 | |
41 | BuildRequires: ImageMagick6-coder-miff | |
42 | BuildRequires: ImageMagick6-coder-mpr | |
43 | BuildRequires: ImageMagick6-coder-pdf | |
44 | BuildRequires: ImageMagick6-coder-png | |
45 | BuildRequires: ImageMagick6-coder-ps2 | |
46 | BuildRequires: ImageMagick6-coder-svg | |
47 | BuildRequires: ImageMagick6-coder-tiff | |
48 | BuildRequires: ImageMagick6-coder-url | |
49 | BuildRequires: ImageMagick6-coder-wmf | |
50 | %endif | |
51 | %if %{with doc} | |
52 | BuildRequires: ruby-rdoc | |
53 | %endif | |
54 | BuildConflicts: ruby-RMagick < 1.7.2 | |
55 | %requires_ge_to ImageMagick6-libs ImageMagick6-devel | |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
58 | %description | |
59 | An interface to the ImageMagick and GraphicsMagick image processing | |
60 | libraries. Supports more than 80 image formats, including GIF, JPEG, | |
61 | PNG. Includes 2D drawing API. Comprehensive HTML documentation. | |
62 | ||
63 | %description -l pl.UTF-8 | |
64 | Jest to interfejs do bibliotek przetwarzania grafiki ImageMagick i | |
65 | GraphicsMagick. Obsługuje ponad 80 formatów graficznych, włączając w | |
66 | to GIF, JPEG, PNG. Zawiera API dla dwuwymiarowego rysowania. Obszerna | |
67 | dokumentacja w HTML-u. | |
68 | ||
69 | %package rdoc | |
70 | Summary: HTML documentation for Ruby %{pkgname} module | |
71 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname} | |
72 | Group: Documentation | |
73 | Requires: ruby >= 1:1.8.7-4 | |
74 | %if "%{_rpmversion}" >= "5" | |
75 | BuildArch: noarch | |
76 | %endif | |
77 | ||
78 | %description rdoc | |
79 | HTML documentation for Ruby %{pkgname} module. | |
80 | ||
81 | %description rdoc -l pl.UTF-8 | |
82 | Dokumentacja w formacie HTML dla modułu języka Ruby %{pkgname}. | |
83 | ||
84 | %package ri | |
85 | Summary: ri documentation for Ruby %{pkgname} module | |
86 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname} | |
87 | Group: Documentation | |
88 | Requires: ruby | |
89 | %if "%{_rpmversion}" >= "5" | |
90 | BuildArch: noarch | |
91 | %endif | |
92 | ||
93 | %description ri | |
94 | ri documentation for Ruby %{pkgname} module. | |
95 | ||
96 | %description ri -l pl.UTF-8 | |
97 | Dokumentacja w formacie ri dla modułu języka Ruby %{pkgname}. | |
98 | ||
99 | %prep | |
100 | %setup -q -n %{pkgname}-%{version} | |
101 | %patch0 -p1 | |
102 | %patch1 -p1 | |
103 | %patch2 -p1 | |
104 | %patch3 -p1 | |
105 | ||
106 | %{__rm} spec/rmagick/draw_spec.rb | |
107 | ||
108 | %build | |
109 | # write .gemspec | |
110 | %__gem_helper spec | |
111 | ||
112 | # make gemspec self-contained | |
113 | ruby -r rubygems -e 'spec = eval(File.read("rmagick.gemspec")) | |
114 | File.open("%{pkgname}-%{version}.gemspec", "w") do |file| | |
115 | file.puts spec.to_ruby_for_cache | |
116 | end' #' | |
117 | ||
118 | rake compile \ | |
119 | CC="%{__cc}" \ | |
120 | LDFLAGS="%{rpmldflags}" \ | |
121 | CFLAGS="%{rpmcflags} -fPIC" | |
122 | ||
123 | %if %{with tests} | |
124 | rake spec | |
125 | rake test | |
126 | %endif | |
127 | ||
128 | %if %{with doc} | |
129 | rdoc --ri --op ri ext/RMagick lib | |
130 | rdoc --op rdoc ext/RMagick lib | |
131 | %{__rm} ri/created.rid | |
132 | %endif | |
133 | ||
134 | %install | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir},%{ruby_specdir},%{ruby_rdocdir}/%{name}-%{version},%{_examplesdir}/%{name}-%{version}} | |
137 | ||
138 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
139 | %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/RMagick2.so | |
140 | ||
141 | # install ext | |
142 | install -p lib/RMagick2.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} | |
143 | ||
144 | %if %{with doc} | |
145 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} | |
146 | cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
147 | %endif | |
148 | ||
149 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
150 | ||
151 | # install gemspec | |
152 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
153 | ||
154 | %clean | |
155 | rm -rf $RPM_BUILD_ROOT | |
156 | ||
157 | %files | |
158 | %defattr(644,root,root,755) | |
159 | %doc doc CHANGELOG.md LICENSE README.textile | |
160 | %{ruby_vendorlibdir}/rmagick | |
161 | %{ruby_vendorlibdir}/rmagick*.rb | |
162 | %{ruby_vendorlibdir}/rvg | |
163 | %attr(755,root,root) %{ruby_vendorarchdir}/RMagick2.so | |
164 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec | |
165 | %{_examplesdir}/%{name}-%{version} | |
166 | ||
167 | %if %{with doc} | |
168 | %files rdoc | |
169 | %defattr(644,root,root,755) | |
170 | %{ruby_rdocdir}/%{name}-%{version} | |
171 | ||
172 | %files ri | |
173 | %defattr(644,root,root,755) | |
174 | %{ruby_ridir}/Magick | |
175 | %{ruby_ridir}/RMagick | |
176 | %endif |