b9f7b3
# this is purely a shell script, so no debug packages
b9f7b3
%global debug_package %{nil}
b9f7b3
b9f7b3
Name: rear
b9f7b3
Version: 2.6
c31218
Release: 17%{?dist}
b9f7b3
Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool
b9f7b3
URL: http://relax-and-recover.org/
b9f7b3
License: GPLv3
b9f7b3
b9f7b3
Source0: https://github.com/rear/rear/archive/%{version}.tar.gz#/rear-%{version}.tar.gz
b9f7b3
# Add cronjob and systemd timer as documentation
b9f7b3
Source1: rear.cron
b9f7b3
Source2: rear.service
b9f7b3
Source3: rear.timer
b9f7b3
# Skip buildin modules, RHBZ#1831311
b9f7b3
Patch0: 0001-skip-kernel-buildin-modules.patch
b9f7b3
Patch4:  rear-bz1492177-warning.patch
b9f7b3
Patch29: rear-bz1832394.patch
b9f7b3
Patch30: rear-sfdc02772301.patch
b9f7b3
Patch31: rear-bz1945869.patch
b9f7b3
Patch32: rear-bz1958247.patch
b9f7b3
Patch33: rear-bz1930662.patch
b9f7b3
Patch34: rear-tmpdir.patch
b9f7b3
Patch35: rear-bz1983013.patch
b9f7b3
Patch36: rear-bz1993296.patch
b9f7b3
Patch37: rear-bz1747468.patch
b9f7b3
Patch38: rear-bz2049091.patch
b9f7b3
Patch39: rear-pr2675.patch
b9f7b3
Patch40: rear-bz2048454.patch
b9f7b3
Patch41: rear-bz2035939.patch
5d051d
Patch42: rear-bz2083272.patch
5d051d
Patch43: rear-bz2111049.patch
5d051d
Patch44: rear-bz2104005.patch
5d051d
Patch45: rear-bz2097437.patch
5d051d
Patch46: rear-bz2096916.patch
5d051d
Patch47: rear-bz2096900.patch
5d051d
Patch48: rear-bz2111059.patch
5d051d
Patch49: rsync-output.patch
5d051d
Patch50: rear-bz2119501.patch
5d051d
Patch51: rear-bz2120736.patch
5d051d
Patch52: rear-bz2117937.patch
c31218
Patch53: rear-bz2091163.patch
c31218
Patch54: rear-bz2130945.patch
c31218
Patch55: rear-bz2131946.patch
c31218
Patch56: s390-no-clobber-disks.patch
b9f7b3
b9f7b3
# rear contains only bash scripts plus documentation so that on first glance it could be "BuildArch: noarch"
b9f7b3
# but actually it is not "noarch" because it only works on those architectures that are explicitly supported.
b9f7b3
# Of course the rear bash scripts can be installed on any architecture just as any binaries can be installed on any architecture.
b9f7b3
# But the meaning of architecture dependent packages should be on what architectures they will work.
b9f7b3
# Therefore only those architectures that are actually supported are explicitly listed.
b9f7b3
# This avoids that rear can be "just installed" on architectures that are actually not supported (e.g. ARM):
b9f7b3
ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le ia64 s390x
b9f7b3
# Furthermore for some architectures it requires architecture dependent packages (like syslinux for x86 and x86_64)
b9f7b3
# so that rear must be architecture dependent because ifarch conditions never match in case of "BuildArch: noarch"
b9f7b3
# see the GitHub issue https://github.com/rear/rear/issues/629
b9f7b3
%ifarch %ix86 x86_64
b9f7b3
Requires: syslinux
5d051d
# We need mkfs.vfat for recreating EFI System Partition
5d051d
Recommends: dosfstools
b9f7b3
%endif
b9f7b3
%ifarch ppc ppc64 ppc64le
b9f7b3
# Called by grub2-install (except on PowerNV)
b9f7b3
Requires:   /usr/sbin/ofpathname
b9f7b3
# Needed to make PowerVM LPARs bootable
b9f7b3
Requires:   /usr/sbin/bootlist
b9f7b3
%endif
c31218
%ifarch s390x
c31218
# Contain many utilities for working with DASDs
c31218
Requires:   s390utils-base
c31218
Requires:   s390utils-core
c31218
%endif
b9f7b3
# In the end this should tell the user that rear is known to work only on ix86 x86_64 ppc ppc64 ppc64le ia64
b9f7b3
# and on ix86 x86_64 syslinux is explicitly required to make the bootable ISO image
b9f7b3
# (in addition to the default installed bootloader grub2) while on ppc ppc64 the
b9f7b3
# default installed bootloader yaboot is also useed to make the bootable ISO image.
b9f7b3
b9f7b3
# Required for HTML user guide
b9f7b3
BuildRequires: make
b9f7b3
BuildRequires: asciidoctor
b9f7b3
b9f7b3
### Mandatory dependencies:
b9f7b3
Requires: binutils
b9f7b3
Requires: ethtool
b9f7b3
Requires: gzip
b9f7b3
Requires: iputils
b9f7b3
Requires: parted
b9f7b3
Requires: tar
b9f7b3
Requires: openssl
b9f7b3
Requires: gawk
b9f7b3
Requires: attr
b9f7b3
Requires: bc
b9f7b3
Requires: iproute
b9f7b3
# No ISO image support on s390x (may change when we add support for LPARs)
b9f7b3
%ifnarch s390x
b9f7b3
Requires:   xorriso
b9f7b3
%endif
b9f7b3
Requires: file
b9f7b3
Requires: dhcp-client
b9f7b3
%if 0%{?rhel}
b9f7b3
Requires: util-linux
b9f7b3
%endif
b9f7b3
b9f7b3
%description
b9f7b3
Relax-and-Recover is the leading Open Source disaster recovery and system
b9f7b3
migration solution. It comprises of a modular
b9f7b3
frame-work and ready-to-go workflows for many common situations to produce
b9f7b3
a bootable image and restore from backup using this image. As a benefit,
b9f7b3
it allows to restore to different hardware and can therefore be used as
b9f7b3
a migration tool as well.
b9f7b3
b9f7b3
Currently Relax-and-Recover supports various boot media (incl. ISO, PXE,
b9f7b3
OBDR tape, USB or eSATA storage), a variety of network protocols (incl.
b9f7b3
sftp, ftp, http, nfs, cifs) as well as a multitude of backup strategies
b9f7b3
(incl.  IBM TSM, MircroFocus Data Protector, Symantec NetBackup, EMC NetWorker,
b9f7b3
Bacula, Bareos, BORG, Duplicity, rsync).
b9f7b3
b9f7b3
Relax-and-Recover was designed to be easy to set up, requires no maintenance
b9f7b3
and is there to assist when disaster strikes. Its setup-and-forget nature
b9f7b3
removes any excuse for not having a disaster recovery solution implemented.
b9f7b3
b9f7b3
Professional services and support are available.
b9f7b3
b9f7b3
#-- PREP, BUILD & INSTALL -----------------------------------------------------#
b9f7b3
%prep
b9f7b3
%autosetup -p1
b9f7b3
b9f7b3
### Add a specific os.conf so we do not depend on LSB dependencies
b9f7b3
%{?fedora:echo -e "OS_VENDOR=Fedora\nOS_VERSION=%{?fedora}" >etc/rear/os.conf}
b9f7b3
%{?rhel:echo -e "OS_VENDOR=RedHatEnterpriseServer\nOS_VERSION=%{?rhel}" >etc/rear/os.conf}
b9f7b3
b9f7b3
# Change /lib to /usr/lib for COPY_AS_IS
b9f7b3
sed -E -e "s:([\"' ])/lib:\1/usr/lib:g" \
b9f7b3
    -i usr/share/rear/prep/GNU/Linux/*include*.sh
b9f7b3
b9f7b3
# Same for Linux.conf
b9f7b3
sed -e 's:/lib/:/usr/lib/:g' \
b9f7b3
    -e 's:/lib\*/:/usr/lib\*/:g' \
b9f7b3
    -e 's:/usr/usr/lib:/usr/lib:g' \
