ZLMediaKit.spec 2.88 KB
Newer Older
wxf committed
1 2
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%global use_devtoolset 0
wxf committed
3 4
%bcond_without faac
%bcond_without x264
wxf committed
5 6
%else
%global use_devtoolset 1
wxf committed
7 8
%bcond_with faac
%bcond_with x264
wxf committed
9 10
%endif

wxf committed
11 12 13
%bcond_without openssl
%bcond_without mysql

wxf committed
14 15 16 17 18 19 20 21 22 23
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

wxf committed
24
%if %{with openssl}
wxf committed
25
BuildRequires:	openssl-devel
wxf committed
26 27 28
%endif

%if %{with mysql}
wxf committed
29
BuildRequires:	mysql-devel
wxf committed
30 31 32
%endif

%if %{with faac}
wxf committed
33
BuildRequires:	faac-devel
wxf committed
34 35 36
%endif

%if %{with x264}
wxf committed
37
BuildRequires:	x264-devel
wxf committed
38
%endif
wxf committed
39 40 41 42 43 44 45 46 47

%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
wxf committed
48
Requires:	%{name} = %{version}
wxf committed
49 50 51 52 53 54
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
wxf committed
55
Requires:	%{name} = %{version}
wxf committed
56 57 58 59 60
Summary:	The %{name} C libraries.
%description c-libs
The %{name} C libraries.

%package c-devel
wxf committed
61
Requires:	%{name}-c-libs = %{version}
wxf committed
62 63 64 65 66
Summary:	The %{name} C API headers.
%description c-devel
The %{name} C API headers.

%package cxx-devel
wxf committed
67
Requires:	%{name} = %{version}
wxf committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
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

wxf committed
84
%cmake3 \
wxf committed
85
    -DCMAKE_BUILD_TYPE:STRING=Release \
wxf committed
86
    -DENABLE_HLS:BOOL=ON \
wxf committed
87 88 89 90
    -DENABLE_OPENSSL:BOOL=%{with openssl} \
    -DENABLE_MYSQL:BOOL=%{with mysql} \
    -DENABLE_FAAC:BOOL=%{with faac} \
    -DENABLE_X264:BOOL=%{with x264} \
wxf committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
    -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