Make client build optional

This commit is contained in:
Uri Lublin 2012-06-01 14:14:02 +02:00 committed by Christophe Fergeau
parent 2c2848a9c4
commit 6e5beb7fbe

View File

@ -1,3 +1,9 @@
# build_client:
# If you want to build both client and server change value to 1
# If you want to only build the server change value to 0
%define build_client 1
Name: spice Name: spice
Version: 0.10.1 Version: 0.10.1
Release: 5%{?dist} Release: 5%{?dist}
@ -24,7 +30,9 @@ BuildRequires: pkgconfig
BuildRequires: spice-protocol >= 0.10.1 BuildRequires: spice-protocol >= 0.10.1
BuildRequires: celt051-devel BuildRequires: celt051-devel
BuildRequires: pixman-devel alsa-lib-devel openssl-devel libjpeg-devel BuildRequires: pixman-devel alsa-lib-devel openssl-devel libjpeg-devel
%if %{build_client}
BuildRequires: libXrandr-devel cegui06-devel BuildRequires: libXrandr-devel cegui06-devel
%endif
BuildRequires: libcacard-devel cyrus-sasl-devel BuildRequires: libcacard-devel cyrus-sasl-devel
BuildRequires: autoconf automake libtool BuildRequires: autoconf automake libtool
@ -35,6 +43,7 @@ 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 where it is running, but from anywhere on the Internet and from a wide
variety of machine architectures. variety of machine architectures.
%if %{build_client}
%package client %package client
Summary: Implements the client side of the SPICE protocol Summary: Implements the client side of the SPICE protocol
Group: User Interface/Desktops Group: User Interface/Desktops
@ -49,6 +58,7 @@ where it is running, but from anywhere on the Internet and from a wide
variety of machine architectures. variety of machine architectures.
This package contains the SPICE client application. This package contains the SPICE client application.
%endif
%package server %package server
Summary: Implements the server side of the SPICE protocol Summary: Implements the server side of the SPICE protocol
@ -88,8 +98,14 @@ using spice-server, you will need to install spice-server-devel.
%patch8 -p1 %patch8 -p1
%build %build
%if %{build_client}
%define configure_client --enable-client --enable-gui
%else
%define configure_client --disable-client
%endif
autoreconf -fi autoreconf -fi
%configure --enable-gui --enable-smartcard %configure --enable-smartcard %{configure_client}
make WARN_CFLAGS='' %{?_smp_mflags} make WARN_CFLAGS='' %{?_smp_mflags}
%install %install
@ -97,10 +113,15 @@ make DESTDIR=%{buildroot} install
rm -f %{buildroot}%{_libdir}/libspice-server.a rm -f %{buildroot}%{_libdir}/libspice-server.a
rm -f %{buildroot}%{_libdir}/libspice-server.la rm -f %{buildroot}%{_libdir}/libspice-server.la
mkdir -p %{buildroot}%{_libexecdir} mkdir -p %{buildroot}%{_libexecdir}
%if %{build_client}
touch %{buildroot}%{_libexecdir}/spice-xpi-client touch %{buildroot}%{_libexecdir}/spice-xpi-client
install -m 0755 %{_sourcedir}/spice-xpi-client-spicec %{buildroot}%{_libexecdir}/ install -m 0755 %{_sourcedir}/spice-xpi-client-spicec %{buildroot}%{_libexecdir}/
%endif
%if %{build_client}
%files client %files client
%doc COPYING README NEWS %doc COPYING README NEWS
%{_bindir}/spicec %{_bindir}/spicec
%ghost %{_libexecdir}/spice-xpi-client %ghost %{_libexecdir}/spice-xpi-client
@ -114,6 +135,7 @@ install -m 0755 %{_sourcedir}/spice-xpi-client-spicec %{buildroot}%{_libexecdir}
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-spicec %{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-spicec
fi fi
%endif
%files server %files server
%doc COPYING README NEWS %doc COPYING README NEWS