1
0

Accepting request 419782 from home:gregfreemyer:branches:filesystems

Update "update-alternatives" logic to meet opensuse policy

OBS-URL: https://build.opensuse.org/request/show/419782
OBS-URL: https://build.opensuse.org/package/show/filesystems/ntfs-3g_ntfsprogs?expand=0&rev=31
This commit is contained in:
Greg Freemyer 2016-08-17 16:15:53 +00:00 committed by Git OBS Bridge
parent 81bb019901
commit bc27a186fa
2 changed files with 15 additions and 17 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 11 21:39:51 UTC 2016 - Greg.Freemyer@gmail.com
- Fix update-alternatives usage.
-------------------------------------------------------------------
Mon Mar 21 22:56:13 UTC 2016 - Greg.Freemyer@gmail.com

View File

@ -53,11 +53,8 @@ Obsoletes: ntfsprogs-fuse < 1.13.1
%if 0%{?suse_version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
# The build service fails to build the package because it doesn't really
# understand Requires(post), so use PreReq too (see bnc#439232).
PreReq: update-alternatives
%endif
%if 0%{?suse_version} > 1010
Requires(preun): update-alternatives
Requires(postun): update-alternatives
Supplements: filesystem(ntfs-3g)
%endif
@ -129,7 +126,6 @@ export LDFLAGS="-pie"
--enable-extras \
--enable-crypto \
--enable-quarantined
make %{?_smp_mflags}
%install
@ -138,8 +134,10 @@ make install DESTDIR="%buildroot"
# Hal stuff for mounting on hotplug.
%{__mkdir_p} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/
%{__install} -m 644 %{SOURCE2} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/21-storage-ntfs-3g.fdi
# Touch ghost files
touch %{buildroot}/sbin/mount.ntfs %{buildroot}%{_mandir}/man8/mount.ntfs.8
# Alternatives for mount.ntfs (binary and manpage)
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/mount.ntfs %{buildroot}/sbin/mount.ntfs
ln -s -f %{_sysconfdir}/alternatives/mount.ntfs.8%{ext_man} %{buildroot}%{_mandir}/man8/mount.ntfs.8%{?ext_man}
%check
TESTFS=$(mktemp) || exit 1
@ -151,21 +149,14 @@ rm -v $TESTFS
%post -n ntfs-3g
# If the mount.ntfs group is in automatic mode, then this will also switch all
# symlinks automatically
update-alternatives --install /sbin/mount.ntfs mount.ntfs /sbin/mount.ntfs-3g 10 --slave /usr/share/man/man8/mount.ntfs.8.gz mount.ntfs.8.gz /usr/share/man/man8/mount.ntfs-3g.8.gz
update-alternatives --install /sbin/mount.ntfs mount.ntfs /sbin/mount.ntfs-3g 10 --slave %{_mandir}/man8/mount.ntfs.8%{?ext_man} mount.ntfs.8%{?ext_man} %{_mandir}/man8/mount.ntfs-3g.8%{?ext_man}
%postun -n ntfs-3g
%preun -n ntfs-3g
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
if [ ! -f /sbin/mount.ntfs-3g ]; then
update-alternatives --remove mount.ntfs /sbin/mount.ntfs-3g
fi
%posttrans -n ntfs-3g
# Workaround old bug in 11.1/11.2 packages that always removed the symlinks in
# %postun. Can be removed during 12.2 development.
if [ ! -f /sbin/mount.ntfs -a -f /sbin/mount.ntfs-3g ]; then
update-alternatives --install /sbin/mount.ntfs mount.ntfs /sbin/mount.ntfs-3g 10 --slave /usr/share/man/man8/mount.ntfs.8.gz mount.ntfs.8.gz /usr/share/man/man8/mount.ntfs-3g.8.gz
fi
%post -n libntfs-3g%soname -p /sbin/ldconfig
%postun -n libntfs-3g%soname -p /sbin/ldconfig
@ -184,6 +175,8 @@ fi
%{_bindir}/ntfs-3g.usermap
%{_bindir}/lowntfs-3g
%ghost /sbin/mount.ntfs
%ghost %{_sysconfdir}/alternatives/mount.ntfs
%ghost %{_sysconfdir}/alternatives/mount.ntfs.8%{?ext_man}
/sbin/mount.ntfs-3g
/sbin/mount.lowntfs-3g
%{_mandir}/man8/mount.lowntfs-3g.8%{?ext_man}