# LDFLAGS: newer gnu linkers can use "-Wl,--as-needed", while older ones,
# like rhel3 and sles9 can't.
-%define LDFLAGS -Wl,--as-needed
+%define enable_as_needed --enable-as-needed
# Define which Distribution we are building:
# Try to detect the distribution we are building:
%define requires_libtermcap Requires: libtermcap.so.2
%define curl curl
%define without_ipv6 --without-ipv6
- %undefine LDFLAGS
%endif
%if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
%define dist redhat
# as integers.
%define curl curl
%if "%{distver}" == "9"
- %undefine LDFLAGS
+ %undefine enable_as_needed
%endif
%endif
%endif
# the platform detection bits.
# without_ipv6 should only be defined on rhel3.
# LDFLAGS macro is defined except on rhel3.
+# --enable-as-needed must be conditional until configure tests whether
+# ld can accept --as-needed.
./configure \
%{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
CFLAGS="%{optflags} -g -pipe" CXXFLAGS="%{optflags}" \
%{?LDFLAGS:LDFLAGS="${LDFLAGS} %{?LDFLAGS:%LDFLAGS}"} \
+ %{?enable_as_needed:%{enable_as_needed}} \
--quiet \
--prefix=%{PREFIX} \
--sysconfdir=%{SYSCONFDIR} \
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/bash %{amanda_user}
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/bash" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
fi
- if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/bash" ] ; then
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/bash, pl correct before start using Amanda !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
else
echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/bash %{amanda_user}
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/bash" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
fi
- if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/bash" ] ; then
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/bash, pl correct before start using Amanda !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
else
echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
# Check for the 'amanda' user
echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
- useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
+ useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/bash %{amanda_user} >>${TMPFILE} 2>&1
if [ %{dist} = "SuSE" ]; then
PASSWD_EXIT=$?
else
echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: SHELL: /bin/bash" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE}
fi
- if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+ if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/bash" ] ; then
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE}
- echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE}
+ echo "`date +'%b %e %Y %T'`: !!! /bin/bash, pl correct before start using Amanda !!!" >>${TMPFILE}
echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
else
echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE}
%{AMLIBEXECDIR}/dumper
%{AMLIBEXECDIR}/planner
%{SBINDIR}/amcheck
+%{SBINDIR}/amservice
%defattr(0750,%{amanda_user},%{amanda_group},0750)
%{LOGDIR}
%{SYSCONFDIR}/amanda