From eed0eec824e5944fbc406159389fac85e20e0f7b51514f44d76b22befa0c2faa Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 21 May 2015 11:02:53 +0000 Subject: [PATCH] Accepting request 308209 from home:Mailaender:branches:devel:languages:perl the reasoning behind this is that packages.ubuntu.com/markdown contains a /usr/bin/markdown so all the shellscripts assume that is how it is done. Won't work on SUSE, because we install this to /usr/bin/Markdown.pl I went with update-alternatives here, because this is not the only Markdown package in town. There is also markdown_py or others that I don't yet know of you may want to use as a replacement. OBS-URL: https://build.opensuse.org/request/show/308209 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Text-Markdown?expand=0&rev=10 --- perl-Text-Markdown.changes | 5 +++++ perl-Text-Markdown.spec | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/perl-Text-Markdown.changes b/perl-Text-Markdown.changes index d27da24..b39c8ca 100644 --- a/perl-Text-Markdown.changes +++ b/perl-Text-Markdown.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 21 09:40:02 UTC 2015 - mailaender@opensuse.org + +- add a Debian compatible symlink with update-alternatives + ------------------------------------------------------------------- Fri Dec 9 08:41:49 UTC 2011 - coolo@suse.com diff --git a/perl-Text-Markdown.spec b/perl-Text-Markdown.spec index 1801cb8..6ef8a4f 100644 --- a/perl-Text-Markdown.spec +++ b/perl-Text-Markdown.spec @@ -1,7 +1,7 @@ # # spec file for package perl-Text-Markdown # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,13 +28,13 @@ Source: http://www.cpan.org/authors/id/B/BO/BOBTFISH/%{cpan_name}-%{vers BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl +BuildRequires: perl-macros BuildRequires: perl(LWP::Simple) BuildRequires: perl(List::MoreUtils) BuildRequires: perl(Module::Build) BuildRequires: perl(Test::Differences) BuildRequires: perl(Test::Exception) BuildRequires: perl(Text::Diff) -BuildRequires: perl-macros %{perl_requires} %description @@ -63,11 +63,24 @@ tags (like
and as well). %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} +# update-alternatives +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/markdown +ln -sf %{_sysconfdir}/alternatives/markdown %{buildroot}%{_bindir}/markdown + +%post +update-alternatives \ + --install %{_bindir}/markdown markdown %{_bindir}/Markdown.pl 30 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove markdown %{_bindir}/Markdown.pl +fi %files -f %{name}.files %defattr(-,root,root,755) %doc Changes License.text README Readme.text Todo +%ghost %{_sysconfdir}/alternatives/markdown +%{_bindir}/markdown %changelog