setuid premissions for speech-dispatcher binary

This commit is contained in:
Hemant Goyal 2008-07-17 10:58:19 +00:00
parent d8d6103eb1
commit 9e0dfe2d49
2 changed files with 72 additions and 25 deletions

View File

@ -2,3 +2,4 @@ speech-dispatcher-0_6_6-13_fc7:HEAD:speech-dispatcher-0.6.6-13.fc7.src.rpm:12142
speech-dispatcher-0_6_6-14_fc7:HEAD:speech-dispatcher-0.6.6-14.fc7.src.rpm:1215968885
speech-dispatcher-0_6_6-14_fc7:HEAD:speech-dispatcher-0.6.6-14.fc7.src.rpm:1216180922
speech-dispatcher-0_6_6-16_fc7:HEAD:speech-dispatcher-0.6.6-16.fc7.src.rpm:1216181531
speech-dispatcher-0_6_6-17_fc7:HEAD:speech-dispatcher-0.6.6-17.fc7.src.rpm:1216292151

View File

@ -1,16 +1,18 @@
%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
%if 0%{?olpc}
%define with_nas 0
%define with_nas 0
%define with_pulse 0
%define with_flite 0
%else
%define with_nas 1
%define with_nas 1
%define with_pulse 1
%define with_flite 1
%endif
Name: speech-dispatcher
Version: 0.6.6
Release: 16%{?dist}
Release: 17%{?dist}
Summary: To provide a high-level device independent layer for speech synthesis
Group: System Environment/Libraries
@ -30,7 +32,10 @@ BuildRequires: python-setuptools-devel
BuildRequires: python-setuptools
%endif
%if %{with_flite}
BuildRequires: flite-devel
%endif
BuildRequires: espeak-devel
%if %{with_nas}
@ -101,7 +106,7 @@ cat << EOF
Build options:
nas support : %{with_nas}
pulse support : %{with_pulse}
flite support : %{with_flite}
Dist Status:
olpc : %{?olpc}
fedora : %{?fedora}
@ -133,17 +138,22 @@ chmod 0755 $RPM_BUILD_ROOT%{python_sitelib}/speechd/_test.py
cd ../../
for dir in \
config/ doc/ src/audio/ src/c/ src/modules/ src/tests/ src/server/
do
pushd $dir
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
popd
config/ doc/ src/audio/ src/c/ src/modules/ src/tests/ src/server/
do
pushd $dir
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
popd
done
#Install the init shell script
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -p -m 0755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/
# We need to include the OLPC specific init script which starts the daemon
# and uses the configuration files in /home/olpc/.speech-settings
%if 1%{?olpc}
install -p -m 0755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/
%endif
#Rename certain generically named binaries
@ -156,31 +166,60 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
cd ../../
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# Now move the files, change ownerships, apply setuid settings incase build is for
# olpc.
%if 0%{?olpc}
#Setuid for speech-dispatcher binary
chmod 6711 $RPM_BUILD_ROOT%{_bindir}/speech-dispatcher
#Move the speech-dispatcher configuration files to olpc writable location.
mkdir -p $RPM_BUILD_ROOT/home/olpc/.speechd
mv $RPM_BUILD_ROOT%{_sysconfdir}/speech-dispatcher/* $RPM_BUILD_ROOT/home/olpc/.speechd
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
/sbin/chkconfig --add speech-dispatcherd
%if 1%{?olpc}
/sbin/chkconfig --add speech-dispatcherd
%endif
%postun
/sbin/ldconfig
if [ "$1" -ge "1" ] ; then
/sbin/service speech-dispatcherd condrestart >/dev/null 2>&1 || :
fi
%if 1%{?olpc}
if [ "$1" -ge "1" ] ; then
/sbin/service speech-dispatcherd condrestart >/dev/null 2>&1 || :
fi
%endif
%preun
%if 1%{?olpc}
if [ $1 = 0 ] ; then
/sbin/service speech-dispatcherd stop >/dev/null 2>&1
/sbin/chkconfig --del speech-dispatcherd
/sbin/service speech-dispatcherd stop >/dev/null 2>&1
/sbin/chkconfig --del speech-dispatcherd
fi
%endif
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog NEWS README TODO COPYING
%if 0%{?olpc}
%config(noreplace) %attr(-,olpc,olpc) /home/olpc/.speechd/speechd.conf
%config(noreplace) %attr(-,olpc,olpc) /home/olpc/.speechd/clients/*.conf
%config(noreplace) %attr(-,olpc,olpc) /home/olpc/.speechd/modules/*.conf
%dir %attr(-,olpc,olpc) /home/olpc/.speechd/
%dir %attr(-,olpc,olpc) /home/olpc/.speechd/clients
%dir %attr(-,olpc,olpc) /home/olpc/.speechd/modules
%else
%config(noreplace) %{_sysconfdir}/speech-dispatcher/speechd.conf
%config(noreplace) %{_sysconfdir}/speech-dispatcher/clients/*.conf
%config(noreplace) %{_sysconfdir}/speech-dispatcher/modules/*.conf
@ -188,11 +227,10 @@ fi
%dir %{_sysconfdir}/speech-dispatcher/
%dir %{_sysconfdir}/speech-dispatcher/clients
%dir %{_sysconfdir}/speech-dispatcher/modules
%endif
%{_bindir}/*
%{_libdir}/speech-dispatcher-modules/sd_*
%dir %{_libdir}/speech-dispatcher-modules
@ -204,8 +242,9 @@ fi
%dir %{_libdir}/speech-dispatcher
%attr(0755,root,root)%{_initrddir}/speech-dispatcherd
%if 1%{?olpc}
%attr(0755,root,root)%{_initrddir}/speech-dispatcherd
%endif
%files devel
%defattr(-,root,root,-)
@ -226,10 +265,10 @@ fi
%preun doc
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/spd-say.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/ssip.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/%{name}-cs.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/spd-say.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/ssip.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/%{name}-cs.info %{_infodir}/dir || :
fi
@ -246,6 +285,13 @@ fi
%changelog
* Wed Jul 16 2008 Hemant Goyal <goyal.hemant@gmail.com> 0.6.6-17
- changing permissions of speech-dispatcher to 6711 (setuid and setguid)
- relocating configuration files in case of OLPC branch.
- excluding init script in case of OLPC branch.
* Wed Jul 16 2008 Hemant Goyal <goyal.hemant@gmail.com> 0.6.6-16
- yet another release bump required :-/