mupdf/mupdf.spec

119 lines
4.7 KiB
RPMSpec
Raw Permalink Normal View History

# Desired jbig2dec header files and library version
# Apparantly, jbig2dec complains even about newer versions.
# Please update if needed.
2020-09-18 19:22:11 +00:00
%global jbig2dec_version 0.19
2011-02-08 20:26:30 +00:00
Name: mupdf
2022-08-12 19:07:10 +00:00
Version: 1.20.3
%global upversion 1.20.3
Release: %autorelease -e 0.riscv64
2011-02-08 20:26:30 +00:00
Summary: A lightweight PDF viewer and toolkit
2018-06-06 11:27:10 +00:00
License: AGPLv3+
2011-02-08 20:26:30 +00:00
URL: http://mupdf.com/
2022-05-13 17:39:57 +00:00
Source0: http://mupdf.com/downloads/archive/%{name}-%{upversion}-source.tar.gz
2011-02-08 20:26:30 +00:00
Source1: %{name}.desktop
2018-10-01 11:00:17 +00:00
Source2: %{name}-gl.desktop
2020-10-03 19:13:40 +00:00
BuildRequires: gcc gcc-c++ make binutils desktop-file-utils coreutils pkgconfig
BuildRequires: openjpeg2-devel desktop-file-utils
2014-10-11 23:08:54 +00:00
BuildRequires: libjpeg-devel freetype-devel libXext-devel curl-devel
BuildRequires: harfbuzz-devel openssl-devel mesa-libEGL-devel
BuildRequires: mesa-libGL-devel mesa-libGLU-devel libXi-devel libXrandr-devel
BuildRequires: gumbo-parser-devel leptonica-devel tesseract-devel
BuildRequires: jbig2dec-devel = %{jbig2dec_version}
BuildRequires: jbig2dec-libs = %{jbig2dec_version}
Requires: jbig2dec-libs = %{jbig2dec_version}
# We need to build against the Artifex fork of lcms2 so that we are thread safe
# (see bug #1553915). Artifex make sure to rebase against upstream, who refuse
# to integrate Artifex's changes.
2022-05-13 17:39:57 +00:00
Provides: bundled(lcms2-devel) = 2.12^85.g558b336
2018-04-23 18:29:00 +00:00
# We need to build against the Artifex fork of freeglut so that we are unicode safe.
2022-05-13 17:39:57 +00:00
Provides: bundled(freeglut-devel) = 3.0.0^11.g13ae6aa
2018-09-26 14:15:44 +00:00
# muPDF needs the muJS sources for the build even if we build against the system
# version so bundling them is the safer choice.
2022-05-13 17:39:57 +00:00
Provides: bundled(mujs-devel) = 1.2.0
2021-10-06 14:55:46 +00:00
# muPDF builds only against in-tree extract which is versioned along with ghostpdl.
2022-08-12 19:07:10 +00:00
Provides: bundled(extract) = 9.56.0^4.g10c442d
2011-02-08 20:26:30 +00:00
%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
2021-07-19 16:05:32 +00:00
(including an Asian font) is approximately seven megabytes.
2011-02-08 20:26:30 +00:00
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}
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
2022-05-13 17:39:57 +00:00
%setup -q -n %{name}-%{upversion}-source
2021-10-06 14:55:46 +00:00
for d in $(ls thirdparty | grep -v -e extract -e freeglut -e lcms2 -e mujs)
do
rm -rf thirdparty/$d
done
2018-09-26 14:15:44 +00:00
echo > user.make "\
USE_SYSTEM_FREETYPE := yes
USE_SYSTEM_HARFBUZZ := yes
USE_SYSTEM_JBIG2DEC := yes
USE_SYSTEM_JPEGXR := yes # not used without HAVE_JPEGXR
USE_SYSTEM_LCMS2 := no # need lcms2-art fork
USE_SYSTEM_LIBJPEG := yes
USE_SYSTEM_MUJS := no # build needs source anyways
USE_SYSTEM_OPENJPEG := yes
USE_SYSTEM_ZLIB := yes
2020-02-05 08:45:22 +00:00
USE_SYSTEM_GLUT := no # need freeglut2-art fork
2018-09-26 14:15:44 +00:00
USE_SYSTEM_CURL := yes
2020-10-03 19:13:40 +00:00
USE_SYSTEM_GUMBO := yes
USE_TESSERACT := yes
USE_SYSTEM_LEPTONICA := yes
USE_SYSTEM_TESSERACT := yes
2018-09-26 14:15:44 +00:00
"
2011-02-08 20:26:30 +00:00
%build
2021-07-14 01:41:56 +00:00
export XCFLAGS="%{optflags} -fPIC -DJBIG_NO_MEMENTO -DTOFU -DTOFU_CJK_EXT"
2011-02-08 20:26:30 +00:00
2018-04-23 18:29:00 +00:00
make %{?_smp_mflags} build=debug verbose=yes
2011-02-08 20:26:30 +00:00
%install
2018-10-01 10:54:17 +00:00
make DESTDIR=%{buildroot} install prefix=%{_prefix} libdir=%{_libdir} build=debug verbose=yes
## handle docs on our own
rm -rf %{buildroot}/%{_docdir}
2011-02-08 20:26:30 +00:00
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
2018-10-01 11:00:17 +00:00
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
2018-04-13 14:35:22 +00:00
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -p -m644 docs/logo/mupdf-logo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/mupdf.svg
2018-10-01 11:00:17 +00:00
install -p -m644 docs/logo/mupdf-logo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/mupdf-gl.svg
2011-02-08 20:26:30 +00:00
## fix strange permissons
2011-05-03 06:21:06 +00:00
chmod 0644 %{buildroot}%{_libdir}/*.a
2011-03-27 12:47:42 +00:00
find %{buildroot}/%{_mandir} -type f -exec chmod 0644 {} \;
2014-05-06 21:37:47 +00:00
find %{buildroot}/%{_includedir} -type f -exec chmod 0644 {} \;
2015-06-01 11:50:27 +00:00
cd %{buildroot}/%{_bindir} && ln -s %{name}-x11 %{name}
2017-03-02 20:16:09 +00:00
2011-02-08 20:26:30 +00:00
%files
%license COPYING
%doc README CHANGES docs/*
2014-05-06 21:37:47 +00:00
%{_bindir}/*
2018-10-01 11:00:17 +00:00
%{_datadir}/applications/mupdf*.desktop
2018-04-13 14:35:22 +00:00
%{_datadir}/icons/hicolor/*/apps/*
2014-05-06 21:37:47 +00:00
%{_mandir}/man1/*.1.gz
2012-05-20 14:17:25 +00:00
2011-02-08 20:26:30 +00:00
%files devel
2014-05-06 21:37:47 +00:00
%{_includedir}/%{name}
%{_libdir}/lib%{name}*.a
2014-05-06 21:37:47 +00:00
%changelog
2021-10-06 14:28:24 +00:00
%autochangelog