]> git.pld-linux.org Git - packages/eventum.git/blobdiff - eventum.spec
- eventum 1.6.0-RC2
[packages/eventum.git] / eventum.spec
index 3881e7f8f5b4fdcd031da92b26b6f33a10670e93..883d0998cdbc329bea24a43918f12c8887d80a88 100644 (file)
@@ -7,33 +7,39 @@
 #  - dynCalendar.js (http://www.phpguru.org/dyncalendar.html)
 #  - overLIB 3.5.1 (http://www.bosrup.com/web/overlib/)
 #  - A few other small javascript libraries
-# - need start-stop-daemon (from dpkg for now)
+# - 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)
-
-%define        uid     146
-%define        gid     146
+%bcond_with    qmail   # build the router-qmail subpackage
 
 # snapshot: DATE
-#define _snap 20050227
+#define        _snap 20050227
+
+# release candidate
+%define _rc            RC2
+
+%define        _rel    6
 
 %if 0%{?_snap}
-%define _source http://downloads.mysql.com/snapshots/%{name}/%{name}-nightly-%{_snap}.tar.gz
+%if 0%{?_rc}
+%define        _source http://pessoal.org/%{name}-%{version}-%{_rc}.tar.gz
 %else
-%define _source http://mysql.wildyou.net/Downloads/%{name}/%{name}-%{version}.tar.gz
+%define        _source http://downloads.mysql.com/snapshots/%{name}/%{name}-nightly-%{_snap}.tar.gz
+%endif
+%else
+%define        _source http://mysql.dataphone.se/Downloads/%{name}/%{name}-%{version}.tar.gz
 %endif
-
-%define _rel 240
 
 Summary:       Eventum Issue / Bug tracking system
 Summary(pl):   Eventum - system ¶ledzenia spraw/b³êdów
 Name:          eventum
-Version:       1.5
-Release:       0.%{?_snap:%{_snap}.}%{_rel}
+Version:       1.6.0
+Release:       %{?_snap:0.%{_snap}.}%{?_rc:%{_rc}.}%{_rel}
 License:       GPL
 Group:         Applications/WWW
 Source0:       %{_source}
-# Source0-md5: 6a467e1a672983f26d72d4eb7568efb6
+# Source0-md5: a13d95ff52264d7460c688419794ffcc
+%{?_snap:NoSource:     0}
 Source1:       %{name}-apache.conf
 Source2:       %{name}-mail-queue.cron
 Source3:       %{name}-mail-download.cron
@@ -45,20 +51,28 @@ 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}-cvs-config.patch
 Patch2:                %{name}-irc-config.patch
 Patch3:                %{name}-PEAR.patch
-Patch10:       %{name}-db-20050227.patch
-Patch11:       %{name}-charset-recent-activity.patch
-URL:           http://dev.mysql.com/downloads/other/eventum/index.html
-BuildRequires: rpmbuild(macros) >= 1.177
+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
+Patch22:       eventum-cli-wr-separated.patch
+URL:           http://dev.mysql.com/downloads/other/eventum/
+BuildRequires: rpmbuild(macros) >= 1.223
 BuildRequires: sed >= 4.0
 Requires:      php >= 4.2.0
 Requires:      php-gd
 Requires:      php-imap
 Requires:      php-mysql
 Requires:      php-pcre
+Requires:      php-session
 Requires:      %{name}-base = %{epoch}:%{version}-%{release}
 Requires:      Smarty >= 2.6.2
 %if %{with pear}
@@ -86,13 +100,10 @@ BuildArch: noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sysconfdir     /etc/%{name}
-%define                _libdir         %{_prefix}/%{_lib}/%{name}
+%define                _libdir         %{_prefix}/lib/%{name}
 %define                _appdir %{_datadir}/%{name}
 %define                _smartyplugindir        %{php_pear_dir}/Smarty/plugins
 
-%define                _apache1dir     /etc/apache
-%define                _apache2dir     /etc/httpd
-
 %description
 Eventum is a user-friendly and flexible issue tracking system that can
 be used by a support department to track incoming technical support
@@ -112,6 +123,14 @@ reakcji.
 Summary:       Eventum base package
 Summary(pl):   Podstawowy pakiet Eventum
 Group:         Applications/WWW
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/groupadd
+Requires(postun):      /usr/sbin/userdel
+Requires(postun):      /usr/sbin/groupdel
+Provides:      user(eventum)
+Provides:      group(eventum)
 
 %description base
 This package contains base directory structure for Eventum.
