From 203714a31f1570508b5d4777d7487c0ecc699caf Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 26 Jul 2014 14:44:22 +0000 Subject: [PATCH] Adding a pkg-config file for poppler-data. This allows third party projects to add strong dependency to (or warning in case of absence of) poppler-data, and also poppler to properly determine POPPLER_DATADIR, rather than having users set --datarootdir. --- .gitignore | 1 + Makefile | 19 ++++++++++++++++--- poppler-data.pc.in | 8 ++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 poppler-data.pc.in diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e0a866 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +poppler-data.pc diff --git a/Makefile b/Makefile index 05da119..44f57b7 100644 --- a/Makefile +++ b/Makefile @@ -5,22 +5,24 @@ prefix = /usr/local datadir = $(prefix)/share pkgdatadir = $(datadir)/poppler -all : +all : poppler-data.pc -install : +install : all install -d -m 0755 $(DESTDIR)$(pkgdatadir)/cidToUnicode install -m 0644 $(cid-to-unicode-files) $(DESTDIR)$(pkgdatadir)/cidToUnicode install -d -m 0755 $(DESTDIR)$(pkgdatadir)/nameToUnicode install -m 0644 $(name-to-unicode-files) $(DESTDIR)$(pkgdatadir)/nameToUnicode install -d -m 0755 $(DESTDIR)$(pkgdatadir)/unicodeMap install -m 0644 $(unicode-map-files) $(DESTDIR)$(pkgdatadir)/unicodeMap + install -d -m 0755 $(DESTDIR)$(datadir)/pkgconfig + install -m 0644 poppler-data.pc $(DESTDIR)$(datadir)/pkgconfig for f in $(cmap-files); do \ install -d -m 0755 $(DESTDIR)$(pkgdatadir)/`dirname $$f`; \ install -m 0644 $$f $(DESTDIR)$(pkgdatadir)/$$f; \ done -distdir : $(DISTFILES) +distdir : $(DISTFILES) all rm -rf $(distdir) mkdir $(distdir) for f in $(DISTFILES); do \ @@ -35,6 +37,15 @@ dist : distdir clean : rm -rf $(distdir) +# poppler-data.pc is not a real PHONY target, but this trick +# allows to force-generate it when needed. +.PHONY: poppler-data.pc +poppler-data.pc : poppler-data.pc.in + sed -e 's!@prefix@!$(prefix)!g' \ + -e 's!@pkgdatadir@!$(pkgdatadir)!g' \ + -e 's/@VERSION@/$(VERSION)/g' \ + poppler-data.pc.in > poppler-data.pc + unicode-map-files = \ unicodeMap/Big5 \ unicodeMap/Big5ascii \ @@ -292,6 +303,8 @@ cid-to-unicode-files = \ cidToUnicode/Adobe-Korea1 DISTFILES = \ + poppler-data.pc.in \ + poppler-data.pc \ Makefile \ README \ COPYING \ diff --git a/poppler-data.pc.in b/poppler-data.pc.in new file mode 100644 index 0000000..b974116 --- /dev/null +++ b/poppler-data.pc.in @@ -0,0 +1,8 @@ +poppler_datadir=@pkgdatadir@ + +Name: poppler-data +Description: Encoding files for use with poppler +Version: @VERSION@ + +Cflags: -DPOPPLER_DATADIR=@pkgdatadir@ + -- 1.8.1.2