LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File openh264.spec of Package openh264 (Project home:aevseev)

%define realname openh264
%define srcext   tar.bz2

%define so_ver   4

# Common info
Name:          lib%{realname}%{?so_ver:-%{so_ver}}
Version:       1.0
Release:       wiz%{?extraver:0.}1
License:       BSD-2-Clause
Group:         Productivity/Multimedia/Video/Editors and Convertors
URL:           https://github.com/cisco/openh264
Summary:       Open Source H.264 Codec

# Install-time parameters
Provides:      %{realname} = %{version} lib%{realname} = %{version}
Obsoletes:     lib%{realname} < %{version}

# Build-time parameters
BuildRequires: gcc-c++ nasm pkg-config
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}.%{srcext}

%description
OpenH264 is a codec library which supports H.264 encoding and decoding. It is
suitable for use in real time applications such as WebRTC.

%package -n lib%{realname}-devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Provides:      %{realname}-devel = %{version}-%{release}
Provides:      %{name}-devel = %{version}-%{release}
Requires:      %{name} = %{version}-%{release}

%description -n lib%{realname}-devel
Development files for %{name}.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}

%build
%{__make} \
 CFLAGS_OPT="%{optflags} %{gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all -pthread %{gcc_lto}" \
 ENABLEPIC=Yes

%install
%{__make} install-shared \
 DESTDIR=%{buildroot} \
 PREFIX=%{_prefix} \
 LIBDIR_NAME=%{_lib} \
 SHAREDLIB_DIR=%{_libdir}
%{__install} -D -m755 h264enc %{buildroot}%{_bindir}/h264enc
%{__install} -D -m755 h264dec %{buildroot}%{_bindir}/h264dec

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc CONTRIBUTORS LICENSE README.md RELEASES
%{_bindir}/h264*
%{_libdir}/libopenh264.so.%{?so_ver}*
%{_libdir}/libopenh264.so.%{version}

# Development stuff
%files -n lib%{realname}-devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/openh264.pc
%{_libdir}/libopenh264.so
%dir %{_includedir}/wels/
%{_includedir}/wels/codec_api.h
%{_includedir}/wels/codec_app_def.h
%{_includedir}/wels/codec_def.h
%{_includedir}/wels/codec_ver.h

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog