]> git.pld-linux.org Git - packages/wkhtmltopdf.git/blob - wkhtmltopdf.spec
- updated to 0.12.5
[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_without  patchedQt       # build against Qt4 modified by wkhtmltopdf project
8 %bcond_with     qt5             # build against Qt5
9 #
10
11 %define         qt_ver  4.8.7
12
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
16 Version:        0.12.5
17 Release:        1
18 License:        LGPL v3+ (library), GPL v3+ (utilities)
19 Group:          Applications/Graphics
20 Source0:        https://github.com/wkhtmltopdf/wkhtmltopdf/archive/%{version}/%{name}-%{version}.tar.gz
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
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 # change QMAKE FLAGS to build
93 %{__sed} -i -e '
94         s|QMAKE_CC.*=.*gcc|QMAKE_CC\t\t= %{__cc}|;
95         s|QMAKE_CXX.*=.*g++|QMAKE_CXX\t\t= %{__cxx}|;
96         s|QMAKE_LINK.*=.*g++|QMAKE_LINK\t\t= %{__cxx}|;
97         s|QMAKE_LINK_SHLIB.*=.*g++|QMAKE_LINK_SHLIB\t= %{__cxx}|;
98         s|QMAKE_CFLAGS_RELEASE.*|QMAKE_CFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcflags}|;
99         s|QMAKE_CXXFLAGS_RELEASE.*|QMAKE_CXXFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcxxflags}|;
100         s|QMAKE_CFLAGS_DEBUG.*|QMAKE_CFLAGS_DEBUG\t+= %{debugcflags}|;
101         s|QMAKE_CXXFLAGS_DEBUG.*|QMAKE_CXXFLAGS_DEBUG\t+= %{debugcflags}|;
102         ' mkspecs/common/g++-base.conf
103 %endif
104
105 %build
106
107 %if %{with patchedQt}
108 export OPTFLAGS="%{rpmcflags}"
109 mkdir -p build_qt
110 cd build_qt
111 qt_prefix=`pwd`
112
113 ../qt-everywhere-opensource-src-%{qt_ver}/configure \
114         -opensource \
115         -confirm-license \
116         -fast \
117         -release \
118         -static \
119         -graphicssystem raster \
120         -webkit \
121         -exceptions \
122         -xmlpatterns \
123         -system-zlib \
124         -system-libpng \
125         -system-libjpeg \
126         -no-libmng \
127         -no-libtiff \
128         -no-accessibility \
129         -no-stl \
130         -no-qt3support \
131         -no-phonon \
132         -no-phonon-backend \
133         -no-opengl \
134         -no-declarative \
135         -no-script \
136         -no-scripttools \
137         -no-sql-ibase \
138         -no-sql-mysql \
139         -no-sql-odbc \
140         -no-sql-psql \
141         -no-sql-sqlite \
142         -no-sql-sqlite2 \
143         -no-mmx \
144         -no-3dnow \
145         -no-sse \
146         -no-sse2 \
147         -no-sse3 \
148         -no-ssse3 \
149         -no-sse4.1 \
150         -no-sse4.2 \
151         -no-avx \
152         -no-multimedia \
153         -nomake demos \
154         -nomake docs \
155         -nomake examples \
156         -nomake tools \
157         -nomake tests \
158         -nomake translations \
159         -silent \
160         -xrender \
161         -largefile \
162         -iconv \
163         -openssl-linked \
164         -no-javascript-jit \
165         -no-rpath \
166         -no-dbus \
167         -no-nis \
168         -no-cups \
169         -no-pch \
170         -no-gtkstyle \
171         -no-nas-sound \
172         -no-sm \
173         -no-xshape \
174         -no-xinerama \
175         -no-xcursor \
176         -no-xfixes \
177         -no-xrandr \
178         -no-mitshm \
179         -no-xinput \
180         -no-xkb \
181         -no-glib \
182         -no-gstreamer \
183         -no-icu \
184         -no-openvg \
185         -no-xsync \
186         -no-audio-backend \
187         -no-neon \
188         -prefix "$qt_prefix"
189
190 %{__make}
191
192 cd ..
193
194 $qt_prefix/bin/qmake \
195 %else
196 qmake-%{?with_qt5:qt5}%{!?with_qt5:qt4} \
197 %endif
198         QMAKE_CXX="%{__cxx}" \
199         QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
200         QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
201
202 %{__make}
203
204 %install
205 rm -rf $RPM_BUILD_ROOT
206 install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}}
207
208 %{__make} install \
209         INSTALL_ROOT=$RPM_BUILD_ROOT%{_prefix}
210
211 if [ ! -d "$RPM_BUILD_ROOT%{_libdir}" ]; then
212   mv $RPM_BUILD_ROOT{%{_prefix}/lib,%{_libdir}}
213 fi
214
215 rm -f $RPM_BUILD_ROOT%{_libdir}/libwkhtmltox.so.0.12
216
217 %clean
218 rm -rf $RPM_BUILD_ROOT
219
220 %post   -p /sbin/ldconfig
221 %postun -p /sbin/ldconfig
222
223 %files
224 %defattr(644,root,root,755)
225 %doc AUTHORS CHANGELOG.md README.md
226 %attr(755,root,root) %{_bindir}/wkhtmltoimage
227 %attr(755,root,root) %{_bindir}/wkhtmltopdf
228 %attr(755,root,root) %{_libdir}/libwkhtmltox.so.*.*.*
229 %attr(755,root,root) %ghost %{_libdir}/libwkhtmltox.so.0
230 %{_mandir}/man1/wkhtmlto*.1*
231
232 %files devel
233 %defattr(644,root,root,755)
234 %attr(755,root,root) %{_libdir}/libwkhtmltox.so
235 %{_includedir}/wkhtmltox
This page took 0.157942 seconds and 3 git commands to generate.