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