日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | dd4bd0f4d4011ef8b814a0f0eabd858060a35867 (tree) |
---|---|
Time | 2016-01-31 06:55:17 |
Author | Osamu Tabata <cantimerny.g@gmai...> |
Commiter | Osamu Tabata |
spec_SFEghc-http-client: initial commit
@@ -0,0 +1,235 @@ | ||
1 | +# | |
2 | +# spec file for package SFEghc-http-client | |
3 | +# | |
4 | + | |
5 | +%include Solaris.inc | |
6 | +%include default-depend.inc | |
7 | +%include packagenamemacros.inc | |
8 | +%define cc_is_gcc 1 | |
9 | +%include base.inc | |
10 | +%include usr-gnu.inc | |
11 | + | |
12 | +%define ghc_ver 7.10.3 | |
13 | +%include yesod-version-sets.inc | |
14 | + | |
15 | +%define oracle_solaris_11_2 %(grep 'Oracle Solaris 11.2' /etc/release > /dev/null ; if [ $? -eq 0 ]; then echo '1'; else echo '0'; fi) | |
16 | + | |
17 | +%define pname http-client | |
18 | + | |
19 | +Name: SFEghc-%{pname} | |
20 | +IPS_package_name: library/ghc/%{pname} | |
21 | +Group: Development/Languages/Haskell | |
22 | +Version: 0.4.26.2 | |
23 | +License: MIT | |
24 | +URL: https://github.com/snoyberg/http-client | |
25 | +Summary: An HTTP client engine, intended as a base layer for more user-friendly packages. | |
26 | +Source: http://hackage.haskell.org/packages/archive/%{pname}/%{version}/%{pname}-%{version}.tar.gz | |
27 | +SUNW_Copyright: ghc-%{pname}.copyright | |
28 | +SUNW_BaseDir: %{_basedir} | |
29 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build | |
30 | + | |
31 | +BuildRequires: developer/ghc-710 = %{ghc_ver} | |
32 | +BuildRequires: developer/ghc-710/prof = %{ghc_ver} | |
33 | +BuildRequires: library/ghc/hscolour-710 = %{hscolour_ver} | |
34 | +BuildRequires: library/ghc/hscolour-710/prof = %{hscolour_ver} | |
35 | +BuildRequires: library/ghc/base64-bytestring-710 = %{base64_bytestring_ver} | |
36 | +BuildRequires: library/ghc/base64-bytestring-710/prof = %{base64_bytestring_ver} | |
37 | +BuildRequires: library/ghc/blaze-builder-710 = %{blaze_builder_ver} | |
38 | +BuildRequires: library/ghc/blaze-builder-710/prof = %{blaze_builder_ver} | |
39 | +BuildRequires: library/ghc/case-insensitive-710 = %{case_insensitive_ver} | |
40 | +BuildRequires: library/ghc/case-insensitive-710/prof = %{case_insensitive_ver} | |
41 | +BuildRequires: library/ghc/cookie-710 = %{cookie_ver} | |
42 | +BuildRequires: library/ghc/cookie-710/prof = %{cookie_ver} | |
43 | +BuildRequires: library/ghc/data-default-class-710 = %{data_default_class_ver} | |
44 | +BuildRequires: library/ghc/data-default-class-710/prof = %{data_default_class_ver} | |
45 | +BuildRequires: library/ghc/exceptions-710 = %{exceptions_ver} | |
46 | +BuildRequires: library/ghc/exceptions-710/prof = %{exceptions_ver} | |
47 | +BuildRequires: library/ghc/http-types-710 = %{http_types_ver} | |
48 | +BuildRequires: library/ghc/http-types-710/prof = %{http_types_ver} | |
49 | +BuildRequires: library/ghc/mime-types-710 = %{mime_types_ver} | |
50 | +BuildRequires: library/ghc/mime-types-710/prof = %{mime_types_ver} | |
51 | +BuildRequires: library/ghc/network-710 = %{network_ver} | |
52 | +BuildRequires: library/ghc/network-710/prof = %{network_ver} | |
53 | +BuildRequires: library/ghc/random-710 = %{random_ver} | |
54 | +BuildRequires: library/ghc/random-710/prof = %{random_ver} | |
55 | +BuildRequires: library/ghc/streaming-commons-710 = %{streaming_commons_ver} | |
56 | +BuildRequires: library/ghc/streaming-commons-710/prof = %{streaming_commons_ver} | |
57 | +BuildRequires: library/ghc/text-710 = %{text_ver} | |
58 | +BuildRequires: library/ghc/text-710/prof = %{text_ver} | |
59 | +BuildRequires: library/ghc/network-uri-710 = %{network_uri_ver} | |
60 | +BuildRequires: library/ghc/network-uri-710/prof = %{network_uri_ver} | |
61 | + | |
62 | +%description | |
63 | +An HTTP client engine, intended as a base layer for more user-friendly packages. | |
64 | + | |
65 | + | |
66 | +%package 710 | |
67 | +IPS_package_name: library/ghc/%{pname}-710 | |
68 | +Summary: http-client system | |
69 | +SUNW_BaseDir: %{_basedir} | |
70 | +%include default-depend.inc | |
71 | +Requires: developer/ghc-710 = %{ghc_ver} | |
72 | +Requires: library/ghc/base64-bytestring-710 = %{base64_bytestring_ver} | |
73 | +Requires: library/ghc/blaze-builder-710 = %{blaze_builder_ver} | |
74 | +Requires: library/ghc/case-insensitive-710 = %{case_insensitive_ver} | |
75 | +Requires: library/ghc/cookie-710 = %{cookie_ver} | |
76 | +Requires: library/ghc/data-default-class-710 = %{data_default_class_ver} | |
77 | +Requires: library/ghc/exceptions-710 = %{exceptions_ver} | |
78 | +Requires: library/ghc/http-types-710 = %{http_types_ver} | |
79 | +Requires: library/ghc/mime-types-710 = %{mime_types_ver} | |
80 | +Requires: library/ghc/network-710 = %{network_ver} | |
81 | +Requires: library/ghc/random-710 = %{random_ver} | |
82 | +Requires: library/ghc/streaming-commons-710 = %{streaming_commons_ver} | |
83 | +Requires: library/ghc/text-710 = %{text_ver} | |
84 | +Requires: library/ghc/network-uri-710 = %{network_uri_ver} | |
85 | + | |
86 | +%package prof-710 | |
87 | +IPS_package_name: library/ghc/%{pname}-710/prof | |
88 | +Summary: %{summary} - profiling libraries | |
89 | +SUNW_BaseDir: %{_basedir} | |
90 | +%include default-depend.inc | |
91 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
92 | +Requires: library/ghc/%{pname}-710 | |
93 | +Requires: library/ghc/base64-bytestring-710/prof = %{base64_bytestring_ver} | |
94 | +Requires: library/ghc/blaze-builder-710/prof = %{blaze_builder_ver} | |
95 | +Requires: library/ghc/case-insensitive-710/prof = %{case_insensitive_ver} | |
96 | +Requires: library/ghc/cookie-710/prof = %{cookie_ver} | |
97 | +Requires: library/ghc/data-default-class-710/prof = %{data_default_class_ver} | |
98 | +Requires: library/ghc/exceptions-710/prof = %{exceptions_ver} | |
99 | +Requires: library/ghc/http-types-710/prof = %{http_types_ver} | |
100 | +Requires: library/ghc/mime-types-710/prof = %{mime_types_ver} | |
101 | +Requires: library/ghc/network-710/prof = %{network_ver} | |
102 | +Requires: library/ghc/random-710/prof = %{random_ver} | |
103 | +Requires: library/ghc/streaming-commons-710/prof = %{streaming_commons_ver} | |
104 | +Requires: library/ghc/text-710/prof = %{text_ver} | |
105 | +Requires: library/ghc/network-uri-710/prof = %{network_uri_ver} | |
106 | + | |
107 | +%package doc-710 | |
108 | +IPS_package_name: library/ghc/%{pname}-710/doc | |
109 | +Summary: %{summary} - doc files | |
110 | +SUNW_BaseDir: %{_basedir} | |
111 | +%include default-depend.inc | |
112 | +Requires: library/ghc/%{pname}-710 | |
113 | + | |
114 | +%description 710 | |
115 | +An HTTP client engine, intended as a base layer for more user-friendly packages. | |
116 | + | |
117 | + | |
118 | +%prep | |
119 | +%setup -q -n %{pname}-%{version} | |
120 | + | |
121 | +%build | |
122 | + | |
123 | +build_for () { | |
124 | + CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') | |
125 | + CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM) | |
126 | + # Need to use same gcc as we used to build ghc (gcc 4.x) | |
127 | + export CC=/usr/bin/gcc | |
128 | + export CXX=/usr/bin/g++ | |
129 | + export CXXFLAGS="%{gcc_cxx_optflags}" | |
130 | + export CFLAGS="%optflags" | |
131 | + export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH | |
132 | + export PKG_CONFIG_PATH="%_pkg_config_path" | |
133 | + export PERL="/usr/perl5/bin/perl" | |
134 | + | |
135 | + %if %{oracle_solaris_11_2} | |
136 | + export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
137 | + export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
138 | + %else | |
139 | + export LDFLAGS="-L%{_libdir} -R%{_libdir}" | |
140 | + %endif | |
141 | + | |
142 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
143 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
144 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
145 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
146 | + VERBOSE=--verbose=2 | |
147 | + | |
148 | + chmod a+x ./Setup.hs | |
149 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs clean | |
150 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs configure --prefix=%{_prefix} \ | |
151 | + --libdir=%{_libdir} \ | |
152 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
153 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
154 | + --libsubdir='$compiler/$pkgid' \ | |
155 | + --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ | |
156 | + --haddock-option="--html" \ | |
157 | + --enable-library-profiling \ | |
158 | + ${VERBOSE} | |
159 | + | |
160 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs build ${VERBOSE} -j$CPUS | |
161 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
162 | + | |
163 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
164 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
165 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
166 | + | |
167 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
168 | + install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
169 | + | |
170 | + # LICENCE FILE | |
171 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
172 | + # # Prepare lists of files for packaging | |
173 | + # cd %{_builddir}/%{pname}-%{version} | |
174 | + find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files | |
175 | + find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files | |
176 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files | |
177 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
178 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
179 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
180 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
181 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
182 | + # Clean up syntax for %files section | |
183 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
184 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
185 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
186 | +} | |
187 | +build_for | |
188 | + | |
189 | + | |
190 | +%install | |
191 | + | |
192 | + | |
193 | +%clean | |
194 | +rm -rf $RPM_BUILD_ROOT | |
195 | + | |
196 | + | |
197 | +%if %{oracle_solaris_11_2} | |
198 | + # pass | |
199 | +%else | |
200 | + # not solaris11 | |
201 | +# %post | |
202 | +# The %install section above will only install files | |
203 | +# We need to register the package with ghc-pkg for ghc to find it | |
204 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
205 | + | |
206 | +# %post -n SFEghc78-http-client-doc | |
207 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
208 | + | |
209 | +# %preun | |
210 | +# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work | |
211 | +# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} | |
212 | + | |
213 | +# %postun -n SFEghc78-http-client-doc | |
214 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
215 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
216 | +# fi | |
217 | + | |
218 | +%endif | |
219 | + | |
220 | + | |
221 | +%files 710 -f pkg-%{ghc_ver}.files | |
222 | +%defattr (-, root, bin) | |
223 | + | |
224 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
225 | +%defattr (-, root, bin) | |
226 | + | |
227 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
228 | +%defattr(-,root,bin) | |
229 | +%dir %attr (0755, root, sys) %{_datadir} | |
230 | +%dir %attr (0755, root, other) %{_docdir} | |
231 | + | |
232 | + | |
233 | +%changelog | |
234 | +* Sat Jan 30 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
235 | +- initial commit |
@@ -0,0 +1,20 @@ | ||
1 | +The MIT License (MIT) | |
2 | + | |
3 | +Copyright (c) 2013 Michael Snoyman | |
4 | + | |
5 | +Permission is hereby granted, free of charge, to any person obtaining a copy of | |
6 | +this software and associated documentation files (the "Software"), to deal in | |
7 | +the Software without restriction, including without limitation the rights to | |
8 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
9 | +the Software, and to permit persons to whom the Software is furnished to do so, | |
10 | +subject to the following conditions: | |
11 | + | |
12 | +The above copyright notice and this permission notice shall be included in all | |
13 | +copies or substantial portions of the Software. | |
14 | + | |
15 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
16 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | |
17 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | |
18 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | |
19 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
20 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |