openmamba logo
GNU/Linux distribution
distribution community wiki forum bugs events products
software   community wiki forum bugs events products
packages drbd.spec
      Pages: < 1 >  DOWNLOAD      
# openmamba 2.6 kernel module specfile
# Copyright (C) 2004-2010 by Silvan Calarco
#
# To build for a specific target:
#
# rpm -ba --define="KERNEL_TARGET mamba" drbd.spec
#
# default is "mamba"
#
%define disable_kernel 1
%define kernel_ver        %{version}
%define build_version     %{kernel_ver}
%define BUILD_CC          %{_target_platform}-gcc
%define BUILD_CXX         %{_target_platform}-g++

%if "%{?KERNEL_TARGET}" == ""
   # build a mamba kernel by default
   %define KERNEL_TARGET  mamba
%endif

%if "%{?KERNEL_VER}" == ""
   %define KERNEL_VER     %(uname -r | sed "s|\\([0-9.]*\\).*|\\1|" )
%endif

%define majversion %(echo %version | cut -d. -f 1-2)

Name:          drbd
Version:       8.3.9
Release:       2mamba
Summary:       RAID 1 over TCP/IP for Linux utilities
Group:         System/Kernel and Hardware
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://www.drbd.org/
Source:        http://oss.linbit.com/drbd/%{majversion}/drbd-%{version}.tar.gz 
Patch0:        %{name}-0.6.12-noterminal.patch
Patch1:        %{name}-0.6.12-nokernelmodules.patch 
License:       GPL
%if "%{disable_kernel}" != "1"
Requires:      drbd_kmod
%endif
BuildRoot:     %{_tmppath}/%{name}-%{version}-build

%description
Drbd is a block device which is designed to build high availability clusters by providing a virtual shared device which keeps disks in nodes synchronised using TCP/IP. 
This simulates RAID 1 but avoiding the use of uncommon hardware (shared SCSI buses or Fibre Channel). It is currently limited to fail-over HA clusters. 

This package contains the programs that will control the drbd kernel module.
You will need a clustering service (such as heartbeat) to fully implement it.

%package -n kernel-%{KERNEL_TARGET}-drbd
Summary:       RAID 1 over TCP/IP for Linux kernel module
Group:         System/Kernel and Hardware/Drivers
Requires(pre): kernel-%{KERNEL_TARGET} >= %{KERNEL_VER}
Requires(pre): kernel-%{KERNEL_TARGET} <= %{KERNEL_VER}.255
Provides:      drbd_kmod

%description -n kernel-%{KERNEL_TARGET}-drbd
Drbd is a block device which is designed to build high availability clusters by providing a virtual shared device which keeps disks in nodes synchronised using TCP/IP. 
This simulates RAID 1 but avoiding the use of uncommon hardware (shared SCSI buses or Fibre Channel). It is currently limited to fail-over HA clusters. 

This package contains the programs that will control the kernel module.

%prep
test x"%{buildroot}" != x/ && rm -rf "%{buildroot}"

%setup -q
%if "%{?KERNEL_TARGET}" == ""
   echo "No target specified, aborting."
   exit 1
%else
   echo "I'm going to build module for a %{KERNEL_TARGET} kernel..."
%endif

%build
#
# build for KERNEL_TARGET
#
BUILD_OPTS="CC=%{BUILD_CC} CXX=%{BUILD_CXX} %{_smp_mflags}"

%configure \
   --with-utils \
%if "%{disable_kernel}" != "1"
   --with-km \
%endif
   --with-udev \
   --with-xen \
   --with-heartbeat \
   --with-bashcompletion \
   --with-distro=redhat

%make -j1 KDIR=%{_prefix}/src/linux-%{KERNEL_VER}%{?KERNEL_TARGET}


#%make -C scripts

%install
%makeinstall
# install-tools \
#   PREFIX=%{buildroot}/ \
#   INITD=%{buildroot}%{_initrddir}
#make -C scripts install \
#   PREFIX=%{buildroot}/ \
#   INITD=%{buildroot}%{_initrddir}

ln -sf %{_initrddir}/drbd \
   %{buildroot}%{_sysconfdir}/ha.d/resource.d/datadisk

# stolen from ./drbd/Makefile
install -d -m 700 %{buildroot}/var/lib/drbd

## remove built module
#rm -rf %{buildroot}/lib/modules

#mv %{buildroot}%{_sysconfdir}/rc.d/init.ddrbd %{buildroot}%{_initrddir}/drbd 

%clean
test x"%{buildroot}" != x/ && rm -rf "%{buildroot}"


%post
if [ $1 -eq 1 ]; then
# new install
    exit 0
fi

%preun
if [ $1 -eq 0 ]; then
# erase
   service drbd stop
   chkconfig --del drbd
fi

%postun
if [ $1 -eq 1 ]; then
# upgrade
#  service drbd restart
   exit 0
fi

%post -n kernel-%{KERNEL_TARGET}-drbd
# new install or upgrade
/sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
   %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:

%postun -n kernel-%{KERNEL_TARGET}-drbd
# erase this package
[ $1 -eq 0 ] &&
   /sbin/depmod -a -F /boot/System.map-%{KERNEL_VER}%{?KERNEL_TARGET} \
      %{KERNEL_VER}%{?KERNEL_TARGET} >/dev/null 2>&1
:

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/drbd.conf
%{_sysconfdir}/drbd.d/global_common.conf
%{_sysconfdir}/ha.d/resource.d/drbdupper
%{_sysconfdir}/udev/rules.d/65-drbd.rules
%{_sysconfdir}/bash_completion.d/drbdadm
%{_sysconfdir}/xen/scripts/block-drbd
%{_sysconfdir}/ha.d/resource.d/datadisk
%{_sysconfdir}/ha.d/resource.d/drbddisk
%{_initrddir}/drbd
/sbin/drbdsetup
/sbin/drbdadm
/sbin/drbdmeta
%{_sbindir}/drbd-overview
%dir /var/lib/drbd
%{_libdir}/drbd/crm-*fence-peer.sh
%{_libdir}/drbd/notify*.sh
%{_libdir}/drbd/outdate-peer.sh
%{_libdir}/drbd/snapshot-resync-target-lvm.sh
%{_libdir}/drbd/unsnapshot-resync-target-lvm.sh
%{_libdir}/ocf/resource.d/linbit/drbd
%{_mandir}/man5/drbd.conf.5.gz
%{_mandir}/man8/drbd*.8.gz

%if "%{disable_kernel}" != "1"
%files -n kernel-%{KERNEL_TARGET}-drbd
%defattr(-,root,root)
/lib/modules/%{KERNEL_VER}%{?KERNEL_TARGET}/kernel/drivers/block/drbd.ko
%endif

%changelog
* Wed Dec 29 2010 Silvan Calarco <silvan.calarco@...> 8.3.9-2mamba
- disabled kernel module build (module was added upstream by 2.6.35)

* Tue Nov 02 2010 Automatic Build System <autodist@...> 8.3.9-1mamba
- automatic update by autodist

* Wed Jun 30 2010 Silvan Calarco <silvan.calarco@...> 8.3.8-2mamba
- automatic rebuild by autodist

* Mon Jun 21 2010 Automatic Build System <autodist@...> 8.3.8-1mamba
- automatic update by autodist

* Sat Jan 23 2010 Automatic Build System <autodist@...> 8.3.7-1mamba
- automatic update by autodist

* Tue Jun 24 2008 Silvan Calarco <silvan.calarco@...> 8.2.6-1mamba
- update to 8.2.6

* Wed Mar 08 2006 Silvan Calarco <silvan.calarco@...> 0.7.17-1qilnx
- update to version 0.7.17 by autospec

* Thu Apr 21 2005 Silvan Calarco <silvan.calarco@...> 0.7.10-1qilnx
- update to version 0.7.10 by autospec

* Thu May 13 2004 Davide Madrisan <davide.madrisan@...> 0.6.12-6qilnx
- specfile modified: the drbd kernel module is now in the kernels packages

* Wed May 12 2004 Silvan Calarco <silvan.calarco@...> 0.6.12-5qilnx
- added an initscript patch to avoid a no terminal fatal error

* Tue May 11 2004 Silvan Calarco <silvan.calarco@...> 0.6.12-4qilnx
- fixed datadisk symlink

* Tue May 11 2004 Silvan Calarco <silvan.calarco@...> 0.6.12-3qilnx
- added datadisk resource file for ha

* Tue May 11 2004 Silvan Calarco <silvan.calarco@...> 0.6.12-2qilnx
- fixed post scripts
- build a standard kernel (should be build in future for all kernel versions)

* Tue May 11 2004 Silvan Calarco <silvan.calarco@...> 0.6.12-1qilnx
- fist build