File burp.spec of Package burp
# vim: set sw=4 ts=4 et nu:
# Copyright (c) 2017-2023 Stefan Jakobs <projects@localside.net>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
%define burp_home /var/spool/burp
Name: burp
Version: 2.4.0
%define soname 1
Release: 1
Summary: Backup and Restore
Source0: http://prdownloads.sourceforge.net/burp/burp-%{version}.tar.bz2
Source1: %{name}.service
Patch0: remove_env_from_shebang.patch
# https://github.com/grke/burp/issues/894: https://github.com/grke/burp/commit/1d6c931af7c11f164cf7ad3479781e8f03413496
Patch1: format-security-fix.patch
URL: http://burp.grke.net/
Group: Productivity/Archiving/Backup
License: AGPL-3.0
BuildRoot: %{_tmppath}/build-%{name}-%{version}
BuildRequires: gcc-c++ gcc make glibc-devel pkgconfig
BuildRequires: autoconf automake libtool
BuildRequires: ncurses-devel
BuildRequires: uthash-devel
BuildRequires: openssl
BuildRequires: zlib-devel
BuildRequires: libacl-devel
BuildRequires: libattr-devel
BuildRequires: libcap-devel
BuildRequires: librsync-devel
BuildRequires: systemd
BuildRequires: fdupes
%if 0%{?suse_version}
BuildRequires: libyajl-devel libopenssl-devel tcpd-devel librsync2
%else
BuildRequires: yajl-devel openssl-devel
BuildRequires: systemd-rpm-macros
%endif
%{?systemd_requires}
Provides: libburp2 = %{version}
Provides: libburp1 = %{version}
Obsoletes: libburp2 < %{version}
Obsoletes: libburp1 < %{version}
%description
Burp is a backup and restore program. It uses librsync in order to save on the
amount of space that is used by each backup. It also uses VSS (Volume Shadow
Copy Service) to make snapshots when backing up Windows computers.
%prep
%setup -q
%patch -P0 -p1
%patch -P1 -p1
%build
%configure \
--sysconfdir="%{_sysconfdir}/burp" \
-docdir="%{_docdir}/burp" \
--disable-static \
%if 0%{?suse_version}
--with-tcp-wrappers
%endif
%__make %{?_smp_mflags}
%check
%__make test
%install
%make_install
make DESTDIR="%{buildroot}" install-configs
install -dm 0755 %{buildroot}/%{_sysconfdir}/burp/autoupgrade/client
install -dm 0755 %{buildroot}/%{_sysconfdir}/burp/autoupgrade/server/win64/%{version}
install -dm 0755 %{buildroot}/%{_sysconfdir}/burp/autoupgrade/server/win32/%{version}
install -m 0644 configs/server/autoupgrade/windows.script %{buildroot}/%{_sysconfdir}/burp/autoupgrade/server/win64/%{version}/script
install -m 0644 configs/server/autoupgrade/windows.script %{buildroot}/%{_sysconfdir}/burp/autoupgrade/server/win32/%{version}/script
mkdir -p %{buildroot}/%{burp_home}
# install systemd service files
mkdir -p %{buildroot}/%{_unitdir}
install -m 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcburp
%fdupes -s %{buildroot}/%{_sysconfdir}/burp
%pre
%if 0%{?suse_version}
%service_add_pre %{name}.service
%endif
%post
%if 0%{?suse_version}
%service_add_post %{name}.service
%{fillup_only %{name}}
%else
%systemd_post %{name}.service
%endif
%preun
%if 0%{?suse_version}
%service_del_preun %{name}.service
%else
%systemd_preun %{name}.service
%endif
%postun
%if 0%{?suse_version}
%service_del_postun %{name}.service
%else
%systemd_postun_with_restart %{name}.service
%endif
%files
%defattr(-,root,root)
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%attr(0700,root,root) %dir %{burp_home}
%dir %{_sysconfdir}/burp
%attr(0700,root,root) %dir %{_sysconfdir}/burp/clientconfdir
%dir %{_sysconfdir}/burp/clientconfdir/incexc
%dir %{_sysconfdir}/burp/CA-client
%dir %{_sysconfdir}/burp/autoupgrade
%dir %{_sysconfdir}/burp/autoupgrade/client
%dir %{_sysconfdir}/burp/autoupgrade/server
%dir %{_sysconfdir}/burp/autoupgrade/server/win32
%dir %{_sysconfdir}/burp/autoupgrade/server/win32/%{version}
%dir %{_sysconfdir}/burp/autoupgrade/server/win64
%dir %{_sysconfdir}/burp/autoupgrade/server/win64/%{version}
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/burp/burp-server.conf
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/burp/burp.conf
%config(noreplace) %{_sysconfdir}/burp/CA.cnf
%config %{_sysconfdir}/burp/autoupgrade/server/win32/%{version}/script
%config %{_sysconfdir}/burp/autoupgrade/server/win64/%{version}/script
%config %{_sysconfdir}/burp/clientconfdir/testclient
%config %{_sysconfdir}/burp/clientconfdir/incexc/example
%{_datadir}/burp/scripts/ssl_extra_checks_script
%dir %{_datadir}/burp
%dir %{_datadir}/burp/scripts
%{_datadir}/burp/scripts/notify_script
%{_datadir}/burp/scripts/summary_script
%{_datadir}/burp/scripts/timer_script
%{_datadir}/burp/scripts/backup_tool_script
%{_bindir}/vss_strip
%{_sbindir}/bedup
%{_sbindir}/bsigs
%{_sbindir}/bsparse
%{_sbindir}/burp
%{_sbindir}/burp_ca
%doc %{_mandir}/man8/burp.8%{ext_man}
%doc %{_mandir}/man8/bedup.8%{ext_man}
%doc %{_mandir}/man8/bsigs.8%{ext_man}
%doc %{_mandir}/man8/bsparse.8%{ext_man}
%doc %{_mandir}/man8/burp_ca.8%{ext_man}
%doc %{_mandir}/man8/vss_strip.8%{ext_man}
%doc %{_docdir}/burp/*.txt
%doc CHANGELOG CONTRIBUTORS LICENSE DONATIONS README* UPGRADING
%changelog