@@ -336,8 +355,7 @@ Group:              Applications/WWW
 Requires:      %{name} = %{epoch}:%{version}-%{release}
 Requires:      php >= 4.1.0
 Requires:      php-sockets
-# FIXME just need start-stop-daemon
-Requires:      dpkg
+PreReq:                rc-scripts >= 0.4.0.18
 
 %description irc
 The IRC notification bot is a nice feature for remote teams that want
@@ -387,7 +405,8 @@ Summary:    Eventum SCM integration
 Summary(pl):   Integracja SCM dla Eventum
 Group:         Applications/WWW
 Requires:      %{name}-base = %{epoch}:%{version}-%{release}
-Requires:      php >= 4.1.0
+Requires:      php-cli >= 4.1.0
+Requires:      php-pcre
 
 %description scm
 This feature allows your software development teams to integrate your
@@ -416,6 +435,9 @@ Szczeg
 find . -type f -print0 | xargs -0 sed -i -e 's,
 $,,'
 
+rm -f setup.conf.php
+rm -rf misc/upgrade/*v1.[123]* # too old to support in PLD
+
 # packaging
 %patch0 -p1 -b .paths
 %patch1 -p1
@@ -423,11 +445,11 @@ $,,'
 %{?with_pear:%patch3 -p1 -b .PEAR}
 
 # bug fixes.
-%patch10 -p1
-%patch11 -p1
-
-# version that we support upgrading from
-mv misc/upgrade/v1.4_to_1.5 upgrade
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch22 -p1
 
 # replace in remaining scripts config.inc.php to system one
 grep -rl 'include_once(".*config.inc.php")' . | xargs sed -i -e '
@@ -440,8 +462,7 @@ sed -i -e '
 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"),
 '
-
-rm -f */*~ */*/*~
+find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -449,6 +470,7 @@ 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 \
        $RPM_BUILD_ROOT%{_appdir}/{include,htdocs/misc,upgrade} \
 
 cp -a *.php css customer images js manage reports rpc setup $RPM_BUILD_ROOT%{_appdir}/htdocs
@@ -459,18 +481,22 @@ 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 upgrade $RPM_BUILD_ROOT%{_appdir}
+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
 
 # 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
-sed -e 's,/usr/local/bin/php,/usr/bin/php4,' misc/cli/eventum \
-       > $RPM_BUILD_ROOT%{_bindir}/%{name}
+sed -e '1s,#!.*/bin/php,#!%{_bindir}/php4,' \
+       misc/cli/eventum > $RPM_BUILD_ROOT%{_bindir}/%{name}
 cp -f misc/cli/eventumrc_example eventumrc
 
 # scm
-echo '#!/usr/bin/php4 -q' > %{name}-scm
+echo '#!%{_bindir}/php4 -q' > %{name}-scm
 cat misc/scm/process_cvs_commits.php >> %{name}-scm
 install %{name}-scm $RPM_BUILD_ROOT%{_libdir}/scm
 
@@ -513,6 +539,7 @@ cp -a include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,tex
        $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
@@ -520,6 +547,7 @@ 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
@@ -528,35 +556,39 @@ rm -rf $RPM_BUILD_ROOT
 %addusertogroup http %{name}
 
 %post
-# apache1
-if [ -d %{_apache1dir}/conf.d ]; 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
-
 # 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
@@ -579,31 +611,18 @@ 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 %{_apache2dir}/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
 
-%postun
-# 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"
+%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
@@ -611,6 +630,7 @@ if [ "$1" = "0" ]; then
        %groupremove %{name}
 fi
 
+%if %{with qmail}
 %post router-qmail
 CF=/etc/qmail/control/virtualdomains
 if ! grep -q ':%{name}\b' $CF 2>/dev/null; then
@@ -634,6 +654,7 @@ fi
 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
@@ -645,75 +666,53 @@ if [ "$1" = "0" ]; then
        chown root:eventum %{_sysconfdir}/{config,private_key}.php
 fi
 
