- adjust update-alternative usage to packaging policy
(see http://lists.opensuse.org/opensuse-packaging/2014-02/msg00024.html) - move mawk to /usr/bin and add symlink in /bin OBS-URL: https://build.opensuse.org/package/show/Base:System/mawk?expand=0&rev=12
This commit is contained in:
parent
e041354f7b
commit
fe3dfa5418
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Feb 8 12:04:51 UTC 2014 - gber@opensuse.org
|
||||||
|
|
||||||
|
- adjust update-alternative usage to packaging policy
|
||||||
|
(see http://lists.opensuse.org/opensuse-packaging/2014-02/msg00024.html)
|
||||||
|
- move mawk to /usr/bin and add symlink in /bin
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 15 08:43:19 UTC 2012 - gber@opensuse.org
|
Tue May 15 08:43:19 UTC 2012 - gber@opensuse.org
|
||||||
|
|
||||||
|
41
mawk.spec
41
mawk.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package mawk
|
# spec file for package mawk
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# Copyright (c) 2010 Guido Berhoerster.
|
# Copyright (c) 2010 Guido Berhoerster.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
@ -51,41 +51,46 @@ chmod 755 examples/*
|
|||||||
# without --enable-warnings several functions will not be marked with gcc's
|
# without --enable-warnings several functions will not be marked with gcc's
|
||||||
# noreturn attribute and produce warnings when $RPM_OPT_FLAGS contains -Wall
|
# noreturn attribute and produce warnings when $RPM_OPT_FLAGS contains -Wall
|
||||||
%configure \
|
%configure \
|
||||||
--enable-warnings \
|
--enable-warnings
|
||||||
--bindir=/bin
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
# move to /bin and symlink to /usr/bin
|
# compatibility symlink
|
||||||
install -d -m 755 %{buildroot}/%{_bindir}
|
install -d -m 755 %{buildroot}/bin
|
||||||
ln -s ../../bin/mawk %{buildroot}/%{_bindir}/mawk
|
ln -s %{_bindir}/mawk %{buildroot}/bin/mawk
|
||||||
# create ghost files
|
# create symlinks for update-alternatives
|
||||||
touch %{buildroot}/bin/awk %{buildroot}%{_bindir}/awk \
|
install -d -m 755 %{buildroot}%{_sysconfdir}/alternatives
|
||||||
%{buildroot}%{_mandir}/man1/awk.1.gz
|
ln -s %{_sysconfdir}/alternatives/awk %{buildroot}/bin/awk
|
||||||
|
ln -s %{_sysconfdir}/alternatives/usr-bin-awk %{buildroot}%{_bindir}/awk
|
||||||
|
ln -s %{_sysconfdir}/alternatives/awk.1%{?ext_man} %{buildroot}%{_mandir}/man1/awk.1%{?ext_man}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make check
|
make check
|
||||||
|
|
||||||
%post
|
%post
|
||||||
/usr/sbin/update-alternatives --install /bin/awk awk /bin/mawk 15 \
|
%{_sbindir}/update-alternatives \
|
||||||
--slave /usr/bin/awk usr-bin-awk /bin/mawk \
|
--install /bin/awk awk %{_bindir}/mawk 15 \
|
||||||
--slave %{_mandir}/man1/awk.1.gz awk.1.gz %{_mandir}/man1/mawk.1.gz
|
--slave %{_bindir}/awk usr-bin-awk %{_bindir}/mawk \
|
||||||
|
--slave %{_mandir}/man1/awk.1.gz awk.1%{?ext_man} %{_mandir}/man1/mawk.1%{?ext_man}
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
/usr/sbin/update-alternatives --remove awk /bin/mawk
|
%{_sbindir}/update-alternatives --remove awk %{_bindir}/mawk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc ACKNOWLEDGMENT CHANGES COPYING README examples/
|
%doc ACKNOWLEDGMENT CHANGES COPYING README examples/
|
||||||
%doc %{_mandir}/man1/mawk.1*
|
|
||||||
%ghost /bin/awk
|
|
||||||
%ghost %{_bindir}/awk
|
|
||||||
%ghost %{_mandir}/man1/awk.1.gz
|
|
||||||
%{_bindir}/mawk
|
|
||||||
/bin/mawk
|
/bin/mawk
|
||||||
|
%{_bindir}/mawk
|
||||||
|
%{_mandir}/man1/mawk.1%{?ext_man}
|
||||||
|
/bin/awk
|
||||||
|
%{_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}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user