diff --git a/.gitignore b/.gitignore index e69de29..1e1c507 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/mupdf-0.7.tar.gz diff --git a/mupdf-cflags.patch b/mupdf-cflags.patch new file mode 100644 index 0000000..45b841a --- /dev/null +++ b/mupdf-cflags.patch @@ -0,0 +1,23 @@ +--- a/Makefile 2011-01-13 23:10:08.911556954 +0300 ++++ b/Makefile 2011-01-13 23:12:43.329510332 +0300 +@@ -36,6 +36,7 @@ + include Makerules + include Makethird + ++CFLAGS ?= + CFLAGS += $(THIRD_INCS) $(SYS_FREETYPE_INC) + + # + +--- a/Makerules 2010-08-25 18:12:08.000000000 +0400 ++++ b/Makerules 2011-01-13 23:31:10.535045464 +0300 +@@ -4,7 +4,8 @@ + OS := $(OS:MINGW%=MINGW) + + CC ?= cc +-CFLAGS := -Ifitz -Imupdf -Wall ++CFLAGS ?= ++CFLAGS += -Ifitz -Imupdf -Wall + LDFLAGS := + + ifeq "$(build)" "debug" diff --git a/mupdf-libdir.patch b/mupdf-libdir.patch new file mode 100644 index 0000000..2deb7ac --- /dev/null +++ b/mupdf-libdir.patch @@ -0,0 +1,20 @@ +--- a/Makefile 2011-02-06 00:31:40.957428001 +0300 ++++ b/Makefile 2011-02-06 00:32:37.597428002 +0300 +@@ -7,6 +7,7 @@ + + build ?= debug + prefix ?= /usr/local ++LIBDIR ?= $(prefix)/lib + + OBJDIR := build/$(build) + GENDIR := build/generated +@@ -378,7 +379,7 @@ + rm -rf build + + install: $(OBJDIR) $(GENDIR) $(MUPDF_LIB) $(APPS) +- install -d $(prefix)/bin $(prefix)/lib $(prefix)/include ++ install -d $(prefix)/bin $(LIBDIR) $(prefix)/include + install $(APPS) $(prefix)/bin +- install $(MUPDF_LIB) $(prefix)/lib ++ install $(MUPDF_LIB) $(MUPDF_SO_LIB) $(LIBDIR) + install $(MUPDF_HDR) $(prefix)/include diff --git a/mupdf-pdfinfo.patch b/mupdf-pdfinfo.patch new file mode 100644 index 0000000..7629bf7 --- /dev/null +++ b/mupdf-pdfinfo.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2011-02-06 00:26:25.906428001 +0300 ++++ b/Makefile 2011-02-06 00:26:37.584428000 +0300 +@@ -336,7 +336,7 @@ + + PDFINFO_SRC=apps/pdfinfo.c + PDFINFO_OBJ=$(PDFINFO_SRC:apps/%.c=$(OBJDIR)/%.o) +-PDFINFO_EXE=$(OBJDIR)/pdfinfo ++PDFINFO_EXE=$(OBJDIR)/pdfinfo-mupdf + $(PDFINFO_OBJ): $(MUPDF_HDR) + $(PDFINFO_EXE): $(PDFINFO_OBJ) $(MUPDF_LIB) $(THIRD_LIBS) + $(LD_CMD) diff --git a/mupdf.desktop b/mupdf.desktop new file mode 100644 index 0000000..ac19a11 --- /dev/null +++ b/mupdf.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Mupdf +GenericName=PDF file viewer +Comment=Lightweight PDF file viewer written on portable C +Exec=mupdf %f +Icon=mupdf +Terminal=false +Type=Application +Categories=Viewer;Graphics; +MimeType=application/pdf;application/x-pdf; +NoDisplay=true diff --git a/mupdf.spec b/mupdf.spec new file mode 100644 index 0000000..5080d8f --- /dev/null +++ b/mupdf.spec @@ -0,0 +1,111 @@ +Name: mupdf +Version: 0.7 +Release: 6%{?dist} +Summary: A lightweight PDF viewer and toolkit + +Group: Applications/Publishing +License: GPLv3 +URL: http://mupdf.com/ +Source0: http://mupdf.com/download/%{name}-%{version}.tar.gz +Source1: %{name}.desktop +Patch1: %{name}-pdfinfo.patch +Patch2: %{name}-libdir.patch +Patch3: %{name}-cflags.patch +BuildRequires: openjpeg-devel jbig2dec-devel desktop-file-utils +BuildRequires: libjpeg-turbo-devel freetype-devel libXext-devel + +%description +MuPDF is a lightweight PDF viewer and toolkit written in portable C. +The renderer in MuPDF is tailored for high quality anti-aliased +graphics. MuPDF renders text with metrics and spacing accurate to +within fractions of a pixel for the highest fidelity in reproducing +the look of a printed page on screen. +MuPDF has a small footprint. A binary that includes the standard +Roman fonts is only one megabyte. A build with full CJK support +(including an Asian font) is approximately five megabytes. +MuPDF has support for all non-interactive PDF 1.7 features, and the +toolkit provides a simple API for accessing the internal structures of +the PDF document. Example code for navigating interactive links and +bookmarks, encrypting PDF files, extracting fonts, images, and +searchable text, and rendering pages to image files is provided. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} + +%description devel +The mupdf-devel package contains header files for developing +applications that use mupdf and static libraries + +%prep +%setup -q +## http://bugs.ghostscript.com/show_bug.cgi?id=691884 +%patch1 -p1 +## http://bugs.ghostscript.com/show_bug.cgi?id=691885 +%patch2 -p1 +%patch3 -p1 + +%build +export CFLAGS="%{optflags}" +make %{?_smp_mflags} verbose=1 + + +%install +make DESTDIR=%{buildroot} install prefix=%{buildroot}/usr LIBDIR=%{buildroot}%{_libdir} +desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} +install -D -m644 debian/%{name}.xpm %{buildroot}/%{_datadir}/pixmaps/%{name}.xpm +install -D -m644 debian/pdfshow.1 %{buildroot}/%{_mandir}/man1/%{name}.1 +install -D -m644 debian/pdfshow.1 %{buildroot}/%{_mandir}/man1/pdfshow.1 +install -D -m644 debian/pdfdraw.1 %{buildroot}/%{_mandir}/man1/pdfdraw.1 +install -D -m644 debian/pdfclean.1 %{buildroot}/%{_mandir}/man1/pdfclean.1 +## fix strange permissons +chmod 0644 %{buildroot}/%{_includedir}/%{name}.h +chmod 0644 %{buildroot}/%{_includedir}/fitz.h +chmod 0644 %{buildroot}%{_libdir}/libmupdf.a + +%post +update-desktop-database &> /dev/null || : + +%postun +update-desktop-database &> /dev/null || : + +%files +%defattr(-,root,root,-) +%doc COPYING README +%{_bindir}/%{name} +%{_bindir}/pdfclean +%{_bindir}/pdfdraw +%{_bindir}/pdfextract +%{_bindir}/pdfinfo-%{name} +%{_bindir}/pdfshow +%{_datadir}/applications/%{name}.desktop +%{_datadir}/pixmaps/%{name}.xpm +%{_mandir}/man?/*.1* + +%files devel +%defattr(-,root,root,-) +%{_includedir}/fitz.h +%{_includedir}/%{name}.h +%{_libdir}/libmupdf.a + +%changelog +* Sun Feb 7 2011 Pavel Zhukov - 0.7-6 +- roll back to static libraries patch for shared libs has been rejected +- Fix spec errors + +* Fri Jan 14 2011 Pavel Zhukov - 0.7-4 +- replac poitless macros to command names + +* Fri Jan 14 2011 Pavel Zhukov - 0.7-3 +- Create patch for optflags +- Change Summary +- Fix Require for devel package + +* Thu Jan 13 2011 Pavel Zhukov -0.7-2 +- add Fedora CFLAGS +- create patch for use shared library + +* Wed Jan 12 2011 Pavel Zhukov - 0.7-1 +- Initial package diff --git a/sources b/sources index e69de29..6c8c2ac 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +83adc4d14eb17835df791a9a0d1e8fa9 mupdf-0.7.tar.gz