File oat.spec of Package oat
Name: oat
%define _client oat-client
%define _appraiser oat-appraiser
%define _WEBAPPS "%{buildroot}%{_datadir}/%{_appraiser}/webapps"
%define _datalib "/var/lib/%{_appraiser}"
%define _varlib "/var/lib"
Summary: Attestation Service & Host Agent based on OpenAttestation SDK
Version: 1.6.0
Release: 9%{?dist}
License: BSD
Group: Applications/System
Source0: OpenAttestation-%{version}.tar.gz
Source1: OAT_configure.sh
Source2: oat-db-drop.sh
Source3: OAT_client.sh
Source4: oat-client.service
Source5: provisioner.sh
Source6: oat-client
Source7: oat_function
# this patch is just for opensuse packaging
Patch0: oat-1.6.0-suse-build.patch
URL: https://github.com/OpenAttestation/OpenAttestation
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ant
BuildRequires: trousers-devel
BuildRequires: java-1_7_0-openjdk
BuildRequires: unzip
BuildRequires: gcc-c++
%description -n %{name}
OpenAttestation (OAT) is a open source project providing a SDK for managing
host integrity verification using TCG-defined remote attestation protocol,
targeting to be integrated into cloud and enterprise management tools.
%package -n %{_appraiser}
Summary: Appraisal Server for OpenAttestation
Requires: trousers
Requires: mysql-community-server
Requires: java-1_7_0-openjdk
Requires: tomcat
Requires: mysql-connector-java
Requires: jakarta-commons-pool
%description -n %{_appraiser}
OpenAttestation (OAT) is a open source project providing a SDK for managing
host integrity verification using TCG-defined remote attestation protocol,
targeting to be integrated into cloud and enterprise management tools.
This package provides the OAT appraisal server.
%package -n %{_client}
Summary: Host Agent for OpenAttestation
%description -n %{_client}
OpenAttestation (OAT) is a open source project providing a SDK for managing
host integrity verification using TCG-defined remote attestation protocol,
targeting to be integrated into cloud and enterprise management tools.
This package provides the host agent which uses Java and the NIARL TPM
Module to acquire integrity measurement data from the host's Trusted
Platform Module (TPM).
The data is compiled into an integrity report and sent to the OAT appraisal
server.
%package commandtool
Summary: Command line tools for OpenAttestation
Requires: curl
Requires: openssl
BuildArch: noarch
%description commandtool
OpenAttestation (OAT) is a open source project providing a SDK for managing
host integrity verification using TCG-defined remote attestation protocol,
targeting to be integrated into cloud and enterprise management tools.
This package provides a number of command line tools which are useful for
interacting with a OAT appraisal server.
%package doc
Summary: Documentation for OpenAttestation
BuildArch: noarch
%description doc
OpenAttestation (OAT) is a open source project providing a SDK for managing
host integrity verification using TCG-defined remote attestation protocol,
targeting to be integrated into cloud and enterprise management tools.
This package provides the documentation for OpenAttestation.
%prep
pwd
%setup -q -n OpenAttestation-%{version}
%patch0 -p1
%build
pushd Source
bash distribute_jar_packages.sh
bash build.sh
popd
%install
###################
#### appraiser ####
###################
install -d %{_WEBAPPS}/{AttestationService,HisPrivacyCAWebServices2,HisWebServices,WLMService}
install -d %{buildroot}%{_datalib}/CaCerts
install -d %{buildroot}%{_datalib}/ClientFiles
install -d %{buildroot}%{_datalib}/Certificate
install -d %{buildroot}%{_sysconfdir}/oat-appraiser/
# copy post install setup files
install -p -D -m 644 Installer/OAT-Appraiser-Configure/OAT_Server_Install/oat_db.MySQL %{buildroot}%{_datadir}/oat-appraiser/
install -p -D -m 644 Installer/FilesForLinux/init.sql %{buildroot}%{_datadir}/oat-appraiser/
# install configs
install -p -D -m 644 Installer/OAT-Appraiser-Configure/OAT_Server_Install/OAT.properties %{buildroot}%_sysconfdir/oat-appraiser/
install -p -D -m 644 Installer/OAT-Appraiser-Configure/OAT_Server_Install/OAT.properties %{buildroot}%{_datalib}/ClientFiles
# install AttestationService
unzip Source/AttestationService/AttestationService.war -d %{_WEBAPPS}/AttestationService
# install WLMService
unzip Source/WLMService/WLMService.war -d %{_WEBAPPS}/WLMService
# install HisWebServices
unzip Source/HisWebServices/HisWebServices.war -d %{_WEBAPPS}/HisWebServices
install -p -D -m 644 %{_WEBAPPS}/HisWebServices/WEB-INF/classes/OpenAttestation.properties %{buildroot}%_sysconfdir/oat-appraiser/
install -p -D -m 644 Source/HisWebServices/WEB-INF/*.xml %{_WEBAPPS}/HisWebServices/WEB-INF/
install -p -D -m 644 Installer/OAT-Appraiser-Configure/OAT_Server_Install/hibernateOat.cfg.xml %{_WEBAPPS}/HisWebServices/WEB-INF/classes/
# install HisPrivacyCAWebServices2
unzip Source/HisPrivacyCAWebServices2/HisPrivacyCAWebServices2.war -d %{_WEBAPPS}/HisPrivacyCAWebServices2
install -p -D -m 644 Source/HisPrivacyCAWebServices2/setup.properties %{buildroot}%_sysconfdir/oat-appraiser/
install -p -D -m 755 %{SOURCE2} %{buildroot}%{_datadir}/oat-appraiser/oat-db-drop.sh
install -p -D -m 755 %{SOURCE1} %{buildroot}%{_datadir}/oat-appraiser/OAT_configure.sh
install -p -D -m 755 %{SOURCE7} %{buildroot}%{_datadir}/oat-appraiser/oat_function
################
#### client ####
################
install -d %{buildroot}%{_datadir}/oat-client/lib
install -d %{buildroot}%{_datadir}/oat-client/script
install -d %{buildroot}%{_datadir}/oat-client/shells
install -d %{buildroot}%{_datadir}/java/
install -d %{buildroot}%{_sysconfdir}/oat-client
install -d %{buildroot}%{_varlib}
install -d %{buildroot}%{_varlib}/oat-client
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_sbindir}
install -p -D -m 644 Source/HisClient/jar/OAT_Standalone.jar %{buildroot}%{_datadir}/java/
install -p -D -m 755 %{SOURCE5} %{buildroot}%{_datadir}/oat-client/script/provisioner.sh
install -p -D -m 644 Source/PrivacyCA/TPMModule.properties %{buildroot}%{_sysconfdir}/oat-client/
install -p -D -m 644 Source/PrivacyCA/PrivacyCA.jar %{buildroot}%{_datadir}/oat-client/lib/
install -p -D -m 644 Source/HisAppraiser/HisAppraiser.jar %{buildroot}%{_datadir}/oat-client/lib/
install -p -D -m 644 Source/HisWebServices/clientlib/HisWebServices-client.jar %{buildroot}%{_datadir}/oat-client/lib/
install -p -D -m 644 Source/HisPrivacyCAWebServices2/clientlib/HisPrivacyCAWebServices2-client.jar %{buildroot}%{_datadir}/oat-client/lib/
install -p -D -m 755 %{SOURCE3} %{buildroot}%{_datadir}/oat-client/script
install -p -D -m 755 Source/TPMModule/plain/linux/NIARL_TPM_Module %{buildroot}%{_bindir}/NIARL_TPM_Module
install -p -D -m 755 %{SOURCE6} %{buildroot}%{_sbindir}
install -p -D -m 755 %{SOURCE7} %{buildroot}%{_datadir}/oat-client/script
touch %{buildroot}%{_sysconfdir}/oat-client/log4j.properties
%files -n %{_appraiser}
%{_datadir}/oat-appraiser
/var/lib/oat-appraiser
%{_sysconfdir}/oat-appraiser/
%files -n %{_client}
%{_sysconfdir}/oat-client
%{_datadir}/oat-client
/var/lib/oat-client
%{_sbindir}/oat-client
%{_datadir}/java/OAT_Standalone.jar
%{_bindir}/NIARL_TPM_Module
%files commandtool
%doc docs/LICENSE
%files doc
%doc README docs/*