Source1: %{name}.init
Source2: %{name}.sysconfig
Source3: %{name}.tmpfiles
-Source5: %{name}.logrotate
+Source4: %{name}.logrotate
+Source5: %{name}.service
# menuselect.* -> make menuconfig; choose options; copy resulting files here
-Source12: menuselect.makedeps
-Source13: menuselect.makeopts
+Source6: menuselect.makedeps
+Source7: menuselect.makeopts
Patch0: mxml-system.patch
Patch1: lua51-path.patch
Patch2: %{name}-lib.patch
BuildRequires: ptlib-devel
%endif
%{?with_radius:BuildRequires: radiusclient-ng-devel}
-BuildRequires: rpmbuild(macros) >= 1.583
+BuildRequires: rpmbuild(macros) >= 1.671
BuildRequires: sed >= 4.0
BuildRequires: spandsp-devel >= 0.0.5
BuildRequires: speex-devel
%{?with_sqlite2:BuildRequires: sqlite-devel}
BuildRequires: sqlite3-devel
BuildRequires: srtp-devel
+Requires(post,preun,postun): systemd-units >= 38
+Requires: systemd-units >= 0.38
%{?with_odbc:BuildRequires: unixODBC-devel}
BuildRequires: uriparser-devel
%{?with_ilbc:BuildRequires: webrtc-libilbc-devel}
%{__make} menuselect/menuselect
%{__make} menuselect-tree
-cp %{SOURCE12} .
-cp %{SOURCE13} .
+cp %{SOURCE6} .
+cp %{SOURCE7} .
%if %{without h323}
menuselect/menuselect --disable chan_ooh323 --disable chan_h323 menuselect.makeopts
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}} \
- $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
+ $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir},%{_mandir}/man1}
export ASTCFLAGS="%{rpmcflags}"
install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
-install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
+install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
# create some directories that need to be packaged
install -d $RPM_BUILD_ROOT%{_datadir}/asterisk/moh
install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/asterisk/outgoing
install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/asterisk/uploads
+install utils/astman.1 $RPM_BUILD_ROOT%{_mandir}/man1/astman.1
+
# We're not going to package any of the sample AGI scripts
rm -f $RPM_BUILD_ROOT%{_datadir}/asterisk/agi-bin/*
%endif
# remove configuration files for components never built
-rm $RPM_BUILD_ROOT%{_sysconfdir}/asterisk/{acl,app_mysql,app_skel,cdr_mysql,config_test,misdn,test_sorcery}.conf
+rm $RPM_BUILD_ROOT%{_sysconfdir}/asterisk/{app_mysql,app_skel,cdr_mysql,config_test,misdn,test_sorcery}.conf
# remove configuration files for disabled optional components
%if %{without corosync}
%userremove asterisk
%groupremove asterisk
fi
+%systemd_reload
%post
/sbin/chkconfig --add asterisk
# use -n (NOOP) as restart would be breaking all current calls.
%service -n asterisk restart "Asterisk daemon"
+%systemd_post %{name}.service
%preun
if [ "$1" = "0" ]; then
%service asterisk stop
/sbin/chkconfig --del asterisk
fi
+%systemd_preun %{name}.service
%triggerpostun -- %{name} < 1.6.1.12-0.1
# chown to asterisk previously root owned files
chown -R asterisk:asterisk /var/spool/asterisk
chown -R asterisk:asterisk /var/lib/asterisk
+%triggerpostun -- %{name} < 12.0.0
+%systemd_trigger %{name}.service
+
%files
%defattr(644,root,root,755)
%doc README *.txt ChangeLog BUGS CREDITS configs
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%{systemdunitdir}/%{name}.service
%attr(750,root,asterisk) %dir %{_sysconfdir}/asterisk
+%attr(640,root,asterisk) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/acl.conf
%attr(640,root,asterisk) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/adsi.conf
%attr(640,root,asterisk) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/agents.conf
%attr(640,root,asterisk) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/alarmreceiver.conf
%attr(755,root,root) %{_libdir}/asterisk/modules/res_timing_pthread.so
%attr(755,root,root) %{_libdir}/asterisk/modules/res_timing_timerfd.so
%attr(755,root,root) %{_libdir}/asterisk/modules/res_statsd.so
-/usr/lib/tmpfiles.d/%{name}.conf
+%{systemdtmpfilesdir}/%{name}.conf
%dir %{_datadir}/asterisk
%dir %{_datadir}/asterisk/agi-bin
%doc doc/api/*
%endif
+%files astman
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/astman
+%{_mandir}/man1/astman.1*
+
%files alsa
%defattr(644,root,root,755)
%attr(640,root,asterisk) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/alsa.conf