[openpts] Initial build on F16 Latest upstream release 0.2.4 Enabled support for tnc and tboot Upstream change

avesh agarwal avesh at fedoraproject.org
Tue Jun 7 20:06:06 UTC 2011


commit 00a70cd72efde9c9a69069e836daf7607ace9c36
Author: Avesh Agarwal <avagarwa at redhat.com>
Date:   Tue Jun 7 16:05:56 2011 -0400

    Initial build on F16
    Latest upstream release 0.2.4
    Enabled support for tnc and tboot
    Upstream changes: ptscd to ptsc, and ptscd.conf to ptsc.conf
    Fixed cleaning of tpm_emaulator and tboot dirs upon uninstall
    Many changes to spec file due to enabling of tnc and tboot
    Fixed local patches

 .gitignore        |    1 +
 bugs.patch        |   30 ++++++++++
 init-script.patch |   19 ++++++
 openpts.spec      |  168 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources           |    1 +
 5 files changed, 219 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..89b63e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/openpts-0.2.4.tgz
diff --git a/bugs.patch b/bugs.patch
new file mode 100644
index 0000000..df667a1
--- /dev/null
+++ b/bugs.patch
@@ -0,0 +1,30 @@
+diff -urNp openpts-0.2.4-cvs-patched/src/fsm.c openpts-0.2.4-current/src/fsm.c
+--- openpts-0.2.4-cvs-patched/src/fsm.c	2011-05-09 13:33:10.336421448 -0400
++++ openpts-0.2.4-current/src/fsm.c	2011-05-09 14:05:21.814459969 -0400
+@@ -757,7 +757,7 @@ char *getEventString(OPENPTS_PCR_EVENT_W
+     /* event */
+     event = eventWrapper->event;
+     if (event != NULL) {
+-        // len = snprintf(buf, size, "PCR[%d],TYPE=%d", (int)event->ulPcrIndex, event->eventType);
++        snprintf(buf, size, "PCR[%d],TYPE=%d", (int)event->ulPcrIndex, event->eventType);
+     } else {
+         ERROR("NULL event\n");  // TODO(munetoh)
+         free(buf);
+diff -urNp openpts-0.2.4-cvs-patched/src/iml.c openpts-0.2.4-current/src/iml.c
+--- openpts-0.2.4-cvs-patched/src/iml.c	2011-05-09 13:33:10.337421438 -0400
++++ openpts-0.2.4-current/src/iml.c	2011-05-09 14:10:10.707623882 -0400
+@@ -1972,10 +1972,10 @@ int printImlByPcr(
+         }
+ 
+         /* base64 */
+-        // len = encodeBase64(
+-        //     (unsigned char *)buf,
+-        //     (unsigned char *)eventWrapper->event->rgbPcrValue,
+-         //   20);
++        encodeBase64(
++            (unsigned char *)buf,
++            (unsigned char *)eventWrapper->event->rgbPcrValue,
++            20);
+ 
+         printf(" (%s) \n", buf);
+         eventWrapper = eventWrapper->next_pcr;
diff --git a/init-script.patch b/init-script.patch
new file mode 100644
index 0000000..17e6115
--- /dev/null
+++ b/init-script.patch
@@ -0,0 +1,19 @@
+diff -urNp openpts-0.2.4-cvs-patched/dist/fedora.initrd.ptscd openpts-0.2.4-current/dist/fedora.initrd.ptscd
+--- openpts-0.2.4-cvs-patched/dist/fedora.initrd.ptscd	2011-05-09 13:33:10.333421478 -0400
++++ openpts-0.2.4-current/dist/fedora.initrd.ptscd	2011-05-09 13:53:46.893282066 -0400
+@@ -87,13 +87,13 @@ case "$1" in
+ 		reload
+ 		;;
+ 	condrestart|try-restart)
+-		if [ -f /var/lock/subsys/openpts ] ; then
++		if [ -f /var/lock/subsys/ptscd ] ; then
+ 			restart
+ 		fi
+ 		;;
+ 	*)
+ 		echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
+-		RETVAL=3
++		RETVAL=2
+ esac
+ exit $RETVAL
+ 
diff --git a/openpts.spec b/openpts.spec
new file mode 100644
index 0000000..31d0433
--- /dev/null
+++ b/openpts.spec
@@ -0,0 +1,168 @@
+%define with_tboot 1
+%define with_libtnc 1
+
+Summary: TCG Platform Trust Service (PTS) for embedded devices
+Name: openpts
+Version: 0.2.4
+
+Release: 1%{?dist}
+License: CPL
+Url: http://sourceforge.jp/projects/openpts/
+Source0: http://sourceforge.jp/projects/openpts/downloads/51879/openpts-%{version}.tgz
+
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires:  autoconf automake libtool trousers-devel openssl-devel 
+BuildRequires: libxml2-devel libuuid-devel gettext-devel
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+Requires(postun): initscripts
+
+%if %{with_libtnc}
+BuildRequires: libtnc-devel
+Requires:      libtnc
+%endif
+
+%if %{with_tboot}
+Requires:      tboot
+%endif
+
+# seems like coding errors
+Patch1: bugs.patch
+# To resolve inconsistency in its file name in /var/lock/subsys/
+Patch2: init-script.patch
+
+%description
+OpenPTS is an open-source package of Platform Trust Service (PTS)
+defined by Trusted Computing Group (TCG). Trusted Computing is a set of
+specifications set forth by the Trusted Computing Group (TCG).
+
+%prep
+%setup -q -n openpts-%{version}
+
+%patch1 -p1
+%patch2 -p1
+
+%build
+sh bootstrap.sh
+%configure --disable-static --prefix=/usr --libdir=%{_libdir} --with-tss --with-aide \
+%if %{with_tboot}
+  --with-tboot \
+%endif
+%if %{with_libtnc}
+  --with-libtnc
+%endif
+make %{?_smp_mflags}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+#mkdir -p ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}/%{_initddir}
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p dist/fedora.initrd.ptsc ${RPM_BUILD_ROOT}/%{_initddir}/ptsc
+cp -p dist/ptsc.conf.in ${RPM_BUILD_ROOT}/%{_sysconfdir}/ptsc.conf
+
+mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/models
+cp -p models/*.uml ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/models/
+mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/openpts
+
+
+mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tpm_emulator
+cp dist/tpm_emulator/README.rhel ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tpm_emulator/README
+cp dist/tpm_emulator/binary_bios_measurements ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tpm_emulator/
+cp dist/tpm_emulator/tcsd ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tpm_emulator/
+
+%if %{with_tboot}
+mkdir -p ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tboot
+cp dist/tboot/README.fedora15 ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tboot/README
+cp dist/tboot/ptsc.conf.fedora15 ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tboot/ptsc.conf
+cp dist/tboot/tcsd.conf.fedora15 ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tboot/tcsd.conf
+cp dist/tboot/tcsd.fedora15 ${RPM_BUILD_ROOT}/%{_prefix}/share/openpts/tboot/tcsd
+%endif
+
+make install DESTDIR=${RPM_BUILD_ROOT} INSTALL='install -p'
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+getent group ptsc >/dev/null || groupadd -r ptsc
+
+%files -f %{name}.lang
+%defattr(-,root,root,-)
+%doc LICENSE README ChangeLog doc/*.eps
+%attr(755, root, root) %{_sbindir}/ptsc
+%attr(755, root, root) %{_bindir}/openpts
+%attr(755, root, root) %{_bindir}/uml2dot
+%attr(755, root, root) %{_bindir}/iml2aide
+%attr(755, root, root) %{_bindir}/tpm_createkey
+%attr(755, root, root) %{_bindir}/tpm_readpcr
+%attr(755, root, root) %{_bindir}/tpm_extendpcr
+%attr(755, root, root) %{_bindir}/iml2text
+%attr(755, root, root) %{_bindir}/ir2text
+%attr(755, root, root) %{_bindir}/rm2dot
+%if %{with_tboot}
+%attr(755, root, root) %{_bindir}/tboot2iml
+%{_prefix}/share/openpts/tboot/*
+%attr(755,root,root) %dir %{_prefix}/share/openpts/tboot
+%endif
+%if %{with_libtnc}
+%{_libdir}/libopenpts_imc.la
+%{_libdir}/libopenpts_imc.so*
+%{_libdir}/libopenpts_imv.la
+%{_libdir}/libopenpts_imv.so*
+%endif
+%{_prefix}/share/openpts/models/*uml
+%{_prefix}/share/openpts/tpm_emulator/*
+%attr(755,root,root) %dir %{_prefix}/share/openpts
+%attr(755,root,root) %dir %{_prefix}/share/openpts/models
+%attr(755,root,root) %dir %{_prefix}/share/openpts/tpm_emulator
+%attr(755,root,root) %dir %{_var}/lib/openpts
+%attr(0640, root, ptsc) %config(noreplace) %{_sysconfdir}/ptsc.conf
+# Fedora
+%{_initddir}/ptsc
+
+# following sections need to be fixed
+#%preun
+#if [ $1 = 0 ]; then
+#        /sbin/service ptsc stop || :
+#        /sbin/chkconfig --del ptsc
+#fi
+
+%post
+/sbin/ldconfig
+#/sbin/chkconfig --add ptsc || :
+
+%postun
+/sbin/ldconfig
+#if [ $1 -ge 1 ] ; then
+#        /sbin/service ptsc condrestart 2>&1 > /dev/null || :
+#fi
+
+%changelog
+* Tue Jun 7 2011 Avesh Agarwal <avagarwa at redhat.com> - 0.2.4-1
+- Initial build on F16
+- Latest upstream release 0.2.4
+- Enabled support for tnc and tboot
+- Upstream changes: ptscd to ptsc, and ptscd.conf to ptsc.conf
+- Fixed cleaning of tpm_emaulator and tboot dirs upon uninstall
+- Many changes to spec file due to enabling of tnc and tboot
+- Fixed local patches
+
+* Fri Apr 15 2011 Avesh Agarwal <avagarwa at redhat.com> - 0.2.3-3
+- committed files in fedora and did initial build
+
+* Wed Apr 13 2011 Avesh Agarwal <avagarwa at redhat.com> - 0.2.3-2
+- Fixed spec file issues found during package review 
+  https://bugzilla.redhat.com/show_bug.cgi?id=691818
+
+* Mon Mar 28 2011 Avesh Agarwal <avagarwa at redhat.com> - 0.2.3-1
+- Initial fedora packaging
+- Added patch for fixing compile errors
+- fixed init script inconsistency issue related 
+  to its /var/lock/subsys file
diff --git a/sources b/sources
index e69de29..22d4eae 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+84d6dc0f4e8c7941056750ef90249d6d  openpts-0.2.4.tgz


More information about the scm-commits mailing list