From c2869247409cce7e02a139d9e735c860dce5e314 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Mon, 29 May 2017 12:42:17 +0200 Subject: Add packaging. Change-Id: I500d7bb7f45d64e4e7269e85ad5b40a7b43cedca --- libteec/Makefile | 4 ++-- packaging/optee-client.spec | 51 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 packaging/optee-client.spec diff --git a/libteec/Makefile b/libteec/Makefile index 66055a7..5de229c 100644 --- a/libteec/Makefile +++ b/libteec/Makefile @@ -9,8 +9,8 @@ all: libteec ################################################################################ # Teec configuration ################################################################################ -MAJOR_VERSION := 1 -MINOR_VERSION := 0 +MAJOR_VERSION ?= 1 +MINOR_VERSION ?= 0 LIB_NAME := libteec.so LIB_MAJOR := $(LIB_NAME).$(MAJOR_VERSION) LIB_MAJ_MIN := $(LIB_NAME).$(MAJOR_VERSION).$(MINOR_VERSION) diff --git a/packaging/optee-client.spec b/packaging/optee-client.spec new file mode 100644 index 0000000..3b31ee9 --- /dev/null +++ b/packaging/optee-client.spec @@ -0,0 +1,51 @@ +%define major_version 2 +%define minor_version 4 + +Name: optee-client +Summary: Library for applications which use OPTEE functions. +Version: %{major_version}.%{minor_version} +Release: 1%{?dist} +Group: Security/Testing +License: BSD-2-Clause +URL: N/A +Source0: %{name}-%{version}.tar.gz +Provides: libteec + +BuildRequires: make + +%description +Library for applications which use OPTEE functions. + +%prep +%setup -q + +%build +make build CROSS_COMPILE="" MAJOR_VERSION=%{major_version} MINOR_VERSION=%{minor_version} + +%install +make CROSS_COMPILE="" MAJOR_VERSION=%{major_version} MINOR_VERSION=%{minor_version} DESTDIR=%{buildroot}/%{_prefix} install + +if [ "%{_libdir}" == "%{_exec_prefix}/lib64" ] +then + mkdir -p %{buildroot}/%{_libdir} + cp -f %{buildroot}/usr/lib/libteec.so* %{buildroot}/%{_libdir}/ + rm -rf %{buildroot}/usr/lib +fi + +rm -rf %{buildroot}%{_libdir}/debug + +%files +%defattr(-, root, root, -) +%{_bindir}/tee-supplicant +%{_libdir}/libteec.so* +%{_includedir}/tee_client_api.h +%{_includedir}/tee_client_api_extensions.h +%{_includedir}/teec_trace.h + +%post +ln -sf %{_libdir}/libteec.so.%{version} %{_libdir}/libteec.so.%{major_version} +ln -sf %{_libdir}/libteec.so.%{major_version} %{_libdir}/libteec.so + +/sbin/ldconfig + +%changelog -- cgit v1.2.3