This repository has been archived on 2024-11-07. You can view files and clone it, but cannot push or open issues or pull requests.
otrs/otrs.spec

268 lines
8.1 KiB
RPMSpec

%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 <silvan.calarco@mambasoft.it>
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
<Location /otrs>
# 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
</Location>
<Directory %{installdir}/var/httpd/htdocs></Directory>
AllowOverride All
RewriteEngine on
Order allow,deny
Allow from All
</Directory>
%if "%{?servername}" != ""
%if "%(dirname %installdir)" != "%{serverdir}"
<VirtualHost *:80>
%{?adminmail:ServerAdmin %adminmail}
DocumentRoot %{installdir}/var/httpd/htdocs/
ServerName %{servername}
ErrorLog %{serverlogdir}/%{servername}-error_log
CustomLog %{serverlogdir}/%{servername}-access_log common
</VirtualHost>
%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 <autodist@mambasoft.it> 3.2.9-1mamba
- automatic update by autodist
* Sun Jun 23 2013 Automatic Build System <autodist@mambasoft.it> 3.2.8-1mamba
- automatic version update by autodist
* Tue May 28 2013 Automatic Build System <autodist@mambasoft.it> 3.2.7-1mamba
- automatic update by autodist
* Sun Apr 14 2013 Automatic Build System <autodist@mambasoft.it> 3.2.5-1mamba
- automatic version update by autodist
* Thu Mar 21 2013 Automatic Build System <autodist@mambasoft.it> 3.2.3-1mamba
- automatic version update by autodist
* Wed Feb 20 2013 Automatic Build System <autodist@mambasoft.it> 3.2.2-1mamba
- automatic version update by autodist
* Fri Sep 14 2012 Automatic Build System <autodist@mambasoft.it> 3.1.10-1mamba
- automatic version update by autodist
* Tue Aug 07 2012 Automatic Build System <autodist@mambasoft.it> 3.1.8-1mamba
- automatic version update by autodist
* Mon Oct 03 2011 Automatic Build System <autodist@mambasoft.it> 3.0.10-1mamba
- automatic version update by autodist
* Mon Jul 25 2011 Automatic Build System <autodist@mambasoft.it> 3.0.9-1mamba
- automatic version update by autodist
* Wed Jun 08 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.8-1mamba
- update to 3.0.8
* Thu May 12 2011 Automatic Build System <autodist@mambasoft.it> 3.0.7-1mamba
- automatic update by autodist
* Wed Nov 10 2010 Automatic Build System <autodist@mambasoft.it> 2.4.9-1mamba
- automatic update by autodist
* Wed Sep 22 2010 Automatic Build System <autodist@mambasoft.it> 2.4.8-1mamba
- automatic update by autodist
* Tue Apr 27 2010 Automatic Build System <autodist@mambasoft.it> 2.4.7-1mamba
- automatic update by autodist
* Tue Jan 26 2010 Automatic Build System <autodist@mambasoft.it> 2.4.6-1mamba
- automatic update by autodist
* Fri Oct 02 2009 Automatic Build System <autodist@mambasoft.it> 2.4.4-1mamba
- automatic update by autodist
* Tue Aug 18 2009 Automatic Build System <autodist@mambasoft.it> 2.4.3-1mamba
- automatic update by autodist
* Tue Aug 04 2009 Automatic Build System <autodist@mambasoft.it> 2.4.2-1mamba
- automatic update by autodist
* Wed Jul 22 2009 Automatic Build System <autodist@mambasoft.it> 2.4.1-1mamba
- automatic update by autodist
* Wed Mar 18 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.4-4mamba
- disable internal dependency generator to avoid provide conflicts for several perl packages
* Sun Mar 15 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.4-3mamba
- added initscript for setting cron jobs
* Sat Mar 14 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.4-2mamba
- added support for SSI via perl-Apache-Clean
* Fri Mar 13 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.4-1mamba
- package created by autospec