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