Actions: | Security

AllGoodBits.org

Navigation: Home | Services | Tools | Articles | Other

Self-contained RT using perlbrew

I have deployed Request Tracker(RT) for many different organizations and I have had to be subject to various different constraints on my approach to deployment. Therefore I am well aware that there are lots of possible approaches. This article outlines one approach that had some clear benefits over others that I have used.

Overview

Details

Comments

  • You will still need to create (or import/upgrade) the database

  • On a multicore machine, you might want to add '-j' to your perlbrew install:

    perlbrew install -j $(expr $(nproc) + 1) perl-5.18.1
    

Example specfile of the perlbrew/megarpm approach for RT:

Name:    rt
Version: 4.2.0
Release: 1%{?dist}
Summary: Request Tracker, the Mega-rpm, including its own perl

Group:   Applications/Internet
License: GPLv2+
URL:     http://www.bestpractical.com/rt

BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: perlbrew
BuildRequires: expat-devel
BuildRequires: gd-devel
BuildRequires: mysql-devel
BuildRequires: openssl-devel
Requires: mysql
Requires: gd
Requires: gnupg2
Requires: graphviz
Requires: openldap
Requires: openssl

AutoReqProv: no

%global RT_PREFIX /opt/rt4
%global PERL_PREFIX /opt/perl5

# NOTICE: you'll need to modify the __os_install_post macro that you can see
# in your rpm --showrc output, so override it in e.g. ~/.rpmmacros. It
# *shouldn't* be here because specfiles don't support multiline macro defs.
# Just remove line %{_rpmconfigdir}/brp-strip-static-archive

%description
RT is an enterprise-grade ticketing system which enables a group of people
to intelligently and efficiently manage tasks, issues, and requests submitted
by a community of users.

This build is with a custom perl5 install to keep it entirely separate from
vendor perl.

%prep

%build

%install

rm -rf %{buildroot}
echo "Copy complete perl5 base directory to buildroot"
mkdir -p %{buildroot}/%{PERL_PREFIX}
cp -Rp %{PERL_PREFIX}/* %{buildroot}/%{PERL_PREFIX}/

echo "Copy complete rt4 base directory to buildroot"
mkdir -p %{buildroot}/%{RT_PREFIX}
cp -Rp %{RT_PREFIX}/* %{buildroot}/%{RT_PREFIX}/

%clean
rm -rf %{buildroot}


%files
#custom perl5
%defattr(644,root,root)
%attr(755,root,root) %{PERL_PREFIX}/bin/*
%{PERL_PREFIX}/etc/*
%{PERL_PREFIX}/perls/*
%{PERL_PREFIX}/Conf.pm
%dir %attr(755, root, root) %{PERL_PREFIX}/bin
%dir %attr(755, root, root) %{PERL_PREFIX}/etc
%dir %attr(755, root, root) %{PERL_PREFIX}/perls

#rt stuff

#%config{noreplace} %{_sysconfdir}/init.d/rt
#%config{noreplace} /opt/rt4/etc/RT_SiteConfig.pm

%attr(755,root,root) %{RT_PREFIX}/bin/*
%attr(755,root,root) %{RT_PREFIX}/sbin/*
%attr(0644,apache,apache) %{RT_PREFIX}/etc/*
%{RT_PREFIX}/lib/*
%{RT_PREFIX}/share/html/*
%{RT_PREFIX}/share/po/*
%{RT_PREFIX}/share/fonts/*
%attr(0755,apache,apache) %{RT_PREFIX}/var/log
%attr(0770,apache,apache) %{RT_PREFIX}/var/mason_data
%attr(0770,apache,apache) %{RT_PREFIX}/var/session_data
%{RT_PREFIX}/local/*

%changelog
* Fri Nov 8 2013 Duncan Hutty <dhutty@allgoodbits.org>