]> git.pld-linux.org Git - packages/eventum.git/blobdiff - eventum.spec
- add to PLD CVS
[packages/eventum.git] / eventum.spec
index 5ae0dde9bfaffd061c0898661e4006d9c17d5427..4708028a95af3411cb4c02e4654c9513564b5f9f 100644 (file)
@@ -1,38 +1,43 @@
 # TODO
-# - system pear is incompatible, at least pear DB class seems broke Eventum
-# - php5 is not tested, but not placing hard conflict on it, as it prevents php4 & php coinstallation
 # - discard bundled packages (from INSTALL):
 #  - JpGraph 1.5.3 (last GPL version)
 #  - dTree 2.0.5 (http://www.destroydrop.com/javascript/tree/)
 #  - 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?
+# - 64bit platforms beware? http://bugs.php.net/bug.php?id=30215 (it's actually Smarty related problem)
 
-%bcond_with    pear    # build with system PEAR packages (or use bundled ones)
+%bcond_without pear    # build with system PEAR packages (or use bundled ones)
+%bcond_with    qmail   # build the router-qmail subpackage
 
 # snapshot: DATE
-#define _snap 20050124
+%define        _snap 20051227
 
+# release candidate
+#define _rc            RC1
+
+%define        _rel    4.45
+
+%if 0%{?_rc:1}
+%define        _source http://pessoal.org/%{name}-%{version}-%{_rc}.tar.gz
+%else
 %if 0%{?_snap}
-%define _source http://downloads.mysql.com/snapshots/%{name}/%{name}-nightly-%{_snap}.tar.gz
+%define        _source http://downloads.mysql.com/snapshots/%{name}/%{name}-nightly-%{_snap}.tar.gz
 %else
-%define _source http://mysql.wildyou.net/Downloads/%{name}/%{name}-%{version}.tar.gz
+%define        _source http://mysql.dataphone.se/Downloads/%{name}/%{name}-%{version}.tar.gz
+%endif
 %endif
 
-%define _rel 1.136
-
-Summary:       Eventum Issue - a bug tracking system
+%{?with_pear:%include  /usr/lib/rpm/macros.php}
+Summary:       Eventum Issue / Bug tracking system
 Summary(pl):   Eventum - system ¶ledzenia spraw/b³êdów
 Name:          eventum
-Version:       1.4
-Release:       %{?_snap:0.%{_snap}.}%{_rel}
+Version:       1.7.0
+Release:       %{?_snap:0.%{_snap}.}%{?_rc:%{_rc}.}%{_rel}
 License:       GPL
 Group:         Applications/WWW
 Source0:       %{_source}
-# Source0-md5: 361c1355e46a6bbfa54e420964ec92cf
+# Source0-md5: 37185deab6f5a1e388800e1fe182e64c
 Source1:       %{name}-apache.conf
 Source2:       %{name}-mail-queue.cron
 Source3:       %{name}-mail-download.cron
@@ -41,25 +46,40 @@ Source5:    %{name}-monitor.cron
 Source6:       %{name}-cvs.php
 Source7:       %{name}-irc.php
 Source8:       %{name}-irc.init
+Source9:       %{name}-irc.sysconfig
+Source10:      %{name}-config.php
+Source11:      %{name}-router-qmail.sh
+Source12:      http://dev.mysql.com/common/favicon.ico
+# Source12-md5:        858be0130832da4144c08d4b59116411
+Source13:      %{name}-config-setup.php
+Source14:      %{name}-upgrade.sh
 Patch0:                %{name}-paths.patch
-Patch1:                %{name}-scm-encode.patch
-Patch2:                %{name}-cvs-config.patch
-Patch3:                %{name}-irc-config.patch
-Patch4:                %{name}-PEAR.patch
-Patch10:               %{name}-clock-status.patch
-Patch11:               %{name}-scm_checkin_associated.patch
-Patch12:               %{name}-mail-queue.tpl.patch
-URL:           http://dev.mysql.com/downloads/other/eventum/index.html
-BuildRequires: rpmbuild(macros) >= 1.177
+Patch1:                %{name}-cvs-config.patch
+Patch2:                %{name}-irc-config.patch
+Patch3:                %{name}-PEAR.patch
+Patch4:                http://glen.alkohol.ee/pld/%{name}-reply-subject.patch
+Patch5:                %{name}-lf.patch
+Patch6:                http://glen.alkohol.ee/pld/%{name}-maq-subject.patch
+Patch7:                %{name}-bot-reconnect.patch
+Patch8:                %{name}-perms.patch
+Patch9:                http://glen.alkohol.ee/pld/%{name}-httpclient-clientside.patch
+Patch10:       %{name}-cli-wr-separated.patch
+Patch11:       %{name}-php440.patch
+Patch12:       %{name}-htmloptions-truncate.patch
+Patch13:       http://glen.alkohol.ee/pld/%{name}-link_filter-updates.patch
+URL:           http://dev.mysql.com/downloads/other/eventum/
+%{?with_pear:BuildRequires:    rpm-php-pearprov >= 4.0.2-98}
+BuildRequires: rpmbuild(macros) >= 1.223
 BuildRequires: sed >= 4.0
-Requires:      php >= 4.1.0
+Requires:      %{name}-base = %{epoch}:%{version}-%{release}
+Requires:      Smarty >= 2.6.2
+Requires:      php >= 3:4.2.0
 Requires:      php-gd
 Requires:      php-imap
 Requires:      php-mysql
 Requires:      php-pcre
-Requires:      %{name}-base = %{epoch}:%{version}-%{release}
+Requires:      php-session
 %if %{with pear}
-Requires:      Smarty >= 2.6.2
 Requires:      php-pear-Benchmark
 Requires:      php-pear-DB
 Requires:      php-pear-Date
@@ -67,27 +87,32 @@ Requires:   php-pear-HTTP_Request
 Requires:      php-pear-Mail
 Requires:      php-pear-Math_Stats
 Requires:      php-pear-Net_DIME
-Requires:      php-pear-Net_POP3
 Requires:      php-pear-Net_SMTP
-Requires:      php-pear-Net_SmartIRC
 Requires:      php-pear-Net_Socket
 Requires:      php-pear-Net_URL
 Requires:      php-pear-Net_UserAgent_Detect
-Requires:      php-pear-PEAR
+Requires:      php-pear-PEAR-core
 Requires:      php-pear-Text_Diff
 Requires:      php-pear-XML_RPC
+#Suggests:     php-pear-Net_POP3
 %endif
-#Requires:     apache-mod_dir
-# conflict with non-confdir apache
-Conflicts:     apache1 < 1.3.33-1.1
+Requires(triggerpostun):       /usr/bin/php
+Requires(triggerpostun):       sed >= 4.0
+Requires:      apache(mod_dir)
+Requires:      webapps
+Requires:      webserver = apache
+BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _sysconfdir     /etc/%{name}
-%define                _appdir %{_datadir}/%{name}
-%define                _smartyplugindir        %{php_pear_dir}/Smarty/plugins
+%define                _noautoreq      'pear(/etc/webapps/.*)' 'pear(jpgraph_dir.php)' 'pear(.*Smarty.class.php)' 'pear(Net/POP3.php)'
 
-%define                _apache1dir     /etc/apache
-%define                _apache2dir     /etc/httpd
+%define                _libdir         %{_prefix}/lib/%{name}
+%define                _appdir %{_datadir}/%{name}
+%define                _smartyplugindir        %{_appdir}/include/smarty
+%define                _smartydir      /usr/share/php/Smarty
+%define                _webapps        /etc/webapps
+%define                _webapp         %{name}
+%define                _sysconfdir     %{_webapps}/%{_webapp}
 
 %description
 Eventum is a user-friendly and flexible issue tracking system that can
@@ -108,6 +133,14 @@ reakcji.
 Summary:       Eventum base package
 Summary(pl):   Podstawowy pakiet Eventum
 Group:         Applications/WWW
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Provides:      group(eventum)
+Provides:      user(eventum)
 
 %description base
 This package contains base directory structure for Eventum.
@@ -119,7 +152,7 @@ Ten pakiet zawiera podstawow
 Summary:       Eventum setup package
 Summary(pl):   Pakiet do wstêpnej konfiguracji Eventum
 Group:         Applications/WWW
-PreReq:                %{name} = %{epoch}:%{version}-%{release}
+Requires:      %{name} = %{epoch}:%{version}-%{release}
 
 %description setup
 Install this package to configure initial Eventum installation. You
@@ -136,8 +169,8 @@ Summary:    Eventum mail queue process
 Summary(pl):   Przetwarzanie kolejki poczty Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires:      /usr/bin/php
 Requires:      crondaemon
