Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name: urbackup-client
- Version: 2.4.11
- Release: 1%{?dist}
- Summary: Client-Server Backup system for Linux
- Group: Productivity/Archiving/Backup
- License: AGPL-3.0
- URL: http://www.urbackup.org/
- Source0: https://hndl.urbackup.org/Client/%{version}/%{name}-%{version}.tar.gz
- BuildRequires: gcc
- BuildRequires: gcc-c++
- BuildRequires: zlib-devel
- Requires: logrotate
- Requires(post): systemd
- Requires(preun): systemd
- %description
- Efficient Client-Server Backup system for Linux and Windows.
- A client part. Backups are stored to disks in a efficient
- way (deduplication) on either Windows or Linux servers.
- %prep
- %setup -q -n %{name}-%{version}.0
- sed -i 's|/usr/local/sbin|/usr/sbin|g' urbackupclientbackend-redhat.service
- sed -i 's|PREFIX="/usr/local"|PREFIX="/usr"|g' init.d_client_rh
- %build
- export SUID_CFLAGS=-fPIE
- export SUID_LDFLAGS=-fpie
- %configure CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" CFLAGS="$CFLAGS -fno-strict-aliasing" --enable-embedded-cryptopp --enable-headless
- make %{?_smp_mflags}
- %install
- %make_install
- mkdir -p %{buildroot}%{_initrddir}
- mkdir -p %{buildroot}%{_unitdir}
- mkdir -p %{buildroot}%{_mandir}/man1
- mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
- install -m 644 defaults_client %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.urbackupclient
- install -m 644 urbackupclientbackend-redhat.service %{buildroot}%{_unitdir}/%{name}.service
- install -m 644 docs/*.1 %{buildroot}%{_mandir}/man1
- %pre
- %service_add_pre %{name}.service
- exit 0
- %post
- # Fix permission. Error message: Could not load password file!
- if [ ! -e /opt/urbackup.cli/pw.txt ]; then
- /usr/bin/touch /opt/urbackup.cli/pw.txt
- /usr/bin/touch /opt/urbackup.cli/pw_change.txt
- fi
- /usr/bin/chmod 666 /opt/urbackup.cli/pw.txt
- /usr/bin/chmod 666 /opt/urbackup.cli/pw_change.txt
- %fillup_only -n urbackupclient
- %service_add_post %{name}.service
- exit 0
- %preun
- %service_del_preun %{name}.service
- exit 0
- %postun
- %service_del_postun %{name}.service
- exit 0
- %posttrans
- if systemctl is-enabled %{name}.service >/dev/null 2>&1
- then
- /bin/systemctl --quiet --force reenable %{name}.service 2>/dev/null || :
- else
- /bin/systemctl --quiet --force reenable %{name}.service 2>/dev/null || :
- /bin/systemctl --quiet disable %{name}.service 2>/dev/null || :
- fi
- exit 0
- %files
- %defattr(-,root,root)
- %doc AUTHORS COPYING ChangeLog README
- %{_bindir}/*
- %attr(750,root,root) %{_sbindir}/*
- %{_localstatedir}/*
- %{_mandir}/man1/*
- %attr(0644,root,root) %{_unitdir}/%{name}.service
- %dir %{_sysconfdir}/urbackup
- %config(noreplace) %{_sysconfdir}/urbackup/*.conf
- %dir %{_datadir}/urbackup/
- %{_datadir}/urbackup/*
- %config %{_localstatedir}/adm/fillup-templates/sysconfig.urbackupclient
- %changelog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement