]> git.pld-linux.org Git - packages/wkhtmltopdf.git/blame - wkhtmltopdf.spec
- fix building on x32
[packages/wkhtmltopdf.git] / wkhtmltopdf.spec
CommitLineData
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
13Summary: Programs capable of converting HTML documents into images or PDF documents
14Summary(pl.UTF-8): Programy do konwersji dokumentów HTML do obrazów lub dokumentów PDF
15Name: wkhtmltopdf
0c848559 16Version: 0.12.5
b1ee5f41 17Release: 2
e24dd55a
JB
18License: LGPL v3+ (library), GPL v3+ (utilities)
19Group: Applications/Graphics
ad4b2378 20Source0: https://github.com/wkhtmltopdf/wkhtmltopdf/archive/%{version}/%{name}-%{version}.tar.gz
0c848559
BS
21# Source0-md5: 653b68fd0eccfa05d4016fe87f6abcc9
22Source1: 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
25Patch0: qt.patch
b1ee5f41 26Patch1: x32.patch
ad4b2378 27URL: http://wkhtmltopdf.org/
0c848559
BS
28%if %{with patchedQt}
29BuildRequires: fontconfig-devel
30BuildRequires: freetype-devel >= 2.1.3
31BuildRequires: libjpeg-devel
32BuildRequires: libpng-devel >= 2:1.0.8
33BuildRequires: libstdc++-devel
34BuildRequires: xorg-lib-libXrender-devel
35BuildRequires: zlib-devel
36%else
2266e8b0
JB
37%if %{with qt5}
38BuildRequires: Qt5Core-devel >= 5
39BuildRequires: Qt5Gui-devel >= 5
40BuildRequires: Qt5Network-devel >= 5
41BuildRequires: Qt5PrintSupport-devel >= 5.2
42BuildRequires: Qt5Svg-devel >= 5
43BuildRequires: Qt5WebKit-devel >= 5
44BuildRequires: Qt5XmlPatterns-devel >= 5
45BuildRequires: qt5-qmake
46%else
e24dd55a
JB
47BuildRequires: QtCore-devel >= 4
48BuildRequires: QtGui-devel >= 4
49BuildRequires: QtNetwork-devel >= 4
50BuildRequires: QtSvg-devel >= 4
51BuildRequires: QtWebKit-devel >= 4
72934c8c 52BuildRequires: QtXmlPatterns-devel >= 4
e24dd55a 53BuildRequires: qt4-qmake
2266e8b0 54%endif
0c848559 55%endif
e24dd55a
JB
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58%description
59Programs capable of converting HTML documents into images or PDF
60documents.
61
62%description -l pl.UTF-8
63Programy do konwersji dokumentów HTML do obrazów lub dokumentów PDF.
64
65%package devel
66Summary: Header files for wkhtmltox library
67Summary(pl.UTF-8): Pliki nagłówkowe biblioteki wkhtmltox
68License: LGPL v3+
69Group: Development/Libraries
70Requires: %{name} = %{version}-%{release}
2266e8b0
JB
71%if %{with qt5}
72Requires: Qt5Core-devel >= 5
73Requires: Qt5Network-devel >= 5
74Requires: Qt5WebKit-devel >= 5
75%else
e24dd55a
JB
76Requires: QtCore-devel >= 4
77Requires: QtNetwork-devel >= 4
78Requires: QtWebKit-devel >= 4
2266e8b0 79%endif
e24dd55a
JB
80
81%description devel
82Header files for wkhtmltox library.
83
84%description devel -l pl.UTF-8
85Pliki nagłówkowe biblioteki wkhtmltox.
86
87%prep
0c848559
BS
88%setup -q %{?with_patchedQt: -a1}
89
90%if %{with patchedQt}
91cd 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}
110export OPTFLAGS="%{rpmcflags}"
111mkdir -p build_qt
112cd build_qt
113qt_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
194cd ..
195
196$qt_prefix/bin/qmake \
197%else
2266e8b0 198qmake-%{?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
207rm -rf $RPM_BUILD_ROOT
0c848559
BS
208install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}}
209
210%{__make} install \
211 INSTALL_ROOT=$RPM_BUILD_ROOT%{_prefix}
212
213if [ ! -d "$RPM_BUILD_ROOT%{_libdir}" ]; then
214 mv $RPM_BUILD_ROOT{%{_prefix}/lib,%{_libdir}}
215fi
e24dd55a 216
0c848559 217rm -f $RPM_BUILD_ROOT%{_libdir}/libwkhtmltox.so.0.12
e24dd55a
JB
218
219%clean
220rm -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
This page took 0.101842 seconds and 4 git commands to generate.