A new user interface for you! Read more...

File asterisk.spec of Package asterisk

Name: asterisk
Version: 13.21.1
Release: 1
Summary: Asterisk PBX
Group: System/Base
License: GPL
URL: http://www.asterisk.org
Source0: %{name}-%{version}.tar.gz
Source1: menuselect.makeopts
Source2: asterisk.service
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: ncurses-devel
BuildRequires: libgsm-devel
BuildRequires: gcc-c++
BuildRequires: openldap2-devel
BuildRequires: net-snmp-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(bluez)
BuildRequires: pkgconfig(iksemel)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libical)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(libusb)
BuildRequires: pkgconfig(libnewt)
BuildRequires: pkgconfig(neon)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(speexdsp)
BuildRequires: pkgconfig(spandsp)
BuildRequires: pkgconfig(gmime-2.6)
BuildRequires: pkgconfig(jansson)
BuildRequires: pkgconfig(libsrtp)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: wget
Requires(pre): /usr/sbin/useradd
Requires(pre): /usr/sbin/groupadd

%description
%{summary}.

%files
%defattr(-,root,root,-)
%{_unitdir}/%{name}*.service
%dir %{_sysconfdir}/asterisk
%config(noreplace) %{_sysconfdir}/asterisk/*
%{_sbindir}/*
%dir %{_libdir}/asterisk
%dir %{_libdir}/asterisk/modules
%{_libdir}/asterisk/modules/*.so
%{_libdir}/*.so.*
/var/lib/asterisk
%{_datadir}/man/man8/*
%attr(0750,asterisk,asterisk) %dir %{_localstatedir}/lib/%{name}
%attr(0750,asterisk,asterisk) %dir %{_localstatedir}/spool/%{name}
%attr(0750,asterisk,asterisk) %dir %{_localstatedir}/log/%{name}
%{_localstatedir}/spool/%{name}/*


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.

%files devel
%defattr(-,root,root,-)
%{_includedir}/asterisk.h
%{_includedir}/asterisk/
%{_libdir}/*.so


%prep
%setup -q
##cp %{SOURCE1} .


%build
./bootstrap.sh
%configure --with-uuid
sed -i 's/^NATIVE_ARCH=$/NATIVE_ARCH=0/' build_tools/menuselect-deps
cat build_tools/menuselect-deps
make menuselect.makeopts
menuselect/menuselect \
    --enable chan_ooh323 \
    --enable chan_mgcp \
    --enable app_meetme \
    --enable app_mysql \
    --enable res_config_mysql \
    --enable res_statsd \
    --enable cdr_mysql \
    --enable aelparse \
    --enable astman \
    --enable check_expr \
    --enable check_expr2 \
    --enable conf2ael \
    --enable muted \
    --enable smsq \
    --enable stereorize \
    --enable streamplayer \
    --disable BUILD_NATIVE \
    menuselect.makeopts
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} samples
install -d -m 755 %{buildroot}/%{_localstatedir}/lib/%{name}
install -d -m 755 %{buildroot}/%{_localstatedir}/spool/%{name}
install -d -m 755 %{buildroot}/%{_localstatedir}/log/%{name}
install -d -m 755 %{buildroot}/%{_localstatedir}/run/%{name}
%fdupes %{buildroot}/%{_libdir}
%fdupes %{buildroot}/%{_includedir}
%fdupes %{buildroot}/var/lib/asterisk
install -D -m644 %{SOURCE2} %{buildroot}/%{_unitdir}/asterisk.service
install -D -m644 menuselect.makeopts %{buildroot}/%{_sysconfdir}/%{name}/
cat menuselect.makeopts


%post
/sbin/ldconfig ||:
mkdir -p -m 0750 %{_localstatedir}/run/%{name}
chown asterisk:asterisk %{_localstatedir}/run/%{name}


%postun -p /sbin/ldconfig

%pre
/usr/sbin/groupadd -f -r asterisk||:
/usr/sbin/useradd -s /bin/nologin -M -r -d /var/lib/asterisk -c "Asterisk" -g asterisk asterisk ||: