Summary: Pseudo Random Number Generator Daemon Name: prngd Version: 0.9.23 Release: 3 Group: System Environment/Daemons Source: ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/related/prngd/prngd-%{version}.tar.gz Source1: IBM_ILA License: IBM_ILA URL: http://ftp.aet.TU-Cottbus.DE/personen/jaenicke/postfix_tls/prngd.html BuildRoot: /var/tmp/%{name}-root Prefix: %{_prefix} %define DEFCC cc %description - This is the PRNGD "Pseudo Random Number Generator Daemon". It offers an EGD compatible interface to obtain random data and is intended to be used as an entropy source to feed other software, especially software based on OpenSSL. - Like EGD it calls system programs to collect entropy. - Unlike EGD it does not generate a pool of random bits that can be called from other software. Rather more it feeds the bits gathered into its internal PRNG from which the "random bits" are obtained when requested. This way, PRNGD is never drained and can never block (unlike EGD), so it is also suitable to seed inetd-started programs. It also features a seed-save file, so that it is immediately usable after system start. %prep %setup -q # Add license info cat $RPM_SOURCE_DIR/IBM_ILA > LICENSE cat $RPM_SOURCE_DIR/%{name}.txt >> LICENSE %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} else export CC=gcc fi fi if test "X$CC" != "Xgcc" then export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` export CFLAGS="$RPM_OPT_FLAGS" fi make "CC=$CC" CFLAGS="$CFLAGS -DAIX43" %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{prefix}/sbin mkdir -p $RPM_BUILD_ROOT/etc install -c -m555 prngd $RPM_BUILD_ROOT%{prefix}/sbin install -c -m644 contrib/AIX-4.3/prngd.conf.aix43 $RPM_BUILD_ROOT/etc/prngd.conf /usr/bin/strip $RPM_BUILD_ROOT%{prefix}/sbin/prngd || : (cd $RPM_BUILD_ROOT mkdir -p usr/sbin cd usr/sbin ln -sf ../..%{prefix}/sbin/* . cd - ) %post # Comment out prngd.conf entries that do not exist on the system # being installed. (If perl isn't there, just proceed anyway # and skip this part; would just result in annoying messages # for those commands that are not present). if [[ -x /usr/bin/perl ]] ; then /usr/bin/perl </tmp/$$.txt"); while (){ \$cur = \$_; ### Proceed on newlines and comments if( (\$cur eq "\n") || (\$cur =~ /^\#/ )){ print OUT \$cur; next; } /.*\s{1}(.*)\s{1}.*\d{1}\.\d+\$/; \$file = \$1; ### filename we need to check # if file exists, just print, else comment it out print OUT "\#\$cur" unless -e \$file; print OUT "\$cur" if -e \$file; } ### end while close(SESAME); close(OUT); EOD cp /tmp/$$.txt /etc/prngd.conf rm /tmp/$$.txt fi /usr/bin/lssrc -s prngd >/dev/null 2>&1 || { /usr/bin/mkssys -s prngd -p /opt/freeware/sbin/prngd -a \ '-f /dev/egd-pool -m 666' -u 0 -S -n 15 -f 9 -R -G prng >/dev/null || : /usr/sbin/lsitab prng >/dev/null || /usr/sbin/mkitab -i srcmstr "prng:2:wait:/usr/bin/startsrc -sprngd" [[ -z "$INUBOSTYPE" ]] && /usr/bin/startsrc -s prngd && exit $? } exit 0 %preun if [ $1 = 0 ]; then /usr/bin/lssrc -s prngd >/dev/null 2>&1 && { /usr/bin/stopsrc -s prngd >/dev/null 2>&1 /usr/bin/rmssys -s prngd >/dev/null 2>&1 /usr/sbin/lsitab prng >/dev/null && /usr/sbin/rmitab prng >/dev/null 2>&1 } fi exit 0 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{prefix}/sbin/* %config /etc/prngd.conf %doc 00DESIGN 00README 00README.gatherers ChangeLog LICENSE %changelog * Fri Nov 22 2002 David Clissold - Add IBM ILA license. * Fri Aug 02 2002 David Clissold - In addition to Chris's change below, I am adding a patch donated by - Roderick Schertler to not print the pesky - "sent X bytes to service Y" message to the console every time something - uses the daemon; the messages are still available in debug mode. - See http://www-124.ibm.com/pipermail/aixtoolbox-list/2002-July/000985.html * Fri Aug 02 2002 Chris Tysor - Comment out files from /etc/prngd.conf that do not exist - on the system * Wed Oct 03 2001 David Clissold - Update to level 0.9.23. * Thu Sep 20 2001 David Clissold - comment out pstat from /etc/prngd.conf; not available on all AIX levels * Thu Aug 02 2001 Marc Stephenson - Don't start daemon during system installation * Wed Jul 11 2001 Marc Stephenson - Adapt for AIX Toolbox