]> git.pld-linux.org Git - packages/asterisk.git/blobdiff - asterisk.spec
package the acl.conf file
[packages/asterisk.git] / asterisk.spec
index c6bba2b1848b8f66b8c5cecad95c2cbc7ce7aa2d..75e7513c51344e9b5684ee8e61ea3a43bdf1c300 100644 (file)
@@ -35,10 +35,11 @@ Source0:    http://downloads.digium.com/pub/asterisk/releases/%{name}-%{version}.ta
 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
@@ -101,13 +102,15 @@ BuildRequires:    popt-devel
 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}
@@ -605,8 +608,8 @@ cp -f .cleancount .lastclean
 %{__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
@@ -707,7 +710,7 @@ touch apps/app_voicemail.so
 %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}"
 
@@ -738,9 +741,10 @@ install -D -p apps/app_voicemail_plain.so $RPM_BUILD_ROOT%{_libdir}/asterisk/mod
 
 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
@@ -754,6 +758,8 @@ install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/asterisk/monitor
 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/*
 
@@ -778,7 +784,7 @@ find doc/api -name '*.map' -size 0 -delete
 %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}
@@ -833,17 +839,20 @@ if [ "$1" = 0 ]; then
        %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
@@ -852,6 +861,9 @@ fi
 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
@@ -873,8 +885,10 @@ chown -R asterisk:asterisk /var/lib/asterisk
 %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
@@ -1137,7 +1151,7 @@ chown -R asterisk:asterisk /var/lib/asterisk
 %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
@@ -1190,6 +1204,11 @@ chown -R asterisk:asterisk /var/lib/asterisk
 %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
This page took 0.032775 seconds and 4 git commands to generate.