]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with v8 # use V8 JS engine instead of MuJS | |
4 | # | |
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 | |
8 | Version: 1.6 | |
9 | Release: 1 | |
10 | License: AGPL v3+ | |
11 | Group: Applications/Text | |
12 | Source0: http://www.mupdf.com/downloads/%{name}-%{version}-source.tar.gz | |
13 | # Source0-md5: 8d69db41ae9e0b6807b76bb6ed70dc2f | |
14 | Patch0: %{name}-openjpeg.patch | |
15 | Patch1: %{name}-shared.patch | |
16 | URL: http://www.mupdf.com/ | |
17 | BuildRequires: curl-devel | |
18 | BuildRequires: freetype-devel >= 2 | |
19 | BuildRequires: jbig2dec-devel | |
20 | BuildRequires: libjpeg-devel | |
21 | BuildRequires: libstdc++-devel | |
22 | %{!?with_v8:BuildRequires: mujs-devel} | |
23 | BuildRequires: openjpeg2-devel >= 2.1.0 | |
24 | BuildRequires: openssl-devel | |
25 | BuildRequires: pkgconfig | |
26 | %{?with_v8:BuildRequires: v8-devel} | |
27 | BuildRequires: xorg-lib-libX11-devel | |
28 | BuildRequires: xorg-lib-libXext-devel | |
29 | BuildRequires: zlib-devel | |
30 | Requires: %{name}-libs = %{version}-%{release} | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | # needs symbols from one of libmupdf-js-* | |
34 | #define skip_post_check_so libmupdf.so.* | |
35 | ||
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 | ||
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 | ||
55 | %package devel | |
56 | Summary: Header files for MuPDF libraries | |
57 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek MuPDF | |
58 | Group: Development/Libraries | |
59 | Requires: %{name}-libs = %{version}-%{release} | |
60 | Requires: freetype-devel >= 2 | |
61 | Requires: jbig2dec-devel | |
62 | Requires: libjpeg-devel | |
63 | Requires: libstdc++-devel | |
64 | %{!?with_v8:Requires: mujs-devel} | |
65 | Requires: openjpeg2-devel >= 2.1.0 | |
66 | Requires: openssl-devel | |
67 | %{?with_v8:Requires: v8-devel} | |
68 | Requires: zlib-devel | |
69 | ||
70 | %description devel | |
71 | Header files for MuPDF libraries. | |
72 | ||
73 | %description devel -l pl.UTF-8 | |
74 | Pliki nagłówkowe bibliotek MuPDF. | |
75 | ||
76 | %package static | |
77 | Summary: Static MuPDF libraries | |
78 | Summary(pl.UTF-8): Statyczne biblioteki MuPDF | |
79 | Group: Development/Libraries | |
80 | Requires: %{name}-devel = %{version}-%{release} | |
81 | ||
82 | %description static | |
83 | Static MuPDF libraries. | |
84 | ||
85 | %description static -l pl.UTF-8 | |
86 | Statyczne biblioteki MuPDF. | |
87 | ||
88 | %prep | |
89 | %setup -q -n %{name}-%{version}-source | |
90 | %patch0 -p1 | |
91 | %patch1 -p1 | |
92 | ||
93 | # use system libs instead | |
94 | %{__rm} -r thirdparty/{curl,freetype,jbig2dec,jpeg,mujs,openjpeg,zlib} | |
95 | ||
96 | %build | |
97 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
98 | LDFLAGS="%{rpmldflags}" \ | |
99 | %{__make} \ | |
100 | CC="%{__cc}" \ | |
101 | CXX="%{__cxx}" \ | |
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 | |
111 | SYS_OPENJPEG_CFLAGS="$(pkg-config --cflags libopenjp2)" \ | |
112 | build=release \ | |
113 | libdir=%{_libdir} \ | |
114 | verbose=1 | |
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 | ||
132 | %post libs -p /sbin/ldconfig | |
133 | %postun libs -p /sbin/ldconfig | |
134 | ||
135 | %files | |
136 | %defattr(644,root,root,755) | |
137 | %doc CHANGES CONTRIBUTORS README | |
138 | %attr(755,root,root) %{_bindir}/mudraw | |
139 | %attr(755,root,root) %{_bindir}/mujstest | |
140 | %attr(755,root,root) %{_bindir}/mupdf-x11 | |
141 | %attr(755,root,root) %{_bindir}/mupdf-x11-curl | |
142 | %attr(755,root,root) %{_bindir}/mutool | |
143 | %{_mandir}/man1/mudraw.1* | |
144 | %{_mandir}/man1/mupdf.1* | |
145 | %{_mandir}/man1/mutool.1* | |
146 | ||
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 | |
151 | ||
152 | %files devel | |
153 | %defattr(644,root,root,755) | |
154 | %doc docs/{naming,overview,progressive,refcount,thirdparty}.txt | |
155 | %attr(755,root,root) %{_libdir}/libmupdf.so | |
156 | %{_libdir}/libmupdf.la | |
157 | %{_includedir}/mupdf | |
158 | ||
159 | %files static | |
160 | %defattr(644,root,root,755) | |
161 | %{_libdir}/libmupdf.a |