-%triggerpostun -- eventum < 1.4-2.160
-cp -f %{_sysconfdir}/config.php{,.rpmsave}
-# very loose trigger
-sed -i -e '
-/config.php/,/SQL variables/d;/_LOG/d;/APP_VERSION/d;/APP_BENCHMARK/,/content-type:/d
-' %{_sysconfdir}/config.php
-
-%triggerpostun -- eventum < 1.4-2.174
-cp -f %{_sysconfdir}/apache.conf{,.rpmsave}
-# loosely fix htdocs directory
-sed -i -e '
-s,%{_appdir},%{_appdir}/htdocs,
-' %{_sysconfdir}/apache.conf
-
-%triggerpostun mail-download -- eventum-mail-download < 1.4-2.20050222.232
-sed -i -e '
-s,%{_appdir}/misc,%{_appdir},
-s,http,eventum,
-' /etc/cron.d/eventum-mail-download
-touch /etc/cron.d/eventum-mail-download
-
-%triggerpostun mail-queue -- eventum-mail-queue < 1.4-2.20050222.232
-sed -i -e '
-s,%{_appdir}/misc,%{_appdir},
-s,http,eventum,
-' /etc/cron.d/eventum-mail-queue
-touch /etc/cron.d/eventum-mail-queue
+%triggerin -- apache1 >= 1.3.33-2
+%apache_config_install -v 1 -c %{_sysconfdir}/apache.conf
 
-%triggerpostun monitor -- eventum-monitor < 1.4-2.20050222.232
-sed -i -e '
-s,%{_appdir}/misc,%{_appdir},
-s,http,eventum,
-' /etc/cron.d/eventum-monitor
-touch /etc/cron.d/eventum-monitor
+%triggerun -- apache1 >= 1.3.33-2
+%apache_config_uninstall -v 1
 
-%triggerpostun reminder -- eventum-reminder < 1.4-2.20050222.232
-sed -i -e '
-s,%{_appdir}/misc,%{_appdir},
-s,http,eventum,
-' /etc/cron.d/eventum-reminder
-touch /etc/cron.d/eventum-reminder
+%triggerin -- apache >= 2.0.0
+%apache_config_install -v 2 -c %{_sysconfdir}/apache.conf
 
-%triggerpostun -- eventum < 1.4-2.20050222.2.208
-chgrp eventum %{_sysconfdir}/{core,config,private_key,setup}.php
+%triggerun -- apache >= 2.0.0
+%apache_config_uninstall -v 2
 
-%triggerpostun irc -- eventum-irc < 1.4-2.20050222.2.208
-chgrp eventum %{_sysconfdir}/irc.php
+# 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 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
+%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-0.240
-echo >&2 ""
-echo >&2 "Performing database upgrades!"
-echo >&2 "These will fail if your eventum user doesn't have ALTER privilege to database."
-echo >&2 ""
+%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
 
-scriptdir=%{_appdir}/upgrade
+%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
 
-/usr/bin/php4 -q $scriptdir/database_changes.php || {
-       echo >&2 "Please run manually: /usr/bin/php4 -q $scriptdir/database_changes.php"
-}
+%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
 
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog FAQ INSTALL README UPGRADE
-%doc misc/upgrade docs/* rpc/xmlrpc_client.php setup/schema.sql
+%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,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
@@ -725,6 +724,7 @@ scriptdir=%{_appdir}/upgrade
 
 %dir %{_appdir}/htdocs
 %{_appdir}/htdocs/*.php
+%{_appdir}/htdocs/*.ico
 %{_appdir}/htdocs/css
 %{_appdir}/htdocs/customer
 %{_appdir}/htdocs/images
@@ -735,7 +735,9 @@ scriptdir=%{_appdir}/upgrade
 %{_appdir}/htdocs/misc
 
 %{_appdir}/templates
-%{_appdir}/upgrade
+%dir %{_appdir}/upgrade
+%attr(755,root,root) %{_appdir}/upgrade/upgrade.sh
+%{_appdir}/upgrade/[!u]*
 
 %{_smartyplugindir}/*
 %if %{without pear}
@@ -752,7 +754,6 @@ scriptdir=%{_appdir}/upgrade
 %{_appdir}/include/class.mime_helper.php
 %{_appdir}/include/class.misc.php
 %{_appdir}/include/db_access.php
-%{_appdir}/include/jsrsServer.inc.php
 
 %dir %attr(730,root,eventum) /var/run/%{name}
 %dir %attr(730,root,eventum) /var/cache/%{name}
@@ -764,6 +765,8 @@ scriptdir=%{_appdir}/upgrade
 %dir %{_appdir}
 # qmail will ignore user, if it's home directory is not owned
 %attr(750,eventum,eventum) %dir /var/lib/%{name}
+# for saved routed emails
+%attr(770,root,eventum) %dir /var/lib/%{name}/routed_emails
 
 %files setup
 %defattr(644,root,root,755)
@@ -799,10 +802,12 @@ scriptdir=%{_appdir}/upgrade
 %{_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)
This page took 0.075361 seconds and 4 git commands to generate.