%global appname com.github.lainsce.quilter %define fix_font %{nil} %define fix_font 1 %define fix_libmarkdown %{nil} %define fix_libmarkdown 0 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} > 7 %define fix_libmarkdown 1 %endif %else %if 0%{?fedora} > 26 %define fix_libmarkdown 1 %endif %endif %else %if 0%{?suse_version} %if 0%{?suse_version} > 1320 %define fix_libmarkdown 1 %endif %endif %endif ################################################################################ %define dir_appdata metainfo %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define dir_appdata appdata %endif %endif %endif %if 0%{!?_metainfodir:1} %define _metainfodir %{_datadir}/%{dir_appdata} %endif ################################################################################ Name: quilter Version: 1.5.5 Release: 1%{?dist} Group: Applications/Productivity License: GPLv3 URL: https://github.com/lainsce/quilter Summary: Writing application Source: https://github.com/lainsce/quilter/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: coreutils findutils BuildRequires: grep sed BuildRequires: pkgconfig BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: gettext BuildRequires: meson >= 0.40.0 BuildRequires: vala BuildRequires: libmarkdown-devel BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(granite) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtksourceview-3.0) BuildRequires: pkgconfig(gtkspell3-3.0) BuildRequires: pkgconfig(webkit2gtk-4.0) Requires: hicolor-icon-theme # https://fedoraproject.org/wiki/Packaging:Scriptlets # https://fedoraproject.org/wiki/PackagingDrafts/ScriptletSnippets Requires(post): coreutils Requires(postun): coreutils Requires(posttrans): coreutils # gtk-update-icon-cache #Requires(post): gtk-update-icon-cache Requires(postun): gtk-update-icon-cache Requires(posttrans): gtk-update-icon-cache # update-mime-database #Requires(post): shared-mime-info #Requires(postun): shared-mime-info #Requires(posttrans): shared-mime-info # update-desktop-database Requires(post): desktop-file-utils Requires(postun): desktop-file-utils #Requires(posttrans): desktop-file-utils # glib-compile-schemas #Requires(post): glib2 Requires(postun): glib2 Requires(posttrans): glib2 # ldconfig #Requires(post): glibc /sbin/ldconfig #Requires(postun): glibc /sbin/ldconfig #Requires(posttrans): glibc /sbin/ldconfig %description A fullscreen word processor for Elementary OS. %prep %{autosetup} %if 0%{?fix_font} # use default font grep -rwl 'PTM55FT.ttf' | while read -r file ; do %{__sed} -i '/PTM55FT.ttf/d' "${file}" done %endif %if 0%{?fix_libmarkdown} # fix the build error grep -wl 'libmarkdown.vapi' 'meson.build' | while read -r file ; do %{__sed} -i '/libmarkdown.vapi/d' "${file}" done %endif %build %{meson} %{meson_build} %install %{meson_install} %{__ln_s} "%{appname}" "%{buildroot}%{_bindir}/%{name}" %if "%{_metainfodir}" != "%{_datadir}/metainfo" %{__mv} "%{buildroot}%{_datadir}/metainfo" "%{buildroot}%{_metainfodir}" %endif %find_lang "%{appname}" "%{name}.lang" %check /usr/bin/desktop-file-validate "%{buildroot}/%{_datadir}/applications/%{appname}.desktop" /usr/bin/appstream-util validate-relax --nonet "%{buildroot}%{_metainfodir}/%{appname}.appdata.xml" %post /bin/touch --no-create "%{_datadir}/icons/hicolor" &> /dev/null || : #/usr/bin/update-mime-database -n %{_datadir}/mime &>/dev/null || : /usr/bin/update-desktop-database &> /dev/null || : #/sbin/ldconfig %postun if [[ "${1}" -eq "0" ]] ; then /usr/bin/glib-compile-schemas "%{_datadir}/glib-2.0/schemas" &> /dev/null || : fi /usr/bin/update-desktop-database &> /dev/null || : if [[ "${1}" -eq "0" ]] ; then /bin/touch --no-create "%{_datadir}/icons/hicolor" &> /dev/null || : /usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || : #/usr/bin/update-mime-database -n %{_datadir}/mime &>/dev/null || : fi #/sbin/ldconfig %posttrans /usr/bin/glib-compile-schemas "%{_datadir}/glib-2.0/schemas" &> /dev/null || : /usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || : #update-mime-database -n %{_datadir}/mime &>/dev/null || : %files -f "%{name}.lang" %doc AUTHORS README.md ISSUE_TEMPLATE.md %license LICENSE %{_bindir}/%{appname} %{_bindir}/%{name} %{_metainfodir}/%{appname}.appdata.xml %{_datadir}/%{appname}/ %{_datadir}/applications/%{appname}.desktop %{_datadir}/glib-2.0/schemas/%{appname}.gschema.xml %{_datadir}/gtksourceview-3.0/styles/quilter-dark.xml %{_datadir}/gtksourceview-3.0/styles/quilter.xml %{_datadir}/icons/hicolor/*/apps/%{appname}.??g %changelog * Thu May 03 2018 Tomasz Tomasik - 1.5.5-1 - Update to 1.5.5 - Fix problem with libmarkdown * Thu May 03 2018 Tomasz Tomasik - 1.5.4-1 - Initial package for EL7