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