From b75bcc63e9b36be706ff8f105f2111d5f14f39a9 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Sat, 6 Jan 2024 08:19:58 +0100 Subject: [PATCH] automatic update by autodist [release 3.2.9-1mamba;Mon Aug 12 2013] --- README.md | 2 + otrs-2.3.4-perl-5.10.0.patch | 11 ++ otrs-initscript | 116 +++++++++++++++ otrs.spec | 267 +++++++++++++++++++++++++++++++++++ 4 files changed, 396 insertions(+) create mode 100644 otrs-2.3.4-perl-5.10.0.patch create mode 100644 otrs-initscript create mode 100644 otrs.spec diff --git a/README.md b/README.md index ef84a70..b9c5609 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # otrs +OTRS is an Open source Ticket Request System (also well known as trouble ticket system) with many features to manage customer telephone calls and e-mails. The system is built to allow your support, sales, pre-sales, billing, internal IT, helpdesk, etc. department to react quickly to inbound inquiries. + diff --git a/otrs-2.3.4-perl-5.10.0.patch b/otrs-2.3.4-perl-5.10.0.patch new file mode 100644 index 0000000..3588729 --- /dev/null +++ b/otrs-2.3.4-perl-5.10.0.patch @@ -0,0 +1,11 @@ +diff -Nru otrs-2.3.4.orig/Kernel/cpan-lib/File/Temp.pm otrs-2.3.4/Kernel/cpan-lib/File/Temp.pm +--- otrs-2.3.4.orig/Kernel/cpan-lib/File/Temp.pm 2008-07-01 09:39:25.000000000 +0200 ++++ otrs-2.3.4/Kernel/cpan-lib/File/Temp.pm 2009-03-13 21:07:32.000000000 +0100 +@@ -146,7 +146,6 @@ + use Fcntl 1.03; + use IO::Seekable; # For SEEK_* + use Errno; +-require VMS::Stdio if $^O eq 'VMS'; + + # pre-emptively load Carp::Heavy. If we don't when we run out of file + # handles and attempt to call croak() we get an error message telling diff --git a/otrs-initscript b/otrs-initscript new file mode 100644 index 0000000..563ee49 --- /dev/null +++ b/otrs-initscript @@ -0,0 +1,116 @@ +#!/bin/sh +# -- +# Cron.sh - start|stop OTRS Cronjobs +# Copyright (C) 2001-2008 OTRS AG, http://otrs.org/ +# -- +# $Id: Cron.sh,v 1.17 2008/07/18 08:05:56 tr Exp $ +# -- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# -- +# chkconfig: 345 90 10 +# description: Start/stop OTRS crons +# processname: otrs + +CURRENTUSER=`whoami` +CRON_USER="otrs" + +# check if a common user try to use -u +if test -n "$CRON_USER"; then + if test $CURRENTUSER != root; then + echo "Run this script just as OTRS user! Or use 'Cron.sh {start|stop|restart} OTRS_USER' as root!" + exit 5 + fi +fi + +# check if the cron user is specified +if test -z "$CRON_USER"; then + if test $CURRENTUSER = root; then + echo "Run this script just as OTRS user! Or use 'Cron.sh {start|stop|restart} OTRS_USER' as root!" + exit 5 + fi +fi + +OTRS_HOME=/opt/otrs + +#OTRS_ROOT=/opt/OpenTRS +if test -e $OTRS_HOME/var/cron; then + OTRS_ROOT=$OTRS_HOME +else + echo "No cronjobs in $OTRS_HOME/var/cron found!"; + echo " * Check the \$HOME (/etc/passwd) of the OTRS user. It must be the root dir of your OTRS system (e. g. /opt/otrs). "; + exit 5; +fi + +CRON_DIR=$OTRS_ROOT/var/cron +CRON_TMP_FILE=$OTRS_ROOT/var/tmp/otrs-cron-tmp.$$ + +echo "Cron.sh - start/stop OTRS cronjobs - <\$Revision: 1.17 $> " +echo "Copyright (C) 2001-2008 OTRS AG, http://otrs.org/" + +# +# main part +# +case "$1" in + # ------------------------------------------------------ + # start + # ------------------------------------------------------ + start) + # add -u to cron user if exits + if test -n "$CRON_USER"; then + CRON_USER=" -u $CRON_USER" + fi + + if mkdir -p $CRON_DIR; cd $CRON_DIR && ls -d * | grep -v '.dist'| grep -v '.rpm'| grep -v CVS | xargs cat > $CRON_TMP_FILE && crontab $CRON_USER $CRON_TMP_FILE; then + + rm -rf $CRON_TMP_FILE + echo "(using $OTRS_ROOT) done"; + exit 0; + else + echo "failed"; + exit 1; + fi + ;; + # ------------------------------------------------------ + # stop + # ------------------------------------------------------ + stop) + # add -u to cron user if exits + if test -n "$CRON_USER"; then + CRON_USER=" -u $CRON_USER" + fi + + if crontab $CRON_USER -r ; then + echo "done"; + exit 0; + else + echo "failed"; + exit 1; + fi + ;; + # ------------------------------------------------------ + # restart + # ------------------------------------------------------ + restart) + $0 stop "$CRON_USER" + $0 start "$CRON_USER" + ;; + # ------------------------------------------------------ + # Usage + # ------------------------------------------------------ + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + diff --git a/otrs.spec b/otrs.spec new file mode 100644 index 0000000..5734211 --- /dev/null +++ b/otrs.spec @@ -0,0 +1,267 @@ +%define otrs_userid 65414 +%define otrs_groupid 65414 + +%define serverdir %(apxs -q htdocsdir 2>/dev/null) + +# To create a customized installation of OTRS: +# autospec -u otrs -a5 \ +# -d "installdir=%serverdir/../www.example.com, \ +# sitename=example, \ +# adminmail=webmaster@example.com" + +%if "%{?installdir}" == "" + %define installdir /opt/otrs +%endif + +%if "%{?sitename}" != "" + %if "%{?servername}" == "" + %define servername otrs.example.com + %endif + %define serverlogdir %(apxs -q logfiledir 2>/dev/null) +%else + %if "%{?aliasdir}" == "" + %define aliasdir /otrs-web/ + %endif +%endif +%if "%{?scriptaliasdir}" == "" + %define scriptaliasdir /otrs/ +%endif + +Name: %{?sitename:%sitename-website-}otrs +Version: 3.2.9 +Release: 1mamba +Summary: An Open source Ticket Request System (also well known as trouble ticket system) +Group: Applications/Web +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.otrs.org/ +Source: http://ftp.otrs.org/pub/otrs/otrs-%{version}.tar.gz +Source1: otrs-initscript +Patch0: otrs-2.3.4-perl-5.10.0.patch +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Requires(pre): httpd +Requires: perl-Apache-Reload +Requires: perl-Apache-Clean +Requires: perl-DBD-mysql +Requires: perl-Net-DNS +Provides: perl(HTML::Safe) + +%description +OTRS is an Open source Ticket Request System (also well known as trouble ticket system) with many features to manage customer telephone calls and e-mails. The system is built to allow your support, sales, pre-sales, billing, internal IT, helpdesk, etc. department to react quickly to inbound inquiries. + +%prep +%setup -q -n otrs-%{version} +%patch0 -p1 + +%define _use_internal_dependency_generator 0 +%define __find_provides %{_builddir}/otrs-%{version}/find_provides.sh +cat > %{_builddir}/otrs-%{version}/find_provides.sh <<_EOF +#! /bin/sh +grep -v %{buildroot}/opt/otrs/Kernel/cpan-lib | \ +%{_prefix}/lib/rpm/find-provides %{buildroot} %{_target_cpu} +_EOF +chmod +x %{_builddir}/otrs-%{version}/find_provides.sh + +%define __find_requires %{_builddir}/otrs-%{version}/find_requires.sh +cat > %{_builddir}/otrs-%{version}/find_requires.sh <<_EOF +#! /bin/sh +%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} 2>/dev/null +# | +#while read line; do +# [ ! -f %{buildroot}/opt/otrs/\$line ] && echo "\$line" +#done +_EOF +chmod +x %{_builddir}/otrs-%{version}/find_requires.sh + +%build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +install -d -m 0755 %{buildroot}/opt/otrs +cp -a * %{buildroot}/opt/otrs/ + +cd %{buildroot}/opt/otrs/ +cp Kernel/Config.pm.dist Kernel/Config.pm +cd Kernel/Config +for foo in *.dist; do cp $foo `basename $foo .dist`; done +cd ../../var/cron +for foo in *.dist; do cp $foo `basename $foo .dist`; done +cd ../.. + +# check if all needed modules are installed +perl -cw bin/cgi-bin/index.pl +perl -cw bin/otrs.PostMaster.pl + +# web server configuration +install -d %{buildroot}%{_sysconfdir}/httpd/httpd.d + +# install initscript +install -D -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/otrs + +%if "%{?servername}" != "" +cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{servername}.conf << EOF +%else +cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{name}.conf << EOF +%endif +ScriptAlias %{scriptaliasdir} %{installdir}/bin/cgi-bin/ +Alias %{aliasdir} %{installdir}/var/httpd/htdocs/ + +Perlrequire %{installdir}/scripts/apache2-perl-startup.pl + +PerlModule Apache2::Reload +PerlInitHandler Apache2::Reload +PerlModule Apache2::RequestRec + + +# ErrorDocument 403 /otrs/customer.pl + ErrorDocument 403 %{installdir}/index.pl + SetHandler perl-script + SetOutputFilter INCLUDES + PerlOutputFilterHandler Apache::Clean + PerlResponseHandler ModPerl::Registry + Options +ExecCGI +Includes + PerlOptions +ParseHeaders + PerlOptions +SetupEnv + Order allow,deny + Allow from all + + + + AllowOverride All + RewriteEngine on + Order allow,deny + Allow from All + + +%if "%{?servername}" != "" +%if "%(dirname %installdir)" != "%{serverdir}" + + + %{?adminmail:ServerAdmin %adminmail} + DocumentRoot %{installdir}/var/httpd/htdocs/ + ServerName %{servername} + ErrorLog %{serverlogdir}/%{servername}-error_log + CustomLog %{serverlogdir}/%{servername}-access_log common + +%endif +%endif +EOF + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%pre +if [ $1 -eq 1 ]; then + /usr/sbin/groupadd otrs -g %{otrs_groupid} 2>/dev/null + /usr/sbin/useradd -u %{otrs_userid} -c 'OTRS user' -d /opt/otrs -g otrs -G apache \ + -s /bin/false otrs 2>/dev/null +fi +exit 0 + +%post +if [ $1 -eq 1 ]; then +# new install + /sbin/chkconfig --add otrs + /sbin/service otrs start +fi +if [ $1 -ge 1 ]; then + /opt/otrs/bin/SetPermissions.sh /opt/otrs otrs apache apache nobody >/dev/null +fi +exit 0 + +%preun +if [ $1 -eq 0 ]; then + /usr/sbin/groupdel otrs 2>/dev/null + /usr/sbin/userdel otrs 2>/dev/null +# erase + /sbin/chkconfig --del otrs + /sbin/service otrs stop +fi +exit 0 + +%files +%defattr(-,root,root) +%{_initrddir}/otrs +%if "%{?sitename}" != "" +%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{servername}.conf +%else +%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{name}.conf +%endif +%attr(755,otrs,otrs) /opt/otrs +%config(noreplace) /opt/otrs/Kernel/Config.pm +%doc COPYING + +%changelog +* Mon Aug 12 2013 Automatic Build System 3.2.9-1mamba +- automatic update by autodist + +* Sun Jun 23 2013 Automatic Build System 3.2.8-1mamba +- automatic version update by autodist + +* Tue May 28 2013 Automatic Build System 3.2.7-1mamba +- automatic update by autodist + +* Sun Apr 14 2013 Automatic Build System 3.2.5-1mamba +- automatic version update by autodist + +* Thu Mar 21 2013 Automatic Build System 3.2.3-1mamba +- automatic version update by autodist + +* Wed Feb 20 2013 Automatic Build System 3.2.2-1mamba +- automatic version update by autodist + +* Fri Sep 14 2012 Automatic Build System 3.1.10-1mamba +- automatic version update by autodist + +* Tue Aug 07 2012 Automatic Build System 3.1.8-1mamba +- automatic version update by autodist + +* Mon Oct 03 2011 Automatic Build System 3.0.10-1mamba +- automatic version update by autodist + +* Mon Jul 25 2011 Automatic Build System 3.0.9-1mamba +- automatic version update by autodist + +* Wed Jun 08 2011 Silvan Calarco 3.0.8-1mamba +- update to 3.0.8 + +* Thu May 12 2011 Automatic Build System 3.0.7-1mamba +- automatic update by autodist + +* Wed Nov 10 2010 Automatic Build System 2.4.9-1mamba +- automatic update by autodist + +* Wed Sep 22 2010 Automatic Build System 2.4.8-1mamba +- automatic update by autodist + +* Tue Apr 27 2010 Automatic Build System 2.4.7-1mamba +- automatic update by autodist + +* Tue Jan 26 2010 Automatic Build System 2.4.6-1mamba +- automatic update by autodist + +* Fri Oct 02 2009 Automatic Build System 2.4.4-1mamba +- automatic update by autodist + +* Tue Aug 18 2009 Automatic Build System 2.4.3-1mamba +- automatic update by autodist + +* Tue Aug 04 2009 Automatic Build System 2.4.2-1mamba +- automatic update by autodist + +* Wed Jul 22 2009 Automatic Build System 2.4.1-1mamba +- automatic update by autodist + +* Wed Mar 18 2009 Silvan Calarco 2.3.4-4mamba +- disable internal dependency generator to avoid provide conflicts for several perl packages + +* Sun Mar 15 2009 Silvan Calarco 2.3.4-3mamba +- added initscript for setting cron jobs + +* Sat Mar 14 2009 Silvan Calarco 2.3.4-2mamba +- added support for SSI via perl-Apache-Clean + +* Fri Mar 13 2009 Silvan Calarco 2.3.4-1mamba +- package created by autospec