日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | 715f39e6930e51b460d2fe1ef7728391ddc5541f (tree) |
---|---|
Time | 2016-02-01 00:15:17 |
Author | Osamu Tabata <cantimerny.g@gmai...> |
Commiter | Osamu Tabata |
spec_SFEghc-project-template: initial commit
@@ -0,0 +1,207 @@ | ||
1 | +# | |
2 | +# spec file for package SFEghc-project-template | |
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 project-template | |
18 | + | |
19 | +Name: SFEghc-%{pname} | |
20 | +IPS_package_name: library/ghc/%{pname} | |
21 | +Group: Development/Languages/Haskell | |
22 | +Version: 0.2.0 | |
23 | +License: BSD3 | |
24 | +URL: https://github.com/fpco/haskell-ide | |
25 | +Summary: Specify Haskell project templates and generate files | |
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/conduit-710 = %{conduit_ver} | |
38 | +BuildRequires: library/ghc/conduit-710/prof = %{conduit_ver} | |
39 | +BuildRequires: library/ghc/conduit-extra-710 = %{conduit_extra_ver} | |
40 | +BuildRequires: library/ghc/conduit-extra-710/prof = %{conduit_extra_ver} | |
41 | +BuildRequires: library/ghc/mtl-710 = %{mtl_ver} | |
42 | +BuildRequires: library/ghc/mtl-710/prof = %{mtl_ver} | |
43 | +BuildRequires: library/ghc/resourcet-710 = %{resourcet_ver} | |
44 | +BuildRequires: library/ghc/resourcet-710/prof = %{resourcet_ver} | |
45 | +BuildRequires: library/ghc/text-710 = %{text_ver} | |
46 | +BuildRequires: library/ghc/text-710/prof = %{text_ver} | |
47 | + | |
48 | +%description | |
49 | +Specify Haskell project templates and generate files | |
50 | + | |
51 | + | |
52 | +%package 710 | |
53 | +IPS_package_name: library/ghc/%{pname}-710 | |
54 | +Summary: project-template system | |
55 | +SUNW_BaseDir: %{_basedir} | |
56 | +%include default-depend.inc | |
57 | +Requires: developer/ghc-710 = %{ghc_ver} | |
58 | +Requires: library/ghc/base64-bytestring-710 = %{base64_bytestring_ver} | |
59 | +Requires: library/ghc/conduit-710 = %{conduit_ver} | |
60 | +Requires: library/ghc/conduit-extra-710 = %{conduit_extra_ver} | |
61 | +Requires: library/ghc/mtl-710 = %{mtl_ver} | |
62 | +Requires: library/ghc/resourcet-710 = %{resourcet_ver} | |
63 | +Requires: library/ghc/text-710 = %{text_ver} | |
64 | + | |
65 | +%package prof-710 | |
66 | +IPS_package_name: library/ghc/%{pname}-710/prof | |
67 | +Summary: %{summary} - profiling libraries | |
68 | +SUNW_BaseDir: %{_basedir} | |
69 | +%include default-depend.inc | |
70 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
71 | +Requires: library/ghc/%{pname}-710 | |
72 | +Requires: library/ghc/base64-bytestring-710/prof = %{base64_bytestring_ver} | |
73 | +Requires: library/ghc/conduit-710/prof = %{conduit_ver} | |
74 | +Requires: library/ghc/conduit-extra-710/prof = %{conduit_extra_ver} | |
75 | +Requires: library/ghc/mtl-710/prof = %{mtl_ver} | |
76 | +Requires: library/ghc/resourcet-710/prof = %{resourcet_ver} | |
77 | +Requires: library/ghc/text-710/prof = %{text_ver} | |
78 | + | |
79 | +%package doc-710 | |
80 | +IPS_package_name: library/ghc/%{pname}-710/doc | |
81 | +Summary: %{summary} - doc files | |
82 | +SUNW_BaseDir: %{_basedir} | |
83 | +%include default-depend.inc | |
84 | +Requires: library/ghc/%{pname}-710 | |
85 | + | |
86 | +%description 710 | |
87 | +Specify Haskell project templates and generate files | |
88 | + | |
89 | + | |
90 | +%prep | |
91 | +%setup -q -n %{pname}-%{version} | |
92 | + | |
93 | +%build | |
94 | + | |
95 | +build_for () { | |
96 | + CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') | |
97 | + CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM) | |
98 | + # Need to use same gcc as we used to build ghc (gcc 4.x) | |
99 | + export CC=/usr/bin/gcc | |
100 | + export CXX=/usr/bin/g++ | |
101 | + export CXXFLAGS="%{gcc_cxx_optflags}" | |
102 | + export CFLAGS="%optflags" | |
103 | + export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH | |
104 | + export PKG_CONFIG_PATH="%_pkg_config_path" | |
105 | + export PERL="/usr/perl5/bin/perl" | |
106 | + | |
107 | + %if %{oracle_solaris_11_2} | |
108 | + export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
109 | + export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib' | |
110 | + %else | |
111 | + export LDFLAGS="-L%{_libdir} -R%{_libdir}" | |
112 | + %endif | |
113 | + | |
114 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
115 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
116 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
117 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
118 | + VERBOSE=--verbose=2 | |
119 | + | |
120 | + chmod a+x ./Setup.hs | |
121 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs clean | |
122 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs configure --prefix=%{_prefix} \ | |
123 | + --libdir=%{_libdir} \ | |
124 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
125 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
126 | + --libsubdir='$compiler/$pkgid' \ | |
127 | + --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ | |
128 | + --haddock-option="--html" \ | |
129 | + --enable-library-profiling \ | |
130 | + ${VERBOSE} | |
131 | + | |
132 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs build ${VERBOSE} -j$CPUS | |
133 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
134 | + | |
135 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
136 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
137 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
138 | + | |
139 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
140 | + install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
141 | + | |
142 | + # LICENCE FILE | |
143 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
144 | + # # Prepare lists of files for packaging | |
145 | + # cd %{_builddir}/%{pname}-%{version} | |
146 | + find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files | |
147 | + find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files | |
148 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files | |
149 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
150 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
151 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
152 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
153 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
154 | + # Clean up syntax for %files section | |
155 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
156 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
157 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
158 | +} | |
159 | +build_for | |
160 | + | |
161 | + | |
162 | +%install | |
163 | + | |
164 | + | |
165 | +%clean | |
166 | +rm -rf $RPM_BUILD_ROOT | |
167 | + | |
168 | + | |
169 | +%if %{oracle_solaris_11_2} | |
170 | + # pass | |
171 | +%else | |
172 | + # not solaris11 | |
173 | +# %post | |
174 | +# The %install section above will only install files | |
175 | +# We need to register the package with ghc-pkg for ghc to find it | |
176 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
177 | + | |
178 | +# %post -n SFEghc78-project-template-doc | |
179 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
180 | + | |
181 | +# %preun | |
182 | +# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work | |
183 | +# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} | |
184 | + | |
185 | +# %postun -n SFEghc78-project-template-doc | |
186 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
187 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
188 | +# fi | |
189 | + | |
190 | +%endif | |
191 | + | |
192 | + | |
193 | +%files 710 -f pkg-%{ghc_ver}.files | |
194 | +%defattr (-, root, bin) | |
195 | + | |
196 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
197 | +%defattr (-, root, bin) | |
198 | + | |
199 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
200 | +%defattr(-,root,bin) | |
201 | +%dir %attr (0755, root, sys) %{_datadir} | |
202 | +%dir %attr (0755, root, other) %{_docdir} | |
203 | + | |
204 | + | |
205 | +%changelog | |
206 | +* Sat Jan 30 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
207 | +- initial commit |
@@ -0,0 +1,30 @@ | ||
1 | +Copyright (c) 2012, Michael Snoyman | |
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 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 Michael Snoyman nor the names of other | |
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. |