# - dynCalendar.js (http://www.phpguru.org/dyncalendar.html)
# - overLIB 3.5.1 (http://www.bosrup.com/web/overlib/)
# - A few other small javascript libraries
-# - create eventum-router-qmail, eventum-router-postfix for -route-mails and -route-notes
# - need start-stop-daemon (from dpkg for now)
-# - use eventum user for irc bot?
%bcond_with pear # build with system PEAR packages (or use bundled ones)
+%define uid 146
+%define gid 146
+
# snapshot: DATE
%define _snap 20050222
%define _source http://mysql.wildyou.net/Downloads/%{name}/%{name}-%{version}.tar.gz
%endif
-%define _rel 2.204
+%define _rel 222
Summary: Eventum Issue / Bug tracking system
Summary(pl): Eventum - system ¶ledzenia spraw/b³êdów
Name: eventum
Version: 1.4
-Release: %{?_snap:2.%{_snap}.}%{_rel}
+Release: 2.%{?_snap:%{_snap}.}%{_rel}
License: GPL
Group: Applications/WWW
Source0: %{_source}
Source8: %{name}-irc.init
Source9: %{name}-irc.sysconfig
Source10: %{name}-config.php
+Source11: %{name}-router-qmail.sh
Patch0: %{name}-paths.patch
Patch1: %{name}-scm-encode.patch
Patch2: %{name}-cvs-config.patch
Patch3: %{name}-irc-config.patch
Patch4: %{name}-PEAR.patch
-Patch11: %{name}-scm_checkin_associated.patch
-Patch12: %{name}-mail-queue.tpl.patch
-Patch13: %{name}-maildecode.patch
-Patch14: %{name}-send-typo.patch
-Patch15: %{name}-fixes.patch
-Patch16: %{name}-rss-charset.patch
-Patch17: %{name}-scm-silence-add.patch
-Patch18: %{name}-default-TZ.patch
-Patch19: %{name}-charset-mailsubj.patch
+Patch11: %{name}-scm_checkin_associated.patch
+Patch12: %{name}-mail-queue.tpl.patch
+Patch13: %{name}-maildecode.patch
+Patch14: %{name}-send-typo.patch
+Patch15: %{name}-fixes.patch
+Patch16: %{name}-rss-charset.patch
+Patch17: %{name}-scm-silence-add.patch
+Patch18: %{name}-default-TZ.patch
+Patch19: %{name}-charset-mailsubj.patch
+Patch20: %{name}-monitor-bot-process.patch
URL: http://dev.mysql.com/downloads/other/eventum/index.html
BuildRequires: rpmbuild(macros) >= 1.177
BuildRequires: sed >= 4.0
Group: Applications/WWW
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: php >= 4.1.0
-#Requires: eventum-router
+Requires: eventum-router
%description route-emails
The email routing feature is used to automatically associate a thread
Group: Applications/WWW
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: php >= 4.1.0
-#Requires: eventum-router
+Requires: eventum-router
%description route-notes
The note routing feature is used to automatically associate a thread
pochodz±ce od Eventu, a odpowiedzi te bêd± automatycznie wi±zane ze
spraw± i rozprowadzane do cz³onków personelu listy og³oszeniowej.
+%package router-qmail
+Summary: Eventum Mail Routing - qmail
+Summary(pl): Przekazywanie poczty Eventum - qmail
+Group: Applications/Mail
+Requires: %{name}-base = %{epoch}:%{version}-%{release}
+Requires: qmail >= 1.03
+Provides: eventum-router
+
+%description router-qmail
+This package provides way of routing notes and emails back to Eventum
+via qmail.
+
+%description router-qmail -l pl
+Ten pakiet udostêpnia metodê przekazywania notatek i listów do Eventum
+przez qmaila.
+
+%package router-postfix
+Summary: Eventum Mail Routing - Postfix
+Summary(pl): Przekazywanie poczty Eventum - Postfix
+Group: Applications/Mail
+Requires: %{name}-base = %{epoch}:%{version}-%{release}
+Requires: postfix
+Provides: eventum-router
+
+%description router-postfix
+This package provides way of routing notes and emails back to Eventum
+via Postfix.
+
+%description router-postfix -l pl
+Ten pakiet udostêpnia metodê przekazywania notatek i listów do Eventum
+przez Postfiksa.
+
%package irc
Summary: Eventum IRC Notification Bot
Summary(pl): IRC-owy bot powiadamiaj±cy dla Eventum
#%patch17 -p1
#%patch18 -p1
%patch19 -p1
+%patch20 -p1
# replace in remaining scripts config.inc.php to system one
grep -rl 'include_once(".*config.inc.php")' . | xargs sed -i -e '
install -d \
$RPM_BUILD_ROOT{%{_sysconfdir},%{_bindir},%{_libdir}} \
$RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,sysconfig} \
- $RPM_BUILD_ROOT/var/{run,log,cache}/%{name} \
+ $RPM_BUILD_ROOT/var/{run,log,cache,lib}/%{name} \
$RPM_BUILD_ROOT%{_appdir}/{include,htdocs/misc} \
cp -a *.php css customer images js manage reports rpc setup $RPM_BUILD_ROOT%{_appdir}/htdocs
cp -a include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,textarea_size}}.php \
$RPM_BUILD_ROOT%{_smartyplugindir}
+# qmail router
+d=$RPM_BUILD_ROOT/var/lib/%{name}
+echo 'root' > $d/.qmail
+echo 'root' > $d/.qmail-default
+echo '| %{_libdir}/router-qmail drafts' > $d/.qmail-draft-default
+echo '| %{_libdir}/router-qmail emails 1' > $d/.qmail-issue-default
+echo '| %{_libdir}/router-qmail notes' > $d/.qmail-note-default
+install %{SOURCE11} $RPM_BUILD_ROOT%{_libdir}/router-qmail
+
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+%addusertogroup http %{name}
+
%post
# apache1
if [ -d %{_apache1dir}/conf.d ]; then
EOF
fi
-
%preun
if [ "$1" = "0" ]; then
# apache1
# nuke cache
rm -f /var/cache/eventum/*.php
+%pre base
+%groupadd -P %{name}-base %{name}
+%useradd -P %{name}-base -d /var/lib/%{name} -g %{name} %{name} -c "Eventum User"
+
+%postun base
+if [ "$1" = "0" ]; then
+ %groupremove %{name}
+ %userremove %{name}
+fi
+
+%post router-qmail
+CF=/etc/qmail/control/virtualdomains
+if ! grep -q ':%{name}\b' $CF 2>/dev/null; then
+ FQDN=$(hostname -f 2>/dev/null || echo localhost)
+ umask 022
+ echo "#${FQDN}:%{name}" >> $CF
+
+%banner %{name}-qmail -e <<EOF
+
+Added "#${FQDN}:%{name}" to $CF,
+Please verify that it is correct and restart qmail:
+# service qmail reload
+
+Consult qmail-send(8) for more details on virtualdomains.
+
+EOF
+fi
+
+%preun router-qmail
+if [ "$1" = "0" ]; then
+ sed -i -e '/:%{name}\b/d' /etc/qmail/control/virtualdomains
+fi
+
%post setup
chmod 660 %{_sysconfdir}/{config,private_key}.php
-chown root:http %{_sysconfdir}/{config,private_key}.php
+chown root:eventum %{_sysconfdir}/{config,private_key}.php
%postun setup
if [ "$1" = "0" ]; then
chmod 640 %{_sysconfdir}/{config,private_key}.php
- chown root:http %{_sysconfdir}/{config,private_key}.php
+ chown root:eventum %{_sysconfdir}/{config,private_key}.php
fi
%triggerpostun -- eventum < 1.4-2.160
sed -i -e 's,%{_appdir}/misc,%{_appdir},' /etc/cron.d/eventum-reminder
touch /etc/cron.d/eventum-reminder
+%triggerpostun -- eventum < 1.4-2.20050222.2.208
+chgrp eventum %{_sysconfdir}/{core,config,private_key,setup}.php
+
+%triggerpostun irc -- eventum-irc < 1.4-2.20050222.2.208
+chgrp eventum %{_sysconfdir}/irc.php
+
+%triggerpostun base -- eventum-base < 1.4-2.20050222.212
+if [ "`getent passwd %{name} | cut -d: -f6`" = "%{_appdir}" ]; then
+ /usr/sbin/usermod -d /var/lib/%{name} %{name}
+fi
+
%files
%defattr(644,root,root,755)
%doc ChangeLog FAQ INSTALL README UPGRADE
-%doc misc/upgrade docs/* rpc/xmlrpc_client.php setup/schema.sql
+%doc misc/upgrade docs/* rpc/xmlrpc_client.php setup/schema.sql
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/private_key.php
-%attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/setup.php
-%attr(640,root,http) %config %verify(not mtime) %{_sysconfdir}/core.php
+%attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
+%attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/private_key.php
+%attr(660,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/setup.php
+%attr(640,root,eventum) %config %verify(not mtime) %{_sysconfdir}/core.php
-%dir %attr(731,root,http) /var/log/%{name}
-%attr(620,root,http) %ghost /var/log/%{name}/*
+%dir %attr(731,root,eventum) /var/log/%{name}
+%attr(620,root,eventum) %ghost /var/log/%{name}/*
%dir %{_appdir}/htdocs
%{_appdir}/htdocs/*.php
%{_appdir}/include/customer
%{_appdir}/include/jpgraph
%{_appdir}/include/workflow
-%{_appdir}/include/class.[^m]*.php
+%{_appdir}/include/class.[!m]*.php
%{_appdir}/include/class.mail.php
%{_appdir}/include/class.mail_queue.php
%{_appdir}/include/class.mime_helper.php
%{_appdir}/include/db_access.php
%{_appdir}/include/jsrsServer.inc.php
-%dir %attr(730,root,http) /var/run/%{name}
-%dir %attr(730,root,http) /var/cache/%{name}
+%dir %attr(730,root,eventum) /var/run/%{name}
+%dir %attr(730,root,eventum) /var/cache/%{name}
%files base
%defattr(644,root,root,755)
%attr(751,root,root) %dir %{_sysconfdir}
%dir %{_libdir}
%dir %{_appdir}
+%attr(750,root,eventum) %dir /var/lib/%{name}
%files setup
%defattr(644,root,root,755)
%{_appdir}/route_drafts.php
%{_appdir}/route_notes.php
+%files router-qmail
+%defattr(644,root,root,755)
+%attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/.qmail*
+%attr(755,root,root) %{_libdir}/router-qmail
+
+%files router-postfix
+%defattr(644,root,root,755)
+
%files irc
%defattr(644,root,root,755)
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/irc.php
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/eventum-irc
+%attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/irc.php
+%attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/eventum-irc
%{_appdir}/irc
%attr(754,root,root) /etc/rc.d/init.d/%{name}-irc