]> git.pld-linux.org Git - packages/wkhtmltopdf.git/blob - wkhtmltopdf.spec
- bundled qt is so broken it does not build, switch to qt5
[packages/wkhtmltopdf.git] / wkhtmltopdf.spec
1 #
2 #TODO
3 # - check which simd instructions can be enabled (like in qt spec)
4 #   patched qt does not compile with mmx, sse and sse2 enabled
5 #
6 # Conditional build:
7 %bcond_with     patchedQt       # build against Qt4 modified by wkhtmltopdf project
8 %bcond_without  qt5             # build against Qt5
9 #
10 %define         qt_ver  4.8.7
11
12 Summary:        Programs capable of converting HTML documents into images or PDF documents
13 Summary(pl.UTF-8):      Programy do konwersji dokumentów HTML do obrazów lub dokumentów PDF
14 Name:           wkhtmltopdf
15 Version:        0.12.5
16 Release:        5
17 License:        LGPL v3+ (library), GPL v3+ (utilities)
18 Group:          Applications/Graphics
19 Source0:        https://github.com/wkhtmltopdf/wkhtmltopdf/archive/%{version}/%{name}-%{version}.tar.gz
20 # Source0-md5:  653b68fd0eccfa05d4016fe87f6abcc9
21 Source1:        http://download.qt-project.org/official_releases/qt/4.8/%{qt_ver}/qt-everywhere-opensource-src-%{qt_ver}.tar.gz
22 # Source1-md5:  d990ee66bf7ab0c785589776f35ba6ad
23 #git clone https://github.com/wkhtmltopdf/qt.git; git diff origin/4.8..wk_4.8.7 > qt.patch
24 Patch0:         qt.patch
25 Patch1:         x32.patch
26 URL:            http://wkhtmltopdf.org/
27 %if %{with patchedQt}
28 BuildRequires:  fontconfig-devel
29 BuildRequires:  freetype-devel >= 2.1.3
30 BuildRequires:  libjpeg-devel
31 BuildRequires:  libpng-devel >= 2:1.0.8
32 BuildRequires:  libstdc++-devel
33 BuildRequires:  xorg-lib-libXrender-devel
34 BuildRequires:  zlib-devel
35 %else
36 %if %{with qt5}
37 BuildRequires:  Qt5Core-devel >= 5
38 BuildRequires:  Qt5Gui-devel >= 5
39 BuildRequires:  Qt5Network-devel >= 5
40 BuildRequires:  Qt5PrintSupport-devel >= 5.2
41 BuildRequires:  Qt5Svg-devel >= 5
42 BuildRequires:  Qt5WebKit-devel >= 5
43 BuildRequires:  Qt5XmlPatterns-devel >= 5
44 BuildRequires:  qt5-qmake
45 %else
46 BuildRequires:  QtCore-devel >= 4
47 BuildRequires:  QtGui-devel >= 4
48 BuildRequires:  QtNetwork-devel >= 4
49 BuildRequires:  QtSvg-devel >= 4
50 BuildRequires:  QtWebKit-devel >= 4
51 BuildRequires:  QtXmlPatterns-devel >= 4
52 BuildRequires:  qt4-qmake
53 %endif
54 %endif
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %description
58 Programs capable of converting HTML documents into images or PDF
59 documents.
60
61 %description -l pl.UTF-8
62 Programy do konwersji dokumentów HTML do obrazów lub dokumentów PDF.
63
64 %package devel
65 Summary:        Header files for wkhtmltox library
66 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki wkhtmltox
67 License:        LGPL v3+
68 Group:          Development/Libraries
69 Requires:       %{name} = %{version}-%{release}
70 %if %{with qt5}
71 Requires:       Qt5Core-devel >= 5
72 Requires:       Qt5Network-devel >= 5
73 Requires:       Qt5WebKit-devel >= 5
74 %else
75 Requires:       QtCore-devel >= 4
76 Requires:       QtNetwork-devel >= 4
77 Requires:       QtWebKit-devel >= 4
78 %endif
79
80 %description devel
81 Header files for wkhtmltox library.
82
83 %description devel -l pl.UTF-8
84 Pliki nagłówkowe biblioteki wkhtmltox.
85
86 %prep
87 %setup -q %{?with_patchedQt: -a1}
88
89 %if %{with patchedQt}
90 cd qt-everywhere-opensource-src-%{qt_ver}
91 %patch0 -p1
92 %patch1 -p1
93 # change QMAKE FLAGS to build
94 %{__sed} -i -e '
95         s|QMAKE_CC.*=.*gcc|QMAKE_CC\t\t= %{__cc}|;
96         s|QMAKE_CXX.*=.*g++|QMAKE_CXX\t\t= %{__cxx}|;
97         s|QMAKE_LINK.*=.*g++|QMAKE_LINK\t\t= %{__cxx}|;
98         s|QMAKE_LINK_SHLIB.*=.*g++|QMAKE_LINK_SHLIB\t= %{__cxx}|;
99         s|QMAKE_CFLAGS_RELEASE.*|QMAKE_CFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcflags}|;
100         s|QMAKE_CXXFLAGS_RELEASE.*|QMAKE_CXXFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcxxflags}|;
101         s|QMAKE_CFLAGS_DEBUG.*|QMAKE_CFLAGS_DEBUG\t+= %{debugcflags}|;
102         s|QMAKE_CXXFLAGS_DEBUG.*|QMAKE_CXXFLAGS_DEBUG\t+= %{debugcflags}|;
103         ' mkspecs/common/g++-base.conf
104 %endif
105
106 %build
107
108 %if %{with patchedQt}
109 export OPTFLAGS="%{rpmcflags}"
110 mkdir -p build_qt
111 cd build_qt
112 qt_prefix=`pwd`
113
114 ../qt-everywhere-opensource-src-%{qt_ver}/configure \
115         -opensource \
116         -confirm-license \
117         -fast \
118         -release \
119         -static \
120         -graphicssystem raster \
121         -webkit \
122         -exceptions \
123         -xmlpatterns \
124         -system-zlib \
125         -system-libpng \
126         -system-libjpeg \
127         -no-libmng \
128         -no-libtiff \
129         -no-accessibility \
130         -no-stl \
131         -no-qt3support \
132         -no-phonon \
133         -no-phonon-backend \
134         -no-opengl \
135         -no-declarative \
136         -no-script \
137         -no-scripttools \
138         -no-sql-ibase \
139         -no-sql-mysql \
140         -no-sql-odbc \
141         -no-sql-psql \
142         -no-sql-sqlite \
143         -no-sql-sqlite2 \
144         -no-mmx \
145         -no-3dnow \
146         -no-sse \
147         -no-sse2 \
148         -no-sse3 \
149         -no-ssse3 \
150         -no-sse4.1 \
151         -no-sse4.2 \
152         -no-avx \
153         -no-multimedia \
154         -nomake demos \
155         -nomake docs \
156         -nomake examples \
157         -nomake tools \
158         -nomake tests \
159         -nomake translations \
160         -silent \
161         -xrender \
162         -largefile \
163         -iconv \
164         -openssl-linked \
165         -no-javascript-jit \
166         -no-rpath \
167         -no-dbus \
168         -no-nis \
169         -no-cups \
170         -no-pch \
171         -no-gtkstyle \
172         -no-nas-sound \
173         -no-sm \
174         -no-xshape \
175         -no-xinerama \
176         -no-xcursor \
177         -no-xfixes \
178         -no-xrandr \
179         -no-mitshm \
180         -no-xinput \
181         -no-xkb \
182         -no-glib \
183         -no-gstreamer \
184         -no-icu \
185         -no-openvg \
186         -no-xsync \
187         -no-audio-backend \
188         -no-neon \
189         -prefix "$qt_prefix"
190
191 %{__make}
192
193 cd ..
194
195 $qt_prefix/bin/qmake \
196 %else
197 qmake-%{?with_qt5:qt5}%{!?with_qt5:qt4} \
198 %endif
199         QMAKE_CXX="%{__cxx}" \
200         QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
201         QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
202
203 %{__make}
204
205 %install
206 rm -rf $RPM_BUILD_ROOT
207 install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}}
208
209 %{__make} install \
210         INSTALL_ROOT=$RPM_BUILD_ROOT%{_prefix}
211
212 if [ ! -d "$RPM_BUILD_ROOT%{_libdir}" ]; then
213   mv $RPM_BUILD_ROOT{%{_prefix}/lib,%{_libdir}}
214 fi
215
216 rm -f $RPM_BUILD_ROOT%{_libdir}/libwkhtmltox.so.0.12
217
218 %clean
219 rm -rf $RPM_BUILD_ROOT
220
221 %post   -p /sbin/ldconfig
222 %postun -p /sbin/ldconfig
223
224 %files
225 %defattr(644,root,root,755)
226 %doc AUTHORS CHANGELOG.md README.md
227 %attr(755,root,root) %{_bindir}/wkhtmltoimage
228 %attr(755,root,root) %{_bindir}/wkhtmltopdf
229 %attr(755,root,root) %{_libdir}/libwkhtmltox.so.*.*.*
230 %attr(755,root,root) %ghost %{_libdir}/libwkhtmltox.so.0
231 %{_mandir}/man1/wkhtmlto*.1*
232
233 %files devel
234 %defattr(644,root,root,755)
235 %attr(755,root,root) %{_libdir}/libwkhtmltox.so
236 %{_includedir}/wkhtmltox
This page took 0.104343 seconds and 4 git commands to generate.