# # spec file for package gammu # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: gammu Version: 1.30.0 Release: 1 Summary: Mobile phone management utility License: GPLv2 Url: http://wammu.eu/gammu/ Group: Productivity/Telephony/Utilities Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 # PATCH-FIX-OPENSUSE gammu-smsd.lsb.patch asterios.dramis@gmail.com -- Fix rpmlint warnings "unknown-lsb-keyword" and "init-script-runlevel-4" Patch0: gammu-smsd.lsb.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Python location %{!?__python: %define __python python} %define g_python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define g_python_major_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0][:3]') # Docdir %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} %define gammu_docdir %{_docdir}/%{name}-%{version} %else %define gammu_docdir %{_docdir}/%{name} %endif # Detect build requires # SUSE %if 0%{?suse_version} %define dist_usb_libs libusb-1_0-devel %define dist_dbi_libs libdbi-devel libdbi-drivers-dbd-sqlite3 sqlite3 %define dist_bluez_libs bluez-devel %define dist_postgres_libs postgresql-devel %else # Mandriva %if 0%{?mandriva_version} %define dist_usb_libs libusb1.0-devel %define dist_dbi_libs libdbi-devel libdbi-drivers-dbd-sqlite3 sqlite3-tools # 64-bit Mandriva has 64 in package name %ifarch x86_64 %define mandriva_hack 64 %endif # Bluetooth things got renamed several times %if 0%{?mandriva_version} > 2007 %define dist_bluez_libs lib%{?mandriva_hack}bluez-devel %else %if 0%{?mandriva_version} > 2006 %define dist_bluez_libs lib%{?mandriva_hack}bluez2-devel %else %define dist_bluez_libs libbluez1-devel >= 2.0 %endif %endif # postgresql-devel does not work for whatever reason in buildservice %if 0%{?mandriva_version} == 2009 %define dist_postgres_libs postgresql8.3-devel %else %define dist_postgres_libs postgresql-devel %endif %else # Fedora / Redhat / Centos %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} %define dist_usb_libs libusb1-devel %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite %define dist_bluez_libs bluez-libs-devel >= 2.0 %define dist_postgres_libs postgresql-devel %else #Defaults for not known distributions %define dist_usb_libs libusb1-devel %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite %define dist_bluez_libs bluez-libs-devel >= 2.0 %define dist_postgres_libs postgresql-devel %endif %endif %endif BuildRequires: cmake BuildRequires: doxygen BuildRequires: gettext BuildRequires: glib2-devel %if 0%{?centos_version} || 0%{?rhel_version} || 0%{?rhel} BuildRequires: curl-devel %else BuildRequires: libcurl-devel %endif %if 0%{?suse_version} > 1110 BuildRequires: libgudev-1_0-devel %endif BuildRequires: mysql-devel %if 0%{?suse_version} BuildRequires: pkg-config %else BuildRequires: pkgconfig %endif BuildRequires: python-devel BuildRequires: unixODBC-devel BuildRequires: %{dist_bluez_libs} %if 0%{?suse_version} > 1130 BuildRequires: %{dist_dbi_libs} %endif BuildRequires: %{dist_postgres_libs} BuildRequires: %{dist_usb_libs} Requires: bluez Requires: dialog %description Gammu is command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic functions should work with majority of them. Program can work with contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem, integrated radio, camera, etc. It also supports daemon mode to send and receive SMSes. Currently supported phones include: * Many Nokia models. * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735). * AT capable phones (Siemens, Nokia, Alcatel, IPAQ). * OBEX and IrMC capable phones (Sony-Ericsson, Motorola). * Symbian phones through gnapplet. This package contains Gammu binary as well as some examples. %package devel Summary: Development files for Gammu License: GPLv2 Group: Development/Libraries/C and C++ %if 0%{?suse_version} Requires: pkg-config %else Requires: pkgconfig %endif Requires: %{name} = %{version} %description devel Gammu is command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic functions should work with majority of them. Program can work with contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem, integrated radio, camera, etc. It also supports daemon mode to send and receive SMSes. Currently supported phones include: * Many Nokia models. * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735). * AT capable phones (Siemens, Nokia, Alcatel, IPAQ). * OBEX and IrMC capable phones (Sony-Ericsson, Motorola). * Symbian phones through gnapplet. This package contain files needed for development. %package smsd Summary: SMS message daemon License: GPLv2 Group: Hardware/Mobile %if 0%{?suse_version} Requires(post): %insserv_prereq %fillup_prereq Requires(preun): %insserv_prereq %fillup_prereq Requires(postun): %insserv_prereq %fillup_prereq %endif %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts %endif %description smsd Gammu is command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic functions should work with majority of them. Program can work with contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem, integrated radio, camera, etc. It also supports daemon mode to send and receive SMSes. Currently supported phones include: * Many Nokia models. * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735). * AT capable phones (Siemens, Nokia, Alcatel, IPAQ). * OBEX and IrMC capable phones (Sony-Ericsson, Motorola). * Symbian phones through gnapplet. This package contains Gammu SMS Daemon and tool to inject messages into the queue. %package -n libGammu7 Summary: Mobile phone management library License: GPLv2 Group: System/Libraries %description -n libGammu7 Gammu is command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic functions should work with majority of them. Program can work with contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem, integrated radio, camera, etc. It also supports daemon mode to send and receive SMSes. Currently supported phones include: * Many Nokia models. * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735). * AT capable phones (Siemens, Nokia, Alcatel, IPAQ). * OBEX and IrMC capable phones (Sony-Ericsson, Motorola). * Symbian phones through gnapplet. This package contains Gammu shared library. %package -n libgsmsd7 Summary: SMS daemon helper library License: GPLv2 Group: System/Libraries %description -n libgsmsd7 Gammu is command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic functions should work with majority of them. Program can work with contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem, integrated radio, camera, etc. It also supports daemon mode to send and receive SMSes. Currently supported phones include: * Many Nokia models. * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735). * AT capable phones (Siemens, Nokia, Alcatel, IPAQ). * OBEX and IrMC capable phones (Sony-Ericsson, Motorola). * Symbian phones through gnapplet. This package contains Gammu SMS daemon shared library. %package -n python-gammu Summary: Python module to communicate with mobile phones License: GPLv2 Group: Development/Languages/Python Requires: python >= %{g_python_major_version} Requires: python < %{g_python_major_version}.99 %if 0%{?suse_version} < 1130 %{?py_requires} %endif %description -n python-gammu This provides gammu module, that can work with any phone Gammu supports - many Nokias, Siemens, Alcatel, ... %prep %setup -q %patch0 # Remove build time references - Fix rpmlint warning "file-contains-date-and-time" FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M') FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y') sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" gammu/gammu.c gammu-detect/main.c libgammu/gsmstate.c smsd/inject.c smsd/monitor.c smsd/main.c sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" gammu/gammu.c gammu-detect/main.c libgammu/gsmstate.c libgammu/phone/dummy/dummy.c smsd/inject.c smsd/monitor.c smsd/main.c # Change permissions - Fix rpmlint warning "doc-file-dependency" chmod 644 python/examples/*.py %build mkdir build cd build export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" cmake ../ \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_PYTHON=/usr/bin/python \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DINSTALL_DOC_DIR=%{gammu_docdir} \ -DINSTALL_LIB_DIR=%{_lib} \ -DINSTALL_LIBDATA_DIR=%{_lib} \ -DINSTALL_LSB_INIT=ON make %{?_smp_mflags} VERBOSE=1 cd .. %check #cd build #ctest -V #cd .. %install %if !0%{?suse_version} make -C build install DESTDIR=%{buildroot} %else cd build %makeinstall cd .. %endif # Change permissions - Fix rpmlint warning "non-executable-script" chmod 755 %{buildroot}%{_sysconfdir}/init.d/gammu-smsd # rc-symlink for gammu-smsd mkdir -p %{buildroot}%{_sbindir} ln -sf ../../etc/init.d/gammu-smsd %{buildroot}%{_sbindir}/rcgammu-smsd # Install config file install -p -m 0644 docs/config/smsdrc %{buildroot}%{_sysconfdir}/gammu-smsdrc # Install additional doc files install -p -m 0644 AUTHORS README.cs README.de README.en_GB README.es README.id README.pt_BR %{buildroot}%{gammu_docdir}/ # Remove unneeded locales %if 0%{?suse_version} && 0%{?suse_version} < 1140 rm -rf %{buildroot}%{_datadir}/locale/sw/ %endif %find_lang %{name} %find_lang libgammu %clean rm -rf %{buildroot} %post smsd %if 0%{?mandriva_version} %_post_service gammu-smsd %endif %if 0%{?suse_version} %fillup_and_insserv gammu-smsd %endif %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} /sbin/chkconfig --add gammu-smsd %endif %preun smsd %if 0%{?suse_version} %stop_on_removal gammu-smsd %endif %if 0%{?mandriva_version} %_preun_service gammu-smsd %endif %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} if [ $1 = 0 ] ; then /sbin/service gammu-smsd stop >/dev/null 2>&1 /sbin/chkconfig --del