File asterisk.spec of Package asterisk

# spec file for package asterisk
# Copyright (c) 2016 SUSE LINUX 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

Name:           asterisk
Version:        16.15.1
Release:        0
Summary:        A free and open source framework for building communications applications
License:        GPL-2.0
Group:          Productivity/Telephony/Servers
Source1:        asterisk.systemd
Source2:        asterisk.sysconfig
Patch0:         asterisk.disable_arch_native.patch
Patch1:         asterisk.enablechathtml.patch
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libjansson-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libsrtp-devel
BuildRequires:  libuuid-devel
BuildRequires:  libxml2-devel
BuildRequires:  ncurses-devel
BuildRequires:  openldap2-devel
BuildRequires:  sqlite-devel
BuildRequires:  wget
BuildRequires:  alsa-devel
BuildRequires:  pjproject-devel
BuildRequires:  unixODBC-devel
BuildRequires:  libtool
# for >= 16.0.0
BuildRequires:  libedit-devel
BuildRequires:  libjansson-devel >= 2.11
Requires:       libjansson4 >= 2.11
Requires:       ncurses
Requires:       sqlite
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%package devel
Summary:        Development package for asterisk
Group:          Development/Libraries/C and C++

Asterisk is a free and open source framework for building communications applications and is sponsored by Digium.
Asterisk turns an ordinary computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference servers and is used by small businesses, large businesses, call centers, carriers and governments worldwide.

%description devel
Development package for asterisk. Asterisk is a free and open source framework.

%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1

%configure --with-ssl --without-pjproject-bundled
make all # %{?_smp_mflags}

# %{?_smp_mflags}
make DESTDIR=%{buildroot} install # %{?_smp_mflags}
make samples DESTDIR=%{?buildroot}

install -D -m 644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system/%{name}.service
%if 0%{?suse_version} < 1500
install -D -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
install -D -m 644 %{SOURCE2} %{buildroot}%{_fillupdir}/sysconfig.%{name}

ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}

%fdupes -s %{buildroot}

%doc ChangeLog COPYING
%if 0%{?suse_version} < 1500
%config(noreplace) %{_sysconfdir}/%{name}
%dir %{_localstatedir}/log/asterisk

%files devel

%service_add_pre %{name}.service

%{fillup_only asterisk}
%service_add_post %{name}.service

%service_del_preun %{name}.service

%service_del_postun %{name}.service

openSUSE Build Service is sponsored by