File spice.spec of Package spice

%define realname spice
%define realver  0.15.2
%define srcext   tar.bz2

%define so_ver   1

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          libspice-server%{?so_ver}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       LGPL-2.1
Group:         Development/Languages/C and C++
URL:           http://www.spice-space.org/
Summary:       Simple Protocol for Independent Computing Environments

# Install-time parameters
Provides:      spice spice-server
%if 0%{?rhel}
Obsoletes:     spice-server
%endif

# Build-time parameters
BuildRequires: meson >= 0.48 ninja
BuildRequires: pkg-config gcc-c++
BuildRequires: pkgconfig(spice-protocol) >= 0.14.3
BuildRequires: pkgconfig(glib-2.0) >= 2.38
BuildRequires: pkgconfig(pixman-1) >= 0.17.7
BuildRequires: pkgconfig(openssl) >= 1.0.0
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(opus) >= 0.9.14
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-base-1.0)
BuildRequires: pkgconfig(gstreamer-app-1.0)
BuildRequires: pkgconfig(gstreamer-video-1.0)
BuildRequires: pkgconfig(orc-0.4)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(libsasl2)
BuildRequires: pkgconfig(libcacard) >= 2.5.1
# subprojects/spice-common
BuildRequires: python3-six python3-pyparsing
#
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://www.spice-space.org/download/releases/spice-server/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
SPICE is a remote display system built for virtual environments which
allows you to view a computing 'desktop' environment not only on the
machine where it is running, but from anywhere on the Internet and
from a wide variety of machine architectures.

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

%description -n libspice-server-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%{__sed} -ri '/doxygen.sh/d' meson.build

%build
_CFLAGS='%{optflags}'
_LDFLAGS='-Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro'
meson setup build \
 --buildtype=release \
 --strip \
 --optimization=2 \
 \
 --prefix=%{_prefix} \
 --libexecdir=%{_libexecdir} \
 --default-library=shared \
 \
 -Dgstreamer=1.0 \
 -Dopus=enabled \
 -Dsmartcard=enabled \
 -Dtests=false \
 \
 -Db_lto=%{?gcc_lto:true}%{!?gcc_lto:false} \
 -Db_ndebug=if-release \
 -Dc_args="$_CFLAGS" \
 -Dcpp_args="$_CFLAGS" \
 -Dc_link_args="$_LDFLAGS"
ninja -v -C build %{?_smp_mflags}

%install
DESTDIR=%{buildroot} ninja -C build install

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

%files
%defattr(-,root,root)
%license COPYING
%doc AUTHORS README
%{_libdir}/*.so.%{?so_ver}*

# Development stuff
%files -n libspice-server-devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/spice-server.pc
%dir %{_includedir}/spice-server/
%{_includedir}/spice-server/*.h
%{_libdir}/*.so

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

%changelog
openSUSE Build Service is sponsored by