SPECS: dspam.spec - created -webui subpackage

glen glen at pld-linux.org
Sun May 7 15:50:29 CEST 2006


Author: glen                         Date: Sun May  7 13:50:29 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- created -webui subpackage

---- Files affected:
SPECS:
   dspam.spec (1.57 -> 1.58) 

---- Diffs:

================================================================
Index: SPECS/dspam.spec
diff -u SPECS/dspam.spec:1.57 SPECS/dspam.spec:1.58
--- SPECS/dspam.spec:1.57	Sun May  7 12:16:22 2006
+++ SPECS/dspam.spec	Sun May  7 15:50:24 2006
@@ -1,10 +1,8 @@
 # $Revision$, $Date$
-#
 # TODO:
 # - support for libdclassify
 # - oracle driver
-# - messages from default install of cron with mysql driver
-# Memory fault
+# - messages from default install of cron with mysql driver Memory fault
 #
 # Conditional build:
 %bcond_without	mysql	# disable MySQL storage driver
@@ -14,16 +12,19 @@
 %bcond_without	daemon	# disable daemon mode
 %bcond_with	mysql40 # use with mysql 4.0
 #
+%include	/usr/lib/rpm/macros.perl
 Summary:	A library and Mail Delivery Agent for Bayesian spam filtering
 Summary(pl):	Biblioteka i MDA do bayesowskiego filtrowania spamu
 Name:		dspam
 Version:	3.6.5
-Release:	0.1
+Release:	0.14
 License:	GPL
 Group:		Applications/Mail
 Source0:	http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
 # Source0-md5:	da4f0e00633bff49d71fde418caaf14b
+Patch0:		%{name}-webui.patch
 Source1:	%{name}.init
+Source2:	%{name}-apache.conf
 URL:		http://www.nuclearelephant.com/projects/dspam/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -33,6 +34,7 @@
 %{?with_mysql:BuildRequires:	mysql-devel}
 BuildRequires:	openldap-devel
 %{?with_pgsql:BuildRequires:	postgresql-devel}
+BuildRequires:	rpm-perlprov >= 4.1-13
 BuildRequires:	rpmbuild(macros) >= 1.268
 BuildRequires:	sed >= 4.0
 %{?with_sqlite:BuildRequires:	sqlite3-devel}
@@ -41,6 +43,9 @@
 Requires:	rc-scripts
 Buildroot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define		_webapps	/etc/webapps
+%define		_webapp		%{name}
+
 %description
 DSPAM (as in De-Spam) is an open-source project to create a new kind
 of anti-spam mechanism, and is currently effective as both a
@@ -218,8 +223,25 @@
 %description driver-sqlite -l pl
 Sterownik SQLite dla DSPAM-a.
 
+%package webui
+Summary:	Dspam Web UI
+Group:		Applications/WWW
+Requires:	webapps
+
+%description webui
+The Web UI (CGI client) can be run from any executable location on a
+web server, and detects its user's identity from the REMOTE_USER
+environment variable. This means you'll need to use HTTP password
+authentication to access the CGI (Any type of authentication will
+work, so long as Apache supports the module). This is also convenient
+in that you can set up authentication using almost any existing system
+you have. The only catch is that you'll need the usernames to match
+the actual DSPAM usernames used the system. A copy of the shadow
+password file will suffice for most common installs.
+
 %prep
 %setup -q
+%patch0 -p1
 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
 %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c}
 
@@ -305,7 +327,6 @@
 
 # fix prefix
 sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
-sed -i -e "s|%{_prefix}/local|%{_prefix}|g" webui/cgi-bin/dspam.cgi
 
 # fix purge stuff
 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
@@ -346,6 +367,11 @@
 EOF
 %endif
 
+install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
+install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
+install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd
+
 %post
 /sbin/chkconfig --add dspam
 %service dspam restart "dspam daemon"
@@ -387,10 +413,21 @@
 	sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf
 fi
 
+%triggerin webui -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun webui -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin webui -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun webui -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc README CHANGELOG RELEASE.NOTES UPGRADING
-%doc webui/*/*.{cgi,prefs,txt} webui/*/*.txt webui/*/templates/*.html
 %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
 %dir %attr(750,root,mail) /var/lib/%{name}
@@ -473,12 +510,31 @@
 %attr(755,root,root) %{_libdir}/libsqlite_drv*.so*
 %endif
 
+%files webui
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_webapps}/%{_webapp}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/htpasswd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/admins
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/configure.pl
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/default.prefs
+
+%dir %{_datadir}/dspam
+%dir %{_datadir}/dspam/cgi
+%attr(755,root,root) %{_datadir}/dspam/cgi/*.cgi
+%{_datadir}/dspam/cgi/templates
+%{_datadir}/dspam/htdocs
+
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.58  2006/05/07 13:50:24  glen
+- created -webui subpackage
+
 Revision 1.57  2006/05/07 10:16:22  glen
 - 3.6.5
 
@@ -489,7 +545,7 @@
 - fix chkconfig, rc-scripts deps
 
 Revision 1.54  2006/03/02 11:47:57  inglod
-up to 3.6.4 (Latest Stable Release)
+- up to 3.6.4 (Latest Stable Release)
 
 Revision 1.53  2006/02/02 07:55:26  arekm
 - log dir added
@@ -524,7 +580,7 @@
 - drivers as loadable modules; enable ldap support
 
 Revision 1.43  2005/10/18 10:52:26  paszczus
-- added version info to prevoius commit ; adaptarized
+- added version info to prevoius commit; adaptarized
 
 Revision 1.42  2005/10/18 10:47:54  speedo
 - Update [3.6.0]
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/dspam.spec?r1=1.57&r2=1.58&f=u



More information about the pld-cvs-commit mailing list