Added specfile changes and patch from Steve Grubb to normalize package

epel9
Emily Ratliff 17 years ago
parent 8e35b1c45f
commit e854b2cda5

@ -0,0 +1,91 @@
--- trousers-0.3.1.orig/dist/fedora/fedora.initrd.tcsd 2008-03-28 15:07:20.000000000 -0700
+++ trousers-0.3.1/dist/fedora/fedora.initrd.tcsd 2008-03-28 15:18:56.000000000 -0700
@@ -21,33 +21,79 @@ prog="tcsd"
# Some variables to make the below more readable
TCSD=/usr/sbin/tcsd
PID_FILE=/var/run/tcsd.pid
-INSMOD=/sbin/insmod
+MODPROBE=/sbin/modprobe
LSMOD=/sbin/lsmod
GREP=/bin/grep
+PWD=/bin/pwd
+MOD_DIR=/lib/modules/$(uname -r)/kernel/drivers/char/tpm
+START_OPT=" start"
load_drivers()
{
- for d in `echo /lib/modules/$(uname -r)/kernel/drivers/char/tpm/tpm_*`; do
- $INSMOD $d
- if test $? -eq 0; then
- break;
+ CUR_DIR=`$PWD`
+ cd $MOD_DIR
+
+ # Must load tpm_bios.ko first
+ $MODPROBE tpm_bios >/dev/null 2>&1
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ failure "Load tpm_bios"
+ echo
+ cd $CUR_DIR
+ return $RETVAL
+ fi
+
+ # Must load tpm.ko second
+ $MODPROBE tpm >/dev/null 2>&1
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ failure "Load tpm"
+ echo
+ cd $CUR_DIR
+ return $RETVAL
+ fi
+
+ # Attempt to load remaining tpm_*.ko
+ # But do NOT return error if they fail
+ for d in `echo tpm_*`; do
+ if [ "$d" != "tpm_bios.ko" ]
+ then
+ m=${d%".ko"}
+ $MODPROBE $m >/dev/null 2>&1
fi
done
+
+ cd $CUR_DIR
+ success "Load tpm"
+ echo
+ return $RETVAL
}
check_drivers()
{
- $LSMOD | $GREP tpm_
+ $LSMOD | $GREP tpm_ >/dev/null 2>&1
+ RETVAL=$?
+ return $RETVAL
}
start()
{
- check_drivers || load_drivers || failure
+ check_drivers
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ load_drivers
+ RETVAL=$?
+ fi
+ if [ $RETVAL -ne 0 ]; then
+ failure $"Loading drivers"
+ fi
echo -n $"Starting $prog: "
- $TCSD $OPTIONS && success || failure
+ $TCSD $START_OPT && success
+ echo
+ touch /var/lock/subsys/tcsd && success
RETVAL=$?
- [ "$RETVAL" = 0 ] && touch /var/lock/subsys/tcsd
echo
+ return $RETVAL
}
stop()

@ -3,10 +3,10 @@
%define name trousers
%define version 0.3.1
%define release 8
%define release 9
Name: %{name}
Summary: Implementation of the TCG's Software Stack v1.2 Specification
Summary: TCG's Software Stack v1.2
Version: %{version}
Release: %{release}%{?dist}
License: CPL
@ -25,6 +25,7 @@ Requires(preun): /sbin/service
Patch0: trousers-0.3.1-remove-group-install-code.patch
Patch1: trousers-0.3.1-limits.patch
Patch2: trousers-0.3.1-cast.patch
Patch3: trousers-0.3.1-module-ordering.patch
%description
TrouSerS is an implementation of the Trusted Computing Group's Software Stack
@ -36,6 +37,7 @@ state using cryptographic hashes and more.
%package static
Summary: TrouSerS TCG Device Driver Library
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
The TCG Device Driver Library (TDDL) used by the TrouSerS tcsd as the
@ -57,13 +59,14 @@ applications.
%patch0 -p1
%patch1 -p2
%patch2 -p1
%patch3 -p1
%build
%configure
make %{?_smp_mflags}
%install
mkdir -p ${RPM_BUILD_ROOT}
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/lib/tpm
mkdir -p ${RPM_BUILD_ROOT}/%{_initrddir}
cp -p dist/fedora/fedora.initrd.tcsd ${RPM_BUILD_ROOT}/%{_initrddir}/tcsd
@ -97,8 +100,8 @@ if [ $1 -gt 1 ]; then
fi
%files
%doc README AUTHORS LICENSE ChangeLog
%defattr(-, root, root, -)
%doc README AUTHORS LICENSE ChangeLog
%attr(755, tss, tss) %{_sbindir}/tcsd
%{_libdir}/libtspi.so.?
%{_libdir}/libtspi.so.?.?.?
@ -117,10 +120,14 @@ fi
%{_mandir}/man3/Tspi_*
%files static
%defattr(-, root, root, -)
# The only static library shipped by trousers, the TDDL
%{_libdir}/libtddl.a
%changelog
* Fri Aug 01 2008 Emily Ratliff <ratliff@austin.ibm.com> - 0.3.1-9
- Incorporated changes from the RHEL package which were done by Steve Grubb
* Wed Jun 04 2008 Emily Ratliff <ratliff@austin.ibm.com> - 0.3.1-8
- Fix cast issue preventing successful build on ppc64 and x86_64

Loading…
Cancel
Save