]>
Commit | Line | Data |
---|---|---|
6d5cd20c JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with v8 # use V8 JS engine instead of MuJS | |
4 | # | |
69d32f06 JB |
5 | Summary: MuPDF - lightweight PDF, XPS and CBZ viewer and parser/rendering library |
6 | Summary(pl.UTF-8): MuPDF - lekka przeglądarka oraz biblioteka renderująca PDF, XPS, CBZ | |
7 | Name: mupdf | |
6d5cd20c JB |
8 | Version: 1.6 |
9 | Release: 1 | |
f735ca81 JB |
10 | License: AGPL v3+ |
11 | Group: Applications/Text | |
6d5cd20c JB |
12 | Source0: http://www.mupdf.com/downloads/%{name}-%{version}-source.tar.gz |
13 | # Source0-md5: 8d69db41ae9e0b6807b76bb6ed70dc2f | |
69d32f06 | 14 | Patch0: %{name}-openjpeg.patch |
6d5cd20c | 15 | Patch1: %{name}-shared.patch |
69d32f06 JB |
16 | URL: http://www.mupdf.com/ |
17 | BuildRequires: curl-devel | |
18 | BuildRequires: freetype-devel >= 2 | |
19 | BuildRequires: jbig2dec-devel | |
20 | BuildRequires: libjpeg-devel | |
f735ca81 | 21 | BuildRequires: libstdc++-devel |
6d5cd20c | 22 | %{!?with_v8:BuildRequires: mujs-devel} |
7f62b790 | 23 | BuildRequires: openjpeg2-devel >= 2.1.0 |
69d32f06 JB |
24 | BuildRequires: openssl-devel |
25 | BuildRequires: pkgconfig | |
6d5cd20c | 26 | %{?with_v8:BuildRequires: v8-devel} |
69d32f06 JB |
27 | BuildRequires: xorg-lib-libX11-devel |
28 | BuildRequires: xorg-lib-libXext-devel | |
29 | BuildRequires: zlib-devel | |
f735ca81 | 30 | Requires: %{name}-libs = %{version}-%{release} |
69d32f06 JB |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
f735ca81 | 33 | # needs symbols from one of libmupdf-js-* |
6d5cd20c | 34 | #define skip_post_check_so libmupdf.so.* |
f735ca81 | 35 | |
69d32f06 JB |
36 | %description |
37 | MuPDF is a lightweight PDF, XPS and CBZ viewer and parser/rendering | |
38 | library. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | MuPDF to lekka przeglądarka oraz biblioteka analizująca/renderująca | |
42 | pliki PDF, XPS i CBZ. | |
43 | ||
f735ca81 JB |
44 | %package libs |
45 | Summary: Shared MuPDF libraries | |
46 | Summary(pl.UTF-8): Biblioteki współdzielone MuPDF | |
47 | Group: Libraries | |
48 | ||
49 | %description libs | |
50 | Shared MuPDF libraries. | |
51 | ||
52 | %description libs -l pl.UTF-8 | |
53 | Biblioteki współdzielone MuPDF. | |
54 | ||
69d32f06 | 55 | %package devel |
f735ca81 JB |
56 | Summary: Header files for MuPDF libraries |
57 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek MuPDF | |
69d32f06 | 58 | Group: Development/Libraries |
f735ca81 | 59 | Requires: %{name}-libs = %{version}-%{release} |
973c4d4a | 60 | Requires: freetype-devel >= 2 |
f735ca81 JB |
61 | Requires: jbig2dec-devel |
62 | Requires: libjpeg-devel | |
63 | Requires: libstdc++-devel | |
6d5cd20c | 64 | %{!?with_v8:Requires: mujs-devel} |
7f62b790 | 65 | Requires: openjpeg2-devel >= 2.1.0 |
f735ca81 | 66 | Requires: openssl-devel |
6d5cd20c | 67 | %{?with_v8:Requires: v8-devel} |
f735ca81 | 68 | Requires: zlib-devel |
69d32f06 JB |
69 | |
70 | %description devel | |
f735ca81 | 71 | Header files for MuPDF libraries. |
69d32f06 JB |
72 | |
73 | %description devel -l pl.UTF-8 | |
f735ca81 | 74 | Pliki nagłówkowe bibliotek MuPDF. |
69d32f06 JB |
75 | |
76 | %package static | |
f735ca81 JB |
77 | Summary: Static MuPDF libraries |
78 | Summary(pl.UTF-8): Statyczne biblioteki MuPDF | |
69d32f06 JB |
79 | Group: Development/Libraries |
80 | Requires: %{name}-devel = %{version}-%{release} | |
81 | ||
82 | %description static | |
f735ca81 | 83 | Static MuPDF libraries. |
69d32f06 JB |
84 | |
85 | %description static -l pl.UTF-8 | |
f735ca81 | 86 | Statyczne biblioteki MuPDF. |
69d32f06 JB |
87 | |
88 | %prep | |
89 | %setup -q -n %{name}-%{version}-source | |
90 | %patch0 -p1 | |
91 | %patch1 -p1 | |
69d32f06 | 92 | |
f735ca81 | 93 | # use system libs instead |
6d5cd20c | 94 | %{__rm} -r thirdparty/{curl,freetype,jbig2dec,jpeg,mujs,openjpeg,zlib} |
69d32f06 JB |
95 | |
96 | %build | |
97 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
f735ca81 | 98 | LDFLAGS="%{rpmldflags}" \ |
69d32f06 JB |
99 | %{__make} \ |
100 | CC="%{__cc}" \ | |
f735ca81 | 101 | CXX="%{__cxx}" \ |
6d5cd20c JB |
102 | %if %{with v8} |
103 | HAVE_V8=yes \ | |
104 | V8_CFLAGS= \ | |
105 | V8_LIBS="-lv8 -lstdc++" \ | |
106 | %else | |
107 | HAVE_MUJS=yes \ | |
108 | MUJS_CFLAGS= \ | |
109 | MUJS_LIBS="-lmujs" \ | |
110 | %endif | |
7f62b790 | 111 | SYS_OPENJPEG_CFLAGS="$(pkg-config --cflags libopenjp2)" \ |
80c18e69 | 112 | build=release \ |
f735ca81 | 113 | libdir=%{_libdir} \ |
80c18e69 | 114 | verbose=1 |
69d32f06 JB |
115 | |
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %{__make} install \ | |
120 | DESTDIR=$RPM_BUILD_ROOT \ | |
121 | V8_PRESENT=yes \ | |
122 | build=release \ | |
123 | prefix=%{_prefix} \ | |
124 | libdir=%{_libdir} | |
125 | ||
126 | # packaged as %doc | |
127 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mupdf | |
128 | ||
129 | %clean | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
f735ca81 JB |
132 | %post libs -p /sbin/ldconfig |
133 | %postun libs -p /sbin/ldconfig | |
69d32f06 JB |
134 | |
135 | %files | |
136 | %defattr(644,root,root,755) | |
137 | %doc CHANGES CONTRIBUTORS README | |
138 | %attr(755,root,root) %{_bindir}/mudraw | |
6d5cd20c | 139 | %attr(755,root,root) %{_bindir}/mujstest |
69d32f06 JB |
140 | %attr(755,root,root) %{_bindir}/mupdf-x11 |
141 | %attr(755,root,root) %{_bindir}/mupdf-x11-curl | |
69d32f06 JB |
142 | %attr(755,root,root) %{_bindir}/mutool |
143 | %{_mandir}/man1/mudraw.1* | |
144 | %{_mandir}/man1/mupdf.1* | |
145 | %{_mandir}/man1/mutool.1* | |
146 | ||
f735ca81 JB |
147 | %files libs |
148 | %defattr(644,root,root,755) | |
149 | %attr(755,root,root) %{_libdir}/libmupdf.so.*.*.* | |
150 | %attr(755,root,root) %ghost %{_libdir}/libmupdf.so.0 | |
f735ca81 | 151 | |
69d32f06 JB |
152 | %files devel |
153 | %defattr(644,root,root,755) | |
154 | %doc docs/{naming,overview,progressive,refcount,thirdparty}.txt | |
f735ca81 | 155 | %attr(755,root,root) %{_libdir}/libmupdf.so |
f735ca81 | 156 | %{_libdir}/libmupdf.la |
69d32f06 JB |
157 | %{_includedir}/mupdf |
158 | ||
69d32f06 JB |
159 | %files static |
160 | %defattr(644,root,root,755) | |
161 | %{_libdir}/libmupdf.a |