日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | dfeaccd61bfd1cbf3c31ce1ab9a1480d0f6b8a0b (tree) |
---|---|
Time | 2015-11-15 10:08:13 |
Author | Fumihisa TONAKA <fumi.ftnk@gmai...> |
Commiter | Fumihisa TONAKA |
merge spec_SFEperl-cwd-guard to default
@@ -425,3 +425,4 @@ | ||
425 | 425 | 1f02e7fb3984fbbea50f5bb8129d121e7d555b94 spec_SFEperl-cgi-emulate-psgi_base |
426 | 426 | f0367cef36c4e01f974776652c6647a128028ff0 spec_SFEperl-cookie-baker-xs_base |
427 | 427 | 099750923862525a98efeae4511922148e733531 spec_SFEperl-file-pushd_base |
428 | +d3198cee9d1b5e33e04be8b3154860ae44dadbd4 spec_SFEperl-cwd-guard_base |
@@ -0,0 +1,299 @@ | ||
1 | +%include Solaris.inc | |
2 | + | |
3 | +%define build584 0 | |
4 | +%define build510 %( if [ -x /usr/perl5/5.10/bin/perl ]; then echo '1'; else echo '0'; fi) | |
5 | +%define build512 %( if [ -x /usr/perl5/5.12/bin/perl ]; then echo '1'; else echo '0'; fi) | |
6 | +%define build516 %( if [ -x /usr/perl5/5.16/bin/perl ]; then echo '1'; else echo '0'; fi) | |
7 | +%define build520 %( if [ -x /usr/perl5/5.20/bin/perl ]; then echo '1'; else echo '0'; fi) | |
8 | +%define include_executable 0 | |
9 | + | |
10 | +%define cpan_name Cwd-Guard | |
11 | +%define sfe_cpan_name cwd-guard | |
12 | +%define ips_cpan_name cwd-guard | |
13 | + | |
14 | +Summary: Temporary changing working directory (chdir) | |
15 | +Name: SFEperl-%{sfe_cpan_name} | |
16 | +IPS_package_name: library/perl-5/%{ips_cpan_name} | |
17 | +Version: 0.04 | |
18 | +IPS_component_version: 0.4 | |
19 | +License: perl_5 | |
20 | +URL: https://metacpan.org/pod/Cwd::Guard | |
21 | +Source0: http://cpan.metacpan.org/authors/id/K/KA/KAZEBURO/Cwd-Guard-%{version}.tar.gz | |
22 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build | |
23 | + | |
24 | +%description | |
25 | +Temporary changing working directory (chdir) | |
26 | + | |
27 | +%if %{build584} | |
28 | +%package 584 | |
29 | +IPS_package_name: library/perl-5/%{ips_cpan_name}-584 | |
30 | +Summary: Temporary changing working directory (chdir) | |
31 | +BuildRequires: runtime/perl-584 = * | |
32 | +BuildRequires: library/perl-5/cpan-meta-584 | |
33 | +BuildRequires: library/perl-5/module-build-584 | |
34 | +BuildRequires: library/perl-5/test-simple-584 | |
35 | +Requires: runtime/perl-584 = * | |
36 | +Requires: library/perl-5/%{ips_cpan_name} | |
37 | +Requires: library/perl-5/exporter-584 | |
38 | +Requires: library/perl-5/if-584 | |
39 | +Requires: library/perl-5/parent-584 | |
40 | +Requires: library/perl-5/pathtools-584 | |
41 | + | |
42 | +%description 584 | |
43 | +Temporary changing working directory (chdir) | |
44 | +%endif | |
45 | + | |
46 | +%if %{build510} | |
47 | +%package 510 | |
48 | +IPS_package_name: library/perl-5/%{ips_cpan_name}-510 | |
49 | +Summary: Temporary changing working directory (chdir) | |
50 | +BuildRequires: runtime/perl-510 = * | |
51 | +BuildRequires: library/perl-5/cpan-meta-510 | |
52 | +BuildRequires: library/perl-5/module-build-510 | |
53 | +BuildRequires: library/perl-5/test-simple-510 | |
54 | +Requires: runtime/perl-510 = * | |
55 | +Requires: library/perl-5/%{ips_cpan_name} | |
56 | +Requires: library/perl-5/exporter-510 | |
57 | +Requires: library/perl-5/if-510 | |
58 | +Requires: library/perl-5/parent-510 | |
59 | +Requires: library/perl-5/pathtools-510 | |
60 | + | |
61 | +%description 510 | |
62 | +Temporary changing working directory (chdir) | |
63 | +%endif | |
64 | + | |
65 | +%if %{build512} | |
66 | +%package 512 | |
67 | +IPS_package_name: library/perl-5/%{ips_cpan_name}-512 | |
68 | +Summary: Temporary changing working directory (chdir) | |
69 | +BuildRequires: runtime/perl-512 = * | |
70 | +BuildRequires: library/perl-5/cpan-meta-512 | |
71 | +BuildRequires: library/perl-5/module-build-512 | |
72 | +BuildRequires: library/perl-5/test-simple-512 | |
73 | +Requires: runtime/perl-512 = * | |
74 | +Requires: library/perl-5/%{ips_cpan_name} | |
75 | +Requires: library/perl-5/exporter-512 | |
76 | +Requires: library/perl-5/if-512 | |
77 | +Requires: library/perl-5/parent-512 | |
78 | +Requires: library/perl-5/pathtools-512 | |
79 | + | |
80 | +%description 512 | |
81 | +Temporary changing working directory (chdir) | |
82 | +%endif | |
83 | + | |
84 | +%if %{build516} | |
85 | +%package 516 | |
86 | +IPS_package_name: library/perl-5/%{ips_cpan_name}-516 | |
87 | +Summary: Temporary changing working directory (chdir) | |
88 | +BuildRequires: runtime/perl-516 = * | |
89 | +BuildRequires: library/perl-5/cpan-meta-516 | |
90 | +BuildRequires: library/perl-5/module-build-516 | |
91 | +BuildRequires: library/perl-5/test-simple-516 | |
92 | +Requires: runtime/perl-516 = * | |
93 | +Requires: library/perl-5/%{ips_cpan_name} | |
94 | +Requires: library/perl-5/exporter-516 | |
95 | +Requires: library/perl-5/if-516 | |
96 | +Requires: library/perl-5/parent-516 | |
97 | +Requires: library/perl-5/pathtools-516 | |
98 | + | |
99 | +%description 516 | |
100 | +Temporary changing working directory (chdir) | |
101 | +%endif | |
102 | + | |
103 | +%if %{build520} | |
104 | +%package 520 | |
105 | +IPS_package_name: library/perl-5/%{ips_cpan_name}-520 | |
106 | +Summary: Temporary changing working directory (chdir) | |
107 | +BuildRequires: runtime/perl-520 = * | |
108 | +BuildRequires: library/perl-5/cpan-meta-520 | |
109 | +BuildRequires: library/perl-5/module-build-520 | |
110 | +BuildRequires: library/perl-5/test-simple-520 | |
111 | +Requires: runtime/perl-520 = * | |
112 | +Requires: library/perl-5/%{ips_cpan_name} | |
113 | +Requires: library/perl-5/exporter-520 | |
114 | +Requires: library/perl-5/if-520 | |
115 | +Requires: library/perl-5/parent-520 | |
116 | +Requires: library/perl-5/pathtools-520 | |
117 | + | |
118 | +%description 520 | |
119 | +Temporary changing working directory (chdir) | |
120 | +%endif | |
121 | + | |
122 | + | |
123 | +%prep | |
124 | +%setup -q -n %{cpan_name}-%{version} | |
125 | +rm -rf %{buildroot} | |
126 | + | |
127 | +%build | |
128 | +build_with_makefile.pl_for() { | |
129 | + perl_ver=$1 | |
130 | + test=$2 | |
131 | + bindir="/usr/perl5/${perl_ver}/bin" | |
132 | + vendor_dir="/usr/perl5/vendor_perl/${perl_ver}" | |
133 | + | |
134 | + export PERL5LIB=${vendor_dir} | |
135 | + ${bindir}/perl Makefile.PL PREFIX=%{_prefix} \ | |
136 | + DESTDIR=$RPM_BUILD_ROOT \ | |
137 | + LIB=${vendor_dir} | |
138 | + make | |
139 | + [ x${test} = 'xwithout_test' ] || make test | |
140 | + make pure_install | |
141 | +} | |
142 | + | |
143 | +build_with_build.pl_for() { | |
144 | + perl_ver=$1 | |
145 | + test=$2 | |
146 | + bindir="/usr/perl5/${perl_ver}/bin" | |
147 | + vendor_dir="/usr/perl5/vendor_perl/${perl_ver}" | |
148 | + | |
149 | + export PERL5LIB=${vendor_dir} | |
150 | + ${bindir}/perl Build.PL \ | |
151 | + --installdirs vendor \ | |
152 | + --destdir $RPM_BUILD_ROOT | |
153 | + ${bindir}/perl ./Build | |
154 | + [ x${test} = 'xwithout_test' ] || ${bindir}/perl ./Build test | |
155 | + ${bindir}/perl ./Build install --destdir $RPM_BUILD_ROOT | |
156 | + ${bindir}/perl ./Build clean | |
157 | +} | |
158 | + | |
159 | +modify_bin_dir() { | |
160 | + perl_ver=$1 | |
161 | + if [ -d $RPM_BUILD_ROOT/usr/bin ] | |
162 | + then | |
163 | + [ -d $RPM_BUILD_ROOT/usr/perl5/${perl_ver} ] || mkdir -p $RPM_BUILD_ROOT/usr/perl5/${perl_ver} | |
164 | + mv $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/bin | |
165 | + fi | |
166 | + | |
167 | + if [ -d $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/bin ] | |
168 | + then | |
169 | + for i in $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/bin/* | |
170 | + do | |
171 | + sed -i.bak -e "s/\/usr\/bin\/env ruby/\/usr\/perl5\/${perl-ver}\/bin\/ruby/" ${i} | |
172 | + [ -f ${i}.bak] || rm -f ${i}.bak | |
173 | + done | |
174 | + fi | |
175 | +} | |
176 | + | |
177 | +modify_man_dir() { | |
178 | + perl_ver=$1 | |
179 | + if [ -d $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/man ] | |
180 | + then | |
181 | + if [ -d $RPM_BUILD_ROOT%{_datadir}/man ] | |
182 | + then | |
183 | + rm -rf $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/man | |
184 | + else | |
185 | + mkdir -p $RPM_BUILD_ROOT%{_datadir} | |
186 | + mv $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/man $RPM_BUILD_ROOT%{_datadir}/ | |
187 | + rm -rf $RPM_BUILD_ROOT/usr/perl5/${perl_ver}/man | |
188 | + fi | |
189 | + rmdir $RPM_BUILD_ROOT/usr/perl5/${perl_ver} | |
190 | + fi | |
191 | +} | |
192 | + | |
193 | +build_for() { | |
194 | + if [ -f Build.PL ]; | |
195 | + then | |
196 | + build_with_build.pl_for $* | |
197 | + elif [ -f Makefile.PL ]; | |
198 | + then | |
199 | + build_with_makefile.pl_for $* | |
200 | + fi | |
201 | + | |
202 | + modify_bin_dir $* | |
203 | + modify_man_dir $* | |
204 | +} | |
205 | + | |
206 | +# To build without test, pass 'without_test' to build_for commaond. | |
207 | +# like 'build_for version without_test' | |
208 | +%if %{build584} | |
209 | +build_for 5.8.4 | |
210 | +%endif | |
211 | + | |
212 | +%if %{build510} | |
213 | +build_for 5.10 | |
214 | +%endif | |
215 | + | |
216 | +%if %{build512} | |
217 | +build_for 5.12 | |
218 | +%endif | |
219 | + | |
220 | +%if %{build516} | |
221 | +build_for 5.16 | |
222 | +%endif | |
223 | + | |
224 | +%if %{build520} | |
225 | +build_for 5.20 | |
226 | +%endif | |
227 | + | |
228 | +%install | |
229 | +if [ -d $RPM_BUILD_ROOT%{_prefix}/man ] | |
230 | +then | |
231 | + mkdir -p $RPM_BUILD_ROOT%{_datadir} | |
232 | + mv $RPM_BUILD_ROOT%{_prefix}/man $RPM_BUILD_ROOT%{_datadir} | |
233 | +fi | |
234 | +if [ -d $RPM_BUILD_ROOT%{_datadir}/man/man3 ] | |
235 | +then | |
236 | + mv $RPM_BUILD_ROOT%{_datadir}/man/man3 $RPM_BUILD_ROOT%{_datadir}/man/man3perl | |
237 | +fi | |
238 | + | |
239 | +%clean | |
240 | +rm -rf %{buildroot} | |
241 | + | |
242 | +%files | |
243 | +%defattr(0755,root,bin,-) | |
244 | +%{_datadir}/man | |
245 | + | |
246 | +%if %{build584} | |
247 | +%files 584 | |
248 | +%defattr(0755,root,bin,-) | |
249 | +%dir %attr (0755, root, sys) /usr | |
250 | +/usr/perl5/vendor_perl/5.8.4 | |
251 | +%if %{include_executable} | |
252 | +/usr/perl5/5.8.4 | |
253 | +%endif | |
254 | +%endif | |
255 | + | |
256 | +%if %{build510} | |
257 | +%files 510 | |
258 | +%defattr(0755,root,bin,-) | |
259 | +%dir %attr (0755, root, sys) /usr | |
260 | +/usr/perl5/vendor_perl/5.10 | |
261 | +%if %{include_executable} | |
262 | +/usr/perl5/5.1.0 | |
263 | +%endif | |
264 | +%endif | |
265 | + | |
266 | +%if %{build512} | |
267 | +%files 512 | |
268 | +%defattr(0755,root,bin,-) | |
269 | +%dir %attr (0755, root, sys) /usr | |
270 | +/usr/perl5/vendor_perl/5.12 | |
271 | +%if %{include_executable} | |
272 | +/usr/perl5/5.12 | |
273 | +%endif | |
274 | +%endif | |
275 | + | |
276 | +%if %{build516} | |
277 | +%files 516 | |
278 | +%defattr(0755,root,bin,-) | |
279 | +%dir %attr (0755, root, sys) /usr | |
280 | +/usr/perl5/vendor_perl/5.16 | |
281 | +%if %{include_executable} | |
282 | +/usr/perl5/5.16 | |
283 | +%endif | |
284 | +%endif | |
285 | + | |
286 | +%if %{build520} | |
287 | +%files 520 | |
288 | +%defattr(0755,root,bin,-) | |
289 | +%dir %attr (0755, root, sys) /usr | |
290 | +/usr/perl5/vendor_perl/5.20 | |
291 | +%if %{include_executable} | |
292 | +/usr/perl5/5.20 | |
293 | +%endif | |
294 | +%endif | |
295 | + | |
296 | + | |
297 | +%changelog | |
298 | +* Sun Nov 15 2015 - Fumihisa TONAKA <fumi.ftnk@gmail.com> | |
299 | +- initial commit |