commit 71fd1f7c389e2fc743e314abf34cb40eda63735a Author: Nathanael D. Noblet <nathanael@xxxxxxx> Date: Tue Mar 1 08:51:36 2011 -0700 move web dir to /var/www dspam-web.conf | 40 +++++++++++++++++++++++++++------------- dspam.spec | 55 ++++++++++++++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 36 deletions(-) --- diff --git a/dspam-web.conf b/dspam-web.conf index 0cf00b9..e2d9274 100644 --- a/dspam-web.conf +++ b/dspam-web.conf @@ -1,16 +1,30 @@ # # Web-UI for DSPAM. # -Alias /dspam /usr/share/dspam-web -<Directory "/usr/share/dspam-web"> - AddHandler cgi-script .cgi - DirectoryIndex dspam.cgi - AllowOverride None - Options ExecCGI - Order allow,deny - Allow from all - AuthType Basic - AuthName "DSPAM WebUI login" - Require valid-user - #AuthUserFile /path/to/dspam-htpasswd -</Directory> +<VirtualHost *:8009> + ServerAdmin postmaster@localhost + DocumentRoot /var/www/dspam + SuexecUserGroup dspam dspam + Options Indexes FollowSymLinks ExecCGI + + # Given we are using Basic auth SSL would be handy. + # You can use the same cert:key pair Apache uses. + #SSLEngine on + #SSLCertificateFile /etc/pki/tls/certs/hostname.cert + #SSLCertificateKeyFile /etc/pki/tls/private/hostname.key + + <Directory "/var/www/dspam"> + AllowOverride None + Options -Indexes +ExecCGI + Order allow,deny + Allow from all + AuthType Basic + AuthName "DSPAM WebUI login" + AuthUserFile /var/www/dspam-passwd + Require valid-user + DirectoryIndex dspam.cgi + AddHandler cgi-script .cgi .pl + </Directory> + ErrorLog /var/log/httpd/dspam-webgui-error_log + CustomLog /var/log/httpd/dspam-webgui-access_log common +</VirtualHost> diff --git a/dspam.spec b/dspam.spec index e779612..d04fb5f 100644 --- a/dspam.spec +++ b/dspam.spec @@ -1,15 +1,17 @@ %global dspam_user dspam %global dspam_group mail +%global mail_group %{dspam_group} %global dspam_homedir %{_localstatedir}/lib/dspam %global dspam_confdir %{_sysconfdir} %global dspam_logdir %{_localstatedir}/log/dspam %global dspam_mode 2511 +%global dspam_web_docroot %{_localstatedir}/www/dspam %global __perl_requires %{SOURCE99} Summary: A library and Mail Delivery Agent for Bayesian SPAM filtering Name: dspam Version: 3.9.0 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2 Group: System Environment/Daemons Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -124,6 +126,7 @@ Summary: Web-based interface for DSPAM Group: System Environment/Daemons Requires: dspam = %{version}-%{release} Requires: webserver +Requires(post): initscripts %description web Web-based interface for DSPAM's powerful Anti-Spam engine. @@ -155,8 +158,8 @@ sh ./autogen.sh --with-storage-driver='hash_drv,mysql_drv,pgsql_drv,sqlite3_drv' \ --with-dspam-home='%{dspam_homedir}' \ --with-dspam-owner='%{dspam_user}' \ - --with-dspam-group='%{dspam_group}' \ - --with-dspam-home-group='%{dspam_group}' \ + --with-dspam-group='%{mail_group}' \ + --with-dspam-home-group='%{mail_group}' \ --with-dspam-mode='%{dspam_mode}' \ --with-logdir='%{dspam_logdir}' \ --sysconfdir='%{dspam_confdir}' @@ -173,14 +176,15 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" %{__install} -d -p -m 755 $RPM_BUILD_ROOT%{dspam_homedir}/opt-out/ %{__install} -d -p -m 775 $RPM_BUILD_ROOT%{dspam_homedir}/data/ %{__install} -d -p -m 755 $RPM_BUILD_ROOT%{dspam_logdir}/ +%{__install} -d -p -m 755 $RPM_BUILD_ROOT%{dspam_web_docroot}/ %{__install} -d -p -m 755 $RPM_BUILD_ROOT%{_var}/run/dspam/ %{__install} -Dp -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/dspam-front # webui - %{__install} -d -p -m 755 $RPM_BUILD_ROOT%{_datadir}/dspam-web/templates/ + %{__install} -d -p -m 755 $RPM_BUILD_ROOT%{dspam_web_docroot}/templates/ for foo in webui/cgi-bin/templates/?? do - [ -d "${foo}" ] && %{__install} -d p -m 755 $RPM_BUILD_ROOT%{_datadir}/dspam-web/templates/${foo##*\/} + [ -d "${foo}" ] && %{__install} -d p -m 755 $RPM_BUILD_ROOT%{dspam_web_docroot}/templates/${foo##*\/} done # remove .la and .a files @@ -236,21 +240,19 @@ echo "Scanned and tagged as non-SPAM with DSPAM %{version} by Your ISP.com"> $RP iconv -f iso8859-1 -t utf-8 CHANGELOG > CHANGELOG.conv && mv -f CHANGELOG.conv CHANGELOG # web -%{__install} -Dp -m0644 webui/htdocs/*.{css,gif} $RPM_BUILD_ROOT%{_datadir}/%{name}-web/ -%{__install} -Dp -m0644 webui/cgi-bin/templates/*.html $RPM_BUILD_ROOT%{_datadir}/%{name}-web/templates -%{__install} -Dp -m0755 webui/cgi-bin/templates/*.pl $RPM_BUILD_ROOT%{_datadir}/%{name}-web/templates -%{__install} -Dp -m0644 webui/cgi-bin/{admins,default.prefs,rgb.txt} $RPM_BUILD_ROOT%{_datadir}/%{name}-web/ +%{__install} -Dp -m0644 webui/htdocs/*.{js,css,gif} $RPM_BUILD_ROOT%{dspam_web_docroot}/ +%{__install} -Dp -m0644 webui/cgi-bin/templates/*.html $RPM_BUILD_ROOT%{dspam_web_docroot}/templates +%{__install} -Dp -m0755 webui/cgi-bin/templates/*.pl $RPM_BUILD_ROOT%{dspam_web_docroot}/templates +%{__install} -Dp -m0644 webui/cgi-bin/{admins,default.prefs,rgb.txt} $RPM_BUILD_ROOT%{dspam_web_docroot}/ -# setup configure.pl to by default expect the url to be /dspam so css and images load -%{__sed} -i -r -e '/CONFIG.*WEB_ROOT/s,"","/dspam",' webui/cgi-bin/configure.pl -%{__install} -Dp -m0755 webui/cgi-bin/{configure.pl,*.cgi} $RPM_BUILD_ROOT%{_datadir}/%{name}-web/ +%{__install} -Dp -m0755 webui/cgi-bin/{configure.pl,*.cgi} $RPM_BUILD_ROOT%{dspam_web_docroot}/ for foo in webui/cgi-bin/templates/?? do if [ -d "${foo}" ] then - %{__install} -Dp -m0644 ${foo}/*.html $RPM_BUILD_ROOT%{_datadir}/%{name}-web/templates/${foo##*\/} - [ -f ${foo}/*.pl ] && %{__install} -Dp -m0644 ${foo}/*.pl $RPM_BUILD_ROOT%{_datadir}/%{name}-web/templates/${foo##*\/} + %{__install} -Dp -m0644 ${foo}/*.html $RPM_BUILD_ROOT%{dspam_web_docroot}/templates/${foo##*\/} + [ -f ${foo}/*.pl ] && %{__install} -Dp -m0644 ${foo}/*.pl $RPM_BUILD_ROOT%{dspam_web_docroot}/templates/${foo##*\/} fi done %{__install} -Dp -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ @@ -273,34 +275,38 @@ if [ $1 -ge 1 ]; then fi %pre libs -getent passwd %{dspam_user} >/dev/null || useradd -r -g %{dspam_group} -d %{dspam_homedir} -s /sbin/nologin -c 'User to own dspam directories and default processes' %{dspam_user} +getent passwd %{dspam_user} >/dev/null || useradd -r -g %{mail_group} -d %{dspam_homedir} -s /sbin/nologin -c 'User to own dspam directories and default processes' %{dspam_user} exit 0 %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig +%post web +chown -R %{dspam_user}:%{dspam_user} %{dspam_web_docroot}/ +service httpd condrestart + %clean %{__rm} -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README CHANGELOG RELEASE.NOTES UPGRADING -%attr(0770,%{dspam_user},%{dspam_group}) %dir %{dspam_logdir} -%attr(0770,%{dspam_user},%{dspam_group}) %dir %{dspam_homedir} +%attr(0770,%{dspam_user},%{mail_group}) %dir %{dspam_logdir} +%attr(0770,%{dspam_user},%{mail_group}) %dir %{dspam_homedir} %dir %{dspam_homedir}/opt-in %dir %{dspam_homedir}/opt-out -%attr(0770,%{dspam_user},%{dspam_group}) %dir %{dspam_homedir}/data +%attr(0770,%{dspam_user},%{mail_group}) %dir %{dspam_homedir}/data %dir %{dspam_homedir}/txt/ %config(noreplace) %{dspam_homedir}/txt/* -%attr(0770,%{dspam_user},%{dspam_group}) %dir %{_var}/run/dspam +%attr(0770,%{dspam_user},%{mail_group}) %dir %{_var}/run/dspam %{_sysconfdir}/cron.daily/dspam %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/dspam %config(noreplace) %{_sysconfdir}/logrotate.d/dspam -%attr(0640,root,%{dspam_group}) %config(noreplace) %{dspam_confdir}/dspam.conf -%attr(0644,root,%{dspam_group}) %config(noreplace) %{dspam_confdir}/dspam.conf.default +%attr(0640,root,%{mail_group}) %config(noreplace) %{dspam_confdir}/dspam.conf +%attr(0644,root,%{mail_group}) %config(noreplace) %{dspam_confdir}/dspam.conf.default %{_initrddir}/dspam %{_mandir}/man1/* -%attr(%{dspam_mode},%{dspam_user},%{dspam_group}) %{_bindir}/dspam +%attr(%{dspam_mode},%{dspam_user},%{mail_group}) %{_bindir}/dspam %{_bindir}/dspam_2sql %{_bindir}/dspam_admin %{_bindir}/dspam_clean @@ -361,10 +367,13 @@ exit 0 %files web %defattr(-,root,root,-) -%{_datadir}/dspam-web/ +%attr(-, %{dspam_user}, %{dspam_user}) %{dspam_web_docroot}/ %config(noreplace) %{_sysconfdir}/httpd/conf.d/dspam-web.conf %changelog +* Tue Mar 1 2011 Nathanael Noblet <nathanael@xxxxxxx> - 3.9.0.-14 +- Applied Matej Cepl's patch to move the web dir to /var/www/dspam + * Wed Jan 26 2011 Nathanael Noblet <nathanael@xxxxxxx> - 3.9.0-13 - Fixed dspam-web cgi bug -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel