2
# RPM spec file for SUSE Linux 9.1 of the OTRS package
3
# Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
5
# $Id: suse-otrs-10.0.spec,v 1.3.2.1 2007/03/08 19:36:42 martin Exp $
7
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
8
# the enclosed file COPYING for license information (GPL). If you
9
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
12
# please send bugfixes or comments to bugs+rpm@otrs.org
15
Summary: The Open Ticket Request System.
18
Copyright: GNU GENERAL PUBLIC LICENSE Version 2, June 1991
19
Group: Applications/Mail
21
Requires: perl perl-DBI perl-GD perl-GDGraph perl-GDTextUtil perl-Net-DNS perl-Digest-MD5 apache2 apache2-mod_perl mysql mysql-client perl-Msql-Mysql-modules mysql-shared fetchmail procmail perl-libwww-perl
24
Source0: otrs-%{version}.tar.bz2
25
BuildRoot: %{_tmppath}/%{name}-%{version}-build
37
cp Kernel/Config.pm.dist Kernel/Config.pm
38
cd Kernel/Config/ && for foo in *.dist; do cp $foo `basename $foo .dist`; done && cd ../../
39
# copy all crontab dist files
40
for foo in var/cron/*.dist; do mv $foo var/cron/`basename $foo .dist`; done
41
# copy all .dist files
42
cp .procmailrc.dist .procmailrc
43
cp .fetchmailrc.dist .fetchmailrc
44
cp .mailfilter.dist .mailfilter
47
# delete old RPM_BUILD_ROOT
48
rm -rf $RPM_BUILD_ROOT
50
export DESTROOT="/opt/otrs/"
51
# create RPM_BUILD_ROOT DESTROOT
52
mkdir -p $RPM_BUILD_ROOT/$DESTROOT/
54
cp -R . $RPM_BUILD_ROOT/$DESTROOT
55
# install init-Script and rc.config entry
56
install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
57
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
58
install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
59
install -d -m 744 $RPM_BUILD_ROOT/var/adm/fillup-templates
60
install -d -m 755 $RPM_BUILD_ROOT/etc/apache2/conf.d
62
# replace apache with apache2
63
sed "s/rcapache/rcapache2/" scripts/suse-rcotrs-config > /tmp.otrs.$$ && mv /tmp.otrs.$$ scripts/suse-rcotrs-config
64
sed "s/apache/apache2/" scripts/suse-rcotrs > /tmp.otrs.$$ && mv /tmp.otrs.$$ scripts/suse-rcotrs
65
install -m 644 scripts/suse-rcotrs-config $RPM_BUILD_ROOT/etc/sysconfig/otrs
67
install -m 755 scripts/suse-rcotrs $RPM_BUILD_ROOT/etc/init.d/otrs
68
rm -f $RPM_BUILD_ROOT/sbin/otrs
69
ln -s ../../etc/init.d/otrs $RPM_BUILD_ROOT/usr/sbin/rcotrs
71
install -m 644 scripts/apache2-httpd-new.include.conf $RPM_BUILD_ROOT/etc/apache2/conf.d/otrs.conf
75
useradd $OTRSUSER || :
78
$RPM_BUILD_ROOT/opt/otrs/bin/SetPermissions.sh $RPM_BUILD_ROOT/opt/otrs $OTRSUSER wwwrun www www
81
# remember about the installed version
82
if test -e /opt/otrs/RELEASE; then
83
cat /opt/otrs/RELEASE|grep VERSION|sed 's/VERSION = //'|sed 's/ /-/g' > /tmp/otrs-old.tmp
87
echo -n "Check OTRS user (/etc/passwd)... "
88
if cat /etc/passwd | grep $OTRSUSER > /dev/null ; then
89
echo "$OTRSUSER exists."
91
usermod -g www $OTRSUSER
93
usermod -d /opt/otrs $OTRSUSER
95
useradd $OTRSUSER -d /opt/otrs/ -s /bin/false -g nogroup -c 'OTRS System User' && echo "$OTRSUSER added."
101
%{fillup_and_insserv -s otrs START_OTRS}
103
# if it's a major-update backup old version templates (maybe not compatible!)
104
if test -e /tmp/otrs-old.tmp; then
105
TOINSTALL=`echo %{version}| sed 's/..$//'`
106
OLDOTRS=`cat /tmp/otrs-old.tmp`
107
if echo $OLDOTRS | grep -v "$TOINSTALL" > /dev/null; then
108
echo "backup old (maybe not compatible) templates (of $OLDOTRS)"
109
for i in /opt/otrs/Kernel/Output/HTML/Standard/*.rpmnew;
110
do BF=`echo $i|sed 's/.rpmnew$//'`; mv -v $BF $BF.backup_maybe_not_compat_to.$OLDOTRS; mv $i $BF;
113
rm -rf /tmp/otrs-old.tmp
116
# OTRS 2.0 -> OTRS 2.1
117
# remove old ticket config file
118
if test -e /opt/otrs/Kernel/Config/Files/Ticket.pm; then
119
mv /opt/otrs/Kernel/Config/Files/Ticket.pm /opt/otrs/Kernel/Config/Files/Ticket.pm.not_longer_used
121
# remove old ticket postmaster config file
122
if test -e /opt/otrs/Kernel/Config/Files/TicketPostMaster.pm; then
123
mv /opt/otrs/Kernel/Config/Files/TicketPostMaster.pm /opt/otrs/Kernel/Config/Files/TicketPostMaster.pm.not_longer_used;
125
# remove old faq config file
126
if test -e /opt/otrs/Kernel/Config/Files/FAQ.pm; then
127
mv /opt/otrs/Kernel/Config/Files/FAQ.pm /opt/otrs/Kernel/Config/Files/FAQ.pm.not_longer_used;
136
echo " Execute 'SuSEconfig' to configure the webserver."
138
echo "[start Apache and MySQL]"
139
echo " Execute 'rcapache2 restart' and 'rcmysql start' in case they don't run."
141
echo "[install the OTRS database]"
142
echo " Use a webbrowser and open this link:"
143
echo " http://$HOST/otrs/installer.pl"
145
echo "[OTRS services]"
146
echo " Start OTRS 'rcotrs start-force' (rcotrs {start|stop|status|restart|start-force|stop-force})."
150
echo " Your OTRS Team"
151
echo " http://otrs.org/"
155
rm -rf $RPM_BUILD_ROOT
158
%config(noreplace) /etc/sysconfig/otrs
159
%config /etc/apache2/conf.d/otrs.conf
167
* Thu Oct 18 2006 - martin+rpm@otrs.org
168
- added rename of old /opt/otrs/Kernel/Config/Files/(Ticket|TicketPostMaster|FAQ).pm files
169
* Sun Mar 25 2006 - martin+rpm@otrs.org
170
- added SUSE 10.0 support