File drbd-utils.spec of Package drbd-utils.5899

#
# spec file for package drbd-utils
#
# Copyright (c) 2017 SUSE LINUX 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 http://bugs.opensuse.org/
#


Name:           drbd-utils
Version:        9.0.0
Release:        0
Summary:        Distributed Replicated Block Device
License:        GPL-2.0+
Group:          Productivity/Clustering/HA
Url:            http://www.drbd.org/
Source:         http://www.drbd.org/download/drbd/utils/%{name}-%{version}.tar.gz

# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1:         init-script-fixes.diff
Patch2:         fix-libdir-in-Makefile.patch
Patch3:         fence-after-pacemaker-down.patch
Patch4:         fix-segfault-up-stacked-resource.patch
# PATCH-SUSE-FIX: Disable quorum in default configuration (bsc#1032142)
Patch5:         0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch6:         move_fencing_from_disk_to_net_in_example.patch
Patch7:         skip_sh-b-pri_in_v9.patch
Patch8:         fix_call_khelper_with_stack.patch
Patch9:         Update-block-drbd-script-to-support-xen.patch
Patch10:        keep-bitmap-in-create-md.patch
# PATCH11~15 are from/merged into upstream
Patch11:        Fix-peer_device-objects.patch
Patch12:        Fix-parsing-drbdsetup-show-for-adjust.patch
Patch13:        Fix-no-bitmap-allocate-for-stacked-res.patch
Patch14:        Support-pass-force-to-dump-md.patch
Patch15:        Support-logfacility-local5.patch

Provides:       drbd-bash-completion = %{version}
Provides:       drbd-pacemaker = %{version}
Provides:       drbd-udev = %{version}
Obsoletes:      drbd-bash-completion < %{version}
Obsoletes:      drbd-pacemaker < %{version}
Obsoletes:      drbd-udev < %{version}
# drbd-utils first splict from drbd-8.4.5(only driver)
# and suse let drbd driver goes in-kernel
# Provides:       drbd = 8.4.5
# Obsoletes:      drbd < 8.4.5

%ifarch %ix86 x86_64
Provides:       drbd-xen = %{version}
Obsoletes:      drbd-xen < %{version}
%endif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  flex
BuildRequires:  gcc
BuildRequires:  glibc-devel
BuildRequires:  libxslt
BuildRequires:  make
BuildRequires:  pkg-config
BuildRequires:  systemd
BuildRequires:  udev
Provides:       drbd-control
Provides:       drbdsetup
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Drbd is a distributed replicated block device. It mirrors a block
device over the network to another machine. Think of it as networked
raid 1. It is a building block for setting up clusters.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1

%build
./autogen.sh
PATH=/sbin:$PATH ./configure \
    --with-udev \
    --with-distro=suse \
    --without-heartbeat \
    --with-pacemaker \
    --with-xen \
    --with-bashcompletion \
    --with-initscripttype=systemd \
    --with-systemdunitdir=/usr/lib/systemd/system \
    --prefix=/ \
    --sbindir=/sbin \
    --libdir=/usr/lib \
    --mandir=%{_mandir} \
    --sysconfdir=%{_sysconfdir} \
    --datarootdir=/usr/share \
    --datadir=/usr/share \
    --libdir=/usr/lib \
    --exec_prefix=/usr/lib \
    --with-tmpfilesdir=%{_tmpfilesdir}

make OPTFLAGS="%{optflags}" %{?_smp_mflags}

%install
%make_install

mkdir -p %{buildroot}%{_localstatedir}/lib/drbd
%ifnarch %ix86 x86_64
rm -rf %{buildroot}%{_sysconfdir}/xen
%endif

%pre
%service_add_pre drbd.service

%post
%service_add_post drbd.service

%preun
%service_del_preun drbd.service

%postun
%service_del_postun drbd.service

%files -n drbd-utils
%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/drbd.conf
%config %{_sysconfdir}/bash_completion.d/drbdadm.sh
%config(noreplace) %{_sysconfdir}/drbd.d/global_common.conf
%{_tmpfilesdir}/drbd.conf
%doc %{_mandir}/man5/drbd.*
%doc %{_mandir}/man8/drbd*
%doc COPYING
%doc README
%doc ChangeLog
%doc scripts/drbd.conf.example
%dir %{_sysconfdir}/drbd.d
/sbin/drbdadm
/sbin/drbdsetup
/sbin/drbdmeta
/sbin/drbd-overview
%ifarch %ix86 x86_64
%dir %attr(700,root,root) %{_sysconfdir}/xen
%dir %{_sysconfdir}/xen/scripts
%{_sysconfdir}/xen/scripts/block-drbd
%endif
%{_prefix}/lib/ocf/resource.d/linbit/drbd
%{_prefix}/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh
%{_udevrulesdir}/65-drbd.rules
%{_unitdir}/drbd.service
/usr/lib/systemd/system/drbd.service
%defattr(-, root, root)
%{_localstatedir}/lib/drbd
/usr/lib/drbd
/lib/drbd
/lib/drbd/drbdadm*
/lib/drbd/drbdsetup*
%dir %{_prefix}/lib/ocf
%dir %{_prefix}/lib/ocf/resource.d
%dir %{_prefix}/lib/ocf/resource.d/linbit

%changelog
openSUSE Build Service is sponsored by