From 5329a46df0be8a667aec15f56a567ca459b387f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20=C5=A0abata?= <contyk@redhat.com>
Date: Tue, 10 Apr 2018 22:46:02 +0200
Subject: [PATCH] 0.2.9 bump
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Petr Šabata <contyk@redhat.com>
---
 .gitignore                                    |  1 +
 sources                                       |  2 +-
 ...ura-pdf-poppler-0.2.7-Fix-make-debug.patch | 13 ----
 zathura-pdf-poppler.spec                      | 69 +++++++------------
 4 files changed, 27 insertions(+), 58 deletions(-)
 delete mode 100644 zathura-pdf-poppler-0.2.7-Fix-make-debug.patch

diff --git a/.gitignore b/.gitignore
index 713d899..9aad394 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 /zathura-pdf-poppler-0.2.5.tar.gz
 /zathura-pdf-poppler-0.2.6.tar.gz
 /zathura-pdf-poppler-0.2.7.tar.gz
+/zathura-pdf-poppler-0.2.9.tar.xz
diff --git a/sources b/sources
index 9e806a7..61ec432 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (zathura-pdf-poppler-0.2.7.tar.gz) = 815ef775059652337ca91ef6a089fa51105bbd3ac649ecd167da7da2a6ac62f617d04e85dbeb311ab47d86929338d8656037bcabc1177435804035914c6dfbdb
+SHA512 (zathura-pdf-poppler-0.2.9.tar.xz) = d363c9051fcd5be73c11ee3a88fff277e9a42b5878ce5a64715d801457380b113891504a01b7343affdf275bbd31cc3c0bf17d5208cb513edf52d6c2f5270cde
diff --git a/zathura-pdf-poppler-0.2.7-Fix-make-debug.patch b/zathura-pdf-poppler-0.2.7-Fix-make-debug.patch
deleted file mode 100644
index 0b28c0f..0000000
--- a/zathura-pdf-poppler-0.2.7-Fix-make-debug.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Makefile b/Makefile
-index b2b6e2f..87bf957 100644
---- a/Makefile
-+++ b/Makefile
-@@ -68,7 +68,7 @@ ${SOFILE}: ${OBJECTS}
- 
- ${SODEBUGFILE}: ${DOBJECTS}
- 	$(ECHO) LD $@
--	$(QUIET)${CC} ${PLATFORMFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS}
-+	$(QUIET)${CC} ${PLATFORMFLAGS} ${LDFLAGS} -o $@ ${DOBJECTS} ${LIBS}
- 
- clean:
- 	$(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} ${SOFILE} ${SODEBUGFILE} \
diff --git a/zathura-pdf-poppler.spec b/zathura-pdf-poppler.spec
index ee459fb..c60b9fa 100644
--- a/zathura-pdf-poppler.spec
+++ b/zathura-pdf-poppler.spec
@@ -1,28 +1,24 @@
 Name:             zathura-pdf-poppler
-Version:          0.2.7
-Release:          4%{?dist}
+Version:          0.2.9
+Release:          1%{?dist}
 Summary:          PDF support for zathura via poppler
 License:          zlib
 URL:              http://pwmt.org/projects/zathura/plugins/%{name}
-Source0:          http://pwmt.org/projects/zathura/plugins/download/%{name}-%{version}.tar.gz
-Patch0:           zathura-pdf-poppler-0.2.7-Fix-make-debug.patch
+Source0:          http://pwmt.org/projects/zathura/plugins/download/%{name}-%{version}.tar.xz
 BuildRequires:    binutils
-BuildRequires:    coreutils
+# Needed to validate the desktop file
 BuildRequires:    desktop-file-utils
 BuildRequires:    gcc
+BuildRequires:    girara-devel
+BuildRequires:    glib2-devel
+# Needed to validate appdata
 BuildRequires:    libappstream-glib
-BuildRequires:    make
-BuildRequires:    pkgconfig
-BuildRequires:    sed
-BuildRequires:    pkgconfig(cairo)
-BuildRequires:    pkgconfig(girara-gtk3)
-BuildRequires:    pkgconfig(poppler-glib)
-BuildRequires:    pkgconfig(zathura)
-Requires:         zathura
-Requires(post):   %{_sbindir}/update-alternatives
-Requires(post):   desktop-file-utils
-Requires(postun): %{_sbindir}/update-alternatives
-Requires(postun): desktop-file-utils
+BuildRequires:    meson >= 0.43
+BuildRequires:    poppler-glib-devel >= 0.18
+BuildRequires:    zathura-devel >= 0.3.9
+Requires:         zathura >= 0.3.9
+# Old plugins used alternatives
+Conflicts:        zathura-pdf-mupdf < 0.3.3
 
 %description
 The zathura-pdf-poppler plugin adds PDF support to zathura by using
@@ -30,46 +26,31 @@ the poppler rendering engine.
 
 %prep
 %setup -q
-%patch0 -p1
-# Don't rebuild during install phase
-sed -i 's/^install:\s*all/install:/' Makefile
 
 %build
-CFLAGS='%{optflags}' make %{?_smp_mflags} LIBDIR=%{_libdir} debug
-mv pdf-debug.so pdf.so
+%meson
+%meson_build
 
 %install
-make DESTDIR=%{buildroot} LIBDIR=%{_libdir} install
-mv %{buildroot}/%{_libdir}/zathura/pdf.so \
-    %{buildroot}/%{_libdir}/zathura/pdf.so.poppler
-touch %{buildroot}/%{_libdir}/zathura/pdf.so
-desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
-appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.metainfo.xml
+%meson_install
+desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
+appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml
 
+# Clean the old alternatives link
 %pre
 [ -L %{_libdir}/zathura/pdf.so ] || rm -f %{_libdir}/zathura/pdf.so
 
-%post
-%{_sbindir}/update-alternatives --install \
-    %{_libdir}/zathura/pdf.so %{name} %{_libdir}/zathura/pdf.so.poppler 10
-update-desktop-database &> /dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
-    %{_sbindir}/update-alternatives --remove \
-        %{name} %{_libdir}/zathura/pdf.so.poppler
-fi
-update-desktop-database &> /dev/null || :
-
 %files
 %license LICENSE
 %doc AUTHORS
-%ghost %{_libdir}/zathura/pdf.so
-%{_libdir}/zathura/pdf.so.poppler
-%{_datadir}/applications/%{name}.desktop
-%{_datadir}/appdata/%{name}.metainfo.xml
+%{_libdir}/zathura/libpdf-poppler.so
+%{_datadir}/applications/org.pwmt.zathura-pdf-poppler.desktop
+%{_datadir}/metainfo/org.pwmt.zathura-pdf-poppler.metainfo.xml
 
 %changelog
+* Tue Apr 10 2018 Petr Šabata <contyk@redhat.com> - 0.2.9-1
+- 0.2.9 bump
+
 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild