aboutsummaryrefslogtreecommitdiffstats
path: root/misc/Botan.spec
blob: 38bb09669c02b1314a238e564f70086cd4155ccc (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
168
169
170
171
# Botan base spec file

# Note that some of the commands in here assume a GNU toolset, which is
# unfortunate and should probably be fixed.

##################################################
# Version numbers and config options             #
##################################################
%define MAJOR $MAJOR
%define MINOR $MINOR
%define PATCH $PATCH

%define ONLY_BASE_MODS 0

##################################################
# Hardware restrictions on various modules       #
##################################################
%define USE_TM_HARD i586 i686 athlon x86_64 alpha sparcv9 sparc64
%define USE_MP64    alpha ppc64 ia64 x86_64

##################################################
# Module settings                                #
##################################################
%define BASE_MODS alloc_mmap,ml_unix,es_egd,es_ftw,es_unix,fd_unix,tm_unix
%define EXTRA_MODS comp_bzip2,comp_zlib,mux_pthr,tm_posix,eng_gmp

%ifarch %{USE_TM_HARD}
  %{expand: %%define EXTRA_MODS %{EXTRA_MODS},tm_hard}
%endif

%ifarch %{USE_MP64}
  %{expand: %%define EXTRA_MODS %{EXTRA_MODS},mp_asm64}
%endif

%if %{ONLY_BASE_MODS}
  %define MODULES %{BASE_MODS}
%else
  %define MODULES %{BASE_MODS},%{EXTRA_MODS}
%endif

##################################################
# Descriptions                                   #
##################################################
%define VERSION %{MAJOR}.%{MINOR}.%{PATCH}

Name: Botan
Summary: A C++ crypto library
Version: %{VERSION}
Release: 1
License: BSD
Group: System Environment/Libraries
Source: http://botan.randombit.net/files/%{name}-%{VERSION}.tgz
URL: http://botan.randombit.net/
Packager: Jack Lloyd <lloyd@randombit.net>
Prefix: /usr
BuildRequires: perl make

%if ! %{ONLY_BASE_MODS}
Requires: zlib, bzip2 >= 1.0.2, gmp >= 4.1
BuildRequires: zlib-devel, bzip2-devel >= 1.0.2, gmp-devel >= 4.1
%endif

BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
Botan is a C++ library which provides support for many common cryptographic
operations, including encryption, authentication, and X.509v3 certificates and
CRLs. A wide variety of algorithms is supported, including RSA, DSA, DES, AES,
MD5, and SHA-1.

%package devel
Summary: Development files for Botan
Group: Development/Libraries
Requires: Botan = %{VERSION}
%description devel
This package contains the header files and libraries needed to develop programs
that use the Botan library.

##################################################
# Main Logic                                     #
##################################################
%prep
%setup -n Botan-%{VERSION}

%build
./configure.pl --noauto --modules=%{MODULES} gcc-%{_target_os}-%{_target_cpu}
make shared static

%clean
rm -rf $RPM_BUILD_ROOT

%install
ROOT="$RPM_BUILD_ROOT/usr"
make OWNER=`id -u` GROUP=`id -g` INSTALLROOT="$ROOT" install

# Need this since we're installing shared libs...
%post
if ! grep "^$RPM_INSTALL_PREFIX/lib$" /etc/ld.so.conf 2>&1 >/dev/null
then
   echo "$RPM_INSTALL_PREFIX/lib" >>/etc/ld.so.conf
fi
/sbin/ldconfig -X

%postun
RMDIR_IGNORE_NONEMPTY="rmdir --ignore-fail-on-non-empty"
/sbin/ldconfig -X
if [ -d $RPM_INSTALL_PREFIX/share/doc/Botan-%{VERSION} ]; then
   $RMDIR_IGNORE_NONEMPTY $RPM_INSTALL_PREFIX/share/doc/Botan-%{VERSION}
fi

%postun devel
RMDIR_IGNORE_NONEMPTY="rmdir --ignore-fail-on-non-empty"
if [ -d $RPM_INSTALL_PREFIX/include/botan ]; then
   $RMDIR_IGNORE_NONEMPTY $RPM_INSTALL_PREFIX/include/botan
fi

##################################################
# File Lists                                     #
##################################################
%files
%defattr(-,root,root)
%docdir /usr/share/doc/Botan-%{VERSION}/
/usr/share/doc/Botan-%{VERSION}/license.txt
/usr/share/doc/Botan-%{VERSION}/readme.txt
/usr/share/doc/Botan-%{VERSION}/log.txt
/usr/share/doc/Botan-%{VERSION}/thanks.txt
/usr/share/doc/Botan-%{VERSION}/credits.txt
/usr/share/doc/Botan-%{VERSION}/pgpkeys.asc
/usr/share/doc/Botan-%{VERSION}/info.txt
/usr/lib/libbotan-%{MAJOR}.%{MINOR}.%{PATCH}.so

%files devel
%defattr(-,root,root)
%docdir /usr/share/doc/Botan-%{VERSION}/
/usr/share/doc/Botan-%{VERSION}/api.tex
/usr/share/doc/Botan-%{VERSION}/api.pdf
/usr/share/doc/Botan-%{VERSION}/tutorial.tex
/usr/share/doc/Botan-%{VERSION}/tutorial.pdf
/usr/share/doc/Botan-%{VERSION}/fips140.tex
/usr/share/doc/Botan-%{VERSION}/fips140.pdf
/usr/share/doc/Botan-%{VERSION}/todo.txt
/usr/share/doc/Botan-%{VERSION}/bugs.txt
/usr/share/doc/Botan-%{VERSION}/botan.rc
/usr/lib/libbotan.so
/usr/lib/libbotan.a
/usr/include/botan/
/usr/bin/botan-config

##################################################
# Changelog                                      #
##################################################
%changelog
* Wed Mar 17 2004 lloyd@randombit.net
 - Changed EXTRA_MODS to include eng_gmp, not mp_gmp
 - Requires: included uneeded stuff if ONLY_BASE_MODS was used

* Sun Feb 1 2004 lloyd@randombit.net
 - The Source: tag pointed to nowhere
 - Removed the FIPS 140 stuff, it was messy and broken

* Mon Dec 1 2003 lloyd@randombit.net
 - Cleaned up module handling
 - Added a preliminary FIPS 140-2 toggle
 - Use %defattr

* Tue Nov 30 2003 lloyd@randombit.net
 - Default to installing into /usr instead of /usr/local
 - Use tm_hard on sparcv9

* Tue Nov 23 2003 lloyd@randombit.net
 - Cleaned up the declaration of TIMERS