summaryrefslogtreecommitdiff
path: root/ghc-Crypto.spec
blob: 1e4573506b464637168780073ff04e5992e3e24d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#
# Conditional build:
%bcond_without	prof	# profiling library
#
%define		pkgname	Crypto
Summary:	Collects together existing Haskell cryptographic functions into a package
Summary(pl.UTF-8):	Zebranie istniejących funkcji kryptograficznych Haskella w pakiet
Name:		ghc-%{pkgname}
Version:	4.2.5.1
Release:	5
License:	BSD, GPL v2+ (depending on module)
Group:		Development/Languages
#Source0Download: http://hackage.haskell.org/package/Crypto
Source0:	http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
# Source0-md5:	e1ec7d91e888107f2544064456f8eb36
URL:		http://hackage.haskell.org/package/Crypto
BuildRequires:	ghc >= 6.12.3
BuildRequires:	ghc-HUnit
BuildRequires:	ghc-QuickCheck >= 2.4.0.1
BuildRequires:	ghc-array
BuildRequires:	ghc-base >= 3
BuildRequires:	ghc-pretty
BuildRequires:	ghc-random
%if %{with prof}
BuildRequires:	ghc-prof >= 6.12.3
BuildRequires:	ghc-HUnit-prof
BuildRequires:	ghc-QuickCheck-prof >= 2.4.0.1
BuildRequires:	ghc-array-prof
BuildRequires:	ghc-base-prof >= 3
BuildRequires:	ghc-pretty-prof
BuildRequires:	ghc-random-prof
%endif
BuildRequires:	latex2html
BuildRequires:	texlive-format-pdflatex
BuildRequires:	texlive-latex
BuildRequires:	rpmbuild(macros) >= 1.608
Requires(post,postun):	/usr/bin/ghc-pkg
%requires_eq	ghc
Requires:	ghc-array
Requires:	ghc-base >= 3
Requires:	ghc-pretty
Requires:	ghc-random
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

# debuginfo is not useful for ghc
%define		_enable_debug_packages	0

# don't compress haddock files
%define		_noautocompressdoc	*.haddock

%description
DES, Blowfish, AES, TEA, SHA1, MD5, RSA, BubbleBabble, Hexdump,
support for Word128, Word192 and Word256 and beyond, PKCS5 padding,
various encryption modes e.g. Cipher Block Chaining all in one
package, with HUnit and QuickCheck tests, and examples.

%description -l pl.UTF-8
DES, Blowfish, AES, TEA, SHA1, MD5, RSA, BubbleBabble, Hexdump,
obsługa typów Word128, Word192, Word256 i dalszych, opakowania PKCS5,
różnych trybów szyfrowania, jak CBC (Cipher Block Chaining) - wszystko
w jednym pakiecie, wraz z testami HUnit i QuickCheck oraz przykładami.

%package prof
Summary:	Profiling %{pkgname} library for GHC
Summary(pl.UTF-8):	Biblioteka profilująca %{pkgname} dla GHC.
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:	ghc-array-prof
Requires:	ghc-base-prof >= 3
Requires:	ghc-pretty-prof
Requires:	ghc-random-prof

%description prof
Profiling %{pkgname} library for GHC. Should be installed when GHC's
profiling subsystem is needed.

%description prof -l pl.UTF-8
Biblioteka profilująca %{pkgname} dla GHC. Powinna być zainstalowana
kiedy potrzebujemy systemu profilującego z GHC.

%prep
%setup -q -n %{pkgname}-%{version}

%build
runhaskell Setup.hs configure -v2 \
	%{?with_prof:--enable-library-profiling} \
	--prefix=%{_prefix} \
	--libdir=%{_libdir} \
	--libexecdir=%{_libexecdir} \
	--docdir=%{_docdir}/%{name}-%{version}

runhaskell Setup.hs build
runhaskell Setup.hs haddock --executables

pdflatex ReadMe.tex

cd dist/build
for f in *Test ; do
	$f/$f
done

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d

runhaskell Setup.hs copy --destdir=$RPM_BUILD_ROOT

# work around automatic haddock docs installation
%{__rm} -rf %{name}-%{version}-doc
cp -a $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} %{name}-%{version}-doc
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}

runhaskell Setup.hs register \
	--gen-pkg-config=$RPM_BUILD_ROOT%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf

%{__rm} $RPM_BUILD_ROOT%{_bindir}/{HMAC,Quick,RSA,SHA1,Symmetric,WordList}Test
%{__rm} $RPM_BUILD_ROOT%{_datadir}/Crypto-%{version}/CryptoHomePage.html

%clean
rm -rf $RPM_BUILD_ROOT

%post
%ghc_pkg_recache

%postun
%ghc_pkg_recache

%files
%defattr(644,root,root,755)
%doc CryptoHomePage.html ReadMe.pdf %{name}-%{version}-doc/*
%{_libdir}/%{ghcdir}/package.conf.d/%{pkgname}.conf
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSCrypto-%{version}-*.so
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSCrypto-%{version}-*.a
%exclude %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSCrypto-%{version}-*_p.a
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Binary
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Binary/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Binary/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/RSA
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/RSA/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/RSA/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Text
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Text/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Text/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.dyn_hi
%dir %{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Digest
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Digest/*.hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Digest/*.dyn_hi

%files prof
%defattr(644,root,root,755)
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/libHSCrypto-%{version}-*_p.a
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Binary/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Encryption/RSA/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Codec/Text/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/*.p_hi
%{_libdir}/%{ghcdir}/%{pkgname}-%{version}/Data/Digest/*.p_hi