SHA256
1
0
forked from pool/gawk

Accepting request 221401 from home:gberh:branches:Base:System

- adjust update-alternative usage to packaging policy
  (see http://lists.opensuse.org/opensuse-packaging/2014-02/msg00024.html)

OBS-URL: https://build.opensuse.org/request/show/221401
OBS-URL: https://build.opensuse.org/package/show/Base:System/gawk?expand=0&rev=35
This commit is contained in:
Stephan Kulow 2014-02-08 12:52:10 +00:00 committed by Git OBS Bridge
parent b9b219b847
commit 86ca471256
2 changed files with 26 additions and 16 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Feb 8 12:02:23 UTC 2014 - gber@opensuse.org
- adjust update-alternative usage to packaging policy
(see http://lists.opensuse.org/opensuse-packaging/2014-02/msg00024.html)
-------------------------------------------------------------------
Mon May 13 09:35:02 UTC 2013 - idonmez@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package gawk
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -75,24 +75,27 @@ make install DESTDIR=$RPM_BUILD_ROOT
#UsrMerge
install -d $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/gawk $RPM_BUILD_ROOT/bin
touch $RPM_BUILD_ROOT/bin/awk
ln -s %{_sysconfdir}/alternatives/awk $RPM_BUILD_ROOT/bin/awk
#EndUsrMerge
rm -f $RPM_BUILD_ROOT/usr/bin/*-%{version} $RPM_BUILD_ROOT/usr/bin/awk
# create ghost files
touch $RPM_BUILD_ROOT/%{_bindir}/awk $RPM_BUILD_ROOT/%{_mandir}/man1/awk.1.gz
# create symlinks for update-alternatives
ln -s %{_sysconfdir}/alternatives/usr-bin-awk $RPM_BUILD_ROOT%{_bindir}/awk
ln -s %{_sysconfdir}/alternatives/awk.1%{?ext_man} $RPM_BUILD_ROOT%{_mandir}/man1/awk.1%{?ext_man}
%find_lang %name
%post
/usr/sbin/update-alternatives --install /bin/awk awk /bin/gawk 20 \
--slave /usr/bin/awk usr-bin-awk /bin/gawk \
--slave %{_mandir}/man1/awk.1.gz awk.1.gz %{_mandir}/man1/gawk.1.gz
%{_sbindir}/update-alternatives \
--install /bin/awk awk %{_bindir}/gawk 20 \
--slave %{_bindir}/awk usr-bin-awk %{_bindir}/gawk \
--slave %{_mandir}/man1/awk.1.gz awk.1%{?ext_man} %{_mandir}/man1/gawk.1%{?ext_man}
%install_info --info-dir=%{_infodir} %{_infodir}/gawk.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gawkinet.info.gz
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove awk /bin/gawk
%{_sbindir}/update-alternatives --remove awk %{_bindir}/gawk
fi
%postun
@ -101,13 +104,14 @@ fi
%files -f %name.lang
%defattr(-,root,root)
%if %{suse_version} >= 1120
#UsrMerge
%ghost /bin/awk
/bin/awk
#EndUsrMerge
%ghost %{_bindir}/awk
%ghost %{_mandir}/man1/awk.1.gz
%endif
%{_bindir}/awk
%{_mandir}/man1/awk.1%{?ext_man}
%ghost %{_sysconfdir}/alternatives/awk
%ghost %{_sysconfdir}/alternatives/usr-bin-awk
%ghost %{_sysconfdir}/alternatives/awk.1%{?ext_man}
%doc AUTHORS COPYING NEWS POSIX.STD README
#UsrMerge
/bin/gawk
@ -119,8 +123,8 @@ fi
%{_datadir}/awk
%{_includedir}/gawkapi.h
%{_infodir}/*.info.gz
%{_mandir}/man1/gawk.1.gz
%{_mandir}/man1/igawk.1.gz
%{_mandir}/man3/*.gz
%{_mandir}/man1/gawk.1%{?ext_man}
%{_mandir}/man1/igawk.1%{?ext_man}
%{_mandir}/man3/*%{?ext_man}
%changelog