f4866ad0bc7724a78a19416b1ea4fe4f039607f3
[packages/mupdf.git] / mupdf.spec
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.8
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:  3205256d78d8524d67dd2a47c7a345fa
14 Patch0:         %{name}-openjpeg.patch
15 Patch1:         %{name}-shared.patch
16 Patch2:         %{name}-mujs.patch
17 URL:            http://www.mupdf.com/
18 BuildRequires:  OpenGL-glut-devel
19 BuildRequires:  curl-devel
20 BuildRequires:  freetype-devel >= 2
21 BuildRequires:  glfw-devel
22 BuildRequires:  jbig2dec-devel
23 BuildRequires:  libjpeg-devel
24 BuildRequires:  libstdc++-devel
25 %{!?with_v8:BuildRequires:      mujs-devel >= 0-0.20160302}
26 BuildRequires:  openjpeg2-devel >= 2.1.0
27 BuildRequires:  openssl-devel
28 BuildRequires:  pkgconfig
29 %{?with_v8:BuildRequires:       v8-devel}
30 BuildRequires:  xorg-lib-libX11-devel
31 BuildRequires:  xorg-lib-libXext-devel
32 BuildRequires:  zlib-devel
33 Requires:       %{name}-libs = %{version}-%{release}
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 %patch2 -p1
93
94 # use system libs instead
95 %{__rm} -r thirdparty/{curl,freetype,glfw,jbig2dec,jpeg,mujs,openjpeg,zlib}
96
97 %build
98 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
99 LDFLAGS="%{rpmldflags}" \
100 %{__make} -j1 \
101         CC="%{__cc}" \
102         CXX="%{__cxx}" \
103 %if %{with v8}
104         HAVE_V8=yes \
105         V8_CFLAGS= \
106         V8_LIBS="-lv8 -lstdc++" \
107 %else
108         HAVE_MUJS=yes \
109         MUJS_CFLAGS= \
110         MUJS_LIBS="-lmujs" \
111 %endif
112         SYS_OPENJPEG_CFLAGS="$(pkg-config --cflags libopenjp2)" \
113         build=release \
114         libdir=%{_libdir} \
115         verbose=1
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119
120 %{__make} install \
121         DESTDIR=$RPM_BUILD_ROOT \
122         V8_PRESENT=yes \
123         build=release \
124         prefix=%{_prefix} \
125         libdir=%{_libdir}
126
127 # packaged as %doc
128 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mupdf
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %post   libs -p /sbin/ldconfig
134 %postun libs -p /sbin/ldconfig
135
136 %files
137 %defattr(644,root,root,755)
138 %doc CHANGES CONTRIBUTORS README
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/mupdf.1*
144 %{_mandir}/man1/mutool.1*
145
146 %files libs
147 %defattr(644,root,root,755)
148 %attr(755,root,root) %{_libdir}/libmupdf.so.*.*.*
149 %attr(755,root,root) %ghost %{_libdir}/libmupdf.so.0
150
151 %files devel
152 %defattr(644,root,root,755)
153 %doc docs/{naming,overview,progressive,refcount,thirdparty}.txt
154 %attr(755,root,root) %{_libdir}/libmupdf.so
155 %{_libdir}/libmupdf.la
156 %{_includedir}/mupdf
157
158 %files static
159 %defattr(644,root,root,755)
160 %{_libdir}/libmupdf.a
This page took 0.078629 seconds and 2 git commands to generate.