• R/O
  • SSH

contrib-spec-files: コミット

日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。


コミットメタ情報

リビジョン10167c752ee9c1c31b40da0f4d3b7010243f2c11 (tree)
日時2015-12-08 01:46:47
作者Fumihisa TONAKA <fumi.ftnk@gmai...>
コミッターFumihisa TONAKA

ログメッセージ

SFEruby-net-sftp: bump to 2.1.2 and build packge for ruby-22 and ruby-23

変更サマリ

差分

diff -r c4ea8a3a8858 -r 10167c752ee9 specs/SFEruby-net-sftp.spec
--- a/specs/SFEruby-net-sftp.spec Sun Jun 22 17:54:38 2014 +0900
+++ b/specs/SFEruby-net-sftp.spec Tue Dec 08 01:46:47 2015 +0900
@@ -1,121 +1,344 @@
11 %include Solaris.inc
22 %include default-depend.inc
33
4-%define gemname net-sftp
5-
6-%define bindir19 /usr/ruby/1.9/bin
7-%define gemdir19 %(%{bindir19}/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
8-%define geminstdir19 %{gemdir19}/gems/%{gemname}-%{version}
9-
10-%define bindir20 /usr/ruby/2.0/bin
11-%define gemdir20 %(%{bindir20}/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
12-%define geminstdir20 %{gemdir20}/gems/%{gemname}-%{version}
4+%define build19 %( if [ -x /usr/ruby/1.9/bin/ruby ]; then echo '1'; else echo '0'; fi)
5+%define build20 %( if [ -x /usr/ruby/2.0/bin/ruby ]; then echo '1'; else echo '0'; fi)
6+%define build21 %( if [ -x /usr/ruby/2.1/bin/ruby ]; then echo '1'; else echo '0'; fi)
7+%define build22 %( if [ -x /usr/ruby/2.2/bin/ruby ]; then echo '1'; else echo '0'; fi)
8+%define build23 %( if [ -x /usr/ruby/2.3/bin/ruby ]; then echo '1'; else echo '0'; fi)
9+%define generate_executable 0
10+%define keep_dependency 1
1311
14-%define bindir21 /usr/ruby/2.1/bin
15-%define gemdir21 %(%{bindir21}/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
16-%define geminstdir21 %{gemdir21}/gems/%{gemname}-%{version}
12+%define gemname net-sftp
13+%define sfe_gemname net-sftp
1714
18-Summary: A pure Ruby implementation of the SFTP client protocol
19-Name: SFEruby-%{gemname}
20-IPS_package_name: library/ruby-21/net-sftp
21-Version: 2.1.1
22-License: MIT License
23-URL: http://rubygems.org/gems/%{gemname}
24-Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem
25-BuildRoot: %{_tmppath}/%{name}-%{version}-build
15+Summary: A pure Ruby implementation of the SFTP client protocol
16+Name: SFEruby-%{sfe_gemname}
17+IPS_package_name: library/ruby/%{gemname}
18+Version: 2.1.2
19+License: MIT
20+URL: https://github.com/net-ssh/net-sftp
21+Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem
22+BuildRoot: %{_tmppath}/%{name}-%{version}-build
2623
27-BuildRequires: runtime/ruby-21
28-Requires: runtime/ruby-21 = *
29-Requires: library/ruby-21/net-ssh
24+
3025
3126 %description
3227 A pure Ruby implementation of the SFTP client protocol
3328
29+%if %{build19}
30+%if %{keep_dependency}
31+%package 19-old
32+IPS_package_name: library/ruby-19/%{gemname}
33+Summary: A pure Ruby implementation of the SFTP client protocol
34+BuildRequires: runtime/ruby-19 = *
35+Requires: runtime/ruby-19 = *
36+Requires: library/ruby/%{gemname}-19
37+
38+%description 19-old
39+A pure Ruby implementation of the SFTP client protocol
40+%endif
41+
3442 %package 19
35-IPS_package_name: library/ruby-19/net-sftp
36-Summary: A pure Ruby implementation of the SFTP client protocol
37-BuildRequires: runtime/ruby-19
38-Requires: runtime/ruby-19 = *
39-Requires: library/ruby-19/net-ssh
43+IPS_package_name: library/ruby/%{gemname}-19
44+Summary: A pure Ruby implementation of the SFTP client protocol
45+BuildRequires: runtime/ruby-19 = *
46+Requires: runtime/ruby-19 = *
47+# net-ssh >= 2.6.5
48+Requires: library/ruby/net-ssh-19
49+Requires: library/ruby/%{gemname}
4050
4151 %description 19
4252 A pure Ruby implementation of the SFTP client protocol
53+%endif
54+
55+%if %{build20}
56+%if %{keep_dependency}
57+%package 20-old
58+IPS_package_name: library/ruby-20/%{gemname}
59+Summary: A pure Ruby implementation of the SFTP client protocol
60+BuildRequires: runtime/ruby-20 = *
61+Requires: runtime/ruby-20 = *
62+Requires: library/ruby/%{gemname}-20
63+
64+%description 20-old
65+A pure Ruby implementation of the SFTP client protocol
66+%endif
4367
4468 %package 20
45-IPS_package_name: library/ruby-20/net-sftp
46-Summary: A pure Ruby implementation of the SFTP client protocol
47-BuildRequires: runtime/ruby-20
48-Requires: runtime/ruby-20 = *
49-Requires: library/ruby-20/net-ssh
69+IPS_package_name: library/ruby/%{gemname}-20
70+Summary: A pure Ruby implementation of the SFTP client protocol
71+BuildRequires: runtime/ruby-20 = *
72+Requires: runtime/ruby-20 = *
73+# net-ssh >= 2.6.5
74+Requires: library/ruby/net-ssh-20
75+Requires: library/ruby/%{gemname}
5076
5177 %description 20
5278 A pure Ruby implementation of the SFTP client protocol
79+%endif
80+
81+%if %{build21}
82+%if %{keep_dependency}
83+%package 21-old
84+IPS_package_name: library/ruby-21/%{gemname}
85+Summary: A pure Ruby implementation of the SFTP client protocol
86+BuildRequires: runtime/ruby-21 = *
87+Requires: runtime/ruby-21 = *
88+Requires: library/ruby/%{gemname}-21
89+
90+%description 21-old
91+A pure Ruby implementation of the SFTP client protocol
92+%endif
93+
94+%package 21
95+IPS_package_name: library/ruby/%{gemname}-21
96+Summary: A pure Ruby implementation of the SFTP client protocol
97+BuildRequires: runtime/ruby-21 = *
98+Requires: runtime/ruby-21 = *
99+# net-ssh >= 2.6.5
100+Requires: library/ruby/net-ssh-21
101+Requires: library/ruby/%{gemname}
102+
103+%description 21
104+A pure Ruby implementation of the SFTP client protocol
105+%endif
106+
107+%if %{build22}
108+%if %{keep_dependency}
109+%package 22-old
110+IPS_package_name: library/ruby-22/%{gemname}
111+Summary: A pure Ruby implementation of the SFTP client protocol
112+BuildRequires: runtime/ruby-22 = *
113+Requires: runtime/ruby-22 = *
114+Requires: library/ruby/%{gemname}-22
115+
116+%description 22-old
117+A pure Ruby implementation of the SFTP client protocol
118+%endif
119+
120+%package 22
121+IPS_package_name: library/ruby/%{gemname}-22
122+Summary: A pure Ruby implementation of the SFTP client protocol
123+BuildRequires: runtime/ruby-22 = *
124+Requires: runtime/ruby-22 = *
125+# net-ssh >= 2.6.5
126+Requires: library/ruby/net-ssh-22
127+Requires: library/ruby/%{gemname}
128+
129+%description 22
130+A pure Ruby implementation of the SFTP client protocol
131+%endif
132+
133+%if %{build23}
134+%if %{keep_dependency}
135+%package 23-old
136+IPS_package_name: library/ruby-23/%{gemname}
137+Summary: A pure Ruby implementation of the SFTP client protocol
138+BuildRequires: runtime/ruby-23 = *
139+Requires: runtime/ruby-23 = *
140+# net-ssh >= 2.6.5
141+Requires: library/ruby/net-ssh-23
142+Requires: library/ruby/%{gemname}-23
143+
144+%description 23-old
145+A pure Ruby implementation of the SFTP client protocol
146+%endif
147+
148+%package 23
149+IPS_package_name: library/ruby/%{gemname}-23
150+Summary: A pure Ruby implementation of the SFTP client protocol
151+BuildRequires: runtime/ruby-23 = *
152+Requires: runtime/ruby-23 = *
153+# net-ssh >= 2.6.5
154+Requires: library/ruby/net-ssh-23
155+
156+%description 23
157+A pure Ruby implementation of the SFTP client protocol
158+%endif
53159
54160 %prep
55161 %setup -q -c -T
56162
57163 %build
164+build_for() {
165+ ruby_ver=$1
166+ bindir="/usr/ruby/${ruby_ver}/bin"
167+ gemdir="$(${bindir}/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)"
168+ geminstdir="${gemdir}/gems/%{gemname}-%{version}"
169+
170+ ${bindir}/gem install --local \
171+ --no-env-shebang \
172+ --install-dir .${gemdir} \
173+ --bindir .${bindir} \
174+ --no-ri \
175+ --no-rdoc \
176+ -V \
177+ --force %{SOURCE0}
178+}
179+
180+%if %{build19}
58181 # ruby-19
59-%{bindir19}/gem install --local \
60- --install-dir .%{gemdir19} \
61- --bindir .%{bindir19} \
62- -V \
63- --force %{SOURCE0}
182+build_for 1.9
183+%endif
64184
185+%if %{build20}
65186 # ruby-20
66-%{bindir20}/gem install --local \
67- --install-dir .%{gemdir20} \
68- --bindir .%{bindir20} \
69- -V \
70- --force %{SOURCE0}
187+build_for 2.0
188+%endif
71189
190+%if %{build21}
72191 # ruby-21
73-%{bindir21}/gem install --local \
74- --install-dir .%{gemdir21} \
75- --bindir .%{bindir21} \
76- -V \
77- --force %{SOURCE0}
192+build_for 2.1
193+%endif
194+
195+%if %{build22}
196+# ruby-22
197+build_for 2.2
198+%endif
199+
200+%if %{build23}
201+# ruby-23
202+build_for 2.3
203+%endif
78204
79205 %install
80206 rm -rf %{buildroot}
81207
82-# ruby-19
83-mkdir -p %{buildroot}/%{gemdir19}
84-cp -a .%{gemdir19}/* \
85- %{buildroot}/%{gemdir19}/
208+%if %{generate_executable}
209+mkdir -p %{buildroot}/%{_bindir}
210+%endif
86211
87-# ruby-20
88-mkdir -p %{buildroot}/%{gemdir20}
89-cp -a .%{gemdir20}/* \
90- %{buildroot}/%{gemdir20}/
212+install_for() {
213+ ruby_ver=$1
214+ bindir="/usr/ruby/${ruby_ver}/bin"
215+ gemdir="$(${bindir}/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)"
216+ geminstdir="${gemdir}/gems/%{gemname}-%{version}"
91217
218+ mkdir -p %{buildroot}/usr/ruby/${ruby_ver}
219+ cp -a ./usr/ruby/${ruby_ver}/* \
220+ %{buildroot}/usr/ruby/${ruby_ver}/
221+
222+ for dir in %{buildroot}${geminstdir}/bin %{buildroot}%{_bindir}
223+ do
224+ if [ -d ${dir} ]
225+ then
226+ pushd ${dir}
227+ for i in ./*
228+ do
229+ if [ -f ${i} ]
230+ then
231+ mv ${i} ${i}.bak
232+ sed -e "s!^\#\!/usr/bin/env ruby\$!\#\!/usr/ruby/${ruby_ver}/bin/ruby!" \
233+ -e "s!^\#\!/usr/bin/ruby\$!\#\!/usr/ruby/${ruby_ver}/bin/ruby!" \
234+ -e "s!^\#\!ruby\$!\#\!/usr/ruby/${ruby_ver}/bin/ruby!" \
235+ ${i}.bak > ${i}
236+ rm ${i}.bak
237+ fi
238+ done
239+ popd
240+ fi
241+ done
242+
243+%if %{generate_executable}
244+ pushd %{buildroot}%{_bindir}
245+ for i in $(ls ../ruby/${ruby_ver}/bin/*)
246+ do
247+ [ -f ${i} ] && ln -s ${i} $(basename ${i})$(echo ${ruby_ver}|sed -e 's/\.//')
248+ done
249+ popd
250+%endif
251+
252+}
253+
254+%if %{build19}
255+# ruby-19
256+install_for 1.9
257+%endif
258+
259+%if %{build20}
260+install_for 2.0
261+%endif
262+
263+%if %{build21}
92264 # ruby-21
93-mkdir -p %{buildroot}/%{gemdir21}
94-cp -a .%{gemdir21}/* \
95- %{buildroot}/%{gemdir21}/
265+install_for 2.1
266+%endif
96267
97-# rm -rf %{buildroot}%{geminstdir}/.yardoc/
268+%if %{build22}
269+# ruby-22
270+install_for 2.2
271+%endif
272+
273+%if %{build23}
274+# ruby-23
275+install_for 2.3
276+%endif
98277
99278 %clean
100279 rm -rf %{buildroot}
101280
102-
103281 %files
104282 %defattr(0755,root,bin,-)
105-%dir %attr (0755, root, sys) /usr
106-/usr/ruby/2.1
107283
284+%if %{build19}
108285 %files 19
109286 %defattr(0755,root,bin,-)
110287 %dir %attr (0755, root, sys) /usr
111288 /usr/ruby/1.9
289+%if %{generate_executable}
290+%dir %attr (0755, root, bin) /usr/bin
291+%attr (0755, root, bin) /usr/bin/*19
292+%endif
293+%endif
112294
295+%if %{build20}
113296 %files 20
114297 %defattr(0755,root,bin,-)
115298 %dir %attr (0755, root, sys) /usr
116299 /usr/ruby/2.0
300+%if %{generate_executable}
301+%dir %attr (0755, root, bin) /usr/bin
302+%attr (0755, root, bin) /usr/bin/*20
303+%endif
304+%endif
305+
306+%if %{build21}
307+%files 21
308+%defattr(0755,root,bin,-)
309+%dir %attr (0755, root, sys) /usr
310+/usr/ruby/2.1
311+%if %{generate_executable}
312+%dir %attr (0755, root, bin) /usr/bin
313+%attr (0755, root, bin) /usr/bin/*21
314+%endif
315+%endif
316+
317+%if %{build22}
318+%files 22
319+%defattr(0755,root,bin,-)
320+%dir %attr (0755, root, sys) /usr
321+/usr/ruby/2.2
322+%if %{generate_executable}
323+%dir %attr (0755, root, bin) /usr/bin
324+%attr (0755, root, bin) /usr/bin/*22
325+%endif
326+%endif
327+
328+%if %{build23}
329+%files 23
330+%defattr(0755,root,bin,-)
331+%dir %attr (0755, root, sys) /usr
332+/usr/ruby/2.3
333+%if %{generate_executable}
334+%dir %attr (0755, root, bin) /usr/bin
335+%attr (0755, root, bin) /usr/bin/*23
336+%endif
337+%endif
117338
118339 %changelog
340+* Tue Dec 08 2015 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
341+- bump to 2.1.2 and build packge for ruby-22 and ruby-23
119342 * Sun Jun 22 2014 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
120343 - generate packages for ruby-20 and ruby-21 instead of ruby-18
121344 * Tue Apr 23 2013 - Fumihisa TONAKA <fumi.ftnk@gmail.com>
旧リポジトリブラウザで表示