-Requires:      php4 >= 4.1.0
 
 %description mail-queue
 Beginning with the first release of Eventum, emails are not directly
@@ -162,8 +195,8 @@ Summary:    Eventum email download
 Summary(pl):   ¦ci±ganie poczty Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires:      /usr/bin/php
 Requires:      crondaemon
-Requires:      php4 >= 4.1.0
 
 %description mail-download
 In order for Eventum's email integration feature to work, you need to
@@ -183,7 +216,7 @@ Summary:    Eventum Reminder System
 Summary(pl):   System przypominania dla Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
+Requires:      /usr/bin/php
 Requires:      crondaemon
 
 %description reminder
@@ -209,8 +242,9 @@ Summary:    Eventum Heartbeat Monitor
 Summary(pl):   Monitor ¿ycia dla Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
+Requires:      /usr/bin/php
 Requires:      crondaemon
+Requires:      php-posix
 
 %description monitor
 The heartbeat monitor is a feature designed for the administrator that
@@ -243,8 +277,8 @@ Summary:    Eventum Email Routing
 Summary(pl):   Przekazywanie poczty dla Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
-#Requires:     eventum-router
+Requires:      /usr/bin/php
+Requires:      eventum(router)
 
 %description route-emails
 The email routing feature is used to automatically associate a thread
@@ -269,8 +303,8 @@ Summary:    Eventum Note Routing
 Summary(pl):   Przekazywanie notatek dla Eventum
 Group:         Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
-#Requires:     eventum-router
+Requires:      /usr/bin/php
+Requires:      eventum(router)
 
 %description route-notes
 The note routing feature is used to automatically associate a thread
@@ -290,15 +324,52 @@ u
 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
+# loose dep is intentional. qmail subpackage isn't built on PLD
+# builders and there really nothing changes.
+Requires:      %{name} >= %{epoch}:%{version}-%{release}
+Requires:      qmail >= 1.03
+Provides:      eventum(router)
+Obsoletes:     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} = %{epoch}:%{version}-%{release}
+Requires:      postfix
+Provides:      eventum(router)
+Obsoletes:     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
 Group:         Applications/WWW
+Requires(triggerpostun):       sed >= 4.0
 Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php >= 4.1.0
+Requires:      /usr/bin/php
+#Requires:     php-pear-Net_SmartIRC
 Requires:      php-sockets
-# FIXME just need start-stop-daemon
-Requires:      dpkg
+Requires:      rc-scripts >= 0.4.0.18
 
 %description irc
 The IRC notification bot is a nice feature for remote teams that want
@@ -328,12 +399,12 @@ kana
 Summary:       Eventum command-line interface
 Summary(pl):   Interfejs linii poleceñ dla Eventum
 Group:         Applications/WWW
-Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
-Requires:      php4-cli
-Requires:      php4-curl
-Requires:      php4-xml
+Requires:      %{name}-base = %{epoch}:%{version}-%{release}
+Requires:      php-cli
+Requires:      php-common >= 3:4.1.0
+Requires:      php-curl
 Requires:      php-pear-XML_RPC
+Requires:      php-xml
 
 %description cli
 The Eventum command-line interface allows you to access most of the
@@ -348,7 +419,9 @@ Summary:    Eventum SCM integration
 Summary(pl):   Integracja SCM dla Eventum
 Group:         Applications/WWW
 Requires:      %{name}-base = %{epoch}:%{version}-%{release}
-Requires:      php4 >= 4.1.0
+Requires:      php-cli
+Requires:      php-common >= 3:4.1.0
+Requires:      php-pcre
 
 %description scm
 This feature allows your software development teams to integrate your
@@ -358,7 +431,7 @@ The integration is implemented in such a way that it will be forward
 compatible with pretty much any SCM system, such as CVS.
 
 For installation see
-/eventum/help.php?topic=scm_integration_installation .
+</eventum/help.php?topic=scm_integration_installation>.
 
 %description scm -l pl
 Ten pakiet pozwala zespo³om programistów na integracjê systemu
@@ -369,50 +442,93 @@ Integracja jest zaimplementowana tak, aby by
 prawie ka¿dym systemem SCM, jak np. CVS.
 
 Szczegó³y na temat instalacji mo¿na przeczytaæ pod
