# # spec file for package MultiMarkdown-5 # # Copyright (c) 2017 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 # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: MultiMarkdown-5 Version: 5.4.0 Release: 0 Summary: Reference implementation of MultiMarkdown License: MIT Group: Productivity/Publishing/Other Url: http://fletcherpenney.net/multimarkdown # We have to use tarball generated via _service as released ones are # missing submodules that are necessary for building Source: %{name}-%{version}.tar.xz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: xz Requires(post): update-alternatives Requires(postun): update-alternatives BuildRoot: %{_tmppath}/%{name}-%{version}-build %description MultiMarkdown is a derivative of Markdown that adds new syntax features, such as footnotes, tables, and metadata. Additionally, it offers mechanisms to convert plain text into LaTeX in addition to HTML. %prep %setup -q %build export CFLAGS="%{optflags} -fPIE -D_GNU_SOURCE" export CXXLAGS="%{optflags} -fPIE -D_GNU_SOURCE" # Build will fail when this file is not present - build system will try to # generate this file using MultiMarkdown which is not yet built install -D /dev/null build/README.html make %{?_smp_mflags} XFLAGS="%{optflags}" -C submodules/greg %cmake make %{?_smp_mflags} %install %cmake_install # Avoid conflict with mtools mv %{buildroot}%{_bindir}/mmd %{buildroot}%{_bindir}/%{name}-mmd # multimarkdown is provided by other packages thus we use # update-alternatives mv %{buildroot}%{_bindir}/markdown %{buildroot}%{_bindir}/%{name}-markdown install -d %{buildroot}%{_sysconfdir}/alternatives touch %{buildroot}%{_sysconfdir}/alternatives/markdown ln -sf %{_sysconfdir}/alternatives/markdown %{buildroot}%{_bindir}/markdown %check %ctest %post update-alternatives \ --install %{_bindir}/markdown markdown %{_bindir}/%{name}-markdown 30 %postun if [ ! -f %{_bindir}/%{name}-markdown ] ; then update-alternatives --remove markdown %{_bindir}/%{name}-markdown fi %files %defattr(-,root,root) %doc LICENSE.txt README.md CHANGELOG.md %ghost %{_sysconfdir}/alternatives/markdown %{_bindir}/markdown %{_bindir}/%{name}-markdown %{_bindir}/%{name}-mmd %{_bindir}/mmd2all %{_bindir}/mmd2odf %{_bindir}/mmd2opml %{_bindir}/mmd2pdf %{_bindir}/mmd2rtf %{_bindir}/mmd2tex %{_bindir}/multimarkdown %changelog