diff --git a/package/rpm/ZLMediaKit.spec b/package/rpm/ZLMediaKit.spec new file mode 100644 index 00000000..e3af386d --- /dev/null +++ b/package/rpm/ZLMediaKit.spec @@ -0,0 +1,123 @@ +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 +%global use_devtoolset 0 +%else +%global use_devtoolset 1 +%endif + +Name: ZLMediaKit +Version: 5.0.0 +Release: 1%{?dist} +Summary: A lightweight, high performance and stable stream server and client framework based on C++11. + +Group: development +License: MIT +URL: https://github.com/xia-chu/ZLMediaKit +Source0: %{name}-%{version}.tar.xz + +BuildRequires: openssl-devel +BuildRequires: mysql-devel +BuildRequires: faac-devel +BuildRequires: x264-devel + +%if 0%{?use_devtoolset} +BuildRequires: devtoolset-8-gcc-c++ +%endif + +%description +A lightweight RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server and client framework based on C++11. + +%package media-server +Requires: %{name}-%{version} +Summary: A lightweight, high performance and stable stream server + +%description media-server +A lightweight RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server. + +%package c-libs +Requires: %{name}-%{version} +Summary: The %{name} C libraries. +%description c-libs +The %{name} C libraries. + +%package c-devel +Requires: %{name}-c-libs-%{version} +Summary: The %{name} C API headers. +%description c-devel +The %{name} C API headers. + +%package cxx-devel +Requires: %{name}-%{version} +Summary: The %{name} C++ API headers and development libraries. +%description cxx-devel +The %{name} C++ API headers and development libraries. + +%prep +%setup -q + +%build +mkdir -p %{_target_platform} + +pushd %{_target_platform} + +%if 0%{?use_devtoolset} +. /opt/rh/devtoolset-8/enable +%endif + +%cmake \ + -DENABLE_HLS:BOOL=ON \ + -DENABLE_OPENSSL:BOOL=ON \ + -DENABLE_MYSQL:BOOL=ON \ + -DENABLE_FAAC:BOOL=ON \ + -DENABLE_X264:BOOL=ON \ + -DENABLE_MP4:BOOL=ON \ + -DENABLE_RTPPROXY:BOOL=ON \ + -DENABLE_API:BOOL=ON \ + -DENABLE_CXX_API:BOOL=ON \ + -DENABLE_TESTS:BOOL=OFF \ + -DENABLE_SERVERL:BOOL=ON \ + .. + +make %{?_smp_mflags} + +popd + +%install +rm -rf $RPM_BUILD_ROOT + +pushd %{_target_platform} +%make_install +popd + +install -m 0755 -d %{buildroot}%{_docdir}/%{name} +install -m 0644 LICENSE %{buildroot}%{_docdir}/%{name} +install -m 0644 README.md %{buildroot}%{_docdir}/%{name} +install -m 0644 README_en.md %{buildroot}%{_docdir}/%{name} + +# TODO: service files + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%doc %{_docdir}/* + +%files media-server +%{_bindir}/* + +%files c-libs +%{_libdir}/libmk_api.so + +%files c-devel +%{_includedir}/mk_* + +%files cxx-devel +%{_includedir}/ZLMediaKit/* +%{_includedir}/ZLToolKit/* +%{_libdir}/libzlmediakit.a +%{_libdir}/libzltoolkit.a +%{_libdir}/libmpeg.a +%{_libdir}/libmov.a +%{_libdir}/libflv.a + +%changelog +