File asterisk-chan-dongle.spec of Package asterisk-chan-dongle
%define realname asterisk-chan-dongle
%define srcext tar.bz2
%define mod_dir %{_libdir}/asterisk/modules
# Common info
Name: %{realname}
Version: 1.1.r14
Release: wiz%{?extraver:0.}1
License: GPL-2.0
Group: Productivity/Telephony/Servers
URL: http://code.google.com/p/asterisk-chan-dongle
Summary: Asterisk's huawei 3g dongle channel driver
# Install-time parameters
Provides: chan-dongle chan_dongle asterisk-chan_dongle
Requires: asterisk
# Build-time parameters
BuildRequires: autoconf automake libtool
BuildRequires: asterisk-devel
BuildRequires: sqlite%{?suse_version:3}-devel
BuildRoot: %{_tmppath}/%{name}-root
Source: %{realname}-%{version}.%{srcext}
%description
This channel driver should work with the folowing UMTS cards:
* Huawei K3715
* Huawei E169 / K3520
* Huawei E155X
* Huawei E175X
* Huawei K3765
Before using the channel driver make sure to:
* Disable PIN code on your SIM card
Supported features:
* Place voice calls and terminate voice calls
* Send SMS and receive SMS
* Send and receive USSD commands / messages
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}
if [ ! -f configure ]; then
if [ -x bootstrap ]; then
./bootstrap
elif [ -f configure.ac ]; then
autoreconf --force --install
else
libtoolize --force --install
aclocal
autoheader
autoconf
fi
fi
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
--disable-static \
--enable-manager \
--enable-apps \
--with-astversion=%(rpm -q --qf %%{version} asterisk-devel) \
DESTDIR=%{mod_dir} \
CFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}
%install
%{__install} -d -m755 %{buildroot}%{mod_dir}
%{__install} -m755 chan_dongle.so %{buildroot}%{mod_dir}/chan_dongle.so
%{__install} -d -m755 %{buildroot}%{_sysconfdir}/asterisk
%{__install} -m644 etc/dongle.conf %{buildroot}%{_sysconfdir}/asterisk/dongle.conf
%{__install} -m644 etc/extensions.conf %{buildroot}%{_sysconfdir}/asterisk/extensions.conf.dongle
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc *.txt BUGS etc
%config(noreplace) %{_sysconfdir}/asterisk/dongle.conf
%config(noreplace) %{_sysconfdir}/asterisk/extensions.conf.dongle
%{mod_dir}/chan_dongle.so
%changelog