-/eventum/help.php?topic=scm_integration_installation .
+</eventum/help.php?topic=scm_integration_installation>.
 
 %prep
 %setup -q %{?_snap:-n %{name}-%{_snap}}
 # undos the source
-find . -type f -print0 | xargs -0 sed -i -e 's,
-$,,'
+find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
+
+rm -f setup.conf.php
+rm -rf misc/upgrade/*v1.[123]* # too old to support in PLD
+rm -rf misc/upgrade/flush_compiled_templates.php
+
+sed -e '1s,#!.*/bin/php -q,#!%{_bindir}/php,' misc/cli/eventum > %{name}-cli
+sed -e '1i#!%{_bindir}/php' misc/scm/process_cvs_commits.php > %{name}-scm
+
+# using system package
+#rm -rf include/pear/Net/SmartIRC*
 
 # packaging
 %patch0 -p1 -b .paths
 %patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%{?with_pear:%patch4 -p1 -b .PEAR}
-
-# bug fixes
+%patch2 -p1 -b .irc-config
+%{?with_pear:%patch3 -p1 -b .PEAR}
+
+# bug fixes.
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
+
+# replace in remaining scripts config.inc.php to system one
+grep -rl 'include_once(".*config.inc.php")' . | xargs sed -i -e '
+       s,include_once(".*config.inc.php"),include_once("%{_sysconfdir}/core.php"),
+'
 