b9f7b3
    -i 'usr/share/rear/conf/GNU/Linux.conf'
b9f7b3
b9f7b3
%build
b9f7b3
# build HTML user guide
b9f7b3
# asciidoc writes a timestamp to files it produces, based on the last
b9f7b3
# modified date of the source file, but is sensitive to the timezone.
b9f7b3
# This makes the results differ according to the timezone of the build machine
b9f7b3
# and spurious changes will be seen.
b9f7b3
# Set the timezone to UTC as a workaround.
b9f7b3
# https://wiki.debian.org/ReproducibleBuilds/TimestampsInDocumentationGeneratedByAsciidoc
b9f7b3
TZ=UTC make doc
b9f7b3
b9f7b3
%install
b9f7b3
%{make_install}
b9f7b3
install -p -d %{buildroot}%{_docdir}/%{name}/
b9f7b3
install -m 0644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/
b9f7b3
install -m 0644 %{SOURCE2} %{buildroot}%{_docdir}/%{name}/
b9f7b3
install -m 0644 %{SOURCE3} %{buildroot}%{_docdir}/%{name}/
b9f7b3
b9f7b3
#-- FILES ---------------------------------------------------------------------#
b9f7b3
%files
b9f7b3
%doc MAINTAINERS COPYING README.adoc doc/*.txt doc/user-guide/*.html
b9f7b3
%doc %{_mandir}/man8/rear.8*
b9f7b3
%doc %{_docdir}/%{name}/rear.*
b9f7b3
%config(noreplace) %{_sysconfdir}/rear/
b9f7b3
%{_datadir}/rear/
b9f7b3
%{_sharedstatedir}/rear/
b9f7b3
%{_sbindir}/rear
b9f7b3
b9f7b3
#-- CHANGELOG -----------------------------------------------------------------#
b9f7b3
%changelog
c31218
* Wed Feb 22 2023 Pavel Cahyna <pcahyna@redhat.com> - 2.6-17
c31218
- Backport PR2943 to fix s390x dasd formatting
c31218
- Require s390utils-{core,base} on s390x
c31218
c31218
* Sun Jan 15 2023 Pavel Cahyna <pcahyna@redhat.com> - 2.6-16
c31218
- Apply PR2903 to protect against colons in pvdisplay output
c31218
- Apply PR2873 to fix initrd regeneration on s390x
c31218
- Apply PR2431 to migrate XFS configuration files
c31218
5d051d
* Thu Aug 25 2022 Pavel Cahyna <pcahyna@redhat.com> - 2.6-15
5d051d
- Exclude /etc/lvm/devices from the rescue system to work around a segfault
5d051d
  in lvm pvcreate
5d051d
5d051d
* Wed Aug 24 2022 Pavel Cahyna <pcahyna@redhat.com> - 2.6-14
5d051d
- Avoid stderr message about irrelevant broken links
5d051d
- Changes for NetBackup (NBU) 9.x support
5d051d
5d051d
* Tue Aug  9 2022 Pavel Cahyna <pcahyna@redhat.com> - 2.6-13
5d051d
- Backport PR2831 - rsync URL refactoring
5d051d
  fixes rsync OUTPUT_URL when different from BACKUP_URL
5d051d
5d051d
* Mon Aug  8 2022 Pavel Cahyna <pcahyna@redhat.com> - 2.6-12
5d051d
- Apply PR2795 to detect changes in system files between backup
5d051d
  and rescue image
5d051d
- Apply PR2808 to exclude dev/watchdog* from recovery system
5d051d
- Backport upstream PRs 2827 and 2839 to pass -y to lvcreate instead of one "y"
5d051d
  on stdin
5d051d
- Apply PR2811 to add the PRE/POST_RECOVERY_COMMANDS directives
5d051d
- Recommend dosfstools on x86_64, needed for EFI System Partition
5d051d
- Backport PR2825 to replace defunct mkinitrd with dracut
5d051d
- Apply PR2580 to load the nvram module in the rescue environment in order
5d051d
  to be able to set the boot order on ppc64le LPARs
5d051d
- Backport PR2822 to include the true vi executable in rescue ramdisk
5d051d
b9f7b3
* Sun Feb 27 2022 Pavel Cahyna <pcahyna@redhat.com> - 2.6-11
b9f7b3
- Apply PR2675 to fix leftover temp dir bug (introduced in backported PR2625)
b9f7b3
- Apply PR2603 to ignore unused PV devices
b9f7b3
- Apply upstream PR2750 to avoid exclusion of wanted multipath devices
b9f7b3
- Remove unneeded xorriso dep on s390x (no ISO image support there)
b9f7b3
- Apply upstream PR2736 to add the EXCLUDE_{IP_ADDRESSES,NETWORK_INTERFACES}
b9f7b3
  options
b9f7b3
- Add patch for better handling of thin pools and other LV types not supported
b9f7b3
  by vgcfgrestore
b9f7b3
b9f7b3
* Mon Aug 16 2021 Pavel Cahyna <pcahyna@redhat.com> - 2.6-10
b9f7b3
- Sync spec changes and downstream patches from RHEL 8 rear-2.6-2
b9f7b3
  - Fix multipath performance regression in 2.6, introduced by upstream PR #2299.
b9f7b3
    Resolves: rhbz1993296
b9f7b3
  - On POWER add bootlist & ofpathname to the list of required programs
b9f7b3
    conditionally (bootlist only if running under PowerVM, ofpathname
b9f7b3
    always except on PowerNV) - upstream PR2665, add them to package
b9f7b3
    dependencies
b9f7b3
    Resolves: rhbz1983013
b9f7b3
  - Backport PR2608:
b9f7b3
    Fix setting boot path in case of UEFI partition (ESP) on MD RAID
b9f7b3
    Resolves: rhbz1945869
b9f7b3
  - Backport PR2625
b9f7b3
    Prevents accidental backup removal in case of errors
b9f7b3
    Resolves: rhbz1958247
b9f7b3
  - Fix rsync error and option handling
b9f7b3
    Resolves: rhbz1930662
b9f7b3
b9f7b3
* Wed Aug 11 2021 Pavel Cahyna <pcahyna@redhat.com> - 2.6-9
b9f7b3
- Put TMPDIR on /var/tmp by default, otherwise it may lack space
b9f7b3
  RHBZ #1988420, upstream PR2664
b9f7b3
b9f7b3
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.6-8
b9f7b3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
b9f7b3
  Related: rhbz#1991688
b9f7b3
b9f7b3
* Wed Jun 30 2021 Pavel Cahyna <pcahyna@redhat.com> - 2.6-7
b9f7b3
- Sync spec changes and downstream patches from RHEL 8
b9f7b3
  - Require xorriso instead of genisoimage
b9f7b3
  - Add S/390 support and forgotten dependency on the file utility
b9f7b3
  - Backport upstream code related to LUKS2 support
b9f7b3
  - Modify the cron command to avoid an e-mail with error message after
b9f7b3
    ReaR is installed but not properly configured when the cron command
b9f7b3
    is triggered for the first time
b9f7b3
  - Changes for NetBackup (NBU) support, upstream PR2544
b9f7b3
- Add dependency on dhcp-client, RHBZ #1926451
b9f7b3
b9f7b3
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.6-6
b9f7b3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
b9f7b3
b9f7b3
* Fri Feb 26 2021 Christopher Engelhard <ce@lcts.de> - 2.6-5
b9f7b3
- Change /lib to /usr/lib in scripts to fix RHBZ #1931112
b9f7b3
b9f7b3
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-4
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b9f7b3
b9f7b3
* Wed Sep 23 2020 Christopher Engelhard <ce@lcts.de> - 2.6-3
b9f7b3
- Stop auto-creating a cronjob, but ship example cronjob/
b9f7b3
  systemd timer units in docdir instead (upstream issue #1829)
b9f7b3
- Build & ship HTML user guide
b9f7b3
- Remove %pre scriptlet, as it was introduced only to fix a
b9f7b3
  specific upgrade issue with v1.15 in 2014
b9f7b3
b9f7b3
* Tue Sep 22 2020 Christopher Engelhard <ce@lcts.de> - 2.6-2
b9f7b3
- Backport upstream PR#2469 to fix RHBZ #1831311
b9f7b3
b9f7b3
* Tue Sep 22 2020 Christopher Engelhard <ce@lcts.de> - 2.6-1
b9f7b3
- Update to 2.6
b9f7b3
- Streamline & clean up spec file
b9f7b3
b9f7b3
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-6
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b9f7b3
b9f7b3
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-5
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
b9f7b3
b9f7b3
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-4
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b9f7b3
b9f7b3
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-3
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
b9f7b3
b9f7b3
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-2
b9f7b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b9f7b3
b9f7b3
* Thu Jul 30 2015 Johannes Meixner <jsmeix@suse.de>
b9f7b3
- For a changelog see the rear-release-notes.txt file.
b9f7b3