"Fossies" - the Fresh Open Source Software Archive 
Member "gammu-1.42.0/gammu.spec" (3 Oct 2020, 11891 Bytes) of package /linux/privat/gammu-1.42.0.tar.bz2:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) RPM Spec source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "gammu.spec":
1.41.0_vs_1.42.0.
1 #
2 # spec file for package gammu
3 #
4
5
6 %define so_ver 8
7
8 # Change if using tar.gz or tar.bz2 sources
9 %define extension xz
10
11 Name: gammu
12 Version: 1.42.0
13 Release: 0
14 Summary: Mobile phone management utility
15 License: GPL-2.0
16 %if 0%{?suse_version}
17 Group: Hardware/Mobile
18 %else
19 Group: Applications/Communications
20 %endif
21 Url: https://wammu.eu/gammu/
22 Source0: https://dl.cihar.com/gammu/releases/%{name}-%{version}.tar.%{extension}
23
24 # Set to 0 to disable PostgreSQL support
25 %define pqsql 1
26 # Set to 0 to disable MySQL support
27 %define mysql 1
28 # Set to 0 to disable DBI support
29 %define dbi 1
30 # Set to 0 to disable ODBC support
31 %define odbc 1
32 # Set to 0 to disable USB support
33 %define usb 1
34 # Set to 0 to disable bluetooth support
35 %if 0%{?opensuse_bs} && 0%{?sles_version} == 9
36 %define bluetooth 0
37 %else
38 %define bluetooth 1
39 %endif
40 # Docdir
41 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
42 %define gammu_docdir %{_docdir}/%{name}-%{version}
43 %else
44 %define gammu_docdir %{_docdir}/%{name}
45 %endif
46 # Detect build requires
47 # SUSE
48 %if 0%{?suse_version}
49 %define dist_usb_libs libusb-1_0-devel
50 %define dist_dbi_libs libdbi-devel libdbi-drivers-dbd-sqlite3 sqlite3
51 %define dist_bluez_libs bluez-devel
52 %define dist_postgres_libs postgresql-devel
53 %else
54 # Mandriva
55 %if 0%{?mandriva_version}
56 # 64-bit Mandriva has 64 in package name
57 %ifarch x86_64
58 %define mandriva_hack 64
59 %endif
60 %if 0%{?mandriva_version} > 200910
61 %define dist_usb_libs lib%{?mandriva_hack}usb1.0-devel
62 %else
63 %define dist_usb_libs lib%{?mandriva_hack}usb-devel
64 %endif
65 %if 0%{?mandriva_version} > 2010
66 %define dist_dbi_libs lib%{?mandriva_hack}dbi-devel libdbi-drivers-dbd-sqlite3 sqlite3-tools
67 %endif
68 %define dist_bluez_libs lib%{?mandriva_hack}bluez-devel
69 # postgresql-devel does not work for whatever reason in buildservice
70 %if 0%{?mandriva_version} == 2009
71 %define dist_postgres_libs postgresql8.3-devel
72 %else
73 %define dist_postgres_libs postgresql-devel
74 %endif
75 %else
76 # Fedora / Redhat / Centos
77 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel} || 0%{?scilin_version}
78 %if 0%{?fedora_version} || 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 || 0%{?scilin_version} >= 700
79 %define dist_usb_libs libusbx-devel
80 %else
81 %define dist_usb_libs libusb1-devel
82 %endif
83 %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite
84 %define dist_bluez_libs bluez-libs-devel >= 2.0
85 %define dist_postgres_libs postgresql-devel
86 %else
87 # Defaults for not known distributions
88 %define dist_usb_libs libusb1-devel
89 %define dist_dbi_libs libdbi-devel libdbi-dbd-sqlite sqlite
90 %define dist_bluez_libs bluez-libs-devel >= 2.0
91 %define dist_postgres_libs postgresql-devel
92 %endif
93 %endif
94 %endif
95 BuildRequires: cmake >= 3.0
96 BuildRequires: gcc
97 BuildRequires: gettext
98 BuildRequires: pkgconfig
99 BuildRoot: %{_tmppath}/%{name}-%{version}-build
100 %if %{bluetooth}
101 BuildRequires: %{dist_bluez_libs}
102 %endif
103 %if %{pqsql}
104 BuildRequires: %{dist_postgres_libs}
105 %endif
106 %if %{mysql}
107 BuildRequires: mysql-devel
108 %endif
109 %if %{dbi}
110 BuildRequires: %{dist_dbi_libs}
111 %endif
112 %if %{odbc}
113 BuildRequires: unixODBC-devel
114 %endif
115 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
116 BuildRequires: glib2-devel
117 BuildRequires: libgudev1-devel
118 %else
119 %if 0%{?mandriva_version}
120 BuildRequires: glib2-devel
121 BuildRequires: libgudev1.0-devel
122 %else
123 BuildRequires: glib2-devel
124 BuildRequires: libgudev-1_0-devel
125 %endif
126 %endif
127 %if 0%{?suse_version} > 1310 || 0%{?fedora_version} >= 15 || 0%{?centos_version} >= 700 || 0%{?rhel_version} >= 700 || 0%{?scientificlinux_version} >= 600
128 BuildRequires: systemd
129 %endif
130 %if 0%{?centos_version} || 0%{?rhel_version} || 0%{?rhel} || 0%{?suse_version} < 1100
131 BuildRequires: curl-devel
132 %else
133 BuildRequires: libcurl-devel
134 %endif
135 %if %{usb}
136 BuildRequires: %{dist_usb_libs}
137 %endif
138
139 %description
140 Gammu is command line utility and library to work with mobile phones
141 from many vendors. Support for different models differs, but basic
142 functions should work with majority of them. Program can work with
143 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
144 integrated radio, camera, etc. It also supports daemon mode to send and
145 receive SMSes.
146
147 Currently supported phones include:
148
149 * Many Nokia models.
150 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
151 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
152 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
153 * Symbian phones through gnapplet.
154
155 This package contains Gammu binary as well as some examples.
156
157 %package devel
158 Summary: Development files for Gammu
159 %if 0%{?suse_version}
160 Group: Development/Libraries/C and C++
161 %else
162 Group: Development/Libraries
163 %endif
164 Requires: libGammu%{so_ver} = %{version}
165 Requires: libgsmsd%{so_ver} = %{version}
166
167 %description devel
168 Gammu is command line utility and library to work with mobile phones
169 from many vendors. Support for different models differs, but basic
170 functions should work with majority of them. Program can work with
171 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
172 integrated radio, camera, etc. It also supports daemon mode to send and
173 receive SMSes.
174
175 Currently supported phones include:
176
177 * Many Nokia models.
178 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
179 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
180 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
181 * Symbian phones through gnapplet.
182
183 This package contain files needed for development.
184
185 %package smsd
186 Summary: SMS message daemon
187 %if 0%{?suse_version}
188 # FIXME: use proper Requires(pre/post/preun/...)
189 PreReq: %insserv_prereq %fillup_prereq
190 %endif
191 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
192 Requires(post): chkconfig
193 Requires(preun): chkconfig
194 Requires(preun): initscripts
195 %endif
196 %if 0%{?suse_version}
197 Group: Hardware/Mobile
198 %else
199 Group: Applications/Communications
200 %endif
201
202 %description smsd
203 Gammu is command line utility and library to work with mobile phones
204 from many vendors. Support for different models differs, but basic
205 functions should work with majority of them. Program can work with
206 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
207 integrated radio, camera, etc. It also supports daemon mode to send and
208 receive SMSes.
209
210 Currently supported phones include:
211
212 * Many Nokia models.
213 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
214 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
215 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
216 * Symbian phones through gnapplet.
217
218 This package contains the Gammu SMS Daemon and tool to inject messages
219 into the queue.
220
221 %package -n libGammu%{so_ver}
222 Summary: Mobile phone management library
223 Group: System/Libraries
224
225 %description -n libGammu%{so_ver}
226 Gammu is command line utility and library to work with mobile phones
227 from many vendors. Support for different models differs, but basic
228 functions should work with majority of them. Program can work with
229 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
230 integrated radio, camera, etc. It also supports daemon mode to send and
231 receive SMSes.
232
233 Currently supported phones include:
234
235 * Many Nokia models.
236 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
237 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
238 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
239 * Symbian phones through gnapplet.
240
241 This package contains the Gammu shared library.
242
243 %package -n libgsmsd%{so_ver}
244 Summary: SMS daemon helper library
245 Group: System/Libraries
246
247 %description -n libgsmsd%{so_ver}
248 Gammu is command line utility and library to work with mobile phones
249 from many vendors. Support for different models differs, but basic
250 functions should work with majority of them. Program can work with
251 contacts, messages (SMS, EMS and MMS), calendar, todos, filesystem,
252 integrated radio, camera, etc. It also supports daemon mode to send and
253 receive SMSes.
254
255 Currently supported phones include:
256
257 * Many Nokia models.
258 * Alcatel BE5 (501/701), BF5 (715), BH4 (535/735).
259 * AT capable phones (Siemens, Nokia, Alcatel, IPAQ).
260 * OBEX and IrMC capable phones (Sony-Ericsson, Motorola).
261 * Symbian phones through gnapplet.
262
263 This package contains the Gammu SMS daemon shared library.
264
265 %prep
266 %setup -q
267
268 %build
269 mkdir build
270 cd build
271 export CFLAGS="%{optflags}"
272 export CXXFLAGS="%{optflags}"
273 cmake ../ \
274 -DBUILD_SHARED_LIBS=ON \
275 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
276 -DINSTALL_DOC_DIR=%{gammu_docdir} \
277 -DINSTALL_LIB_DIR=%{_lib} \
278 -DINSTALL_LIBDATA_DIR=%{_lib} \
279 -DINSTALL_LSB_INIT=ON \
280 -DINSTALL_UDEV_RULES=ON \
281 -DSYSTEMD_FOUND=ON \
282 -DWITH_SYSTEMD=ON
283 make %{?_smp_mflags} VERBOSE=1
284
285 %check
286 cd build
287 ctest -V
288 cd ..
289
290 %install
291 make -C build install DESTDIR=%{buildroot}
292
293 # Install config file
294 install -pm 0644 docs/config/smsdrc %{buildroot}%{_sysconfdir}/gammu-smsdrc
295
296 # Move init script to correct location
297 if [ /etc/init.d != %{_initddir} ] ; then
298 install -d -m 0755 %{buildroot}%{_initddir}
299 mv %{buildroot}/etc/init.d/gammu-smsd %{buildroot}%{_initddir}
300 fi
301
302 %find_lang %{name}
303 %find_lang libgammu
304
305 %post -n libGammu%{so_ver} -p /sbin/ldconfig
306
307 %postun -n libGammu%{so_ver} -p /sbin/ldconfig
308
309 %post -n libgsmsd%{so_ver} -p /sbin/ldconfig
310
311 %postun -n libgsmsd%{so_ver} -p /sbin/ldconfig
312
313 %post smsd
314 %if 0%{?mandriva_version}
315 %{_post_service} gammu-smsd
316 %endif
317 %if 0%{?suse_version}
318 %fillup_and_insserv gammu-smsd
319 %endif
320 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
321 /sbin/chkconfig --add gammu-smsd
322 %endif
323
324 %preun smsd
325 %if 0%{?suse_version}
326 %stop_on_removal gammu-smsd
327 %endif
328 %if 0%{?mandriva_version}
329 %{_preun_service} gammu-smsd
330 %endif
331 %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
332 if [ $1 = 0 ] ; then
333 /sbin/service gammu-smsd stop >/dev/null 2>&1
334 /sbin/chkconfig --del gammu-smsd
335 fi
336 %endif
337
338
339 %postun smsd
340 %if 0%{?suse_version}
341 %restart_on_update gammu-smsd
342 %insserv_cleanup
343 %endif
344
345
346 %files -f %{name}.lang
347 %defattr(-,root,root,-)
348 %config %{_sysconfdir}/bash_completion.d/gammu
349 %{_bindir}/gammu
350 %{_bindir}/gammu-config
351 %{_bindir}/gammu-detect
352 %{_bindir}/jadmaker
353 %doc %{gammu_docdir}
354 %doc %{_mandir}/man1/gammu-config.1*
355 %doc %{_mandir}/man1/gammu-detect.1*
356 %doc %{_mandir}/man1/gammu.1*
357 %doc %{_mandir}/man1/jadmaker.1*
358 %doc %{_mandir}/man5/gammu-backup.5*
359 %doc %{_mandir}/man5/gammu-smsbackup.5*
360 %doc %{_mandir}/man5/gammurc.5*
361
362 %files devel
363 %defattr(-,root,root,-)
364 %{_includedir}/gammu/
365 %{_libdir}/*.so
366 %{_libdir}/pkgconfig/gammu-smsd.pc
367 %{_libdir}/pkgconfig/gammu.pc
368
369 %files smsd
370 %defattr(-,root,root)
371 %attr(755,root,root) %config %{_initddir}/gammu-smsd
372 %config %{_sysconfdir}/gammu-smsdrc
373 %{_bindir}/gammu-smsd
374 %{_bindir}/gammu-smsd-inject
375 %{_bindir}/gammu-smsd-monitor
376 %doc %{_mandir}/man1/gammu-smsd-inject.1*
377 %doc %{_mandir}/man1/gammu-smsd-monitor.1*
378 %doc %{_mandir}/man1/gammu-smsd.1*
379 %doc %{_mandir}/man5/gammu-smsdrc.5*
380 %doc %{_mandir}/man7/gammu-smsd-dbi.7*
381 %doc %{_mandir}/man7/gammu-smsd-files.7*
382 %doc %{_mandir}/man7/gammu-smsd-mysql.7*
383 %doc %{_mandir}/man7/gammu-smsd-null.7*
384 %doc %{_mandir}/man7/gammu-smsd-odbc.7*
385 %doc %{_mandir}/man7/gammu-smsd-pgsql.7*
386 %doc %{_mandir}/man7/gammu-smsd-run.7*
387 %doc %{_mandir}/man7/gammu-smsd-sql.7*
388 %doc %{_mandir}/man7/gammu-smsd-tables.7*
389 %dir %{_libexecdir}/systemd
390 %dir %{_libexecdir}/systemd/system
391 %{_libexecdir}/systemd/system/gammu-smsd.service
392
393 %files -n libGammu%{so_ver} -f libgammu.lang
394 %defattr(-,root,root,-)
395 %{_libdir}/libGammu.so.%{so_ver}*
396 %{_datadir}/gammu/
397 %dir /etc/udev
398 %dir /etc/udev/rules.d
399 /etc/udev/rules.d/69-gammu-acl.rules
400
401 %files -n libgsmsd%{so_ver}
402 %defattr(-,root,root,-)
403 %{_libdir}/libgsmsd.so.%{so_ver}*
404
405 %changelog