• R/O
  • SSH

contrib-spec-files: Commit

日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。


Commit MetaInfo

Revision1ebbeba82df7cf1a0da6ef5cf38d69ca3965b84e (tree)
Time2017-01-03 12:26:42
AuthorOsamu Tabata <cantimerny.g@gmai...>
CommiterOsamu Tabata

Log Message

spec_SFEghc-cryptohash-sha256: initial commit

Change Summary

Incremental Difference

diff -r 3cde205d6d75 -r 1ebbeba82df7 specs/SFEghc-cryptohash-sha256.spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/specs/SFEghc-cryptohash-sha256.spec Tue Jan 03 12:26:42 2017 +0900
@@ -0,0 +1,216 @@
1+#
2+# spec file for package SFEghc-cryptohash-sha256
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 8.0.1
13+%include stackage-lts-version-set.inc
14+
15+%define oracle_solaris_11 %(grep 'Oracle Solaris 11' /etc/release > /dev/null ; if [ $? -eq 0 ]; then echo '1'; else echo '0'; fi)
16+
17+%define pname cryptohash-sha256
18+
19+Name: SFEghc-%{pname}
20+IPS_package_name: library/ghc/%{pname}
21+Group: Development/Languages/Haskell
22+Version: 0.11.100.1
23+License: BSD3
24+URL: https://github.com/hvr/cryptohash-sha256
25+Summary: Fast, pure and practical SHA-256 implementation
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-80 = %{ghc_ver}
32+BuildRequires: developer/ghc-80/prof = %{ghc_ver}
33+BuildRequires: library/ghc/hscolour-80 = %{hscolour_ver}
34+BuildRequires: library/ghc/hscolour-80/prof = %{hscolour_ver}
35+
36+%description
37+A practical incremental and one-pass, pure API to the
38+<https://en.wikipedia.org/wiki/SHA-2 SHA-256 hash algorithm>
39+(including <https://en.wikipedia.org/wiki/HMAC HMAC> support)
40+with performance close to the fastest implementations available in other languages.
41+.
42+The implementation is made in C with a haskell FFI wrapper that hides the C implementation.
43+.
44+NOTE: This package has been forked off @cryptohash-0.11.7@ because the @cryptohash@ package has been
45+deprecated and so this package continues to satisfy the need for a lightweight package
46+providing the SHA256 hash algorithm without any dependencies on packages other than
47+@base@ and @bytestring@.
48+.
49+Consequently, this package can be used as a drop-in replacement for @cryptohash@'s
50+"Crypto.Hash.SHA256" module, though with a clearly smaller footprint.
51+
52+
53+
54+
55+%package 80
56+IPS_package_name: library/ghc/%{pname}-80
57+Summary: cryptohash-sha256 system
58+SUNW_BaseDir: %{_basedir}
59+%include default-depend.inc
60+Requires: developer/ghc-80 = %{ghc_ver}
61+Requires: library/ghc/hscolour-80 = %{hscolour_ver}
62+
63+%package prof-80
64+IPS_package_name: library/ghc/%{pname}-80/prof
65+Summary: %{summary} - profiling libraries
66+SUNW_BaseDir: %{_basedir}
67+%include default-depend.inc
68+Requires: developer/ghc-80/prof = %{ghc_ver}
69+Requires: library/ghc/%{pname}-80
70+Requires: library/ghc/hscolour-80/prof = %{hscolour_ver}
71+
72+%package doc-80
73+IPS_package_name: library/ghc/%{pname}-80/doc
74+Summary: %{summary} - doc files
75+SUNW_BaseDir: %{_basedir}
76+%include default-depend.inc
77+Requires: library/ghc/%{pname}-80
78+
79+%description 80
80+A practical incremental and one-pass, pure API to the
81+<https://en.wikipedia.org/wiki/SHA-2 SHA-256 hash algorithm>
82+(including <https://en.wikipedia.org/wiki/HMAC HMAC> support)
83+with performance close to the fastest implementations available in other languages.
84+.
85+The implementation is made in C with a haskell FFI wrapper that hides the C implementation.
86+.
87+NOTE: This package has been forked off @cryptohash-0.11.7@ because the @cryptohash@ package has been
88+deprecated and so this package continues to satisfy the need for a lightweight package
89+providing the SHA256 hash algorithm without any dependencies on packages other than
90+@base@ and @bytestring@.
91+.
92+Consequently, this package can be used as a drop-in replacement for @cryptohash@'s
93+"Crypto.Hash.SHA256" module, though with a clearly smaller footprint.
94+
95+
96+
97+
98+%prep
99+%setup -q -n %{pname}-%{version}
100+
101+%build
102+
103+build_for () {
104+ CPUNUM=$(psrinfo | gawk '$2=="on-line"{cpus++}END{print (cpus==0)?1:cpus}')
105+ CPUS=$(test $CPUNUM -ge 4 && echo 4 || echo $CPUNUM)
106+ CPUS=1
107+ # Need to use same gcc as we used to build ghc (gcc 4.x)
108+ export CC=/usr/bin/gcc
109+ export CXX=/usr/bin/g++
110+ export CXXFLAGS="%{gcc_cxx_optflags}"
111+ export CFLAGS="%optflags"
112+ export LD_LIBRARY_PATH=/usr/gnu/lib:/usr/lib:$LD_LIBRARY_PATH
113+ export PKG_CONFIG_PATH="%_pkg_config_path"
114+ export PERL="/usr/perl5/bin/perl"
115+
116+ %if %{oracle_solaris_11}
117+ export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib'
118+ export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib'
119+ %else
120+ export LDFLAGS="-L%{_libdir} -R%{_libdir}"
121+ %endif
122+
123+ GHC=/usr/gnu/bin/ghc-%{ghc_ver}
124+ GHC_PKG=/usr/gnu/bin/ghc-pkg-%{ghc_ver}
125+ HSC2HS=/usr/gnu/bin/hsc2hs-%{ghc_ver}
126+ HADDOCK=/usr/gnu/bin/haddock-ghc-%{ghc_ver}
127+ VERBOSE=--verbose=2
128+
129+ chmod a+x ./Setup.hs
130+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs clean
131+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs configure --prefix=%{_prefix} \
132+ --libdir=%{_libdir} \
133+ --docdir=%{_datadir}/doc/ghc-%{ghc_ver}/%{pname}-%{version} \
134+ --htmldir=%{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/%{pname}-%{version} \
135+ --libsubdir=%{pname}-%{version}/ghc-%{ghc_ver} \
136+ --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} --with-haddock=${HADDOCK} \
137+ --haddock-option="--html" \
138+ --enable-library-profiling \
139+ ${VERBOSE}
140+
141+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs build ${VERBOSE} -j$CPUS
142+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs haddock ${VERBOSE} --executables --hoogle --hyperlink-source
143+
144+ install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}
145+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs register ${VERBOSE} --gen-pkg-config=%{pname}-%{version}.conf
146+ /usr/gnu/bin/runghc-%{ghc_ver} ./Setup.hs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT}
147+
148+ install -d ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/
149+ install -c -m 755 %{pname}-%{version}.conf ${RPM_BUILD_ROOT}%{_libdir}/ghc-%{ghc_ver}/%{pname}-%{version}/%{pname}-%{version}.conf
150+
151+ # LICENCE FILE
152+ # mv $RPM_BUILD_ROOT%{_datadir}/doc/%{pname}-%{version} $RPM_BUILD_ROOT%/%{_datadir}/doc/ghc-%{ghc_ver}
153+ # # Prepare lists of files for packaging
154+ # cd %{_builddir}/%{pname}-%{version}
155+ find $RPM_BUILD_ROOT -type f -name "*.p_hi" | grep "ghc-%{ghc_ver}" > pkg-prof-%{ghc_ver}.files
156+ find $RPM_BUILD_ROOT -type f -name "*_p.a" | grep "ghc-%{ghc_ver}" >> pkg-prof-%{ghc_ver}.files
157+ find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-all-%{ghc_ver}.files
158+ sort pkg-prof-%{ghc_ver}.files > pkg-prof-sort-%{ghc_ver}.files
159+ sort pkg-all-%{ghc_ver}.files > pkg-all-sort-%{ghc_ver}.files
160+ comm -23 pkg-all-sort-%{ghc_ver}.files pkg-prof-sort-%{ghc_ver}.files > pkg-%{ghc_ver}.files
161+ find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" | grep "ghc-%{ghc_ver}" > pkg-doc-%{ghc_ver}.files
162+ sort pkg-doc-%{ghc_ver}.files > pkg-doc-sort-%{ghc_ver}.files
163+ # Clean up syntax for %files section
164+ cat pkg-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-%{ghc_ver}.files
165+ cat pkg-prof-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof-%{ghc_ver}.files
166+ cat pkg-doc-sort-%{ghc_ver}.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc-%{ghc_ver}.files
167+}
168+build_for
169+
170+
171+%install
172+
173+
174+%clean
175+rm -rf $RPM_BUILD_ROOT
176+
177+
178+%if %{oracle_solaris_11}
179+ # pass
180+%else
181+ # not solaris11
182+# %post
183+# The %install section above will only install files
184+# We need to register the package with ghc-pkg for ghc to find it
185+# /usr/bin/ghc-pkg register --global --force %{_libdir}/ghc-%{ghc_ver}/%{cname}-%{version}/%{cname}-%{version}.conf
186+
187+# %post -n SFEghc78-cryptohash-sha256-doc
188+# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index
189+
190+# %preun
191+# # Need to unregister the package with ghc-pkg for the rebuild of the spec file to work
192+# /usr/bin/ghc-pkg unregister --global --force %{pname}-%{version}
193+
194+# %postun -n SFEghc78-cryptohash-sha256-doc
195+# if [ "$1" -eq 0 ] && [ -x %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries/gen_contents_index ] ; then
196+# cd %{_datadir}/doc/ghc-%{ghc_ver}/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index
197+# fi
198+
199+%endif
200+
201+
202+%files 80 -f pkg-%{ghc_ver}.files
203+%defattr (-, root, bin)
204+
205+%files prof-80 -f pkg-prof-%{ghc_ver}.files
206+%defattr (-, root, bin)
207+
208+%files doc-80 -f pkg-doc-%{ghc_ver}.files
209+%defattr(-,root,bin)
210+%dir %attr (0755, root, sys) %{_datadir}
211+%dir %attr (0755, root, other) %{_docdir}
212+
213+
214+%changelog
215+* Tue Jan 03 2017 - Osamu Tabata<cantimerny.g@gmail.com>
216+- initial commit
diff -r 3cde205d6d75 -r 1ebbeba82df7 specs/copyright/ghc-cryptohash-sha256.copyright
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/specs/copyright/ghc-cryptohash-sha256.copyright Tue Jan 03 12:26:42 2017 +0900
@@ -0,0 +1,28 @@
1+Copyright (c) 2010-2014 Vincent Hanquez <vincent@snarc.org>
2+ 2016 Herbert Valerio Riedel <hvr@gnu.org>
3+
4+All rights reserved.
5+
6+Redistribution and use in source and binary forms, with or without
7+modification, are permitted provided that the following conditions
8+are met:
9+1. Redistributions of source code must retain the above copyright
10+ notice, this list of conditions and the following disclaimer.
11+2. Redistributions in binary form must reproduce the above copyright
12+ notice, this list of conditions and the following disclaimer in the
13+ documentation and/or other materials provided with the distribution.
14+3. Neither the name of the author nor the names of his contributors
15+ may be used to endorse or promote products derived from this software
16+ without specific prior written permission.
17+
18+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
22+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+SUCH DAMAGE.
Show on old repository browser