Accepting request 221411 from home:gberh:branches:shells

- 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/221411
OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=200
This commit is contained in:
Dr. Werner Fink 2014-02-20 09:19:56 +00:00 committed by Git OBS Bridge
parent b16f508984
commit 4731fe8e07
2 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Feb 8 13:13:22 UTC 2014 - gber@opensuse.org
- adjust update-alternative usage to packaging policy
(see http://lists.opensuse.org/opensuse-packaging/2014-02/msg00024.html)
-------------------------------------------------------------------
Fri Dec 6 21:13:42 UTC 2013 - matz@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package ksh
#
# 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
@ -665,9 +665,22 @@ fi
%if %use_suid_exe
install bin/suid_exec %{buildroot}/%{_lib}/ast/bin/
%endif
%if %suse_version > 1120
# create update-alternatives symlinks
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
touch %{buildroot}/%{_sysconfdir}/alternatives/ksh
touch %{buildroot}/%{_sysconfdir}/alternatives/usr-bin-ksh
touch %{buildroot}/%{_sysconfdir}/alternatives/ksh.1.gz
touch %{buildroot}/%{_sysconfdir}/alternatives/rksh.1.gz
ln -sf %{_sysconfdir}/alternatives/ksh %{buildroot}/bin/ksh
ln -sf %{_sysconfdir}/alternatives/usr-bin-ksh %{buildroot}%{_bindir}/ksh
ln -sf %{_sysconfdir}/alternatives/ksh.1.gz %{buildroot}/%{_mandir}/man1/ksh.1.gz
ln -sf %{_sysconfdir}/alternatives/rksh.1.gz %{buildroot}/%{_mandir}/man1/rksh.1.gz
%else
# create ghost files
ln -sf /bin/true %{buildroot}/bin/ksh
ln -sf /bin/true %{buildroot}%{_bindir}/ksh
ln -sf /bin/true %{buildroot}/bin/ksh
ln -sf /bin/true %{buildroot}%{_bindir}/ksh
%endif
ln -sf /bin/ksh93 %{buildroot}%{_bindir}/rksh
ln -sf /bin/ksh93 %{buildroot}/%{_lib}/ast/ksh
ln -sf ast %{buildroot}/%{_lib}/ksh
@ -845,8 +858,19 @@ fi
%doc LICENSE EPL-1.0 CPL-1.0 src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE*
%doc Builtins PROMO OBSOLETE MEMORANDUM
/bin/ksh93
%if %suse_version > 1120
/bin/ksh
%{_bindir}/ksh
%doc %{_mandir}/man1/ksh.1.gz
%doc %{_mandir}/man1/rksh.1.gz
%ghost %{_sysconfdir}/alternatives/ksh
%ghost %{_sysconfdir}/alternatives/usr-bin-ksh
%ghost %{_sysconfdir}/alternatives/ksh.1.gz
%ghost %{_sysconfdir}/alternatives/rksh.1.gz
%else
%ghost %verify(not link) /bin/ksh
%ghost %verify(not link) %{_bindir}/ksh
%endif
%if %suse_version > 1120
%ghost %verify(not link) %{_mandir}/man1/ksh.1ast.gz
%ghost %verify(not link) %{_mandir}/man1/rksh.1ast.gz