Add packaging. 89/131489/6
authoru.harbuz <u.harbuz@samsung.com>
Mon, 29 May 2017 10:42:17 +0000 (12:42 +0200)
committeru.harbuz <u.harbuz@samsung.com>
Tue, 27 Jun 2017 13:58:38 +0000 (15:58 +0200)
Change-Id: I500d7bb7f45d64e4e7269e85ad5b40a7b43cedca

libteec/Makefile
packaging/optee-client.spec [new file with mode: 0644]

index 66055a7..5de229c 100644 (file)
@@ -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 (file)
index 0000000..3b31ee9
--- /dev/null
@@ -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