cmake_minimum_required(VERSION 3.0.0)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+
find_program(CCACHE_PROGRAM ccache)
find_program(CLACHE_PROGRAM clcache)
# Add subdirectories
add_subdirectory(hailort)
+
+configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
\ No newline at end of file
--- /dev/null
+Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null
+Name: hailo-rt
+Summary: Hailo runtime
+Version: 0.1
+Release: 0
+Group: Multimedia/Libraries
+License: MIT, LGPL 2.1
+ExclusiveArch: %{arm} aarch64
+Source0: %{name}-%{version}.tar.gz
+Source100: protobuf-src.tar.gz
+Source101: spdlog-src.tar.gz
+Source102: eigen-src.tar.gz
+Source103: cli11-src.tar.gz
+Source104: json-src.tar.gz
+Source105: dotwriter-src.tar.gz
+Source106: readerwriterqueue-src.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: cmake
+%define _unpackaged_files_terminate_build 0
+
+%description
+HailoRT is a lightweight, production-grade runtime library that runs on the host processor and provides a robust user-space library (the HailoRT Library) with intuitive APIs in C/C++ for optimized performance
+
+%package devel
+Summary: Header and library files for HailoRT
+Group: Multimedia/Framework
+Requires: %{name}
+
+%description devel
+HailoRT (Dev)
+
+%prep
+%setup -q
+%setup -q -T -D -a 100
+%setup -q -T -D -a 101
+%setup -q -T -D -a 102
+%setup -q -T -D -a 103
+%setup -q -T -D -a 104
+%setup -q -T -D -a 105
+%setup -q -T -D -a 106
+
+mkdir -p hailort/external
+mv protobuf-src hailort/external/
+mv spdlog-src hailort/external/
+mv eigen-src hailort/external/
+mv cli11-src hailort/external/
+mv json-src hailort/external/
+mv dotwriter-src hailort/external/
+mv readerwriterqueue-src hailort/external/
+
+%build
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+
+cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DHAILO_BUILD_EXAMPLES=1 -DHAILO_OFFLINE_COMPILATION=ON
+
+cd build
+make %{?jobs:-j%jobs}
+
+%install
+
+cd build
+%make_install
+
+%define LIB_DIR %(uname -m | grep -q '^arm' && echo lib || echo lib64)
+
+mkdir -p %{buildroot}%{_includedir}/hailort
+mkdir -p %{buildroot}%{_libdir}
+mkdir -p %{buildroot}%{_libdir}/pkgconfig
+mkdir -p %{buildroot}%{_bindir}
+
+strip %{buildroot}/usr/local/%{LIB_DIR}/libhailort.so.4.18.0
+strip %{buildroot}/usr/local/bin/hailortcli
+
+cp -a %{buildroot}/usr/local/include/* %{buildroot}%{_includedir}/
+cp -a %{buildroot}/pkgconfig/HailoRT.pc %{buildroot}%{_libdir}/pkgconfig/
+cp -a %{buildroot}/usr/local/%{LIB_DIR}/* %{buildroot}%{_libdir}/
+cp -a %{buildroot}/usr/local/bin/* %{buildroot}%{_bindir}/
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%license LICENSE.MIT
+%defattr(-,root,root,-)
+%{_libdir}/libhailort.so.4.18.0
+%{_libdir}/libhailort.so
+%{_bindir}/*
+
+%files devel
+%{_libdir}/pkgconfig/*.pc
+%{_includedir}/hailo/*