-rm -f */*~ */*/*~
+grep -rl 'APP_INC_PATH..*"private_key.php"' . | xargs sed -i -e '
+       s,include_once(APP_INC_PATH.*"private_key.php"),include_once("%{_sysconfdir}/private_key.php"),
+'
+find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_bindir},%{_appdir}} \
-       $RPM_BUILD_ROOT{/etc/{rc.d/init.d,cron.d},/var/log/%{name}} \
-       $RPM_BUILD_ROOT{/var/run/eventum,/var/cache/eventum}
-
-cp -a *.php {css,customer,images,include,js} \
-       {manage,misc,reports,rpc,setup,templates} $RPM_BUILD_ROOT%{_appdir}
+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,lib}/%{name} \
+       $RPM_BUILD_ROOT/var/lib/%{name}/routed_{emails,drafts,notes} \
+       $RPM_BUILD_ROOT%{_appdir}/{include,htdocs/misc,upgrade} \
+
+cp -a *.php css customer images js manage reports rpc setup $RPM_BUILD_ROOT%{_appdir}/htdocs
+cp -a misc/*.html $RPM_BUILD_ROOT%{_appdir}/htdocs/misc
+cp -a misc/*.php $RPM_BUILD_ROOT%{_appdir}
+cp -a misc/irc $RPM_BUILD_ROOT%{_appdir}
+cp -a templates $RPM_BUILD_ROOT%{_appdir}
+cp -a include/{customer,jpgraph,pear,workflow} $RPM_BUILD_ROOT%{_appdir}/include
+cp -a include/*.php $RPM_BUILD_ROOT%{_appdir}/include
 cp -a logs/* $RPM_BUILD_ROOT/var/log/%{name}
+cp -a misc/upgrade $RPM_BUILD_ROOT%{_appdir}
+
+install %{SOURCE12} $RPM_BUILD_ROOT%{_appdir}/htdocs/favicon.ico
+install %{SOURCE13} $RPM_BUILD_ROOT%{_appdir}/htdocs/setup/config.inc.php
+install %{SOURCE14} $RPM_BUILD_ROOT%{_appdir}/upgrade/upgrade.sh
 
-> $RPM_BUILD_ROOT%{_appdir}/setup.conf.php
+# cli
+install -d $RPM_BUILD_ROOT%{_appdir}/cli
+install misc/cli/include/class.{misc,command_line}.php $RPM_BUILD_ROOT%{_appdir}/cli
+install misc/cli/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/cli.php
+install %{name}-cli $RPM_BUILD_ROOT%{_bindir}/%{name}
+cp -f misc/cli/eventumrc_example eventumrc
 
-sed -i -e 's,/usr/local/bin/php,/usr/bin/php4,' $RPM_BUILD_ROOT%{_appdir}/misc/cli/eventum
-echo '#!/usr/bin/php4 -q' > %{name}-scm
-cat $RPM_BUILD_ROOT%{_appdir}/misc/scm/process_cvs_commits.php >> %{name}-scm
+# scm
+install %{name}-scm $RPM_BUILD_ROOT%{_libdir}/scm
 
+# private key
+mv $RPM_BUILD_ROOT{%{_appdir}/include/private_key.php,%{_sysconfdir}}
 # change private key, so we can easily grep
 sed -i -e '
 s,$private_key\s*=\s*".*";,$private_key = "DEFAULTPRIVATEKEYPLEASERUNSETUP!";,
-' $RPM_BUILD_ROOT%{_appdir}/include/private_key.php
+' $RPM_BUILD_ROOT%{_sysconfdir}/private_key.php
 
 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder
@@ -420,72 +536,88 @@ install %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor
 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/cvs.php
 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/irc.php
 install %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/eventum-irc
+install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/eventum-irc
 
-# in conf
-mv $RPM_BUILD_ROOT%{_appdir}/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/config.php
-mv $RPM_BUILD_ROOT%{_appdir}/setup.conf.php $RPM_BUILD_ROOT%{_sysconfdir}/setup.php
-mv $RPM_BUILD_ROOT%{_appdir}/include/private_key.php $RPM_BUILD_ROOT%{_sysconfdir}
-mv $RPM_BUILD_ROOT%{_appdir}/misc/cli/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/cli.php
-ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.inc.php
-ln -s %{_sysconfdir}/setup.php $RPM_BUILD_ROOT%{_appdir}/setup.conf.php
-ln -s %{_sysconfdir}/private_key.php $RPM_BUILD_ROOT%{_appdir}/include/private_key.php
-
-# in doc
-rm -rf $RPM_BUILD_ROOT%{_appdir}/misc/upgrade
-# sample, not used in eventum
-rm -rf $RPM_BUILD_ROOT%{_appdir}/rpc/xmlrpc_client.php
+sed -e '
+s,%%{APP_VERSION}%%,%{version}%{?_snap:-%{_snap}},
+s,%%{PHP_PEAR_DIR}%%,%{?with_pear:%{php_pear_dir}}%{!?with_pear:%{_appdir}/includes/pear},
+s,%%{APP_PATH}%%,%{_appdir},
+s,%%{SMARTY_DIR}%%,%{_smartydir},
+s,%%{SYSCONFDIR}%%,%{_sysconfdir},
+' %{SOURCE10} > $RPM_BUILD_ROOT%{_sysconfdir}/core.php
+
+# config
+> $RPM_BUILD_ROOT%{_sysconfdir}/setup.php
+mv $RPM_BUILD_ROOT{%{_appdir}/htdocs/config.inc,%{_sysconfdir}/config}.php
 
-# in bindir
-mv $RPM_BUILD_ROOT%{_appdir}/misc/cli/eventum $RPM_BUILD_ROOT%{_bindir}
-rm -f $RPM_BUILD_ROOT%{_appdir}/misc/{cli/eventumrc_example,scm/process_cvs_commits.php}
-cp misc/cli/eventumrc_example eventumrc
-install %{name}-scm $RPM_BUILD_ROOT%{_bindir}/%{name}-scm
+# sample, not used in eventum
+rm -f $RPM_BUILD_ROOT%{_appdir}/htdocs/rpc/xmlrpc_client.php
 
 %if %{with pear}
 # provided by PEAR
-rm -rf $RPM_BUILD_ROOT%{_appdir}/misc/cli/include/pear
 rm -rf $RPM_BUILD_ROOT%{_appdir}/include/pear
+%endif
 
 # use system Smarty
 rm -rf $RPM_BUILD_ROOT%{_appdir}/include/Smarty
 install -d $RPM_BUILD_ROOT%{_smartyplugindir}
 # These plugins are not in Smarty package (Smarty-2.6.2-3)
-cp -a include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,textarea_size}}.php $RPM_BUILD_ROOT%{_smartyplugindir}
+cp -a \
+       include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,textarea_size}}.php \
+       include/Smarty/plugins/modifier.highlight_quoted.php \
+       $RPM_BUILD_ROOT%{_smartyplugindir}
+
+# qmail router
+%if %{with qmail}
+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
 %endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-# apache1
-if [ -f %{_apache1dir}/apache.conf ]; then
-       ln -sf %{_sysconfdir}/apache.conf %{_apache1dir}/conf.d/99_%{name}.conf
-       if [ -f /var/lock/subsys/apache ]; then
-               /etc/rc.d/init.d/apache restart 1>&2
-       fi
-fi
-# apache2
-if [ -d %{_apache2dir}/httpd.conf ]; then
-       ln -sf %{_sysconfdir}/apache.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
-       if [ -f /var/lock/subsys/httpd ]; then
-               /etc/rc.d/init.d/httpd restart 1>&2
-       fi
-fi
+%pre
+%addusertogroup http %{name}
 
+%post
 # check if the package is configured.
 if grep -q 'header("Location: setup/")' %{_sysconfdir}/config.php; then
+if [ -f %{_appdir}/htdocs/setup/index.php ]; then
 %banner %{name} -e <<EOF
 
 You haven't yet configured Eventum!
+Please open in browser <http://localhost/eventum/>
+If you need access from elsewhere, you need to edit
+%{_sysconfdir}/apache.conf and restart apache.
 
-Install %{name}-setup and open up http://yourserver/eventum/
--- that will help you setup initial config.
+IMPORTANT: When You have configured Eventum, please uninstall the
+setup package, so that %{name}-setup is able to secure your Eventum
+installation.
 
-when have configured Eventum, please uninstall the setup package,
-so that %{name}-setup is able to secure your Eventum installation.
+EOF
+#' vim stupidity.
+else
+%banner %{name} -e <<EOF
+
+You haven't yet configured Eventum!
+
+To setup eventum, please install %{name}-setup and open in browser
+<http://localhost/eventum/>.
+If you need access from elsewhere, you need to edit
+%{_sysconfdir}/apache.conf and restart apache.
+
+IMPORTANT: When You have configured Eventum, please uninstall the
+setup package, so that %{name}-setup is able to secure your Eventum
+installation.
 
 EOF
 #' vim stupidity.
+fi
 
 elif grep -q 'DEFAULTPRIVATEKEY' %{_sysconfdir}/private_key.php; then
 %banner %{name} -e <<EOF
@@ -508,130 +640,302 @@ so that %{name}-setup is able to secure your Eventum installation.
 EOF
 fi
 
+# nuke Smarty templates cache after upgrade
+rm -f /var/cache/eventum/*.php
 
 %preun
 if [ "$1" = "0" ]; then
-       # apache1
-       if [ -f %{_apache1dir}/apache.conf ]; then
-               rm -f %{_apache1dir}/conf.d/99_%{name}.conf
-               if [ -f /var/lock/subsys/apache ]; then
-                       /etc/rc.d/init.d/apache restart 1>&2
-               fi
-       fi
-       # apache2
-       if [ -d %{_apache2dir}/httpd.conf ]; then
-               rm -f %{_apache1dir}/httpd.conf/99_%{name}.conf
-               if [ -f /var/lock/subsys/httpd ]; then
-                       /etc/rc.d/init.d/httpd restart 1>&2
-               fi
-       fi
+       # nuke cache
+       rm -f /var/cache/eventum/*.php 2>/dev/null || :
 fi
 
+%pre base
+%groupadd -P %{name}-base -g 146 %{name}
+%useradd -P %{name}-base -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
+
+%postun base
+if [ "$1" = "0" ]; then
+       %userremove %{name}
+       %groupremove %{name}
+fi
+
+%if %{with qmail}
+%post router-qmail
+CF=/etc/qmail/control/virtualdomains
+if ! grep -q ':%{name}\b' $CF 2>/dev/null; then
+       FQDN=$(awk -F'"' '/define/ && $2 ~ /APP_HOSTNAME/ {print $4}' %{_sysconfdir}/config.php 2>/dev/null)
+       [ "$FQDN" ] || 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 information on virtualdomains.
+
+EOF
+fi
+
+%preun router-qmail
+if [ "$1" = "0" ]; then
+       sed -i -e '/:%{name}\b/d' /etc/qmail/control/virtualdomains
+fi
+%endif
+
 %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
+
+%post irc
+/sbin/chkconfig --add eventum-irc
+if [ -f /var/lock/subsys/eventum-irc ]; then
+       /etc/rc.d/init.d/eventum-irc restart >&2
+else
+       echo "Run \"/etc/rc.d/init.d/eventum-irc start\" to start Eventum IRC Bot." >&2
+fi
+
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache >= 2.0.0
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache >= 2.0.0
+%webapp_unregister httpd %{_webapp}
+
+# FIXME
+# only one upgrade trigger is called if you're upgrading over two
+# versions, say 1.5 to 1.5.3, only 1.5.3 trigger is called.
+# use common trigger (the highest version and rpmvercmp from poldek?)
+%triggerpostun -- eventum < 1.5.1-0.257
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5_to_v1.5.1 <<EOF
+database_changes.php Perform database changes
+EOF
+
+%triggerpostun -- eventum < 1.5.2-0.289
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.1_to_v1.5.2 <<EOF
+database_changes.php Perform database changes
+set_priority_ranks.php Fix the ranking of priority values
+EOF
+
+%triggerpostun -- eventum < 1.5.3-0.291
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.2_to_v1.5.3 <<EOF
+database_changes.php Perform database changes
+EOF
+
+%triggerpostun -- eventum < 1.5.4-1.12
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.3_to_v1.5.4 <<EOF
+database_changes.php Perform database changes
+EOF
+
+%triggerpostun -- eventum < 1.6.0-RC2.6
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.5_to_v1.6.0 <<EOF
+database_changes.php Perform database changes
+upgrade_saved_searches.php Upgrade existing custom filters (saved searches)
+EOF
+
+%triggerpostun -- eventum < 1.6.1-0.2
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.0_to_v1.6.1 <<EOF
+database_changes.php Perform database changes
+EOF
+
+%triggerpostun irc -- eventum-irc < 1.6.1-3.14
+sed -i -e '
+s,\$irc_host,$irc_server_hostname,
+s,\$irc_port,$irc_server_port,
+s,\$irc_nick,$nickname,
+s,\$irc_realname,$realname,
+s,\$irc_username,$username,
+s,\$irc_password,$password,
+' /etc/eventum/irc.php
+
+%triggerpostun -- eventum < 1.7.0-0.20051130.4.25
+# migrate from apache-config macros
+if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
+       if [ -d /etc/apache/webapps.d ]; then
+               cp -f %{_webapps}/%{_webapp}/apache.conf{,.rpmnew}
+               cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/apache.conf
+       fi
+
+       if [ -d /etc/httpd/webapps.d ]; then
+               cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
+               cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
+       fi
+fi
+
+if [ -L /etc/apache/conf.d/99_%{_webapp}.conf ]; then
+       /usr/sbin/webapp register apache %{_webapp}
+       rm -f /etc/apache/conf.d/99_%{_webapp}.conf
+       if [ -f /var/lock/subsys/apache ]; then
+               /etc/rc.d/init.d/apache reload 1>&2
+       fi
+fi
+if [ -L /etc/httpd/httpd.conf/99_%{_webapp}.conf ]; then
+       /usr/sbin/webapp register httpd %{_webapp}
+       rm -f /etc/httpd/httpd.conf/99_%{_webapp}.conf
+       if [ -f /var/lock/subsys/httpd ]; then
+               /etc/rc.d/init.d/httpd reload 1>&2
+       fi
+fi
+
+%{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.1_to_v1.7.0 <<EOF
+database_changes.php Perform database changes
+set_root_message_ids.php Set iss_root_message_id
+EOF
+
+# regular configs
+for i in apache.conf config.php private_key.php setup.php; do
+       if [ -f /etc/eventum/$i.rpmsave ]; then
+               mv -f %{_sysconfdir}/$i{,.rpmnew}
+               mv -f /etc/eventum/$i.rpmsave %{_sysconfdir}/$i
+       fi
+done
+
+%triggerpostun cli -- %{name}-cli < 1.6.1-4.16
+if [ -f /etc/eventum/cli.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/cli.php{,.rpmnew}
+       mv -f /etc/eventum/cli.php.rpmsave %{_sysconfdir}/cli.php
+fi
+
+%triggerpostun irc -- %{name}-irc < 1.6.1-4.17
+if [ -f /etc/eventum/irc.php.rpmsave ]; then
+       mv -f %{_sysconfdir}/irc.php{,.rpmnew}
+       mv -f /etc/eventum/irc.php.rpmsave %{_sysconfdir}/irc.php
 fi
 
 %files
 %defattr(644,root,root,755)
-%doc ChangeLog FAQ INSTALL README UPGRADE misc/upgrade docs/* rpc/xmlrpc_client.php
+%doc ChangeLog FAQ INSTALL README UPGRADE
+%doc 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,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%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,eventum) /var/log/%{name}
+%attr(620,root,eventum) %ghost /var/log/%{name}/*
+
+%dir %{_appdir}/htdocs
+%{_appdir}/htdocs/*.php
+%{_appdir}/htdocs/*.ico
+%{_appdir}/htdocs/css
+%{_appdir}/htdocs/customer
+%{_appdir}/htdocs/images
+%{_appdir}/htdocs/js
+%{_appdir}/htdocs/manage
+%{_appdir}/htdocs/reports
+%{_appdir}/htdocs/rpc
+%{_appdir}/htdocs/misc
 
-%dir %{_appdir}
-%dir %{_appdir}/misc
-
-%dir %attr(731,root,http) /var/log/%{name}
-%attr(620,root,http) %ghost /var/log/%{name}/*
-
-%{_appdir}/*.php
-%{_appdir}/css
-%{_appdir}/customer
-%{_appdir}/images
-%{_appdir}/js
-%{_appdir}/manage
-%{_appdir}/reports
-%{_appdir}/rpc
 %{_appdir}/templates
+%dir %{_appdir}/upgrade
+%attr(755,root,root) %{_appdir}/upgrade/upgrade.sh
+%{_appdir}/upgrade/[!u]*
 
-%if %{with pear}
-%{_smartyplugindir}/*
-%else
+%{_smartyplugindir}
+%if %{without pear}
 %{_appdir}/include/pear
-%{_appdir}/include/Smarty
 %endif
 
 %dir %{_appdir}/include
 %{_appdir}/include/customer
 %{_appdir}/include/jpgraph
 %{_appdir}/include/workflow
-%{_appdir}/include/*.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/class.misc.php
+%{_appdir}/include/db_access.php
 
-%dir %attr(730,root,http) /var/run/%{name}
-%dir %attr(730,root,http) /var/cache/%{name}
-
-%{_appdir}/misc/blank.html
+%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}
+# qmail will ignore user, if it's home directory is not owned
+%attr(750,eventum,eventum) %dir /var/lib/%{name}
+# saved mail copies
+%attr(770,root,eventum) %dir /var/lib/%{name}/routed_emails
+%attr(770,root,eventum) %dir /var/lib/%{name}/routed_drafts
+%attr(770,root,eventum) %dir /var/lib/%{name}/routed_notes
 
 %files setup
 %defattr(644,root,root,755)
-%{_appdir}/setup
+%{_appdir}/htdocs/setup
 
 %files mail-queue
 %defattr(644,root,root,755)
-%{_appdir}/misc/process_mail_queue.php
+%{_appdir}/process_mail_queue.php
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
 
 %files mail-download
 %defattr(644,root,root,755)
-%{_appdir}/misc/download_emails.php
+%{_appdir}/download_emails.php
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
 
 %files reminder
 %defattr(644,root,root,755)
-%{_appdir}/misc/check_reminders.php
+%{_appdir}/check_reminders.php
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
 
 %files monitor
 %defattr(644,root,root,755)
-%{_appdir}/misc/monitor.php
+%{_appdir}/include/class.monitor.php
+%{_appdir}/monitor.php
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
 
 %files route-emails
 %defattr(644,root,root,755)
-%{_appdir}/misc/route_emails.php
+%{_appdir}/route_emails.php
 
 %files route-notes
 %defattr(644,root,root,755)
-%{_appdir}/misc/route_drafts.php
-%{_appdir}/misc/route_notes.php
+%{_appdir}/route_drafts.php
+%{_appdir}/route_notes.php
+
+%if %{with qmail}
+%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
+%endif
+
+%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
-%{_appdir}/misc/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
 
 %files cli
 %defattr(644,root,root,755)
 %doc eventumrc
-%attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cli.php
+%attr(644,root,root) %config %verify(not md5 mtime size) %{_sysconfdir}/cli.php
 %attr(755,root,root) %{_bindir}/%{name}
-%dir %{_appdir}/misc/cli
-%{_appdir}/misc/cli/include
+%{_appdir}/cli
 
 %files scm
 %defattr(644,root,root,755)
 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cvs.php
-# FIXME: not sure about this naming.
-%attr(755,root,root) %{_bindir}/%{name}-scm
+%attr(755,root,root) %{_libdir}/scm
This page took 0.091801 seconds and 4 git commands to generate.