Debian Codegraph @

packaging/rpm/rear.spec

raw
1 %define rpmrelease %{nil}
2 %define debug_package %{nil}
3
4 ### Work-around the fact that openSUSE/SLES _always_ defined both :-/
5 %if 0%{?sles_version} == 0
6 %undefine sles_version
7 %endif
8
9 Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool
10 Name: rear
11 Version: 2.9
12 Release: 1%{?rpmrelease}%{?dist}
13 # Since some time the license value 'GPLv3' causes build failures in the openSUSE Build Service
14 # cf. https://github.com/rear/rear/issues/2289#issuecomment-559713101
15 # so we use now 'GPL-3.0' that is known to work (at least for now) according to
16 # https://github.com/rear/rear/issues/2289#issuecomment-576625186
17 License: GPL-3.0
18 Group: Applications/File
19 URL: http://relax-and-recover.org/
20
21 Source: https://github.com/rear/rear/archive/%{version}.tar.gz#/rear-%{version}.tar.gz
22
23 # BuildRoot: is required for SLES 11 and RHEL/CentOS 5 builds on openSUSE Build Service (#2135)
24 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
25
26 # rear contains only bash scripts plus documentation so that on first glance it could be "BuildArch: noarch"
27 # but actually it is not "noarch" because it only works on those architectures that are explicitly supported.
28 # Of course the rear bash scripts can be installed on any architecture just as any binaries can be installed on any architecture.
29 # But the meaning of architecture dependent packages should be on what architectures they will work.
30 # Therefore only those architectures that are actually supported are explicitly listed.
31 # This avoids that rear can be "just installed" on architectures that are actually not supported (e.g. ARM):
32 ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le ia64 s390x
33 # Furthermore for some architectures it requires architecture dependent packages (like syslinux for x86 and x86_64)
34 # so that rear must be architecture dependent because ifarch conditions never match in case of "BuildArch: noarch"
35 # see the GitHub issue https://github.com/rear/rear/issues/629
36 %ifarch %ix86 x86_64
37 Requires: syslinux
38 %endif
39 # In the end this should tell the user that rear is known to work only on ix86 x86_64 ppc ppc64 ppc64le ia64
40 # and on ix86 x86_64 syslinux is explicitly required to make the bootable ISO image
41 # (in addition to the default installed bootloader grub2) while on ppc ppc64 the
42 # default installed bootloader yaboot is also used to make the bootable ISO image.
43
44 BuildRequires: make
45
46 ### Mandatory dependencies on all distributions:
47 Requires: binutils
48 Requires: ethtool
49 Requires: gzip
50 Requires: iputils
51 Requires: parted
52 Requires: tar
53 Requires: openssl
54 Requires: gawk
55 Requires: attr
56 Requires: bc
57
58 ### Non-mandatory dependencies should be specified as RPM weak dependency via
59 ### Recommends: RPM_package_name
60 ### because missing RPM Recommends do not cause hard errors during installation
61 ### and using Recommends instead of Requires has the additional advantage
62 ### that the user can use ReaR without unneeded hard requirements when
63 ### he does not use functionality in ReaR that uses the hard requirements
64 ### e.g. when he does not need genisoimage or mkisofs to make an ISO image
65 ### (i.e. when he does not use "OUTPUT=ISO"), cf.
66 ### https://github.com/rear/rear/issues/2289
67 ### When particular functionality in ReaR requires certain programs
68 ### those programs need to be specified in the ReaR scripts in the
69 ### REQUIRED_PROGS config array but not here in the RPM spec file.
70
71 ### If you require NFS, you may need the below packages
72 #Requires: nfsclient portmap rpcbind
73
74 ### We drop LSB requirements because it pulls in too many dependencies
75 ### The OS is hardcoded in /etc/rear/os.conf instead
76 #Requires: redhat-lsb
77
78 ### Required for Bacula/MySQL support
79 #Requires: bacula-mysql
80
81 ### Required for OBDR
82 #Requires: lsscsi sg3_utils
83
84 ### Optional requirement
85 #Requires: cfg2html
86
87 %if %{?suse_version:1}0
88 Requires: iproute2
89 ### Since SLES11 there is an extra nfs-client package:
90 Recommends: nfs-client
91 ### In SLES11 and SLES12 there is
92 ### /usr/bin/genisoimage provided by the genisoimage RPM and there is
93 ### /usr/bin/mkisofs provided by the cdrkit-cdrtools-compat RPM and
94 ### both RPMs are installed by default.
95 ### In openSUSE Leap 15.0 and SLES15 there is (at least by default)
96 ### no longer /usr/bin/genisoimage but there is
97 ### only /usr/bin/mkisofs provided by the mkisofs RPM
98 ### so we recommend all of them to get any of them if available:
99 Recommends: cdrkit-cdrtools-compat
100 Recommends: genisoimage
101 Recommends: mkisofs
102 %endif
103
104 %if %{?mandriva_version:1}0
105 Requires: iproute2
106 ### Mandriva switched from 2008 away from mkisofs,
107 ### and as a specialty call the package cdrkit-genisoimage!
108 %if 0%{?mandriva_version} >= 2008
109 Requires: cdrkit-genisoimage
110 %else
111 Requires: mkisofs
112 %endif
113 #Requires: lsb
114 %endif
115
116 ### On RHEL/Fedora the genisoimage packages provides mkisofs
117 %if %{?centos_version:1}%{?fedora:1}%{?rhel_version:1}0
118 Requires: iproute
119 #Requires: mkisofs
120 Requires: genisoimage
121 #Requires: redhat-lsb
122 %endif
123
124 # Note that CentOS also has rhel defined so there is no need to use centos
125 %if 0%{?rhel}
126 Requires: util-linux
127 %endif
128
129 %description
130 Relax-and-Recover is the leading Open Source disaster recovery and system
131 migration solution. It comprises of a modular
132 frame-work and ready-to-go workflows for many common situations to produce
133 a bootable image and restore from backup using this image. As a benefit,
134 it allows to restore to different hardware and can therefore be used as
135 a migration tool as well.
136
137 Currently Relax-and-Recover supports various boot media (incl. ISO, PXE,
138 OBDR tape, USB or eSATA storage), a variety of network protocols (incl.
139 sftp, ftp, http, nfs, cifs) as well as a multitude of backup strategies
140 (incl. IBM TSM, MircroFocus Data Protector, Symantec NetBackup, EMC NetWorker,
141 Bacula, Bareos, BORG, Duplicity, rsync).
142
143 Relax-and-Recover was designed to be easy to set up, requires no maintenance
144 and is there to assist when disaster strikes. Its setup-and-forget nature
145 removes any excuse for not having a disaster recovery solution implemented.
146
147 Professional services and support are available.
148
149 %pre
150 if [ $1 -gt 1 ] ; then
151 # during upgrade remove obsolete directories
152 %{__rm} -rf %{_datadir}/rear/output/NETFS
153 fi
154
155 %prep
156 %setup -q
157
158 %build
159
160 %install
161 %{__rm} -rf %{buildroot}
162 %{__make} install DESTDIR="%{buildroot}" sbindir="%{_sbindir}" OFFICIAL=1
163
164 %check
165 %{__make} validate OFFICIAL=1
166
167 %files
168 # defattr: is required for SLES 11 and RHEL/CentOS 5 builds on openSUSE Build Service (#2135)
169 %defattr(-, root, root, 0755)
170 %doc MAINTAINERS COPYING README.md doc/*.txt
171 %doc %{_mandir}/man8/rear.8*
172 %config(noreplace) %{_sysconfdir}/rear/
173 %config(noreplace) %{_sysconfdir}/rear/cert/
174 %{_datadir}/rear/
175 %{_localstatedir}/lib/rear/
176 %{_sbindir}/rear
177
178 %changelog
179 * Wed Jan 29 2025 Schlomo Schapiro <[email protected]>
180 - Always set OFFICIAL=1 to install ReaR from SPEC file, as the git version magic happens earlier
181
182 * Thu Jul 30 2015 Johannes Meixner <[email protected]>
183 - For a changelog see the rear-release-notes.txt file.
184