1d95cc3ef23fff3ce53f0fd8888b2e7c8c77e9c4
[packages/mupdf.git] / mupdf.spec
1 Summary:        MuPDF - lightweight PDF, XPS and CBZ viewer and parser/rendering library
2 Summary(pl.UTF-8):      MuPDF - lekka przeglądarka PDF, XPS, CBZ
3 Name:           mupdf
4 Version:        1.18.0
5 Release:        1
6 License:        AGPL v3+
7 Group:          Applications/Text
8 Source0:        https://www.mupdf.com/downloads/archive/%{name}-%{version}-source.tar.gz
9 # Source0-md5:  6f42be1365350f05270f8776517a3872
10 Patch0:         %{name}-soname.patch
11 URL:            https://www.mupdf.com/
12 BuildRequires:  OpenGL-glut-devel
13 BuildRequires:  curl-devel >= 7.66.0
14 BuildRequires:  freetype-devel >= 1:2.10.0
15 BuildRequires:  gumbo-parser-devel >= 0.10.1
16 BuildRequires:  harfbuzz-devel >= 2.8.0
17 BuildRequires:  jbig2dec-devel >= 0.18
18 BuildRequires:  libjpeg-devel
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  libtool
21 BuildRequires:  mujs-devel >= 1.0.9
22 BuildRequires:  openjpeg2-devel >= 2.3.1
23 BuildRequires:  openssl-devel >= 1.1.0
24 BuildRequires:  pkgconfig
25 BuildRequires:  xorg-lib-libX11-devel
26 BuildRequires:  xorg-lib-libXext-devel
27 BuildRequires:  zlib-devel >= 1.2.11
28 Requires:       curl-libs >= 7.66.0
29 Requires:       freetype >= 1:2.10.0
30 Requires:       gumbo-parser >= 0.10.1
31 Requires:       harfbuzz >= 2.8.0
32 Requires:       jbig2dec >= 0.18
33 Requires:       openjpeg2 >= 2.3.1
34 Requires:       zlib >= 1.2.11
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 MuPDF is a lightweight PDF, XPS and CBZ viewer.
39
40 %description -l pl.UTF-8
41 MuPDF to lekka przeglądarka pliki PDF, XPS i CBZ.
42
43 %package libs
44 Summary:        Shared MuPDF libraries
45 Summary(pl.UTF-8):      Biblioteki współdzielone MuPDF
46 Group:          Libraries
47 Requires:       freetype >= 1:2.10.0
48 Requires:       jbig2dec >= 0.18
49 Requires:       mujs >= 1.0.9
50 Requires:       openjpeg2
51 Requires:       openssl >= 1.1.0
52 Requires:       zlib >= 1.2.11
53
54 %description libs
55 Shared MuPDF libraries.
56
57 %description libs -l pl.UTF-8
58 Biblioteki współdzielone MuPDF.
59
60 %package devel
61 Summary:        Header files for MuPDF libraries
62 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek MuPDF
63 Group:          Development/Libraries
64 Requires:       %{name}-libs = %{version}-%{release}
65 Requires:       freetype-devel >= 1:2.10.0
66 Requires:       jbig2dec-devel >= 0.18
67 Requires:       libjpeg-devel
68 Requires:       libstdc++-devel
69 Requires:       mujs-devel >= 1.0.9
70 Requires:       openjpeg2-devel >= 2.3.1
71 Requires:       openssl-devel >= 1.1.0
72 Requires:       zlib-devel >= 1.2.11
73
74 %description devel
75 Header files for MuPDF libraries.
76
77 %description devel -l pl.UTF-8
78 Pliki nagłówkowe bibliotek MuPDF.
79
80 %package static
81 Summary:        Static MuPDF libraries
82 Summary(pl.UTF-8):      Statyczne biblioteki MuPDF
83 Group:          Development/Libraries
84 Requires:       %{name}-devel = %{version}-%{release}
85
86 %description static
87 Static MuPDF libraries.
88
89 %description static -l pl.UTF-8
90 Statyczne biblioteki MuPDF.
91
92 %prep
93 %setup -q -n %{name}-%{version}-source
94 %patch0 -p1
95
96 # use system libs instead:
97 # curl 7.66.0
98 # freetype 2.10.0
99 # gumbo-parser 0.10.1
100 # harfbuzz 2.6.4 + git update (nothing crucial)
101 # jbig2dec 0.18
102 # libjpeg 9
103 # mujs ?
104 # openjpeg 2.3.1
105 # zlib 1.2.11
106 %{__rm} -r thirdparty/{curl,freetype,gumbo-parser,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib}
107 # but keep:
108 # freeglut - 3.0.0 + some additional keyboard and clipboard APIs
109 # lcms2 - "art" fork with tread safety
110
111 %build
112 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
113 LDFLAGS="%{rpmldflags}" \
114 %{__make} -j1 \
115         CC="%{__cc}" \
116         CXX="%{__cxx}" \
117         SYS_OPENJPEG_CFLAGS="$(pkg-config --cflags libopenjp2)" \
118         USE_SYSTEM_LIBS=yes \
119         USE_SYSTEM_MUJS=yes \
120         build=release \
121         libdir=%{_libdir} \
122         verbose=yes
123
124 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
125 LDFLAGS="%{rpmldflags}" \
126 %{__make} -j1 \
127         CC="%{__cc}" \
128         CXX="%{__cxx}" \
129         SYS_OPENJPEG_CFLAGS="$(pkg-config --cflags libopenjp2)" \
130         USE_SYSTEM_LIBS=yes \
131         USE_SYSTEM_MUJS=yes \
132         build=release \
133         shared=yes \
134         libdir=%{_libdir} \
135         verbose=yes
136
137 %install
138 rm -rf $RPM_BUILD_ROOT
139
140 %{__make} install \
141         DESTDIR=$RPM_BUILD_ROOT \
142         USE_SYSTEM_LIBS=yes \
143         USE_SYSTEM_MUJS=yes \
144         build=release \
145         prefix=%{_prefix} \
146         libdir=%{_libdir}
147
148 %{__make} install \
149         DESTDIR=$RPM_BUILD_ROOT \
150         USE_SYSTEM_LIBS=yes \
151         USE_SYSTEM_MUJS=yes \
152         build=release \
153         shared=yes \
154         prefix=%{_prefix} \
155         libdir=%{_libdir}
156
157 # packaged as %doc
158 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/mupdf
159
160 %clean
161 rm -rf $RPM_BUILD_ROOT
162
163 %post   libs -p /sbin/ldconfig
164 %postun libs -p /sbin/ldconfig
165
166 %files
167 %defattr(644,root,root,755)
168 %doc CHANGES CONTRIBUTORS README docs/{index,manual*,thirdparty}.html
169 %attr(755,root,root) %{_bindir}/mupdf-gl
170 %attr(755,root,root) %{_bindir}/mupdf-x11
171 %attr(755,root,root) %{_bindir}/mupdf-x11-curl
172 %attr(755,root,root) %{_bindir}/muraster
173 %attr(755,root,root) %{_bindir}/mutool
174 %{_mandir}/man1/mupdf.1*
175 %{_mandir}/man1/mutool.1*
176
177 %files libs
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_libdir}/libmupdf.so
180
181 %files devel
182 %defattr(644,root,root,755)
183 %{_includedir}/mupdf
184
185 %files static
186 %defattr(644,root,root,755)
187 %{_libdir}/libmupdf.a
188 %{_libdir}/libmupdf-third.a
This page took 0.078208 seconds and 2 git commands to generate.