################################################################################
# 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)
--- /dev/null
+%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