日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | 2a118767c485551536b3b5eb69150ed73424ddcd (tree) |
---|---|
Time | 2016-01-30 17:49:18 |
Author | Osamu Tabata <cantimerny.g@gmai...> |
Commiter | Osamu Tabata |
spec_SFEghc-case-insensitive: initial commit
@@ -0,0 +1,199 @@ | ||
1 | +# | |
2 | +# spec file for package SFEghc-case-insensitive | |
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 case-insensitive | |
18 | + | |
19 | +Name: SFEghc-%{pname} | |
20 | +IPS_package_name: library/ghc/%{pname} | |
21 | +Group: Development/Languages/Haskell | |
22 | +Version: 1.2.0.5 | |
23 | +License: BSD3 | |
24 | +URL: https://github.com/basvandijk/case-insensitive | |
25 | +Summary: Case insensitive string comparison | |
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/hashable-710 = %{hashable_ver} | |
36 | +BuildRequires: library/ghc/hashable-710/prof = %{hashable_ver} | |
37 | +BuildRequires: library/ghc/text-710 = %{text_ver} | |
38 | +BuildRequires: library/ghc/text-710/prof = %{text_ver} | |
39 | + | |
40 | +%description | |
41 | +constructor which can be parameterised by a string-like | |
42 | +type like: 'String', 'ByteString', 'Text', | |
43 | +etc.. Comparisons of values of the resulting type will be | |
44 | +insensitive to cases. | |
45 | + | |
46 | + | |
47 | +%package 710 | |
48 | +IPS_package_name: library/ghc/%{pname}-710 | |
49 | +Summary: case-insensitive system | |
50 | +SUNW_BaseDir: %{_basedir} | |
51 | +%include default-depend.inc | |
52 | +Requires: developer/ghc-710 = %{ghc_ver} | |
53 | +Requires: library/ghc/hashable-710 = %{hashable_ver} | |
54 | +Requires: library/ghc/text-710 = %{text_ver} | |
55 | + | |
56 | +%package prof-710 | |
57 | +IPS_package_name: library/ghc/%{pname}-710/prof | |
58 | +Summary: %{summary} - profiling libraries | |
59 | +SUNW_BaseDir: %{_basedir} | |
60 | +%include default-depend.inc | |
61 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
62 | +Requires: library/ghc/%{pname}-710 | |
63 | +Requires: library/ghc/hashable-710/prof = %{hashable_ver} | |
64 | +Requires: library/ghc/text-710/prof = %{text_ver} | |
65 | + | |
66 | +%package doc-710 | |
67 | +IPS_package_name: library/ghc/%{pname}-710/doc | |
68 | +Summary: %{summary} - doc files | |
69 | +SUNW_BaseDir: %{_basedir} | |
70 | +%include default-depend.inc | |
71 | +Requires: library/ghc/%{pname}-710 | |
72 | + | |
73 | +%description 710 | |
74 | +constructor which can be parameterised by a string-like | |
75 | +type like: 'String', 'ByteString', 'Text', | |
76 | +etc.. Comparisons of values of the resulting type will be | |
77 | +insensitive to cases. | |
78 | + | |
79 | + | |
80 | + | |
81 | + | |
82 | +%prep | |
83 | +%setup -q -n %{pname}-%{version} | |
84 | + | |
85 | +%build | |
86 | + | |
87 | +build_for () { | |
88 | + CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') | |
89 | + CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM) | |
90 | + # Need to use same gcc as we used to build ghc (gcc 4.x) | |
91 | + export CC=/usr/bin/gcc | |
92 | + export CXX=/usr/bin/g++ | |
93 | + export CXXFLAGS="%{gcc_cxx_optflags}" | |
94 | + export CFLAGS="%optflags" | |
95 | + export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH | |
96 | + export PKG_CONFIG_PATH="%_pkg_config_path" | |
97 | + export PERL="/usr/perl5/bin/perl" | |
98 | + | |
99 | + %if %{oracle_solaris_11_2} | |
100 | + export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
101 | + export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
102 | + %else | |
103 | + export LDFLAGS="-L%{_libdir} -R%{_libdir}" | |
104 | + %endif | |
105 | + | |
106 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
107 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
108 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
109 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
110 | + VERBOSE=--verbose=2 | |
111 | + | |
112 | + chmod a+x ./Setup.lhs | |
113 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs clean | |
114 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs configure --prefix=%{_prefix} \ | |
115 | + --libdir=%{_libdir} \ | |
116 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
117 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
118 | + --libsubdir='$compiler/$pkgid' \ | |
119 | + --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ | |
120 | + --haddock-option="--html" \ | |
121 | + --enable-library-profiling \ | |
122 | + ${VERBOSE} | |
123 | + | |
124 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs build ${VERBOSE} -j$CPUS | |
125 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
126 | + | |
127 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
128 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
129 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
130 | + | |
131 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
132 | + install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
133 | + | |
134 | + # LICENCE FILE | |
135 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
136 | + # # Prepare lists of files for packaging | |
137 | + # cd %{_builddir}/%{pname}-%{version} | |
138 | + find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files | |
139 | + find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files | |
140 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files | |
141 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
142 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
143 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
144 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
145 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
146 | + # Clean up syntax for %files section | |
147 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
148 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
149 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
150 | +} | |
151 | +build_for | |
152 | + | |
153 | + | |
154 | +%install | |
155 | + | |
156 | + | |
157 | +%clean | |
158 | +rm -rf $RPM_BUILD_ROOT | |
159 | + | |
160 | + | |
161 | +%if %{oracle_solaris_11_2} | |
162 | + # pass | |
163 | +%else | |
164 | + # not solaris11 | |
165 | +# %post | |
166 | +# The %install section above will only install files | |
167 | +# We need to register the package with ghc-pkg for ghc to find it | |
168 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
169 | + | |
170 | +# %post -n SFEghc78-case-insensitive-doc | |
171 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
172 | + | |
173 | +# %preun | |
174 | +# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work | |
175 | +# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} | |
176 | + | |
177 | +# %postun -n SFEghc78-case-insensitive-doc | |
178 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
179 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
180 | +# fi | |
181 | + | |
182 | +%endif | |
183 | + | |
184 | + | |
185 | +%files 710 -f pkg-%{ghc_ver}.files | |
186 | +%defattr (-, root, bin) | |
187 | + | |
188 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
189 | +%defattr (-, root, bin) | |
190 | + | |
191 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
192 | +%defattr(-,root,bin) | |
193 | +%dir %attr (0755, root, sys) %{_datadir} | |
194 | +%dir %attr (0755, root, other) %{_docdir} | |
195 | + | |
196 | + | |
197 | +%changelog | |
198 | +* Sat Jan 30 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
199 | +- initial commit |
@@ -0,0 +1,31 @@ | ||
1 | +Copyright (c) 2011-2013 Bas van Dijk | |
2 | + | |
3 | +All rights reserved. | |
4 | + | |
5 | +Redistribution and use in source and binary forms, with or without | |
6 | +modification, are permitted provided that the following conditions are | |
7 | +met: | |
8 | + | |
9 | + * Redistributions of source code must retain the above copyright | |
10 | + notice, this list of conditions and the following disclaimer. | |
11 | + | |
12 | + * Redistributions in binary form must reproduce the above | |
13 | + copyright notice, this list of conditions and the following | |
14 | + disclaimer in the documentation and/or other materials provided | |
15 | + with the distribution. | |
16 | + | |
17 | + * The name of Bas van Dijk and the names of contributors may NOT | |
18 | + be used to endorse or promote products derived from this | |
19 | + software without specific prior written permission. | |
20 | + | |
21 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
22 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
23 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
24 | +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
25 | +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
26 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
27 | +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
28 | +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
29 | +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
30 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
31 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |