File drbd.spec of Package drbd

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


Name:           drbd
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  udev
Summary:        Distributed Replicated Block Device
License:        GPL-2.0+
Group:          Productivity/Clustering/HA
Version:        8.4.3
Release:        0
Source:         %{name}-%{version}.tar.gz
Provides:       drbd-control
Provides:       drbdsetup
Url:            http://www.drbd.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(post): %insserv_prereq %fillup_prereq
Requires(preun): %insserv_prereq %fillup_prereq
Requires(postun): %insserv_prereq fileutils

%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

%build
PATH=/sbin:$PATH %configure \
    --without-km \
    --with-utils \
    --with-udev \
    --with-distro=suse \
    --with-heartbeat \
    --with-pacemaker \
    --with-xen \
    --with-bashcompletion

make OPTFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}

%install
%makeinstall
ln -sf ../etc/init.d/drbd $RPM_BUILD_ROOT/sbin/rcdrbd
mkdir -p $RPM_BUILD_ROOT/var/lib/drbd
#
# and I only want to install a hint to the example conf
#
cat <<___ > $RPM_BUILD_ROOT/etc/drbd.conf
#
# please have a a look at the example configuration file in
# %{_docdir}/drbd/drbd.conf
#
___
#
%ifnarch %ix86 x86_64
rm -rf $RPM_BUILD_ROOT/etc/xen
%endif

%post
%{fillup_and_insserv}

%preun
%{stop_on_removal}

%postun
%{insserv_cleanup}

%files -n drbd
%defattr(-, root, root)
%config(noreplace) /etc/drbd.conf
/etc/bash_completion.d/drbdadm.sh
%config /etc/drbd.d/global_common.conf
%doc %{_mandir}/man5/drbd.conf.5*
%doc %{_mandir}/man8/drbd.8*
%doc %{_mandir}/man8/drbdsetup.8*
%doc %{_mandir}/man8/drbdadm.8*
%doc %{_mandir}/man8/drbddisk.8*
%doc %{_mandir}/man8/drbdmeta.8*
%doc COPYING
%doc README
%doc ChangeLog
%doc scripts/drbd.conf
%dir /etc/drbd.d
/sbin/drbdadm
/sbin/drbdsetup
/sbin/rcdrbd
/sbin/drbdmeta
/usr/sbin/drbd-overview
%dir /lib/drbd
/lib/drbd/drbdadm-83
/lib/drbd/drbdsetup-83
%ifarch %ix86 x86_64
%dir %attr(700,root,root) /etc/xen
%dir /etc/xen/scripts
/etc/xen/scripts/block-drbd
%endif
/usr/lib/ocf/resource.d/linbit/drbd
/etc/ha.d/resource.d/drbddisk
/etc/ha.d/resource.d/drbdupper
%dir /etc/udev
%dir /etc/udev/rules.d
/etc/udev/rules.d/65-drbd.rules
%config /etc/init.d/drbd
%defattr(-, root, root)
/var/lib/drbd
/usr/lib/drbd
%dir /usr/lib/ocf
%dir /usr/lib/ocf/resource.d
%dir /usr/lib/ocf/resource.d/linbit
%dir /etc/ha.d
%dir /etc/ha.d/resource.d

%changelog