File: dieharder.spec.in

package info (click to toggle)
dieharder 3.31.1-7
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 7,316 kB
  • ctags: 2,692
  • sloc: ansic: 16,937; sh: 10,158; makefile: 498; perl: 73; php: 2
file content (187 lines) | stat: -rw-r--r-- 6,857 bytes parent folder | download | duplicates (5)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
%define _unpackaged_files_terminate_build 0
%define __arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot


Name: dieharder-src
Summary: Dieharder is a random number generator tester and timer
%define version @VERSION@
%define release @RELEASE@
Version: %{version}
Release: %{release}
License: Open Source (GPL)
Group: Development/Tools
Source: dieharder-%{version}.tgz
URL: http://www.phy.duke.edu/~rgb/General/dieharder.php
Requires: gsl
BuildRequires: chrpath gsl-devel

# Mandatory path for Fedora Core builds
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description 

########################################################################
# LIBRARY: This is the basic dieharder library
########################################################################
%package -n libdieharder
Summary: A library of random number generator tests and timing routines
Group: Development/Tools
Provides: libdieharder.so
%description -n libdieharder

libdieharder is the core library of dieharder and friends, designed to
be "the last suite of random number testers you'll ever wear".  It can
test any of its many prebuilt and library linked generators (basically
all of those in the Gnu Scientific Library plus a number of others from
various sources) or a potentially random dataset in either an
ascii-formatted or raw (presumed 32 bit uint) binary file.  It is fairly
straightforward to wrap new software generators for testing, or to add
hardware generators that have a software interface for testing, and the
file input method permits pretty much any software or hardware RNG to be
tested using libdieharder calls.

libdieharder has as a design goal the full encapsulation in an
extensible shell of basically all the random number tests I have been
able to find -- George Marsaglia's "diehard" battery of tests, STS
(v1.6) from NIST FIPS, Knuth's tests, and more.  Check in the man
page(s) or /usr/share/dieharder*/dieharder.pdf for documentation.

########################################################################
# This is dieharder itself, the tty UI
########################################################################
%package -n dieharder
Summary: dieharder is a random number generator tester and timer.
Group: Development/Tools
Requires: libdieharder = %{version}

%description -n dieharder

dieharder is a fairly involved random number/uniform deviate generator
tester.  It can either test any of its many prebuilt and linked
generators (basically all of those in the Gnu Scientific Library plus
others I've added) or a potentially random dataset in a file.  With file
input, it can manage either a variety of ascii-formatted input or a raw
binary bitstring.  It is thus suitable for use in testing both software
RNG's and hardware RNG's.

dieharder does all of its work with a standalone, extensible library,
libdieharder.  Its tests can therefore be integrated into other
programs, subject to the requirements of the GPL (NOT, note, the LGPL as
it uses the GSL which is full GSL, viral).

dieharder encapsulates (or will eventually encapsulate) basically all
the random number tests I have been able to find -- George Marsaglia's
"diehard" battery of tests, STS (v1.5) from NIST FIPS, Knuth's tests,
and more.  Check in the man page or /usr/share documentation for a
complete list of the tests and references where possible.  It is
intended to be the "swiss army knife of random number testers", or "the
last suite of random number testers you'll ever wear".

########################################################################
# The main section common to all builds.
########################################################################
%prep
%setup -q -n dieharder-%{version}
./autogen.sh


%configure
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

%build
./configure --prefix=$RPM_BUILD_ROOT%{_prefix} --libdir=$RPM_BUILD_ROOT%{_libdir}
make

# Note that multipackage sources with libraries are happier with
# their own local buildroot to facilitate development without a
# full install.
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{_prefix} install
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/dieharder
rm -rf $RPM_BUILD_ROOT%{_libdir}/libdieharder.a
rm -rf $RPM_BUILD_ROOT%{_libdir}/libdieharder.la
rm -rf $RPM_BUILD_ROOT%{_libdir}/libdieharder.so.?

# make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \
#     mandir=$RPM_BUILD_ROOT%{_mandir} libdir=$RPM_BUILD_ROOT%{_libdir} \
#     localstatedir=$RPM_BUILD_ROOT%{_localstatedir} \
#     datadir=$RPM_BUILD_ROOT%{_datadir} \
#     includedir=$RPM_BUILD_ROOT%{_includedir} \
#     sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install

%clean
rm -rf $RPM_BUILD_ROOT

########################################################################
# Files in libdieharder
########################################################################
%files -n libdieharder

%defattr(-,root,root)

%dir %{_libdir}

# The libdieharder library.  We ONLY install the primary
# versioned library -- ldconfig and ln are used to finish off
# later.
# %{_libdir}/libdieharder.so.%{version}
%{_libdir}/libdieharder.so.@DIEHARDER_LIB_VERSION@
%{_libdir}/libdieharder.so

# The libdieharder include files are under here
%attr(644,root,root) /usr/include/dieharder

# The libdieharder man page
%attr(644,root,root) /usr/share/man/man3/libdieharder.3.gz

# These are all pretty much standard.
%doc ChangeLog Copyright README COPYING NOTES dieharder.html

########################################################################
# Files installed with the dieharder tty UI
########################################################################
%files -n dieharder
%defattr(-,root,root)

# The dieharder binary
%attr(755,root,root) /usr/bin/dieharder

# This is supposed to be installed by/for the GBT?
%attr(755,root,root) /usr/bin/dieharder-config

# The dieharder man page
%attr(644,root,root) /usr/share/man/man1/dieharder.1.gz

# These are all pretty much standard.
%doc ChangeLog Copyright README COPYING NOTES dieharder.html

########################################################################
# Command to execute post install or uninstall of libdieharder
########################################################################
%post -n libdieharder

if [ -d /usr/lib64 ]
then
  cd /usr/lib64
  # ln -sf libdieharder.so.%{version} libdieharder.so
  ldconfig -n .
else
  cd /usr/lib
  # ln -sf libdieharder.so.%{version} libdieharder.so
  ldconfig -n .
fi

%postun -n libdieharder

if [ -d /usr/lib64 ]
then
  rm -f /usr/lib64/libdieharder.so
  rm -f /usr/lib64/libdieharder.so.%{version}
  ldconfig
else
  rm -f /usr/lib/libdieharder.so
  rm -f /usr/lib/libdieharder.so.%{version}
  ldconfig
fi