日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。
Revision | 673f01727bd447c70aa1f0061955dd538d9e59a6 (tree) |
---|---|
Time | 2016-01-26 05:38:50 |
Author | Osamu Tabata <cantimerny.g@gmai...> |
Commiter | Osamu Tabata |
spec_SFEghc-data-default-class: build only 7.10
@@ -9,11 +9,8 @@ | ||
9 | 9 | %include base.inc |
10 | 10 | %include usr-gnu.inc |
11 | 11 | |
12 | -%define build78 1 | |
13 | -%define build710 1 | |
14 | - | |
15 | -%define ghc_ver_78 7.8.3 | |
16 | -%define ghc_ver_710 7.10.3 | |
12 | +%define ghc_ver 7.10.3 | |
13 | +%include yesod-version-sets.inc | |
17 | 14 | |
18 | 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) |
19 | 16 |
@@ -32,57 +29,27 @@ | ||
32 | 29 | SUNW_BaseDir: %{_basedir} |
33 | 30 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
34 | 31 | |
35 | -BuildRequires: developer/ghc-78 = %{ghc_ver_78} | |
36 | -BuildRequires: developer/ghc-78/prof = %{ghc_ver_78} | |
37 | -BuildRequires: developer/ghc-710 = %{ghc_ver_710} | |
38 | -BuildRequires: developer/ghc-710/prof = %{ghc_ver_710} | |
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} | |
39 | 36 | |
40 | 37 | %description |
41 | 38 | A class for types with a default value |
42 | 39 | |
43 | -%if %{build78} | |
44 | -%package 78 | |
45 | -IPS_package_name: library/ghc/%{pname}-78 | |
46 | -Summary: data-default-class system | |
47 | -SUNW_BaseDir: %{_basedir} | |
48 | -%include default-depend.inc | |
49 | -Requires: library/ghc/ghc-78 = %{ghc_ver_78} | |
50 | - | |
51 | -%package prof-78 | |
52 | -IPS_package_name: library/ghc/%{pname}-78/prof | |
53 | -Summary: %{summary} - profiling libraries | |
54 | -SUNW_BaseDir: %{_basedir} | |
55 | -%include default-depend.inc | |
56 | -Requires: developer/ghc-78/prof = %{ghc_ver_78} | |
57 | -Requires: library/ghc/%{pname}-78 | |
58 | - | |
59 | -%package doc-78 | |
60 | -IPS_package_name: library/ghc/%{pname}-78/doc | |
61 | -Summary: %{summary} - doc files | |
62 | -SUNW_BaseDir: %{_basedir} | |
63 | -%include default-depend.inc | |
64 | -Requires: library/ghc/%{pname}-78 | |
65 | - | |
66 | -%description 78 | |
67 | -A class for types with a default value | |
68 | - | |
69 | -%endif | |
70 | - | |
71 | - | |
72 | -%if %{build710} | |
73 | 40 | %package 710 |
74 | 41 | IPS_package_name: library/ghc/%{pname}-710 |
75 | 42 | Summary: data-default-class system |
76 | 43 | SUNW_BaseDir: %{_basedir} |
77 | 44 | %include default-depend.inc |
78 | -Requires: library/ghc/ghc-710 = %{ghc_ver_710} | |
45 | +Requires: library/ghc/ghc-710 = %{ghc_ver} | |
79 | 46 | |
80 | 47 | %package prof-710 |
81 | 48 | IPS_package_name: library/ghc/%{pname}-710/prof |
82 | 49 | Summary: %{summary} - profiling libraries |
83 | 50 | SUNW_BaseDir: %{_basedir} |
84 | 51 | %include default-depend.inc |
85 | -Requires: developer/ghc-710/prof = %{ghc_ver_710} | |
52 | +Requires: developer/ghc-710/prof = %{ghc_ver} | |
86 | 53 | Requires: library/ghc/%{pname}-710 |
87 | 54 | |
88 | 55 | %package doc-710 |
@@ -95,14 +62,11 @@ | ||
95 | 62 | %description 710 |
96 | 63 | A class for types with a default value |
97 | 64 | |
98 | -%endif | |
99 | - | |
100 | 65 | |
101 | 66 | %prep |
102 | 67 | %setup -q -n %{pname}-%{version} |
103 | 68 | |
104 | 69 | %build |
105 | - | |
106 | 70 | build_for () { |
107 | 71 | ghc_version=$1 |
108 | 72 | CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}') |
@@ -123,60 +87,53 @@ | ||
123 | 87 | export LDFLAGS="-L%{_libdir} -R%{_libdir}" |
124 | 88 | %endif |
125 | 89 | |
126 | - GHC=/usr/gnu/bin/ghc-${ghc_version} | |
127 | - GHC_PKG=/usr/gnu/bin/ghc-pkg-${ghc_version} | |
128 | - HSC2HS=/usr/gnu/bin/hsc2hs-${ghc_version} | |
129 | - HADDOCK=/usr/gnu/bin/haddock-ghc-${ghc_version} | |
90 | + GHC=/usr/gnu/bin/ghc-%{ghc_ver} | |
91 | + GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver} | |
92 | + HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver} | |
93 | + HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver} | |
130 | 94 | VERBOSE=--verbose=2 |
131 | 95 | |
132 | 96 | chmod a+x ./Setup.lhs |
133 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs clean | |
134 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs configure --prefix=%{_prefix} \ | |
97 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs clean | |
98 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs configure --prefix=%{_prefix} \ | |
135 | 99 | --libdir=%{_libdir} \ |
136 | - --docdir=%{_datadir}/doc/ghc-${ghc_version}/%{pname}-%{version} \ | |
137 | - --htmldir=%{_datadir}/doc/ghc-${ghc_version}/html/libraries/%{pname}-%{version} \ | |
100 | + --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \ | |
101 | + --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \ | |
138 | 102 | --libsubdir='$compiler/$pkgid' \ |
139 | 103 | --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \ |
140 | 104 | --haddock-option="--html" \ |
141 | 105 | --enable-library-profiling \ |
142 | 106 | ${VERBOSE} |
143 | 107 | |
144 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs build ${VERBOSE} -j$CPUS | |
145 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
108 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs build ${VERBOSE} -j$CPUS | |
109 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs haddock ${VERBOSE} --executables --hoogle --hyperlink-source | |
146 | 110 | |
147 | - install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-${ghc_version} | |
148 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
149 | - /usr/gnu/bin/runghc-${ghc_version} ./Setup.lhs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
111 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver} | |
112 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf | |
113 | + /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.lhs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT} | |
150 | 114 | |
151 | - install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-${ghc_version}/%{pname}-%{version}/ | |
152 | - install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-${ghc_version}/%{pname}-%{version}/%{pname}-%{version}.conf | |
115 | + install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/ | |
116 | + install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf | |
153 | 117 | |
154 | 118 | # LICENCE FILE |
155 | - # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-${ghc_version} | |
119 | + # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver} | |
156 | 120 | # # Prepare lists of files for packaging |
157 | 121 | # cd %{_builddir}/%{pname}-%{version} |
158 | - find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-${ghc_version}" > pkg-prof-${ghc_version}.files | |
159 | - find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-${ghc_version}" >> pkg-prof-${ghc_version}.files | |
160 | - find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-${ghc_version}" > pkg-all-${ghc_version}.files | |
161 | - sort pkg-prof-${ghc_version}.files > pkg-prof-sort-${ghc_version}.files | |
162 | - sort pkg-all-${ghc_version}.files > pkg-all-sort-${ghc_version}.files | |
163 | - comm -23 pkg-all-sort-${ghc_version}.files pkg-prof-sort-${ghc_version}.files > pkg-${ghc_version}.files | |
164 | - find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-${ghc_version}" > pkg-doc-${ghc_version}.files | |
165 | - sort pkg-doc-${ghc_version}.files > pkg-doc-sort-${ghc_version}.files | |
122 | + find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files | |
123 | + find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files | |
124 | + find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files | |
125 | + sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files | |
126 | + sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files | |
127 | + comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files | |
128 | + find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files | |
129 | + sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files | |
166 | 130 | # Clean up syntax for %files section |
167 | - cat pkg-${ghc_version}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-${ghc_version}.files | |
168 | - cat pkg-prof-sort-${ghc_version}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-${ghc_version}.files | |
169 | - cat pkg-doc-sort-${ghc_version}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-${ghc_version}.files | |
131 | + cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files | |
132 | + cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files | |
133 | + cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files | |
170 | 134 | } |
171 | - | |
135 | +build_for | |
172 | 136 | |
173 | -%if %{build78} | |
174 | -build_for 7.8.3 | |
175 | -%endif | |
176 | - | |
177 | -%if %{build710} | |
178 | -build_for 7.10.3 | |
179 | -%endif | |
180 | 137 | |
181 | 138 | %install |
182 | 139 |
@@ -192,49 +149,36 @@ | ||
192 | 149 | # %post |
193 | 150 | # The %install section above will only install files |
194 | 151 | # We need to register the package with ghc-pkg for ghc to find it |
195 | -# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-${ghc_version}/%{cname}-%{version}/%{cname}-%{version}.conf | |
152 | +# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf | |
196 | 153 | |
197 | 154 | # %post -n SFEghc78-data-default-class-doc |
198 | -# cd %{_datadir}/doc/ghc-${ghc_version}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
155 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
199 | 156 | |
200 | 157 | # %preun |
201 | 158 | # # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work |
202 | 159 | # /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version} |
203 | 160 | |
204 | 161 | # %postun -n SFEghc78-data-default-class-doc |
205 | -# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-${ghc_version}/html/libraries/gen_contents_index ] ; then | |
206 | -# cd %{_datadir}/doc/ghc-${ghc_version}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
162 | +# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then | |
163 | +# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index | |
207 | 164 | # fi |
208 | 165 | |
209 | 166 | %endif |
210 | 167 | |
211 | 168 | |
212 | -%if %{build78} | |
213 | -%files 78 -f pkg-%{ghc_ver_78}.files | |
169 | +%files 710 -f pkg-%{ghc_ver}.files | |
214 | 170 | %defattr (-, root, bin) |
215 | 171 | |
216 | -%files prof-78 -f pkg-prof-%{ghc_ver_78}.files | |
172 | +%files prof-710 -f pkg-prof-%{ghc_ver}.files | |
217 | 173 | %defattr (-, root, bin) |
218 | 174 | |
219 | -%files doc-78 -f pkg-doc-%{ghc_ver_78}.files | |
175 | +%files doc-710 -f pkg-doc-%{ghc_ver}.files | |
220 | 176 | %defattr(-,root,bin) |
221 | 177 | %dir %attr (0755, root, sys) %{_datadir} |
222 | 178 | %dir %attr (0755, root, other) %{_docdir} |
223 | -%endif | |
224 | - | |
225 | -%if %{build710} | |
226 | -%files 710 -f pkg-%{ghc_ver_710}.files | |
227 | -%defattr (-, root, bin) | |
228 | - | |
229 | -%files prof-710 -f pkg-prof-%{ghc_ver_710}.files | |
230 | -%defattr (-, root, bin) | |
231 | - | |
232 | -%files doc-710 -f pkg-doc-%{ghc_ver_710}.files | |
233 | -%defattr(-,root,bin) | |
234 | -%dir %attr (0755, root, sys) %{_datadir} | |
235 | -%dir %attr (0755, root, other) %{_docdir} | |
236 | -%endif | |
237 | 179 | |
238 | 180 | %changelog |
181 | +* Tue Jan 16 2016 - Osamu Tabata<cantimerny.g@gmail.com> | |
182 | +- build only 7.10 | |
239 | 183 | * Tue Jan 19 2016 - Osamu Tabata<cantimerny.g@gmail.com> |
240 | 184 | - initial commit |