342 lines
10 KiB
RPMSpec
342 lines
10 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.16
|
|
Release: 2mamba
|
|
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-3.2.16-perl-5.16.patch
|
|
License: GPL
|
|
## AUTOBUILDREQ-BEGIN
|
|
BuildRequires: apache-mod_perl
|
|
BuildRequires: libperl
|
|
BuildRequires: perl-Algorithm-Diff
|
|
BuildRequires: perl-Authen-NTLM
|
|
BuildRequires: perl-Authen-Radius
|
|
BuildRequires: perl-CSS-Minifier
|
|
BuildRequires: perl-Class-Inspector
|
|
BuildRequires: perl-Convert-BinHex
|
|
BuildRequires: perl-Crypt-PasswdMD5
|
|
BuildRequires: perl-DBI
|
|
BuildRequires: perl-Date-Pcalc
|
|
BuildRequires: perl-Digest-HMAC
|
|
BuildRequires: perl-Email-Valid
|
|
BuildRequires: perl-Encode-Locale
|
|
BuildRequires: perl-FCGI
|
|
BuildRequires: perl-File-Listing
|
|
BuildRequires: perl-GSSAPI
|
|
BuildRequires: perl-HTTP-Date
|
|
BuildRequires: perl-HTTP-GHTTP
|
|
BuildRequires: perl-HTTP-Message
|
|
BuildRequires: perl-HTTP-Negotiate
|
|
BuildRequires: perl-IO-Interactive
|
|
BuildRequires: perl-IO-Socket-SSL
|
|
BuildRequires: perl-IO-stringy
|
|
BuildRequires: perl-JSON
|
|
BuildRequires: perl-JavaScript-Minifier
|
|
BuildRequires: perl-LWP-MediaTypes
|
|
BuildRequires: perl-MIME-Tools
|
|
BuildRequires: perl-Mail-IMAPClient
|
|
BuildRequires: perl-Mail-POP3Client
|
|
BuildRequires: perl-Mail-Tools
|
|
BuildRequires: perl-Net-HTTP
|
|
BuildRequires: perl-Net-IMAP-Simple
|
|
BuildRequires: perl-Net-LDAP
|
|
BuildRequires: perl-Net-SMTP-SSL
|
|
BuildRequires: perl-Net-SMTP-TLS-ButMaintained
|
|
BuildRequires: perl-Net-SSLeay
|
|
BuildRequires: perl-SOAP-Lite
|
|
BuildRequires: perl-Test-WWW-Selenium
|
|
BuildRequires: perl-Text-CSV
|
|
BuildRequires: perl-Text-Diff
|
|
BuildRequires: perl-TimeDate
|
|
BuildRequires: perl-URI
|
|
BuildRequires: perl-URI-urn
|
|
BuildRequires: perl-WWW-RobotRules
|
|
BuildRequires: perl-XML-FeedPP
|
|
BuildRequires: perl-XML-TreePP
|
|
BuildRequires: perl-YAML
|
|
BuildRequires: perl-devel
|
|
BuildRequires: perl-libwww
|
|
## AUTOBUILDREQ-END
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
Requires(pre): httpd
|
|
Requires: perl-Apache-Reload
|
|
Requires: perl-Apache-Clean
|
|
Requires: perl-DBD-mysql
|
|
Requires: perl-Net-DNS
|
|
Requires: perl-YAML-LibYAML
|
|
Requires: perl-Crypt-SSLeay
|
|
Requires: perl-Encode-HanExtra
|
|
Requires: perl-GD
|
|
Requires: perl-GD-Text
|
|
Requires: perl-GD-Graph
|
|
Requires: perl-JSON-XS
|
|
Requires: perl-PDF-API2
|
|
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
|
|
|
|
# Don't package those files
|
|
rm -f %{buildroot}/opt/otrs/{find_provides.sh,find_requires.sh}
|
|
|
|
%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
|
|
Require all granted
|
|
Order allow,deny
|
|
Allow from all
|
|
</Location>
|
|
|
|
<Directory %{installdir}/var/httpd/htdocs></Directory>
|
|
AllowOverride All
|
|
Require all granted
|
|
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
|
|
systemctl -q daemon-reload
|
|
/sbin/chkconfig --add otrs
|
|
/sbin/service otrs start
|
|
fi
|
|
if [ $1 -ge 1 ]; then
|
|
/opt/otrs/bin/otrs.SetPermissions.pl /opt/otrs --otrs-user=otrs \
|
|
--otrs-group=apache --web-user=apache --web-group=nobody /opt/otrs >/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
|
|
%config(noreplace) /opt/otrs/Kernel/Config/GenericAgent.pm
|
|
%doc COPYING
|
|
|
|
%changelog
|
|
* Wed May 28 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.16-2mamba
|
|
- added missing perl requirement checked with /opt/otrs/bin/otrs.CheckModules.pl
|
|
|
|
* Wed May 28 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.16-1mamba
|
|
- update to 3.2.16
|
|
- fix SetPermissions script name in post script
|
|
|
|
* 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
|