File virt-sandbox.spec of Package virt-sandbox

# spec file for package virt-sandbox
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define libvirt_version 1.0.2
%define soname 1_0-4 

Name:           virt-sandbox
Version:        0.5.1
Release:        1%{?dist}%{?extra_release}
Summary:        Libvirt application sandbox framework
License:        LGPL-2.0+
Group:          System/Management

# Upstream patches
Patch0:         87a9b5cc-lib-prefix-fix.patch
Patch1:         945e8e71-selinux-only-if-supported.patch
Patch2:         baf47f5b-service-check-secmodel.patch
Patch3:         a54e094b-service-suse-paths.patch

# Patches pending upstream review
Patch100:       systemd-path-fix.patch

# Our patches
Patch150:       no-libexec.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  glib2-devel >= 2.32.0
BuildRequires:  glibc-static
BuildRequires:  gobject-introspection-devel
BuildRequires:  intltool
BuildRequires:  libselinux-devel
BuildRequires:  libtool
BuildRequires:  libvirt-glib-devel >= 0.1.8
BuildRequires:  perl
Requires:       rpm-python
# For virsh lxc-enter-namespace command
Requires:       libvirt-client >= %{libvirt_version}
Requires:       python3-gobject
Requires:       systemd >= 198
# Requires: libselinux-python
Requires:       cron
Requires:       libvirt-sandbox-%{soname} = %{version}-%{release}

%package -n libvirt-sandbox-%{soname}
Summary:        Libvirt application sandbox framework libraries
Group:          Development/Libraries/C and C++
# So we get the full libvirtd daemon, not just client libs
Requires:       libvirt-daemon-qemu >= %{libvirt_version}
Requires:       libvirt-daemon-lxc >= %{libvirt_version}

%package -n typelib-1_0-LibvirtSandbox-1_0
Summary:        GLib and GObject mapping of libvirt-sandbox - gi-bindings
Group:          System/Libraries

%package -n libvirt-sandbox-devel
Summary:        Libvirt application sandbox framework development files
Group:          Development/Libraries/C and C++
Requires:       libvirt-sandbox-%{soname} = %{version}-%{release}

This package provides a command for running applications within
a sandbox using libvirt.

%description -n libvirt-sandbox-%{soname}
This package provides a framework for building application sandboxes
using libvirt.

%description -n libvirt-sandbox-devel
This package provides development header files and libraries for
the libvirt sandbox

%description -n typelib-1_0-LibvirtSandbox-1_0
This package provides Gnome-introspection bindings for building
applications within a sandbox using libvirt.

%setup -q -n libvirt-sandbox-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch100 -p1
%patch150 -p1


%configure --enable-introspection --disable-static
make V=1 %{?_smp_mflags}

chmod a-x examples/*.py examples/*.pl examples/*.js
chmod a-x bin/
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt-sandbox-1.0.a
rm -f $RPM_BUILD_ROOT%{_libdir}/

%find_lang libvirt-sandbox


%post -n libvirt-sandbox-%{soname} -p /sbin/ldconfig
%postun -n libvirt-sandbox-%{soname} -p /sbin/ldconfig

%config(noreplace) %{_sysconfdir}/cron.daily/virt-sandbox-service.logrotate
%dir %{_sysconfdir}/libvirt-sandbox/services

%files -n libvirt-sandbox-%{soname} -f libvirt-sandbox.lang
%dir %{_sysconfdir}/libvirt-sandbox
%dir %{_sysconfdir}/libvirt-sandbox/scratch
%config %{_sysconfdir}/libvirt-sandbox/scratch/README

%files -n typelib-1_0-LibvirtSandbox-1_0

%files -n libvirt-sandbox-devel
%doc examples/
%doc examples/
%doc examples/virt-sandbox.js
%doc examples/
%dir %{_includedir}/libvirt-sandbox-1.0
%dir %{_includedir}/libvirt-sandbox-1.0/libvirt-sandbox