Advertisement
ParTYZane

urbackup-client.spec

Apr 6th, 2021 (edited)
3,252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Name:       urbackup-client
  2. Version:    2.4.11
  3. Release:    1%{?dist}
  4. Summary:    Client-Server Backup system for Linux
  5.  
  6. Group:      Productivity/Archiving/Backup
  7. License:    AGPL-3.0
  8. URL:        http://www.urbackup.org/
  9. Source0:    https://hndl.urbackup.org/Client/%{version}/%{name}-%{version}.tar.gz
  10.  
  11. BuildRequires:  gcc
  12. BuildRequires:  gcc-c++
  13. BuildRequires:  zlib-devel
  14. Requires:       logrotate
  15. Requires(post): systemd
  16. Requires(preun): systemd
  17.  
  18. %description
  19. Efficient Client-Server Backup system for Linux and Windows.
  20. A client part. Backups are stored to disks in a efficient
  21. way (deduplication) on either Windows or Linux servers.
  22.  
  23. %prep
  24. %setup -q -n %{name}-%{version}.0
  25. sed -i 's|/usr/local/sbin|/usr/sbin|g' urbackupclientbackend-redhat.service
  26. sed -i 's|PREFIX="/usr/local"|PREFIX="/usr"|g' init.d_client_rh
  27.  
  28. %build
  29. export SUID_CFLAGS=-fPIE
  30. export SUID_LDFLAGS=-fpie
  31. %configure CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" CFLAGS="$CFLAGS -fno-strict-aliasing" --enable-embedded-cryptopp --enable-headless
  32. make %{?_smp_mflags}
  33.  
  34.  
  35. %install
  36. %make_install
  37. mkdir -p %{buildroot}%{_initrddir}
  38. mkdir -p %{buildroot}%{_unitdir}
  39. mkdir -p %{buildroot}%{_mandir}/man1
  40. mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
  41. install -m 644 defaults_client %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.urbackupclient
  42. install -m 644 urbackupclientbackend-redhat.service %{buildroot}%{_unitdir}/%{name}.service
  43. install -m 644 docs/*.1 %{buildroot}%{_mandir}/man1
  44.  
  45.  
  46. %pre
  47. %service_add_pre %{name}.service
  48. exit 0
  49.  
  50. %post
  51. # Fix permission. Error message: Could not load password file!
  52. if [ ! -e /opt/urbackup.cli/pw.txt ]; then
  53.   /usr/bin/touch /opt/urbackup.cli/pw.txt
  54.   /usr/bin/touch /opt/urbackup.cli/pw_change.txt
  55. fi
  56. /usr/bin/chmod 666 /opt/urbackup.cli/pw.txt
  57. /usr/bin/chmod 666 /opt/urbackup.cli/pw_change.txt
  58. %fillup_only -n urbackupclient
  59. %service_add_post %{name}.service
  60. exit 0
  61.  
  62. %preun
  63. %service_del_preun %{name}.service
  64. exit 0
  65.  
  66. %postun
  67. %service_del_postun %{name}.service
  68. exit 0
  69.  
  70. %posttrans
  71. if systemctl is-enabled %{name}.service >/dev/null 2>&1
  72. then
  73.    /bin/systemctl --quiet --force reenable %{name}.service 2>/dev/null || :
  74. else
  75.    /bin/systemctl --quiet --force reenable %{name}.service 2>/dev/null || :
  76.    /bin/systemctl --quiet disable %{name}.service 2>/dev/null || :
  77. fi
  78. exit 0
  79.  
  80. %files
  81. %defattr(-,root,root)
  82. %doc AUTHORS COPYING ChangeLog README
  83. %{_bindir}/*
  84. %attr(750,root,root) %{_sbindir}/*
  85. %{_localstatedir}/*
  86. %{_mandir}/man1/*
  87. %attr(0644,root,root) %{_unitdir}/%{name}.service
  88. %dir %{_sysconfdir}/urbackup
  89. %config(noreplace) %{_sysconfdir}/urbackup/*.conf
  90. %dir %{_datadir}/urbackup/
  91. %{_datadir}/urbackup/*
  92. %config %{_localstatedir}/adm/fillup-templates/sysconfig.urbackupclient
  93.  
  94. %changelog
  95.  
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement