commit cefe276a9c3e16aa424c7f56d2cd895361fd7dc9
Author: Momcilo Medic <fedorauser(a)fedoraproject.org>
Date: Tue Apr 9 13:52:22 2019 +0200
Added patches for headers and library destination handling
.gitignore | 1 +
headers-fix.patch | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
libdir-fix.patch | 19 ++++++++++
libftl.spec | 59 +++++++++++++++++++++++++++++
sources | 1 +
5 files changed, 191 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..82e1d26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/libftl-0.9.14.tar.gz
diff --git a/headers-fix.patch b/headers-fix.patch
new file mode 100644
index 0000000..e20c60f
--- /dev/null
+++ b/headers-fix.patch
@@ -0,0 +1,111 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,6 +11,9 @@ MESSAGE(STATUS "FTL DISABLE_FTL_APP: " ${DISABLE_FTL_APP})
+ option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be compiled as a static
lib. If TRUE, the program will want to statically link to the ftl cmake object."
FALSE)
+ MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE})
+
++option(FTL_INSTALL_INCLUDES "Set to TRUE if you want development headers to be
installed." FALSE)
++MESSAGE(STATUS "FTL FTL_INSTALL_INCLUDES: " ${FTL_INSTALL_INCLUDES})
++
+ find_package(Threads REQUIRED)
+
+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+@@ -57,17 +60,18 @@ if (WIN32)
+ ftl_app/win32/ctrlc_handler.c)
+ #set(FTL_PLATFORM_LIBS kernel32 user32 gdi32 advapi32 )
+ #set(FTL_PLATFORM_LIBS ws2_32 )
+- set(FTLSDK_PLATFORM_FILES libftl/win32/socket.c
+- libftl/win32/socket.h
+- libftl/win32/threads.c
+- libftl/win32/threads.h)
++ set(FTLSDK_PLATFORM_HEADERS libftl/win32/socket.h
++ libftl/win32/threads.h)
++ set(FTLSDK_PLATFORM_SOURCES libftl/win32/socket.c
++ libftl/win32/threads.c)
+ include_directories(libftl/win32)
+ else()
+ set(FTL_PLATFORM_FILES ftl_app/posix/ctrlc_handler.c)
+- set(FTLSDK_PLATFORM_FILES libftl/posix/socket.c
+- libftl/posix/socket.h
+- libftl/posix/threads.c
+- libftl/posix/threads.h)
++
++ set(FTLSDK_PLATFORM_HEADERS libftl/posix/socket.h
++ libftl/posix/threads.h)
++ set(FTLSDK_PLATFORM_SOURCES libftl/posix/socket.c
++ libftl/posix/threads.c)
+ include_directories(libftl/posix)
+ endif()
+
+@@ -79,21 +83,33 @@ else(FTL_STATIC_COMPILE)
+ set(FTL_LIB_TYPE SHARED)
+ endif(FTL_STATIC_COMPILE)
+
+-add_library(ftl ${FTL_LIB_TYPE} libftl/hmac/hmac.c
+- libftl/hmac/hmac.h
+- libftl/hmac/sha2.c
+- libftl/hmac/sha2.h
+- libftl/gettimeofday/gettimeofday.c
+- libftl/gettimeofday/gettimeofday.h
+- libftl/ftl-sdk.c
+- libftl/handshake.c
+- libftl/ingest.c
+- libftl/ftl_helpers.c
+- libftl/media.c
+- libftl/logging.c
+- libftl/ftl.h
+- libftl/ftl_private.h
+- ${FTLSDK_PLATFORM_FILES})
++set(FTL_HEADERS
++ libftl/ftl.h
++ libftl/ftl_private.h)
++
++set(FTL_HMAC_HEADERS
++ libftl/hmac/hmac.h
++ libftl/hmac/sha2.h)
++
++set(FTL_GETTIMEOFDAY_HEADERS
++ libftl/gettimeofday/gettimeofday.h)
++
++set(FTL_SOURCES
++ libftl/hmac/hmac.c
++ libftl/hmac/sha2.c
++ libftl/gettimeofday/gettimeofday.c
++ libftl/ftl-sdk.c
++ libftl/handshake.c
++ libftl/ingest.c
++ libftl/ftl_helpers.c
++ libftl/media.c
++ libftl/logging.c)
++
++add_library(ftl ${FTL_LIB_TYPE} ${FTL_HEADERS}
++ ${FTL_HMAC_HEADERS}
++ ${FTL_GETTIMEOFDAY_HEADERS}
++ ${FTLSDK_PLATFORM_HEADERS}
++ ${FTLSDK_PLATFORM_SOURCES})
+ include_directories(libftl libftl/gettimeofday)
+
+ set_target_properties(ftl PROPERTIES VERSION "0.5.0")
+@@ -132,4 +148,19 @@ endif()
+
+ # Install rules
+ install(TARGETS ftl DESTINATION
+- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+\ No newline at end of file
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++
++if (FTL_INSTALL_INCLUDES)
++foreach(ITEM ${FTL_HEADERS})
++ install(FILES ${ITEM} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftl)
++endforeach()
++foreach(ITEM ${FTL_HMAC_HEADERS})
++ install(FILES ${ITEM} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftl/hmac/)
++endforeach()
++foreach(ITEM ${FTL_GETTIMEOFDAY_HEADERS})
++ install(FILES ${ITEM} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftl/gettimeofday)
++endforeach()
++foreach(ITEM ${FTLSDK_PLATFORM_HEADERS})
++ install(FILES ${ITEM} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ftl)
++endforeach()
++endif()
+\ No newline at end of file
diff --git a/libdir-fix.patch b/libdir-fix.patch
new file mode 100644
index 0000000..2fecbc2
--- /dev/null
+++ b/libdir-fix.patch
@@ -0,0 +1,19 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,6 +15,7 @@ find_package(Threads REQUIRED)
+
+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
++include("GNUInstallDirs")
+
+ if (DISABLE_AUTO_INGEST)
+ add_definitions(-DDISABLE_AUTO_INGEST)
+@@ -130,4 +131,5 @@ if (NOT DISABLE_FTL_APP)
+ endif()
+
+ # Install rules
+-install(TARGETS ftl DESTINATION lib)
+\ No newline at end of file
++install(TARGETS ftl DESTINATION
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+\ No newline at end of file
diff --git a/libftl.spec b/libftl.spec
new file mode 100644
index 0000000..d42e8e8
--- /dev/null
+++ b/libftl.spec
@@ -0,0 +1,59 @@
+Name: libftl
+Version: 0.9.14
+Release: 2%{?dist}
+Summary: FTL audio/video streaming library
+
+License: MIT
+URL:
https://github.com/mixer/ftl-sdk
+Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
+Patch0: libdir-fix.patch
+Patch1: headers-fix.patch
+
+BuildRequires: cmake
+BuildRequires: gcc
+BuildRequires: gcc-c++
+
+%description
+FTL-SDK is a cross platform SDK written in C to enable sending audio/video to
+mixer using FTL service.
+
+
+%prep
+%autosetup -p1 -n ftl-sdk-%{version}
+
+%package devel
+Summary: Development files for libftl
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+Development files for libftl.
+
+
+%build
+mkdir -p build
+pushd build
+%cmake3 -DDISABLE_AUTO_INGEST=TRUE \
+ -DDISABLE_FTL_APP=TRUE \
+ -DFTL_INSTALL_INCLUDES=TRUE ..
+%make_build
+popd
+
+%install
+%make_install -C build
+
+%files
+%license LICENSE
+%doc README.md
+%{_libdir}/%{name}.so.0*
+
+
+%files devel
+%{_libdir}/%{name}.so
+%{_includedir}/ftl/
+
+%changelog
+* Wed Apr 03 2019 Momcilo Medic <fedorauser(a)fedoraproject.org> - 0.9.14-2
+- Added patches for headers and library destination handling
+
+* Tue Apr 02 2019 Momcilo Medic <fedorauser(a)fedoraproject.org> - 0.9.14-1
+- First public release
diff --git a/sources b/sources
index e69de29..69bb3c3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+b736abbe6b9706f5e668c6029476801c libftl-0.9.14.tar.gz