Translation update done using Pootle.
[gammu.git] / gammu.spec
blob9acc608aede4d9859510f50ff21dd240f312874b
1 Name: gammu
2 Version: 1.30.93
3 Release: 1
4 # Set to 0 to disable bluetooth support
5 %if 0%{?opensuse_bs} && 0%{?sles_version} == 9
6 %define bluetooth 0
7 %else
8 %define bluetooth 1
9 %endif
10 # Set to 0 to disable PostgreSQL support
11 %define pqsql 1
12 # Set to 0 to disable MySQL support
13 %define mysql 1
14 # Set to 0 to disable DBI support
15 %define dbi 1
16 # Set to 0 to disable ODBC support
17 %define odbc 1
18 # Set to 0 to disable USB support
19 %define usb 1
20 # Change if using tar.gz sources
21 %define extension bz2
23 # Python name
24 %{!?__python: %define __python python}
25 %define g_python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
26 %define g_python_major_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0][:3]')
28 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
29 %define gammu_docdir %_docdir/%{name}-%{version}
30 %else
31 %define gammu_docdir %_docdir/%{name}
32 %endif
34 Summary: Mobile phone management utility
35 License: GPLv2
36 %if 0%{?suse_version}
37 Group: Hardware/Mobile
38 %else
39 Group: Applications/Communications
40 %endif
41 Vendor: Michal Čihař <michal@cihar.com>
43 # Detect build requires, I really hate this crap
45 # SUSE
46 %if 0%{?suse_version}
48 %define dist_usb_libs libusb-1_0-devel
49 %define dist_dbi_libs libdbi-devel libdbi-drivers-dbd-sqlite3 sqlite
51 # 11.1 changed name of devel package for Bluetooth
52 %if 0%{?suse_version} >= 1110
53 %define dist_bluez_libs bluez-devel
54 %else
55 %define dist_bluez_libs bluez-libs >= 2.0
56 %endif
58 %define dist_postgres_libs postgresql-devel
60 %else
62 # Mandriva
63 %if 0%{?mandriva_version}
65 %define dist_usb_libs libusb-1.0-devel
66 %define dist_dbi_libs libdbi-devel libdbi-drivers-dbd-sqlite3 sqlite3-tools
68 # 64-bit Mandriva has 64 in package name
69 %ifarch x86_64
70 %define mandriva_hack 64
71 %endif
73 # Bluetooth things got renamed several times
74 %if 0%{?mandriva_version} > 2007
75 %define dist_bluez_libs lib%{?mandriva_hack}bluez-devel
76 %else
77 %if 0%{?mandriva_version} > 2006
78 %define dist_bluez_libs lib%{?mandriva_hack}bluez2-devel
79 %else
80 %define dist_bluez_libs libbluez1-devel >= 2.0
81 %endif
82 %endif
84 # postgresql-devel does not work for whatever reason in buildservice
85 %if 0%{?mandriva_version} == 2009
86 %define dist_postgres_libs postgresql8.3-devel
87 %else
88 %define dist_postgres_libs postgresql-devel
89 %endif
91 %else
93 # Fedora / Redhat / Centos
94 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
96 %define dist_usb_libs libusb1-devel
97 %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite
98 %define dist_bluez_libs bluez-libs-devel >= 2.0
99 %define dist_postgres_libs postgresql-devel
101 %else
103 #Defaults for not know distributions
104 %define dist_usb_libs libusb1-devel
105 %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite
106 %define dist_bluez_libs bluez-libs-devel >= 2.0
107 %define dist_postgres_libs postgresql-devel
109 %endif
110 %endif
111 %endif
113 %if %bluetooth
114 BuildRequires: %{dist_bluez_libs}
115 %endif
117 %if pqsql
118 BuildRequires: %{dist_postgres_libs}
119 %endif
121 %if %mysql
122 BuildRequires: mysql-devel
123 %endif
125 %if %dbi
126 BuildRequires: %{dist_dbi_libs}
127 %endif
129 %if %odbc
130 BuildRequires: unixODBC-devel
131 %endif
133 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
134 BuildRequires: libgudev1-devel glib2-devel
135 %else
136 %if 0%{?mandriva_version}
137 BuildRequires: libgudev-1.0-devel glib2-devel
138 %else
139 BuildRequires: libgudev-1_0-devel glib2-devel
140 %endif
141 %endif
143 BuildRequires: python-devel
145 %if 0%{?centos_version} || 0%{?rhel_version} || 0%{?rhel} || 0%{?suse_version} < 1100
146 BuildRequires: curl-devel
147 %else
148 BuildRequires: libcurl-devel
149 %endif
151 %if %usb
152 BuildRequires: %{dist_usb_libs}
153 %endif
155 BuildRequires: gettext cmake pkgconfig gcc
157 Source: http://dl.cihar.com/gammu/releases/gammu-%{version}.tar.%{extension}
158 URL: http://wammu.eu/gammu/
159 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
161 %description
162 Gammu is command line utility and library to work with mobile phones
163 from many vendors. Support for different models differs, but basic
164 functions should work with majority of them. Program can work with
165 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
166 integrated radio, camera, etc. It also supports daemon mode to send and
167 receive SMSes.
169 Currently supported phones include:
171 * Many Nokia models.
172 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
173 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
174 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
175 * Symbian phones through gnapplet.
177 This package contains Gammu binary as well as some examples.
179 %package devel
180 License: GPL v2
181 Summary: Development files for Gammu
182 %if 0%{?suse_version}
183 Group: Development/Libraries/C and C++
184 %else
185 Group: Development/Libraries
186 %endif
187 Requires: %{name} = %{version}-%{release} pkgconfig
189 %description devel
190 Gammu is command line utility and library to work with mobile phones
191 from many vendors. Support for different models differs, but basic
192 functions should work with majority of them. Program can work with
193 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
194 integrated radio, camera, etc. It also supports daemon mode to send and
195 receive SMSes.
197 Currently supported phones include:
199 * Many Nokia models.
200 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
201 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
202 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
203 * Symbian phones through gnapplet.
205 This package contain files needed for development.
207 %package -n python-gammu
208 License: GPL v2
209 Summary: Python module to communicate with mobile phones
210 %if 0%{?suse_version}
211 Group: Development/Libraries/Python
212 %else
213 Group: Development/Languages
214 %endif
215 Requires: python >= %{g_python_major_version}, python < %{g_python_major_version}.99
216 %{?py_requires}
218 %description -n python-gammu
219 This provides gammu module, that can work with any phone Gammu
220 supports - many Nokias, Siemens, Alcatel, ...
222 %package smsd
223 Summary: SMS message daemon
224 %if 0%{?suse_version}
225 PreReq: %insserv_prereq %fillup_prereq
226 %endif
227 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
228 Requires(post): chkconfig
229 Requires(preun): chkconfig
230 Requires(preun): initscripts
231 %endif
232 %if 0%{?suse_version}
233 Group: Hardware/Mobile
234 %else
235 Group: Applications/Communications
236 %endif
238 %description smsd
239 Gammu is command line utility and library to work with mobile phones
240 from many vendors. Support for different models differs, but basic
241 functions should work with majority of them. Program can work with
242 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
243 integrated radio, camera, etc. It also supports daemon mode to send and
244 receive SMSes.
246 Currently supported phones include:
248 * Many Nokia models.
249 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
250 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
251 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
252 * Symbian phones through gnapplet.
254 This package contains Gammu SMS Daemon and tool to inject messages
255 into the queue.
257 %package -n libGammu7
258 Summary: Mobile phone management library
259 Group: System/Libraries
261 %description -n libGammu7
262 Gammu is command line utility and library to work with mobile phones
263 from many vendors. Support for different models differs, but basic
264 functions should work with majority of them. Program can work with
265 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
266 integrated radio, camera, etc. It also supports daemon mode to send and
267 receive SMSes.
269 Currently supported phones include:
271 * Many Nokia models.
272 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
273 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
274 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
275 * Symbian phones through gnapplet.
277 This package contains Gammu shared library.
279 %package -n libgsmsd7
280 Summary: SMS daemon helper library
281 Group: System/Libraries
283 %description -n libgsmsd7
284 Gammu is command line utility and library to work with mobile phones
285 from many vendors. Support for different models differs, but basic
286 functions should work with majority of them. Program can work with
287 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
288 integrated radio, camera, etc. It also supports daemon mode to send and
289 receive SMSes.
291 Currently supported phones include:
293 * Many Nokia models.
294 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
295 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
296 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
297 * Symbian phones through gnapplet.
299 This package contains Gammu SMS daemon shared library.
301 %prep
302 %setup -q
304 %build
305 mkdir build-dir
306 cd build-dir
307 cmake ../ \
308 -DBUILD_SHARED_LIBS=ON \
309 -DINSTALL_LSB_INIT=ON \
310 -DBUILD_PYTHON=/usr/bin/python \
311 -DCMAKE_INSTALL_PREFIX=%_prefix \
312 -DINSTALL_DOC_DIR=%gammu_docdir \
313 -DINSTALL_LIB_DIR=%_lib \
314 -DINSTALL_LIBDATA_DIR=%_lib
315 make %{?_smp_mflags} %{!?_smp_mflags:%{?jobs:-j %jobs}}
317 %check
318 cd build-dir
319 ctest -V
321 %install
322 %if 0%{?suse_version} == 0
323 rm -rf %buildroot
324 mkdir %buildroot
325 %endif
326 make -C build-dir install DESTDIR=%buildroot
327 %find_lang %{name}
328 %find_lang libgammu
329 cat libgammu.lang >> %{name}.lang
330 install -m644 docs/config/smsdrc %buildroot/etc/gammu-smsdrc
332 %post -n libGammu7 -p /sbin/ldconfig
334 %post -n libgsmsd7 -p /sbin/ldconfig
336 %postun -n libGammu7 -p /sbin/ldconfig
338 %postun -n libgsmsd7 -p /sbin/ldconfig
340 %post smsd
341 %if 0%{?mandriva_version}
342 %_post_service gammu-smsd
343 %endif
344 %if 0%{?suse_version}
345 %fillup_and_insserv gammu-smsd
346 %endif
347 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
348 /sbin/chkconfig --add gammu-smsd
349 %endif
351 %preun smsd
352 %if 0%{?suse_version}
353 %stop_on_removal gammu-smsd
354 %endif
355 %if 0%{?mandriva_version}
356 %_preun_service gammu-smsd
357 %endif
358 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
359 if [ $1 = 0 ] ; then
360 /sbin/service gammu-smsd stop >/dev/null 2>&1
361 /sbin/chkconfig --del <script>
363 %endif
366 %postun smsd
367 %if 0%{?suse_version}
368 %restart_on_update gammu-smsd
369 %insserv_cleanup
370 %endif
373 %files -f %name.lang
374 %defattr(-,root,root)
375 %doc %gammu_docdir
376 %config /etc/bash_completion.d/gammu
377 %_bindir/gammu
378 %_bindir/gammu-config
379 %_bindir/gammu-detect
380 %_bindir/jadmaker
381 %_mandir/man1/gammu.1*
382 %_mandir/man1/gammu-config.1*
383 %_mandir/man1/gammu-detect.1*
384 %_mandir/man1/jadmaker.1*
385 %_mandir/man5/gammurc.5*
386 %_mandir/man5/gammu-backup.5*
387 %_mandir/man5/gammu-smsbackup.5*
389 %files smsd
390 %defattr(-,root,root)
391 %_bindir/gammu-smsd
392 %_bindir/gammu-smsd-inject
393 %_bindir/gammu-smsd-monitor
394 %_mandir/man1/gammu-smsd*
395 %_mandir/man7/gammu-smsd*
396 %_mandir/man5/gammu-smsd*
397 %attr(755,root,root) %config /etc/init.d/gammu-smsd
398 %config /etc/gammu-smsdrc
400 %files -n libGammu7
401 %defattr(-,root,root)
402 %_libdir/libGammu*.so.*
403 %_datadir/gammu/
405 %files -n libgsmsd7
406 %defattr(-,root,root)
407 %_libdir/libgsmsd*.so.*
409 %files devel
410 %defattr(-,root,root)
411 %_includedir/%name
412 %_libdir/pkgconfig/%name.pc
413 %_libdir/pkgconfig/%name-smsd.pc
414 %_libdir/*.so
416 %files -n python-gammu
417 %defattr(-,root,root)
418 %doc README.Python python/examples
419 %g_python_sitearch/*
421 %clean
422 rm -rf %buildroot
424 %changelog
425 * Fri Apr 3 2009 Michal Čihař <michal@cihar.com> - 1.23.93-1
426 - do not define own %%version, %%name, %%rel
427 - always use pkgconfig, pkg-config provides it
428 - do not delete build root on SUSE
429 - fix some package names (DBI and libusb) for Fedora
430 - drop support for Fedora 8
432 * Thu Jan 22 2009 Michal Čihař <michal@cihar.com> - 1.21.91-1
433 - merged python-gammu packaging as upstream merged the code
435 * Fri Oct 24 2008 Michal Čihař <michal@cihar.com> - 1.21.0-1
436 - fixed according to Fedora policy
438 * Wed Oct 8 2008 Michal Cihar <michal@cihar.com>
439 - do not remove build root in %%install
440 - move make test to %%check
442 * Tue Oct 7 2008 Michal Cihar <michal@cihar.com>
443 - use find_lang macro
445 * Thu Mar 28 2007 Michal Cihar <michal@cihar.com>
446 - update to current code status
448 * Thu Jan 6 2005 Michal Cihar <michal@cihar.com>
449 - add support for Mandrake, thanks to Olivier BERTEN <Olivier.Berten@advalvas.be> for testing
450 - use new disable-bluetooth
452 * Wed Nov 12 2003 Michal Cihar <michal@cihar.com>
453 - distiguish between packaging on SUSE and Redhat
454 - build depends on bluez if wanted
456 * Mon Nov 10 2003 Peter Soos <sp@osb.hu>
457 - using rpm macros where is possible
458 - added ldconfig to post/postun
460 * Mon Nov 03 2003 Michal Cihar <michal@cihar.com>
461 - split devel package
463 * Thu Jan 02 2003 Michal Cihar <michal@cihar.com>
464 - made it install in directories that are defined in rpm
466 * Sun Nov 10 2002 Marcin Wiacek <marcin@mwiacek.com>
467 - topnet.pl email no more available
469 * Sun Sep 30 2002 Marcin Wiacek <marcin-wiacek@topnet.pl>
470 - build system is now really working OK
472 * Sat Sep 15 2002 R P Herrold <herrold@owlriver.com>
473 - initial packaging