X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=packaging%2Frpm%2Famanda.spec;h=64deb845989da8419ea1954fa900e3b598660d25;hb=fb2bd066c2f8b34addafe48d62550e3033a59431;hp=b71eb0cf5be2f7e176969b32086f95d9a9c9d2dd;hpb=a6127998ee6dcab6bb034f6ca985b07804a86f9a;p=debian%2Famanda diff --git a/packaging/rpm/amanda.spec b/packaging/rpm/amanda.spec index b71eb0c..64deb84 100644 --- a/packaging/rpm/amanda.spec +++ b/packaging/rpm/amanda.spec @@ -35,34 +35,34 @@ # Try to detect the distribution we are building: %if %{_vendor} == redhat # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least - # fc3-7. So RHEL and Fedora look at the same file. The awk trickery here - # forces the field to be numeric so that the spec comparison works - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3 + # fc3-8. So RHEL and Fedora look at the same file. Different versions have + # different numbers of spaces; hence the use if $3 vs. $4.. + %if %(awk '$1 == "Fedora" && $4 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 3 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4 + %if %(awk '$1 == "Fedora" && $4 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 4 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5 + %if %(awk '$1 == "Fedora" && $4 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 5 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6 + %if %(awk '$1 == "Fedora" && $4 ~ /6.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 6 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7 + %if %(awk '$1 == "Fedora" && $3 ~ /7.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 7 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8 + %if %(awk '$1 == "Fedora" && $3 ~ /8.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist fedora %define disttag fc %define distver 8 @@ -72,17 +72,19 @@ %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig} %endif %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3 + %if %(awk '$1 == "Red" && $7 ~ /3.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 3 + %define tarver 1.14 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4 + %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 4 + %define tarver 1.14 %endif - %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5 + %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 5 @@ -117,12 +119,15 @@ %define xinetd_reload restart %endif +# Set minimum tar version if it wasn't set in the per-distro section +%{!?tarver: %define tarver 1.15} + %define packer %(%{__id_u} -n) # --- Definitions --- # Define amanda_version if it is not already defined. -%{!?amanda_version: %define amanda_version 2.6.0p1} +%{!?amanda_version: %define amanda_version 2.6.0p2} %{!?amanda_release: %define amanda_release 1} %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" %define amanda_user amandabackup @@ -171,7 +176,7 @@ Requires: libnsl.so.1 Requires: curl >= 7.10.0 Requires: xinetd Requires: perl >= 5.6.0 -Requires: tar >= 1.15 +Requires: tar >= %{tarver} %if %{dist} == redhat || %{dist}== fedora Requires: libtermcap.so.2 Requires: initscripts @@ -649,7 +654,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE} chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then @@ -1052,7 +1057,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE} chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then @@ -1419,7 +1424,7 @@ if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDAHOMEDIR}/.gnupg'." >>${TMPFILE} chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then @@ -1500,7 +1505,8 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an /sbin/ldconfig # --- Files to install --- - +# Notes: Do not use wildcards on directories not wholly owned by amanda. An +# uninstall of the software will attempt to delete whatever matches here. %files backup_client %defattr(0755,%{amanda_user},%{amanda_group}) %{SYSCONFDIR}/amanda