Name: blcr Version: 0.5.0 Release: 2 Summary: Berkeley Lab Checkpoint/Restart for Linux # If not building against the running kernel, then you'll need to # ensure that the 'kernel_ver' variable indicates the version you are # compiling for, by adding "--define 'kernel_ver '" to your # rpmbuild (or rpm) command line. When doing this you may also # want/need "--define 'kernel_src /usr/src/linux-'" # and/or "--define 'kernel_obj /lib/modules//build'". # Use of "--define 'kernel_type '" will allow one to # override /boot/kernel.h, where SOMETHING=SMP, UP, etc.. # Read next line as "kernel = defined(kernel_ver) ? kernel_ver : `uname -r`" %define kernel %{?kernel_ver:%{kernel_ver}}%{!?kernel_ver:%(uname -r)} # Name the kernel modules package w/o dashes in the kernel version: %define modsubpkg modules_dkms #%define moduledir /lib/modules/%{kernel}/%{name} # Name of the unpacked source directory and stem of the tarball name %define distname %{name}-%{version} # Disable RedHat's automatic build of a debuginfo subpackage: %define debug_package %{nil} # Macro for scanning configure arguments # First arg is default value, second is option name. %define is_enabled() %(X=%1; eval set -- ; for x in "$@"; do if [ x"$x" = "x--disable-%2" -o x"$x" = "x--enable-%2=no" ]; then X=0; elif [ x"$x" = "x--enable-%2" -o x"$x" = "x--enable-%2=yes" ]; then X=1; fi; done; echo $X) # Are we building the SSS components? %define build_sss %{is_enabled 0 sss} # Are we building static libs? %define build_static %{is_enabled 0 static} # Are we building both 32- and 64-bit libcr? %define build_libdir32 0 %ifarch x86_64 %define build_libdir32 %{is_enabled 1 multilib} %endif # Where to put 32-bit libs on a 64-bit platform %if %{build_libdir32} %define libdir32 %(echo %{_libdir} | sed -e s/lib64/lib/) %endif Group: System Environment License: GPL Source: %{distname}.tar.gz Patch0: blcr-chkconfig.patch Patch1: blcr-configure.patch BuildRoot: %{_tmppath}/buildroot-%{name}-%{version} BuildRequires: perl sed autoconf automake Prereq: /sbin/chkconfig ExclusiveArch: i386 i486 i586 i686 athlon x86_64 ExclusiveOs: Linux Requires: gcc, make Requires(post): dkms Requires(preun): dkms Provides: dkms-blcr = %{version}-%{release} # DON'T require since many clusters are built w/ non-RPM kernels: # BuildPreReq: kernel-source = %{kernel} %description Berkeley Lab Checkpoint/Restart for Linux (BLCR) This package implements system-level checkpointing of scientific applications in a manner suitable for implementing preemption, migration and fault recovery by a batch scheduler. BLCR includes documented interfaces for a cooperating applications or libraries to implement extensions to the checkpoint system, such as consistent checkpointing of distributed MPI applications. Using this package with an appropriate MPI implementation, the vast majority of scientific applications which use MPI for communucation on Linux clusters are checkpointable without any modifications to the application source code. You must also install the %{name}-libs package and a %{name}-modules_* package matching your kernel version. %prep # Ensure we don't build for a i386 %ifarch i386 set +x echo "==========================================================================" echo "ERROR: Cannot build BLCR for a generic i386." >&2 echo "ERROR: Add \"--target `uname -p`\" (or similar) to the rpmbuild command line." >&2 echo "==========================================================================" exit 1 %endif %setup -n %{distname} %patch0 -p1 %patch1 -p1 rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT %build # Work with rpm's various botched ideas of host vs. target %define _host_cpu %{_target_cpu} %define _host %{_target} %define _build_cpu %{_target_cpu} %define _build %{_target} # Configure the thing # Order arguments such that user's configure arguments can disable multilib, and # enable the config-report, but doesn't clobber kernel version info from the # rpmbuild command line autoreconf --force --install %configure \ --with-components=util,libcr,include \ %{?libdir32:--enable-multilib} # Now build it %{__make} %clean rm -rf ${RPM_BUILD_ROOT} %install %{__rm} -rf %{buildroot} %define dkms_name blcr %define dkms_vers %{version}-%{release} %define quiet -q make install DESTDIR=${RPM_BUILD_ROOT} # Ensure man pages are gzipped, regardless of brp-compress if [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]; then find ${RPM_BUILD_ROOT}/%{_mandir} -name '*.[1-9]' | xargs gzip -9 fi # Install the init script make -C etc install DESTDIR=${RPM_BUILD_ROOT} # Kernel module sources install for dkms %{__mkdir_p} %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/ %{__cp} -a . \ %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/ ( cd %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers} && make clean ; ) # Configuration for dkms %{__cat} > %{buildroot}%{_usrsrc}/%{dkms_name}-%{dkms_vers}/dkms.conf << 'EOF' PACKAGE_NAME=%{dkms_name} PACKAGE_VERSION=%{dkms_vers} MAKE[0]="./configure --with-components=modules && make" BUILT_MODULE_NAME[0]=blcr BUILT_MODULE_LOCATION[0]=cr_module/kbuild BUILT_MODULE_NAME[1]=blcr_imports BUILT_MODULE_LOCATION[1]=blcr_imports/kbuild BUILT_MODULE_NAME[2]=blcr_vmadump BUILT_MODULE_LOCATION[2]=vmadump4/kbuild DEST_MODULE_LOCATION[0]=/extra DEST_MODULE_LOCATION[1]=/extra DEST_MODULE_LOCATION[2]=/extra AUTOINSTALL="YES" EOF %files %defattr(-,root,root) %doc LICENSE.txt %doc COPYING %doc NEWS %doc doc/README %doc doc/html %doc %{_mandir}/man1/cr_checkpoint.1.gz %doc %{_mandir}/man1/cr_restart.1.gz %doc %{_mandir}/man1/cr_run.1.gz %{_bindir}/cr_checkpoint #%{_bindir}/cr_info %{_bindir}/cr_restart %{_bindir}/cr_run #%{_libexecdir}/vmadcheck %{_sysconfdir}/init.d/blcr # # Libs in a separate package # %package libs Group: System Environment/Libraries Summary: Libraries for Berkeley Lab Checkpoint/Restart for Linux License: LGPL Prereq: /sbin/ldconfig %description libs Runtime libaries for Berkeley Lab Checkpoint/Restart for Linux (BLCR) %post libs /sbin/ldconfig exit 0 %postun libs /sbin/ldconfig exit 0 %files libs %defattr(-,root,root) %doc LICENSE.txt %doc COPYING.LIB %doc NEWS %{_libdir}/libcr.so.0 %{_libdir}/libcr.so.0.1.3 %if %{build_libdir32} %{libdir32}/libcr.so.0 %{libdir32}/libcr.so.0.1.3 %endif # # Separate -devel package # %package devel Requires: %{name}-libs = %{version}-%{release} Group: Development/Libraries Summary: Header and object files for Berkeley Lab Checkpoint/Restart for Linux License: LGPL %description devel Header and object files for Berkeley Lab Checkpoint/Restart for Linux You must also install the %{name}-libs package. %files devel %defattr(-,root,root) %{_includedir}/blcr_common.h %{_includedir}/blcr_errcodes.h %{_includedir}/blcr_ioctl.h %{_includedir}/blcr_proc.h %{_includedir}/libcr.h %{_libdir}/libcr.la %{_libdir}/libcr.so %if %{build_libdir32} %{libdir32}/libcr.la %{libdir32}/libcr.so %endif %if %{build_static} %{_libdir}/libcr.a %endif %if %{build_static} && %{build_libdir32} %{libdir32}/libcr.a %endif # # Kernel modules as a separate package # %package %{modsubpkg} Group: System Environment Summary: Kernel modules for Berkeley Lab Checkpoint/Restart for Linux Provides: %{name}-modules = %{version}-%{release} Prereq: %{name} = %{version} # DON'T require since many clusters are built w/ non-RPM kernels: # Requires: kernel = %{kernel} %description %{modsubpkg} Kernel modules for Berkeley Lab Checkpoint/Restart for Linux (BLCR) These kernel modules are built for Linux %{kernel}. %post #if [ $1 = 1 ]; then # /sbin/chkconfig --add blcr #fi # Add to DKMS registry dkms add -m %{dkms_name} -v %{dkms_vers} %{?quiet} || : # Rebuild and make available for the currenty running kernel dkms build -m %{dkms_name} -v %{dkms_vers} %{?quiet} || : dkms install -m %{dkms_name} -v %{dkms_vers} %{?quiet} --force || : %preun # Remove all versions from DKMS registry dkms remove -m %{dkms_name} -v %{dkms_vers} %{?quiet} --all || : #if [ $1 = 0 ]; then # /sbin/chkconfig --del blcr #fi #exit 0 #You must also install the base %{name} package. #%post %{modsubpkg} #if [ $1 = 2 ]; then # conditional reload on upgrade # /etc/init.d/blcr reload >& /dev/null #fi #/sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} #exit 0 #%preun %{modsubpkg} #if [ $1 = 0 ]; then # /etc/init.d/blcr stop >& /dev/null #fi #exit 0 #%postun %{modsubpkg} #if [ $1 = 0 ]; then # /sbin/depmod -a -F /boot/System.map-%{kernel} %{kernel} #fi #exit 0 %files %{modsubpkg} %defattr(-,root,root) %{_usrsrc}/%{dkms_name}-%{dkms_vers}/ # Note suffix may be either .o (2.4 kernel) or .ko (2.6 kernel) ## ## blcr-lampd and blcr-crmg as additional packages if configured in ## %if %{build_sss} %package lampd Requires: %{name} = %{version}-%{release} BuildRequires: system-mpd-dev Group: System Environment Summary: MPI startup helper for Berkeley Lab Checkpoint/Restart for Linux License: GPL BuildRequires: system-mpd-dev %description lampd lampd is an mpirun replacement allowing the mpd-based Scalable Systems Process Manager to launch MPI applications build with a BLCR-compatible LAM/MPI. %files lampd %defattr(-,root,root) %{_bindir}/lampd %package crmg-server Group: System Environment Summary: SSS Checkpoint Manager over Berkeley Lab Checkpoint/Restart for Linux License: GPL Requires: ssslib-python %description crmg-server This is the BLCR implementation of the Scalable Systems Software "Checkpoint Manager" component. %post crmg-server if [ $1 = 1 ]; then /sbin/chkconfig --add sss-cr fi exit 0 %preun crmg-server if [ $1 = 0 ]; then /etc/init.d/sss-cr stop >& /dev/null /sbin/chkconfig --del sss-cr fi exit 0 %files crmg-server %defattr(-,root,root) %{_sbindir}/crmg.py %{_bindir}/lampd %config %{_sysconfdir}/init.d/sss-cr #%package crmg-clients #Group: System Environment #Summary: Clients for SSS Checkpoint Manager over Berkeley Lab Checkpoint/Restart for Linux #License: GPL #Requires: blcr-crmg-server #%description crmg-clients #This is the BLCR implementation of the Scalable Systems Software #"Checkpoint Manager" component. This package contains the command #line clients for using the Checkpoint Manager directly. #%files crmg-clients #%defattr(-,root,root) #%{_bindir}/FOO %endif %changelog * Mon Mar 5 2007 Neal Becker - 0.5.0-2 - Add br autoconf automake for autoreconf * Sun Mar 4 2007 Neal Becker - 0.5.0-1 - Add autoreconf - Fix tab->space in chkconfig - Remove %config from init.d/blcr