Репозиторий Sisyphus
Последнее обновление: 7 декабря 2022 | Пакетов: 17972 | Посещений: 25528358
en ru br
Репозитории ALT

Группа :: Система/Ядро и оборудование
Пакет: drbd-utils

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%def_without xen
%define githash 409097fe02187f83790b88ac3e0d94f3c167adab
%define gitdiff c6e62702d5e4fb2cf6b3fa27e67cb0d4b399a30b
%define _localstatedir %_var
%global optflags_lto %optflags_lto -ffat-lto-objects

Name: drbd-utils
Version: 9.22.0
Release: alt1

Summary: DRBD user-land tools and scripts
License: GPLv2+
Group: System/Kernel and hardware

Url: http://www.drbd.org/
Source0: %name-%version.tar
Source1: %name-headers-%version.tar
Patch0: %name-%version-%release.patch

%define check_arches x86_64 %ix86
%ifarch %check_arches
%def_with check
%else
%def_without check
%endif


BuildRequires: docbook-style-xsl flex xsltproc
BuildRequires: gcc-c++ po4a udev libudev-devel libsystemd-devel
BuildRequires: asciidoctor resource-agents
%{?!_without_check:%{?!_disable_check:BuildRequires: /proc clitest}}

Requires: linux-ha-common

Conflicts: drbd-tools drbd83-tools
Provides: %name-bash-completion = %EVR
Obsoletes: %name-bash-completion < %EVR

%description
DRBD refers to block devices designed as a building block to form high
availability (HA) clusters. This is done by mirroring a whole block device
via an assigned network. DRBD can be understood as network based raid-1.

This packages includes the DRBD administration tools.

%package xen
Summary: Xen block device management script for DRBD
Group: System/Kernel and hardware
Requires: %name = %version-%release
Requires: xen
BuildArch: noarch

%description xen
This package contains a Xen block device helper script for DRBD, capable of
promoting and demoting DRBD resources as necessary.

%package pacemaker
Summary: Pacemaker resource agent for DRBD
Group: System/Kernel and hardware
Requires: %name = %version-%release
Requires: pacemaker
License: GPLv2
BuildArch: noarch

%description pacemaker
This package contains the master/slave DRBD resource agent for the
Pacemaker High Availability cluster manager.

%package rgmanager
Summary: Red Hat Cluster Suite agent for DRBD
Group: System/Kernel and hardware
Requires: %name = %version-%release
BuildArch: noarch

%description rgmanager
This package contains the DRBD resource agent for the Red Hat Cluster Suite
resource manager.

%prep
%setup -a1
tar -xf %SOURCE1 -C drbd-headers
%patch0 -p1
(echo -e "#define GITHASH \"%githash\""; \
echo -e "#define GITDIFF \"%gitdiff\"") > user/shared/drbd_buildtag.h
%ifarch %e2k
# lcc 1.25.15 barfs at DrbdRole.cpp:36, DrbdVolume.cpp:748
sed -i 's,-Wshadow,,' user/drbdmon/Makefile*
%endif

%build
%autoreconf
%configure \
   %{subst_with xen} \
   --with-udev \
   --with-pacemaker \
   --with-rgmanager \
   --with-heartbeat \
   --with-distro=generic

# Bug in configure.ac, enabling WITH_DRBDMON anyway:

sed -i "s|WITH_DRBDMON[[:space:]]*=[[:space:]]*no|WITH_DRBDMON = yes|" \
 Makefile user/drbdmon/Makefile documentation/common/Makefile_v9_com
# Bug in compiler option:
sed -i "s|--pedantic-errors|-pedantic-errors|" user/drbdmon/Makefile

%make_build

%install
%makeinstall_std

rm -rf %buildroot%_mandir/ja
rm -f  %buildroot/etc/init.d/drbd # NB: _not_ %%_initdir here
pushd scripts
install -pDm644 -t %buildroot%_unitdir *.service
install -pDm644 -t %buildroot%_unitdir *.target
install -pDm755 -t %buildroot/lib/drbd/scripts drbd drbd-service-shim.sh drbd-wait-promotable.sh ocf.ra.wrapper.sh
install -pDm755 drbd %buildroot%_initdir/drbd
popd

%post
%post_service drbd

%preun
%preun_service drbd

%check
make test

%files
%doc scripts/drbd.conf.example COPYING ChangeLog README.md
%config(noreplace) %_sysconfdir/drbd.conf
%dir %_sysconfdir/drbd.d
%config(noreplace) %_sysconfdir/drbd.d/global_common.conf
%config(noreplace) %_sysconfdir/multipath/conf.d/drbd.conf
%_sysconfdir/ha.d/resource.d/*
%_initdir/drbd
%_unitdir/drbd.service
%_unitdir/drbd-lvchange at .service
%_unitdir/drbd-promote at .service
%_unitdir/drbd-reconfigure-suspend-or-error at .service
%_unitdir/drbd-demote-or-escalate at .service
%_unitdir/drbd-services at .target
%_unitdir/drbd-wait-promotable at .service
%_unitdir/drbd at .service
%_unitdir/drbd at .target
%_unitdir/ocf.ra at .service
%_sbindir/drbdsetup
%_sbindir/drbdadm
%_sbindir/drbdmeta
%_sbindir/drbdmon
%dir /lib/drbd
/lib/drbd/drbdadm-*
/lib/drbd/drbdsetup-*
%dir /lib/drbd/scripts
/lib/drbd/scripts/drbd
/lib/drbd/scripts/drbd-service-shim.sh
/lib/drbd/scripts/drbd-wait-promotable.sh
/lib/drbd/scripts/ocf.ra.wrapper.sh
/lib/udev/rules.d/65-drbd.rules
%exclude /usr/lib/drbd/crm-*fence-peer.sh
%exclude /usr/lib/drbd/stonith_admin-fence-peer.sh
%dir /usr/lib/drbd
/usr/lib/drbd/*.sh
/usr/lib/drbd/rhcs_fence
%dir %_var/lib/drbd
%_man8dir/drbd*
%_man7dir/*
%_man5dir/drbd*
%_sysconfdir/bash_completion.d/*

%if_with xen
%files xen
%_sysconfdir/xen/scripts/block-drbd
%endif

%files pacemaker
%dir /usr/lib/ocf/resource.d/linbit
/usr/lib/ocf/resource.d/linbit/drbd
/usr/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh
/usr/lib/ocf/resource.d/linbit/drbd-attr
/usr/lib/drbd/crm-*fence-peer.sh
/usr/lib/drbd/stonith_admin-fence-peer.sh

%files rgmanager
%_datadir/cluster/drbd.sh
%_datadir/cluster/drbd.metadata

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin