summaryrefslogtreecommitdiff
path: root/dist/fedora/trousers.spec.in
blob: 6b02ad03fe5d92dc5a7f5f767a9c8b298ed2d58f (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

# RPM specfile for the trousers project on Fedora

%define name		@PACKAGE@
%define version		@VERSION@
%define release		1

Name:			%{name}
Summary:		Implementation of the TCG's Software Stack v1.1 Specification
Version:		%{version}
Release:		%{release}
License:		CPL
Group:			Development/Libraries
Source:			%{name}-%{version}.tar.gz
Url:			http://www.sf.net/projects/trousers
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:		libtool, gtk2-devel, openssl-devel
Requires:		gtk+ >= 2.0, openssl
Requires(post):		/sbin/ldconfig
Requires(post):		/sbin/chkconfig
Requires(postun):	/sbin/ldconfig
Requires(postun):	/sbin/service
Requires(preun):	/sbin/chkconfig
Requires(preun):	/sbin/service

%description
TrouSerS is an implementation of the Trusted Computing Group's Software Stack
(TSS) specification. You can use TrouSerS to write applications that make use
of your TPM hardware. TPM hardware can create, store and use RSA keys
securely (without ever being exposed in memory), verify a platform's software
state using cryptographic hashes and more.

%package	devel
Summary:	TrouSerS header files and documentation
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description	devel
Header files and man pages for use in creating Trusted Computing enabled
applications.

%prep
%setup -q

%build
autoreconf
%configure --disable-static --prefix=/usr --libdir=%{_libdir}
make %{?_smp_mflags}

%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT};

#
# $1 is the number of entries in the RPM database for the package after the step is
# executed. So in the post step, if $1 is 1, then this is the first time we've been
# installed. If its 2, we're upgrading.
#
%post
/sbin/ldconfig
if [ $1 = 1 ]; then
	/sbin/chkconfig --add tcsd
	if [ $? == 0 ]; then
		/sbin/chkconfig --level 35 tcsd on
	fi
fi

%post devel -p /sbin/ldconfig

%install
# This line keeps build machines from being affected
[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT};
mkdir -p ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/%{_initrddir}
cp dist/fedora/fedora.initrd.tcsd ${RPM_BUILD_ROOT}/%{_initrddir}/tcsd
make install DESTDIR=${RPM_BUILD_ROOT}
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/libtspi.la

%preun
if [ $1 = 0 ]; then
	/sbin/service tcsd stop &> /dev/null
	/sbin/chkconfig --del tcsd
fi

%postun
/sbin/ldconfig
if [ $1 -gt 1 ]; then
	/sbin/service tcsd condrestart &>/dev/null
fi

%postun devel -p /sbin/ldconfig

%files
%doc README AUTHORS LICENSE
%defattr(755, root, root)
%attr(755, tss, tss) %{_sbindir}/tcsd
%{_libdir}/libtspi.so.?
%{_libdir}/libtspi.so.?.?.?
%config(noreplace) %attr(600, tss, tss) %{_sysconfdir}/tcsd.conf
%attr(644, root, root) %{_mandir}/man5/*
%attr(644, root, root) %{_mandir}/man8/*
%{_initrddir}/tcsd

# The files to be used by developers, 'trousers-devel'
%files		devel
%attr(755, root, root) %{_libdir}/libtspi.so
%defattr(644, root, root)
%{_libdir}/libtddl.a
%{_includedir}/tss/*.h
%{_includedir}/trousers/*.h
%{_mandir}/man3/Tspi_*

%changelog
* Mon Nov 12 2007 Kent Yoder <kyoder@users.sf.net> - 0.3.1
- Updated specfile for comments in RHBZ#323441

* Wed Jun 07 2006 Kent Yoder <kyoder@users.sf.net> - 0.2.6-1
- Updated build section to use smp_mflags
- Removed .la file from installed dest and files section

* Tue Jun 06 2006 Kent Yoder <kyoder@users.sf.net> - 0.2.6-1
- Initial add of changelog tag for trousers CVS