]> git.pld-linux.org Git - packages/calibre.git/blob - calibre.spec
- Up to 2.47.0.
[packages/calibre.git] / calibre.spec
1 #
2 # TODO: - rewrite generate-tarball.sh script to provide locales.zip handling (if needed)
3 #       - make separate server package with init-scripts, etc...
4 #
5 # NOTE:
6 # Upstream packages some unfree fonts which we cannot redistribute,
7 # so when upgrading calibre we should download upstream tarball by hand from
8 # http://downloads.sourceforge.net/calibre and run generate-tarball.sh script
9 # included as SourceX.
10 #
11 Summary:        E-book converter and library management
12 Summary(pl.UTF-8):      Konwerter oraz biblioteka dla e-booków
13 Name:           calibre
14 Version:        2.47.0
15 Release:        1
16 License:        GPL v3+
17 Group:          Applications/Multimedia
18 Source0:        %{name}-%{version}-nofonts.tar.xz
19 # Source0-md5:  014738246e7fd31cb328fed3a8c296ff
20 Source1:        generate-tarball.sh
21 Source2:        %{name}-mount-helper
22 Patch0:         %{name}-prefix.patch
23 Patch1:         %{name}-no-update.patch
24 Patch2:         %{name}-env_module.patch
25 Patch3:         %{name}-locales.patch
26 Patch4:         shebang-python-fix.patch
27 Patch5:         desktop-integration.patch
28 URL:            http://www.calibre-ebook.com/
29 %define         baeutifulsoup_ver 3.0.5
30 %define         pil_ver 1.1.6
31 %define         pyqt5_ver 5.3.1
32 %define         apsw_ver 3.8.0.1
33 %define         cssselect_ver 0.7.1
34 %define         cssutils_ver 1:0.9.9
35 %define         dateutil_ver 1.4.1
36 %define         dns_ver 1.6.0
37 %define         lxml_ver 2.2.1
38 %define         mechanize_ver 0.1.11
39 %define         netifaces_ver 0.8
40 %define         psutil_ver 0.6.1
41 BuildRequires:  ImageMagick-devel >= 6.6.4.7
42 BuildRequires:  Qt5Core-devel
43 BuildRequires:  Qt5DBus-devel
44 BuildRequires:  Qt5Gui-devel
45 BuildRequires:  Qt5PlatformSupport-devel
46 BuildRequires:  Qt5Widgets-devel
47 BuildRequires:  chmlib-devel >= 0.40
48 BuildRequires:  libicu-devel
49 BuildRequires:  libinput-devel
50 BuildRequires:  libmtp-devel >= 1.1.5
51 BuildRequires:  libwmf-devel >= 0.2.8
52 BuildRequires:  mtdev-devel
53 BuildRequires:  pkgconfig
54 BuildRequires:  podofo-devel >= 0.8.2
55 BuildRequires:  poppler-qt5-devel >= 0.28.1
56 BuildRequires:  poppler-glib-devel >= 0.28.1
57 BuildRequires:  python-BeautifulSoup >= %{baeutifulsoup_ver}
58 BuildRequires:  python-PIL >= %{pil_ver}
59 BuildRequires:  python-PyQt5 >= %{pyqt5_ver}
60 BuildRequires:  python-PyQt5-devel-tools >= %{pyqt5_ver}
61 BuildRequires:  python-PyQt5-uic >= %{pyqt5_ver}
62 BuildRequires:  python-apsw >= %{apsw_ver}
63 BuildRequires:  python-cssselect >= %{cssselect_ver}
64 BuildRequires:  python-cssutils >= %{cssutils_ver}
65 BuildRequires:  python-dateutil >= %{dateutil_ver}
66 BuildRequires:  python-devel >= 1:2.7.1
67 BuildRequires:  python-dns >= %{dns_ver}
68 BuildRequires:  python-genshi
69 BuildRequires:  python-lxml >= %{lxml_ver}
70 BuildRequires:  python-mechanize >= %{mechanize_ver}
71 BuildRequires:  python-modules-sqlite
72 BuildRequires:  python-netifaces >= %{netifaces_ver}
73 BuildRequires:  python-psutil >= %{psutil_ver}
74 BuildRequires:  python-sip-devel
75 BuildRequires:  qt5-build
76 BuildRequires:  qt5-qmake
77 BuildRequires:  rpm-pythonprov
78 BuildRequires:  rpmbuild(macros) >= 1.710
79 BuildRequires:  sed >= 4.0
80 BuildRequires:  sqlite3-devel
81 BuildRequires:  sip-PyQt5
82 BuildRequires:  tar >= 1:1.22
83 BuildRequires:  unzip
84 BuildRequires:  xdg-utils
85 BuildRequires:  xz >= 1:4.999.7
86 Requires:       Qt5Svg
87 Requires:       Qt5WebKit
88 Requires:       python-BeautifulSoup >= %{baeutifulsoup_ver}
89 Requires:       python-PIL >= %{pil_ver}
90 Requires:       python-PyQt5 >= %{pyqt5_ver}
91 Requires:       python-apsw >= %{apsw_ver}
92 Requires:       python-cssselect >= %{cssselect_ver}
93 Requires:       python-cssutils >= %{cssutils_ver}
94 Requires:       python-dateutil >= %{dateutil_ver}
95 Requires:       python-dns >= %{dns_ver}
96 Requires:       python-genshi
97 Requires:       python-lxml >= %{lxml_ver}
98 Requires:       python-mechanize >= %{mechanize_ver}
99 Requires:       python-modules-sqlite
100 Requires:       python-netifaces >= %{netifaces_ver}
101 Requires:       python-psutil >= %{psutil_ver}
102 Suggests:       ImageMagick-coder-jpeg
103 Suggests:       ImageMagick-coder-png
104 ### FIXME: libunrar.so is needed for rar-packed files
105 Suggests:       libunrar-devel
106 Suggests:       poppler-progs
107 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
108
109 %description
110 Calibre is meant to be a complete e-library solution. It includes
111 library management, format conversion, news feeds to ebook conversion
112 as well as e-book reader sync features.
113
114 Calibre is primarily a ebook cataloging program. It manages your ebook
115 collection for you. It is designed around the concept of the logical
116 book, i.e. a single entry in the database that may correspond to
117 ebooks in several formats. It also supports conversion to and from a
118 dozen different ebook formats.
119
120 Supported input formats are: MOBI, LIT, PRC, EPUB, CHM, ODT, HTML,
121 CBR, CBZ, RTF, TXT, PDF and LRS.
122
123 %description -l pl.UTF-8
124 Calibre to bardzo dobry i darmowy program do czytania e-książek.
125
126 Calibre umożliwia zarówno czytanie e-książek jak i konwersję wielu
127 formatów do ich postaci. Program obsługuje następujące typy plików:
128 import: LRF, PDF, LIT, RTF, OPF, MOBI, PRC, EPUB, FB2, IMP, RB i HTML
129 eksport: Mobi, LRF i EPUB oraz do aplikacji iPhone-reader i Stanza.
130
131 Ten czytnik e-książek oferuje również pobieranie okładek, komiksów i
132 najnowszych wiadomości z serwisów poświęconym e-książkom. Twórcy
133 dołączyli również aplikację, którą użytkownik może wykorzystać jako
134 swój własny serwer darmowych książek.
135
136 %package -n bash-completion-calibre
137 Summary:        bash-completion for calibre
138 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla calibre
139 Group:          Applications/Shells
140 Requires:       %{name} = %{version}-%{release}
141 Requires:       bash-completion
142 %if "%{_rpmversion}" >= "5"
143 BuildArch:      noarch
144 %endif
145
146 %description -n bash-completion-calibre
147 bash-completion for calibre.
148
149 %description -n bash-completion-calibre -l pl.UTF-8
150 Pakiet ten dostarcza bashowe uzupełnianie nazw dla calibre.
151
152 %package -n zsh-completion-calibre
153 Summary:        zsh-completion for calibre
154 Summary(pl.UTF-8):      uzupełnianie nazw dla calibre w powłoce zsh
155 Group:          Applications/Shells
156 Requires:       %{name} = %{version}-%{release}
157 Requires:       bash-completion
158
159 %description -n zsh-completion-calibre
160 zsh-completion for calibre.
161
162 %description -n zsh-completion-calibre -l pl.UTF-8
163 Pakiet ten dostarcza uzupełnianie nazw dla calibre w powłoce zsh.
164
165 %prep
166 %setup -q
167 %patch0 -p1
168 #%patch1 -p1 Patch does not apply, not removed completly since spec update is in progress
169 %patch2 -p1
170 %patch3 -p1
171 %patch4 -p1
172 %patch5 -p1
173
174 # 64bit target build fix
175 %{__sed} -i -e "s!'/usr/lib'!'%{_libdir}'!g" setup/build_environment.py
176
177 # upstream decides to store locale files in a single zip file but we prefer separate .mo
178 mkdir resources/localization/locales
179 unzip resources/localization/locales.zip -d resources/localization/locales
180 chmod 755 resources/localization/locales/*
181 rm -f resources/localization/locales.zip
182
183 %build
184 CC="%{__cc}" \
185 CXX=%{__cxx} \
186 OVERRIDE_CFLAGS="%{rpmcflags}" \
187 OVERRIDE_LDFLAGS="%{rpmldflags}" \
188 QMAKE="%{_bindir}/qmake-qt5" \
189 %{__python} setup.py build
190
191 %install
192 rm -rf $RPM_BUILD_ROOT
193 # create directories for xdg-utils
194 install -d $RPM_BUILD_ROOT%{_datadir}/{icons/hicolor,packages,mime/packages,desktop-directories} \
195         $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/usr/share/zsh/site-functions}
196
197 XDG_DATA_DIRS="$RPM_BUILD_ROOT%{_datadir}" \
198 XDG_UTILS_INSTALL_MODE="system" \
199 LIBPATH="%{_libdir}" \
200 %{__python} setup.py install \
201         --no-compile \
202         --prefix=%{_prefix} \
203         --root=$RPM_BUILD_ROOT \
204         --libdir="%{_libdir}"
205
206 cp -p resources/images/library.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}-gui.png
207 cp -p resources/images/viewer.png $RPM_BUILD_ROOT%{_pixmapsdir}/calibre-viewer.png
208
209 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/%{name}
210 %py_comp $RPM_BUILD_ROOT%{_libdir}/%{name}
211 %py_postclean %{_libdir}/%{name}
212
213 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/localization/locales $RPM_BUILD_ROOT%{_localedir}
214
215 # set proper filenames for locales (TODO: switch to patch if possible)
216 for file in $RPM_BUILD_ROOT%{_localedir}/*; do
217         lang=$(echo $file|%{__sed} 's:.*locale/\(.*\).*:\1:')
218         mkdir $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
219         mv $RPM_BUILD_ROOT%{_localedir}/$lang/*.mo \
220                 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES
221 done;
222 for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/messages.mo; do
223         lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
224         mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/messages.mo \
225                 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}.mo
226 done;
227 for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/iso639.mo; do
228         lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
229         mv $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/iso639.mo \
230                 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_iso639.mo
231 done;
232 for file in $RPM_BUILD_ROOT%{_localedir}/*/lcdata.pickle; do
233         lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/lcdata.pickle:\1:')
234         mv $RPM_BUILD_ROOT%{_localedir}/$lang/lcdata.pickle \
235                 $RPM_BUILD_ROOT%{_localedir}/$lang/LC_MESSAGES/%{name}_lcdata.pickle
236 done;
237
238 %{__rm} $RPM_BUILD_ROOT%{_bindir}/%{name}-uninstall
239
240 # unsupported
241 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/bn_BD
242 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/jv
243 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ltg
244 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/sl_SI
245
246 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
247
248 %find_lang %{name} --all-name
249 for file in $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/%{name}_lcdata.pickle; do
250         lang=$(echo $file|%{__sed} 's:.*locale/\(.*\)/LC_MESSAGES.*:\1:')
251         echo $file | %{__sed} "s:$RPM_BUILD_ROOT\(.*\):%lang($lang) \1:" >>%{name}.lang
252 done;
253
254 %clean
255 rm -rf $RPM_BUILD_ROOT
256
257 %post
258 %update_desktop_database
259 %update_mime_database
260 %update_icon_cache hicolor
261
262 %postun
263 if [ $1 -eq 0 ] ; then
264         %update_desktop_database
265         %update_mime_database
266         %update_icon_cache hicolor
267 fi
268
269 %files -f %{name}.lang
270 %defattr(644,root,root,755)
271 %doc Changelog.yaml COPYRIGHT README.md
272 %attr(755,root,root) %{_bindir}/calibre
273 %attr(755,root,root) %{_bindir}/calibre-complete
274 %attr(755,root,root) %{_bindir}/calibre-customize
275 %attr(755,root,root) %{_bindir}/calibre-debug
276 %attr(755,root,root) %{_bindir}/calibre-mount-helper
277 %attr(755,root,root) %{_bindir}/calibre-parallel
278 %attr(755,root,root) %{_bindir}/calibre-server
279 %attr(755,root,root) %{_bindir}/calibre-smtp
280 %attr(755,root,root) %{_bindir}/calibredb
281 %attr(755,root,root) %{_bindir}/ebook-convert
282 %attr(755,root,root) %{_bindir}/ebook-device
283 %attr(755,root,root) %{_bindir}/ebook-edit
284 %attr(755,root,root) %{_bindir}/ebook-meta
285 %attr(755,root,root) %{_bindir}/ebook-polish
286 %attr(755,root,root) %{_bindir}/ebook-viewer
287 %attr(755,root,root) %{_bindir}/fetch-ebook-metadata
288 %attr(755,root,root) %{_bindir}/lrf2lrs
289 %attr(755,root,root) %{_bindir}/lrfviewer
290 %attr(755,root,root) %{_bindir}/lrs2lrf
291 %attr(755,root,root) %{_bindir}/markdown-calibre
292 %attr(755,root,root) %{_bindir}/web2disk
293 %{_datadir}/%{name}
294 %{_datadir}/appdata/calibre-ebook-edit.appdata.xml
295 %{_datadir}/appdata/calibre-ebook-viewer.appdata.xml
296 %{_datadir}/appdata/calibre-gui.appdata.xml
297 %{_libdir}/%{name}
298 %{_desktopdir}/calibre-ebook-edit.desktop
299 %{_desktopdir}/calibre-ebook-viewer.desktop
300 %{_desktopdir}/calibre-gui.desktop
301 %{_desktopdir}/calibre-lrfviewer.desktop
302 %{_iconsdir}/hicolor/*/*/*.png
303 %{_datadir}/mime/application/*.xml
304 %{_datadir}/mime/text/*.xml
305 %{_datadir}/mime/packages/calibre-mimetypes.xml
306 %{_pixmapsdir}/%{name}-gui.png
307 %{_pixmapsdir}/calibre-viewer.png
308
309 %files -n bash-completion-calibre
310 %defattr(644,root,root,755)
311 %{bash_compdir}/calibre
312
313 %files -n zsh-completion-calibre
314 %defattr(644,root,root,755)
315 %{_datadir}/zsh/site-functions/*
This page took 0.083271 seconds and 3 git commands to generate.