fixed various problems in pre/post scripts [release 4.21.1-2mamba;Wed Oct 16 2024]

This commit is contained in:
Silvan Calarco 2024-10-17 11:39:11 +02:00
parent 3f86435390
commit d212a772ca

View File

@ -1,6 +1,6 @@
Name: samba
Version: 4.21.1
Release: 1mamba
Release: 2mamba
Summary: Samba provides seamless file and print services to SMB/CIFS clients
Group: System/Servers
Vendor: openmamba
@ -308,36 +308,24 @@ mkdir %{buildroot}%{_localstatedir}/lib/samba/usershares
%sysusers_create_package samba %{SOURCE1}
:
%preun server
%systemd_preun smb
%systemd_preun nmb
:
%pre server
%sysusers_create_package samba-server %{SOURCE2}
%tmpfiles_create samba.conf
:
%post server
%systemd_post nmb
%systemd_post smb
if [ $1 -ge 1 ]; then
%tmpfiles_create samba.conf
# clean old sysv broken links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
[ -e %{_initrddir}/nmb ] && {
systemctl -q enable nmb
systemctl -q restart nmb
}
[ -e %{_initrddir}/smb ] && {
systemctl -q enable smb
systemctl -q restart smb
}
fi
if [ $1 -gt 1 ]; then
# remove UTF-8 unix charset definition (leave default) to fix smb4k
sed -i "/unix charset = LOCALE/d" %{_sysconfdir}/samba/smb.conf
sed -i "/unix charset = UTF-8/d" %{_sysconfdir}/samba/smb.conf
fi
exit 0
%preun server
%systemd_preun smb
%systemd_preun nmb
%systemd_post nmb
%systemd_post smb
:
%postun server
@ -345,53 +333,39 @@ exit 0
%systemd_postun_with_restart smb
:
%post winbind
%systemd_post winbind
if [ $1 -ge 1 ]; then
# clean old sysv broken links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
fi
%preun winbind
%systemd_preun winbind
:
%postun winbind
%systemd_postun_with_restart winbind
%post winbind
if [ $1 -ge 1 ]; then
# new install or update
# new install or update
grep "^auth.*pam_winbind.so" %{_sysconfdir}/pam.d/system-auth >/dev/null || sed -i -e '/^auth.*pam_unix.so/a\
auth sufficient pam_winbind.so use_first_pass' %{_sysconfdir}/pam.d/system-auth
grep "^account.*pam_winbind.so" %{_sysconfdir}/pam.d/system-auth >/dev/null || sed -i -e '/^account.*pam_unix/i\
account sufficient pam_winbind.so' %{_sysconfdir}/pam.d/system-auth
fi
%systemd_post winbind
:
%preun winbind
%systemd_preun winbind
%postun winbind
%systemd_postun_with_restart winbind
if [ $1 -eq 0 ]; then
# remove package
systemctl -q stop winbind
# remove package
sed -i "/.*pam_winbind.so/d" %{_sysconfdir}/pam.d/system-auth
fi
:
%pre -n samba4-server
%systemd_pre samba
%preun -n samba4-server
%systemd_preun samba
:
%post -n samba4-server
/sbin/ldconfig
%systemd_post samba
if [ $1 -ge 1 ]; then
%tmpfiles_create samba
fi
:
%preun -n samba4-server
%systemd_preun_with_restart samba
:
%postun -n samba4-server
/sbin/ldconfig
%systemd_postun samba
%systemd_postun_with_restart samba
:
%files
@ -426,6 +400,7 @@ fi
%{_bindir}/wspsearch
%{_sbindir}/eventlogadm
%{_sysusersdir}/samba.conf
%{_presetdir}/50-samba.preset
%dir %{_libdir}/samba
%dir %{_libdir}/samba/krb5
%{_libdir}/samba/krb5/*.so
@ -444,7 +419,6 @@ fi
%{_datadir}/samba/mdssvc/elasticsearch_mappings.json
%dir %{_datadir}/samba/setup
%{_datadir}/samba/setup/*
%{_presetdir}/50-samba.preset
%dir %{python3_sitearch}/samba
%{python3_sitearch}/samba/*
%dir /var/log/samba
@ -504,7 +478,7 @@ fi
%{_libdir}/pkgconfig/ndr_standard.pc
%{_libdir}/pkgconfig/samba-*.pc
%{_libdir}/pkgconfig/samdb.pc
%{_mandir}/man3/ldb.3.gz
%{_mandir}/man3/ldb.3*
%files server
%defattr(-,root,root)
@ -512,6 +486,12 @@ fi
%{_sbindir}/nmbd
%{_sbindir}/smbd
%{_prefix}/lib/cups/backend/smb
%dir %attr(1770,root,sambashares) %{_localstatedir}/lib/samba/usershares
%{_sysusersdir}/samba-server.conf
%{_tmpfilesdir}/samba.conf
%{_unitdir}/nmb.service
%{_unitdir}/smb.service
%{_libdir}/libnss_wins.so.2
%dir %attr(755,root,root) /var/lib/samba/netlogon
%dir %attr(2775,root,users) /var/lib/samba/profiles
%dir %attr(755,root,root) /var/lib/samba/profdata
@ -520,12 +500,6 @@ fi
%dir %attr(1777,root,root) /var/spool/samba
%dir %attr(755,root,root) /var/lock/samba
%dir %attr(755,root,root) /var/lock/samba/msg.lock
%dir %attr(1770,root,sambashares) %{_localstatedir}/lib/samba/usershares
%{_sysusersdir}/samba-server.conf
%{_tmpfilesdir}/samba.conf
%{_unitdir}/nmb.service
%{_unitdir}/smb.service
%{_libdir}/libnss_wins.so.2
%{_mandir}/man5/*
%{_mandir}/man7/*
%{_mandir}/man8/*
@ -614,6 +588,9 @@ fi
%{_mandir}/man8/winbindd.*
%changelog
* Wed Oct 16 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 4.21.1-2mamba
- fixed various problems in pre/post scripts
* Tue Oct 15 2024 Automatic Build System <autodist@openmamba.org> 4.21.1-1mamba
- automatic version update by autodist