日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
リビジョン | 1f1cf75f21d4c02f25ffc0209e002ddc5724c8be (tree) |
---|---|
日時 | 2016-02-07 17:30:02 |
作者 | Osamu Tabata <cantimerny.g@gmai...> |
コミッター | Osamu Tabata |
spec_SFEghc-alex: initial commit
@@ -0,0 +1,264 @@ | ||
1 | +# | |
2 | +# spec file for package SFEghc-alex | |
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 | +%define major_version 7.10 | |
14 | +%include yesod-version-sets.inc | |
15 | + | |
16 | +%define oracle_solaris_11_2 %(grep 'Oracle Solaris 11.2' /etc/release > /dev/null ; if [ $? -eq 0 ]; then echo '1'; else echo '0'; fi) | |
17 | + | |
18 | +%define pname alex | |
19 | + | |
20 | +Name: SFEghc-%{pname} | |
21 | +IPS_package_name: library/ghc/%{pname} | |
22 | +Group: Development/Languages/Haskell | |
23 | +Version: 3.1.4 | |
24 | +License: BSD3 | |
25 | +URL: http://www.haskell.org/alex/ | |
26 | +Summary: Alex is a tool for generating lexical analysers in Haskell | |
27 | +Source: http://hackage.haskell.org/packages/archive/%{pname}/%{version}/%{pname}-%{version}.tar.gz | |
28 | +SUNW_Copyright: ghc-%{pname}.copyright | |
29 | +SUNW_BaseDir: %{_basedir} | |
30 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build | |
31 | + | |
32 | +BuildRequires: developer/ghc-710 = %{ghc_ver} | |
33 | +BuildRequires: developer/ghc-710/prof = %{ghc_ver} | |
34 | +BuildRequires: library/ghc/hscolour-710 = %{hscolour_ver} | |
35 | +BuildRequires: library/ghc/hscolour-710/prof = %{hscolour_ver} | |
36 | +BuildRequires: library/ghc/QuickCheck-710 = %{QuickCheck_ver} | |
37 | +BuildRequires: library/ghc/QuickCheck-710/prof = %{QuickCheck_ver} | |
38 | +BuildRequires: library/ghc/happy-710 = %{happy_ver} | |
39 | +BuildRequires: library/ghc/happy-710/prof = %{happy_ver} | |
40 | + | |
41 | +%description | |
42 | +Alex is a tool for generating lexical analysers in Haskell. | |
43 | +It takes a description of tokens based on regular | |
44 | +expressions and generates a Haskell module containing code | |
45 | +for scanning text efficiently. It is similar to the tool | |
46 | +lex or flex for C/C++. | |
47 | +. | |
48 | +Changes in 3.1.4: | |
49 | +. | |
50 | +* Add Applicative/Functor instances for GHC 7.10 | |
51 | +. | |
52 | +Changes in 3.1.3: | |
53 | +. | |
54 | +* Fix for clang (XCode 5) | |
55 | +. | |
56 | +Changes in 3.1.2: | |
57 | +. | |
58 | +* Add missing file to extra-source-files | |
59 | +. | |
60 | +Changes in 3.1.1: | |
61 | +. | |
62 | +* Bug fixes (#24, #30, #31, #32) | |
63 | +. | |
64 | +Changes in 3.1.0: | |
65 | +. | |
66 | +* necessary changes to work with GHC 7.8.1 | |
67 | + | |
68 | + | |
69 | + | |
70 | + | |
71 | +%package 710 | |
72 | +IPS_package_name: library/ghc/%{pname}-710 | |
73 | +Summary: alex system | |
74 | +SUNW_BaseDir: %{_basedir} | |
75 | +%include default-depend.inc | |
76 | +Requires: developer/ghc-710 = %{ghc_ver} | |
77 | +Requires: library/ghc/QuickCheck-710 = %{QuickCheck_ver} | |
78 | +Requires: library/ghc/happy-710 = %{happy_ver} | |
79 | + | |
80 | +%package prof-710 | |
81 | +IPS_package_name: library/ghc/%{pname}-710/prof | |
82 | +Summary: %{summary} - profiling libraries | |
83 | +SUNW_BaseDir: %{_basedir} | |
84 | +%include default-depend.inc | |
85 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
86 | +Requires: library/ghc/%{pname}-710 | |
87 | +Requires: library/ghc/QuickCheck-710/prof = %{QuickCheck_ver} | |
88 | +Requires: library/ghc/happy-710/prof = %{hgappy_ver} | |
89 | + | |
90 | +%package doc-710 | |
91 | +IPS_package_name: library/ghc/%{pname}-710/doc | |
92 | +Summary: %{summary} - doc files | |
93 | +SUNW_BaseDir: %{_basedir} | |
94 | +%include default-depend.inc | |
95 | +Requires: library/ghc/%{pname}-710 | |
96 | + | |
97 | +%description 710 | |
98 | +Alex is a tool for generating lexical analysers in Haskell. | |
99 | +It takes a description of tokens based on regular | |
100 | +expressions and generates a Haskell module containing code | |
101 | +for scanning text efficiently. It is similar to the tool | |
102 | +lex or flex for C/C++. | |
103 | +. | |
104 | +Changes in 3.1.4: | |
105 | +. | |
106 | +* Add Applicative/Functor instances for GHC 7.10 | |
107 | +. | |
108 | +Changes in 3.1.3: | |
109 | +. | |
110 | +* Fix for clang (XCode 5) | |
111 | +. | |
112 | +Changes in 3.1.2: | |
113 | +. | |
114 | +* Add missing file to extra-source-files | |
115 | +. | |
116 | +Changes in 3.1.1: | |
117 | +. | |
118 | +* Bug fixes (#24, #30, #31, #32) | |
119 | +. | |
120 | +Changes in 3.1.0: | |
121 | +. | |
122 | +* necessary changes to work with GHC 7.8.1 | |
123 | + | |
124 | + | |
125 | + | |
126 | + | |
127 | +%prep | |
128 | +%setup -q -n %{pname}-%{version} | |
129 | + | |
130 | +%build | |
131 | + | |
132 | +build_for () { | |
133 | + CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') | |
134 | + CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM) | |
135 | + # Need to use same gcc as we used to build ghc (gcc 4.x) | |
136 | + export CC=/usr/bin/gcc | |
137 | + export CXX=/usr/bin/g++ | |
138 | + export CXXFLAGS="%{gcc_cxx_optflags}" | |
139 | + export CFLAGS="%optflags" | |
140 | + export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH | |
141 | + export PKG_CONFIG_PATH="%_pkg_config_path" | |
142 | + export PERL="/usr/perl5/bin/perl" | |
143 | + | |
144 | + %if %{oracle_solaris_11_2} | |
145 | + export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
146 | + export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
147 | + %else | |
148 | + export LDFLAGS="-L%{_libdir} -R%{_libdir}" | |
149 | + %endif | |
150 | + | |
151 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
152 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
153 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
154 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
155 | + VERBOSE=--verbose=2 | |
156 | + | |
157 | + cp dist/build/alex/alex-tmp/*.hs src/ | |
158 | + chmod a+x ./Setup.lhs | |
159 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs clean | |
160 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs configure --prefix=%{_prefix} \ | |
161 | + --libdir=%{_libdir} \ | |
162 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
163 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
164 | + --libsubdir='$compiler/$pkgid' \ | |
165 | + --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ | |
166 | + --haddock-option="--html" \ | |
167 | + --with-alex=true \ | |
168 | + --with-happy=true \ | |
169 | + --flag=small_base \ | |
170 | + --enable-library-profiling \ | |
171 | + ${VERBOSE} | |
172 | + | |
173 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs build ${VERBOSE} -j$CPUS | |
174 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
175 | + | |
176 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
177 | + # /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
178 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
179 | + | |
180 | + # install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
181 | + # install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
182 | + | |
183 | + mkdir -p $RPM_BUILD_ROOT/usr/bin | |
184 | + pushd $RPM_BUILD_ROOT/usr/gnu/bin | |
185 | + mv alex alex-%{ghc_ver} | |
186 | + ln -sf alex-%{ghc_ver} alex | |
187 | + popd | |
188 | + pushd $RPM_BUILD_ROOT/usr/bin | |
189 | + ln -fs ../gnu/bin/alex-%{ghc_ver} alex | |
190 | + popd | |
191 | + | |
192 | + # LICENCE FILE | |
193 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
194 | + # # Prepare lists of files for packaging | |
195 | + # cd %{_builddir}/%{pname}-%{version} | |
196 | + echo '' > pkg-prof-%{ghc_ver}.files | |
197 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" > pkg-all-%{ghc_ver}.files | |
198 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
199 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
200 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
201 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
202 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
203 | + # Clean up syntax for %files section | |
204 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
205 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
206 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
207 | +} | |
208 | +build_for | |
209 | + | |
210 | + | |
211 | +%install | |
212 | + | |
213 | + | |
214 | +%clean | |
215 | +rm -rf $RPM_BUILD_ROOT | |
216 | + | |
217 | + | |
218 | +%if %{oracle_solaris_11_2} | |
219 | + # pass | |
220 | +%else | |
221 | + # not solaris11 | |
222 | +# %post | |
223 | +# The %install section above will only install files | |
224 | +# We need to register the package with ghc-pkg for ghc to find it | |
225 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
226 | + | |
227 | +# %post -n SFEghc78-alex-doc | |
228 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
229 | + | |
230 | +# %preun | |
231 | +# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work | |
232 | +# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} | |
233 | + | |
234 | +# %postun -n SFEghc78-alex-doc | |
235 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
236 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
237 | +# fi | |
238 | + | |
239 | +%endif | |
240 | + | |
241 | + | |
242 | +%files 710 -f pkg-%{ghc_ver}.files | |
243 | +%defattr(0755, root, sys) | |
244 | + | |
245 | +%defattr (-, root, bin) | |
246 | +%dir %attr(0755, root, bin) %{_bindir} | |
247 | +%attr(0555, root, bin) %{_bindir}/alex-%{ghc_ver} | |
248 | + | |
249 | +%attr(0555, root, bin) %ips_tag (mediator=ghc mediator-version=%{major_version}) /usr/gnu/bin/alex | |
250 | +%attr(0555, root, bin) %ips_tag (mediator=ghc mediator-version=%{major_version}) /usr/bin/alex | |
251 | + | |
252 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
253 | +%defattr (-, root, bin) | |
254 | +%{_libdir}/* | |
255 | + | |
256 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
257 | +%defattr(-,root,bin) | |
258 | +%dir %attr (0755, root, sys) %{_datadir} | |
259 | +%dir %attr (0755, root, other) %{_docdir} | |
260 | + | |
261 | + | |
262 | +%changelog | |
263 | +* Sun Feb 07 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
264 | +- initial commit |
@@ -0,0 +1,30 @@ | ||
1 | +Copyright (c) 1995-2011, Chris Dornan and Simon Marlow | |
2 | +All rights reserved. | |
3 | + | |
4 | +Redistribution and use in source and binary forms, with or without | |
5 | +modification, are permitted provided that the following conditions are | |
6 | +met: | |
7 | + | |
8 | + * Redistributions of source code must retain the above copyright | |
9 | + notice, this list of conditions and the following disclaimer. | |
10 | + | |
11 | + * Redistributions in binary form must reproduce the above | |
12 | + copyright notice, this list of conditions and the following | |
13 | + disclaimer in the documentation and/or other materials provided | |
14 | + with the distribution. | |
15 | + | |
16 | + * Neither the name of the copyright holders, nor the names of the | |
17 | + contributors may be used to endorse or promote products derived | |
18 | + from this software without specific prior written permission. | |
19 | + | |
20 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
21 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
22 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
23 | +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
24 | +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
25 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
26 | +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
27 | +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
28 | +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
29 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
30 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |