日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | 5a9a87f690ee13a3365cd92aebfd92af6d13753e (tree) |
---|---|
Time | 2016-01-30 16:23:00 |
Author | Osamu Tabata <cantimerny.g@gmai...> |
Commiter | Osamu Tabata |
spec_SFEghc-parsec: initial commit
@@ -0,0 +1,203 @@ | ||
1 | +# | |
2 | +# spec file for package SFEghc-parsec | |
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 parsec | |
18 | + | |
19 | +Name: SFEghc-%{pname} | |
20 | +IPS_package_name: library/ghc/%{pname} | |
21 | +Group: Development/Languages/Haskell | |
22 | +Version: 3.1.9 | |
23 | +License: BSD3 | |
24 | +URL: https://github.com/aslatter/parsec | |
25 | +Summary: Monadic parser combinators | |
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/mtl-710 = %{mtl_ver} | |
36 | +BuildRequires: library/ghc/mtl-710/prof = %{mtl_ver} | |
37 | +BuildRequires: library/ghc/text-710 = %{text_ver} | |
38 | +BuildRequires: library/ghc/text-710/prof = %{text_ver} | |
39 | + | |
40 | +%description | |
41 | +Parsec is designed from scratch as an industrial-strength parser | |
42 | +library. It is simple, safe, well documented (on the package | |
43 | +homepage), has extensive libraries, good error messages, | |
44 | +and is fast. It is defined as a monad transformer that can be | |
45 | +stacked on arbitrary monads, and it is also parametric in the | |
46 | +input stream type. | |
47 | + | |
48 | + | |
49 | + | |
50 | +%package 710 | |
51 | +IPS_package_name: library/ghc/%{pname}-710 | |
52 | +Summary: parsec system | |
53 | +SUNW_BaseDir: %{_basedir} | |
54 | +%include default-depend.inc | |
55 | +Requires: developer/ghc-710 = %{ghc_ver} | |
56 | +Requires: library/ghc/mtl-710 = %{mtl_ver} | |
57 | +Requires: library/ghc/text-710 = %{text_ver} | |
58 | + | |
59 | +%package prof-710 | |
60 | +IPS_package_name: library/ghc/%{pname}-710/prof | |
61 | +Summary: %{summary} - profiling libraries | |
62 | +SUNW_BaseDir: %{_basedir} | |
63 | +%include default-depend.inc | |
64 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
65 | +Requires: library/ghc/%{pname}-710 | |
66 | +Requires: library/ghc/mtl-710/prof = %{mtl_ver} | |
67 | +Requires: library/ghc/text-710/prof = %{text_ver} | |
68 | + | |
69 | +%package doc-710 | |
70 | +IPS_package_name: library/ghc/%{pname}-710/doc | |
71 | +Summary: %{summary} - doc files | |
72 | +SUNW_BaseDir: %{_basedir} | |
73 | +%include default-depend.inc | |
74 | +Requires: library/ghc/%{pname}-710 | |
75 | + | |
76 | +%description 710 | |
77 | +Parsec is designed from scratch as an industrial-strength parser | |
78 | +library. It is simple, safe, well documented (on the package | |
79 | +homepage), has extensive libraries, good error messages, | |
80 | +and is fast. It is defined as a monad transformer that can be | |
81 | +stacked on arbitrary monads, and it is also parametric in the | |
82 | +input stream type. | |
83 | + | |
84 | + | |
85 | + | |
86 | +%prep | |
87 | +%setup -q -n %{pname}-%{version} | |
88 | + | |
89 | +%build | |
90 | + | |
91 | +build_for () { | |
92 | + CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') | |
93 | + CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM) | |
94 | + # Need to use same gcc as we used to build ghc (gcc 4.x) | |
95 | + export CC=/usr/bin/gcc | |
96 | + export CXX=/usr/bin/g++ | |
97 | + export CXXFLAGS="%{gcc_cxx_optflags}" | |
98 | + export CFLAGS="%optflags" | |
99 | + export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH | |
100 | + export PKG_CONFIG_PATH="%_pkg_config_path" | |
101 | + export PERL="/usr/perl5/bin/perl" | |
102 | + | |
103 | + %if %{oracle_solaris_11_2} | |
104 | + export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
105 | + export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
106 | + %else | |
107 | + export LDFLAGS="-L%{_libdir} -R%{_libdir}" | |
108 | + %endif | |
109 | + | |
110 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
111 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
112 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
113 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
114 | + VERBOSE=--verbose=2 | |
115 | + | |
116 | + chmod a+x ./Setup.hs | |
117 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs clean | |
118 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs configure --prefix=%{_prefix} \ | |
119 | + --libdir=%{_libdir} \ | |
120 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
121 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
122 | + --libsubdir='$compiler/$pkgid' \ | |
123 | + --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ | |
124 | + --haddock-option="--html" \ | |
125 | + --enable-library-profiling \ | |
126 | + ${VERBOSE} | |
127 | + | |
128 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs build ${VERBOSE} -j$CPUS | |
129 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
130 | + | |
131 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
132 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
133 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
134 | + | |
135 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
136 | + install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
137 | + | |
138 | + # LICENCE FILE | |
139 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
140 | + # # Prepare lists of files for packaging | |
141 | + # cd %{_builddir}/%{pname}-%{version} | |
142 | + find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files | |
143 | + find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files | |
144 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files | |
145 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
146 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
147 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
148 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
149 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
150 | + # Clean up syntax for %files section | |
151 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
152 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
153 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
154 | +} | |
155 | +build_for | |
156 | + | |
157 | + | |
158 | +%install | |
159 | + | |
160 | + | |
161 | +%clean | |
162 | +rm -rf $RPM_BUILD_ROOT | |
163 | + | |
164 | + | |
165 | +%if %{oracle_solaris_11_2} | |
166 | + # pass | |
167 | +%else | |
168 | + # not solaris11 | |
169 | +# %post | |
170 | +# The %install section above will only install files | |
171 | +# We need to register the package with ghc-pkg for ghc to find it | |
172 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
173 | + | |
174 | +# %post -n SFEghc78-parsec-doc | |
175 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
176 | + | |
177 | +# %preun | |
178 | +# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work | |
179 | +# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} | |
180 | + | |
181 | +# %postun -n SFEghc78-parsec-doc | |
182 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
183 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
184 | +# fi | |
185 | + | |
186 | +%endif | |
187 | + | |
188 | + | |
189 | +%files 710 -f pkg-%{ghc_ver}.files | |
190 | +%defattr (-, root, bin) | |
191 | + | |
192 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
193 | +%defattr (-, root, bin) | |
194 | + | |
195 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
196 | +%defattr(-,root,bin) | |
197 | +%dir %attr (0755, root, sys) %{_datadir} | |
198 | +%dir %attr (0755, root, other) %{_docdir} | |
199 | + | |
200 | + | |
201 | +%changelog | |
202 | +* Sat Jan 30 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
203 | +- initial commit |
@@ -0,0 +1,21 @@ | ||
1 | +Copyright 1999-2000, Daan Leijen; 2007, Paolo Martini. All rights reserved. | |
2 | + | |
3 | +Redistribution and use in source and binary forms, with or without | |
4 | +modification, are permitted provided that the following conditions are met: | |
5 | + | |
6 | +* Redistributions of source code must retain the above copyright notice, | |
7 | + this list of conditions and the following disclaimer. | |
8 | +* Redistributions in binary form must reproduce the above copyright | |
9 | + notice, this list of conditions and the following disclaimer in the | |
10 | + documentation and/or other materials provided with the distribution. | |
11 | + | |
12 | +This software is provided by the copyright holders "as is" and any express or | |
13 | +implied warranties, including, but not limited to, the implied warranties of | |
14 | +merchantability and fitness for a particular purpose are disclaimed. In no | |
15 | +event shall the copyright holders be liable for any direct, indirect, | |
16 | +incidental, special, exemplary, or consequential damages (including, but not | |
17 | +limited to, procurement of substitute goods or services; loss of use, data, | |
18 | +or profits; or business interruption) however caused and on any theory of | |
19 | +liability, whether in contract, strict liability, or tort (including | |
20 | +negligence or otherwise) arising in any way out of the use of this software, | |
21 | +even if advised of the possibility of such damage. |