From af6446507eef80766f44eed3e778051c7d662a1f Mon Sep 17 00:00:00 2001 From: wxf Date: Thu, 17 Dec 2020 20:14:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=AF=91=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/rpm/ZLMediaKit.spec | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/package/rpm/ZLMediaKit.spec b/package/rpm/ZLMediaKit.spec index e3af386d..09d0838c 100644 --- a/package/rpm/ZLMediaKit.spec +++ b/package/rpm/ZLMediaKit.spec @@ -1,9 +1,16 @@ %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %global use_devtoolset 0 +%bcond_without faac +%bcond_without x264 %else %global use_devtoolset 1 +%bcond_with faac +%bcond_with x264 %endif +%bcond_without openssl +%bcond_without mysql + Name: ZLMediaKit Version: 5.0.0 Release: 1%{?dist} @@ -14,10 +21,21 @@ License: MIT URL: https://github.com/xia-chu/ZLMediaKit Source0: %{name}-%{version}.tar.xz +%if %{with openssl} BuildRequires: openssl-devel +%endif + +%if %{with mysql} BuildRequires: mysql-devel +%endif + +%if %{with faac} BuildRequires: faac-devel +%endif + +%if %{with x264} BuildRequires: x264-devel +%endif %if 0%{?use_devtoolset} BuildRequires: devtoolset-8-gcc-c++ @@ -64,11 +82,12 @@ pushd %{_target_platform} %endif %cmake \ + -DCMAKE_BUILD_TYPE:STRING=Release \ -DENABLE_HLS:BOOL=ON \ - -DENABLE_OPENSSL:BOOL=ON \ - -DENABLE_MYSQL:BOOL=ON \ - -DENABLE_FAAC:BOOL=ON \ - -DENABLE_X264:BOOL=ON \ + -DENABLE_OPENSSL:BOOL=%{with openssl} \ + -DENABLE_MYSQL:BOOL=%{with mysql} \ + -DENABLE_FAAC:BOOL=%{with faac} \ + -DENABLE_X264:BOOL=%{with x264} \ -DENABLE_MP4:BOOL=ON \ -DENABLE_RTPPROXY:BOOL=ON \ -DENABLE_API:BOOL=ON \