Update scriplet dealing with symlinks as Gudelines suggests

This commit is contained in:
Michal Schorm 2017-10-30 13:25:35 +01:00
parent 039fdbed92
commit d37e9dcbed

View File

@ -1,6 +1,6 @@
Name: mariadb-connector-c
Version: 3.0.2
Release: 12%{?dist}
Release: 13%{?dist}
Summary: The MariaDB Native Client library (C driver)
Group: Applications/Databases
License: LGPLv2+
@ -107,13 +107,18 @@ ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h
%pre devel
if [ -h %{_libdir}/mariadb ]; then
unlink %{_libdir}/mariadb
fi
if [ -h %{_libdir}/mysql ]; then
unlink %{_libdir}/mysql
fi
# https://fedoraproject.org/wiki/Packaging:Directory_Replacement
%pretrans -p <lua> devel
path = "%{_libdir}/mariadb"
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
path = "%{_libdir}/mysql"
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -160,6 +165,10 @@ fi
# https://jira.mariadb.org/browse/MDEV-13836
%changelog
* Mon Oct 30 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-13
- Update scriplet dealing with symlinks as Gudelines suggests
Related: #1501933
* Thu Oct 26 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-12
- Move library directly to libdir, don't create any symlinks to directories
- Update scritplets, so they only check for old symlinks to directories