[rt-devel] FW: post of rt 2.0.15 RPM

Jason Corley Jason.Corley at togethersoft.com
Wed Dec 18 09:25:21 EST 2002


Sorry for the MIME attachments.  Here is the spec file, patch, and perl.txt referenced below.
Thanks,
Jason

----- Begin rt.spec -----

%define name            rt
%define version         2.0.15
%define release         1
%define installdir      /var/rt2
%define logdir          /var/log/rt2
%define webuser         apache

Name: %{name}
Version: %{version}
Release: %{release}
Group: Applications/Web
Packager: Jason Corley <jason.corley at togethersoft.com>
Vendor: http://www.fsck.com/projects/%{name}
Source: http://www.fsck.com/pub/%{name}/release/%{name}.tar.gz
Copyright: GPL
Summary: %{name} Request Tracker
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: perl
Requires: mod_perl > 1.22
# Perl Modules are different per platform, distribution, and/or user so
# I've left getting them installed properly as an exercise for the user
# Here's a list of what you need (ripped from the testdeps tool)
#       Digest::MD5
#       Storable
#       DBI 1.18
#       DBIx::DataSource 0.02
#       DBIx::SearchBuilder 0.48
#       HTML::Entities
#       MLDBM
#       Net::Domain
#       Net::SMTP
#       Params::Validate 0.02
#       HTML::Mason 1.02
#       CGI::Cookie 1.20
#       Apache::Cookie
#       Apache::Session 1.53
#       Date::Parse
#       Date::Format
#       MIME::Entity 5.108
#       Mail::Mailer 1.20
#       Getopt::Long 2.24
#       Tie::IxHash
#       Text::Wrapper
#       Text::Template
#       File::Spec 0.8
#       Errno
#       FreezeThaw
#       File::Temp
#       Log::Dispatch 1.6
# For MySQL you also need this:
#       DBD::mysql 2.0416
# For PostgreSQL you also need this:
#       DBD::Pg
# For Oracle you also need this:
#       DBD::Oracle
Patch: %{name}.patch

%description
RT is an industrial-grade ticketing system. It lets a group
of people intelligently and efficiently manage requests
submitted by a community of users. RT is used by systems
administrators, customer support staffs, NOCs, developers
and even marketing departments at over a thousand sites
around the world.

%prep
groupadd %{name} || true
%setup -q -n %{name}-2-0-15

# Need to patch some files to make them accept %{installdir}
%patch
perl -pi -e 's at ___CHANGEME___@%{installdir}@' lib/RT/TestHarness.pm Makefile

%build


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

#
# Perform all the non-site specfic steps whilst building the package
#
make dirs DESTDIR=$RPM_BUILD_ROOT
make libs-install INSTALLSITELIB=$RPM_BUILD_ROOT%{installdir}/lib INSTALLMAN1DIR=$RPM_BUILD_ROOT%{installdir}/man/man1 INSTALLMAN3DIR=$RPM_BUILD_ROOT%{installdir}/man/man3 DESTDIR=$RPM_BUILD_ROOT
make html-install DESTDIR=$RPM_BUILD_ROOT
make bin-install DESTDIR=$RPM_BUILD_ROOT

#
# fixperms needs these, so make fake empty files
touch $RPM_BUILD_ROOT%{installdir}/etc/insertdata $RPM_BUILD_ROOT%{installdir}/etc/config.pm
make fixperms insert-install WEB_USER=%{webuser} DESTDIR=$RPM_BUILD_ROOT

#
# Copy in the files needed again after install
#
mkdir -p $RPM_BUILD_ROOT%{installdir}/postinstall/bin
cp -rp Makefile etc tools $RPM_BUILD_ROOT%{installdir}/postinstall
cp -rp bin/initacls.* $RPM_BUILD_ROOT%{installdir}/postinstall/bin

# logging in %{logdir}
mkdir -p $RPM_BUILD_ROOT%{logdir}
chown %{webuser} $RPM_BUILD_ROOT%{logdir}
chgrp %{name} $RPM_BUILD_ROOT%{logdir}
chmod ug=rwx,o= $RPM_BUILD_ROOT%{logdir}

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

#
# A new %{name} groups is required
#
%pre
groupadd %{name} || true

#
# Show the user the site specific steps required after install
#
%post
cat <<EOF
-----------------------------------------------------------------------
%{name} installation is complete. Now create the %{name} database by running:
-----------------------------------------------------------------------

# cd %{installdir}/postinstall
# make config-replace initialize.mysql insert RT_LOG_PATH=%{logdir} DB_RT_PASS=new_rt_user_password

Choose your own new_rt_user_password. You will need the MySQL root password.
You can try PostgreSQL or Oracle instead of MySQL but that is untested.

Review and configure your site specific details in %{installdir}/etc/config.pm
EOF

%preun
groupdel %{name}

%files
%dir %{installdir}
%{installdir}/bin
%{installdir}/WebRT
%{installdir}/lib
%{installdir}/local
%{installdir}/man
%{installdir}/postinstall
%dir %{installdir}/etc
%{installdir}/etc/insertdata
%config %{installdir}/etc/config.pm
%dir %{logdir}

%changelog
* Fri Dec 13 2002 Jason Corley <jason.corley at togethersoft.com>
- Added macros to make specfile more portable and configurable
- Added rt.patch to make the installer actually install into the configured
  directories
- Removed perl module dependencies because they don't map well from distro to
  distro...  See comment
* Mon Sep 24 2001 Jesse Vincent <jesse at bestpractical.com>
- Switch to rt DESTDIR support
* Fri Sep 14 2001 Cris Bailiff <c.bailiff at devsecure.com>
- Fix permissions on created /var/log/rt2 and roll in 2.0.7
* Tue Sep 4 2001 Cris Bailiff <c.bailiff at devsecure.com>
- created initial spec file
* Tue Sep 4 2001 Cris Bailiff <c.bailiff at devsecure.com>
- created initial spec file
* Tue Sep 4 2001 Cris Bailiff <c.bailiff at devsecure.com>
- created initial spec file

----- End rt.spec -----

----- Begin rt.patch -----

--- Makefile    Fri Oct  4 14:48:46 2002
+++ Makefile.new        Mon Dec 16 13:29:21 2002
@@ -40,7 +40,7 @@
 # RT_PATH is the name of the directory you want make to install RT in
 # RT must be installed in its own directory (don't set this to /usr/local)

-RT_PATH                        =       /opt/rt2
+RT_PATH                        =       ___CHANGEME___

 # The rest of these paths are all configurable, but you probably don't want to
 # put them elsewhere
--- lib/RT/TestHarness.pm       Tue Nov  6 18:04:14 2001
+++ lib/RT/TestHarness.pm.new   Mon Dec 16 13:30:25 2002
@@ -1,4 +1,4 @@
-use lib "/opt/rt2/etc/";
+use lib "___CHANGEME___/etc/";

 use RT::Interface::CLI  qw(CleanEnv LoadConfig DBConnect
                           GetCurrentUser GetMessageContent);
--- Makefile    Fri Oct  4 14:48:46 2002
+++ Makefile.new        Mon Dec 16 17:11:28 2002
@@ -294,16 +294,15 @@
        chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
        chmod -R $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_LIB_PATH)
        ( cd ./lib; \
-         $(PERL) Makefile.PL INSTALLSITELIB=$(RT_LIB_PATH) \
-                             INSTALLMAN1DIR=$(RT_MAN_PATH)/man1 \
-                             INSTALLMAN3DIR=$(RT_MAN_PATH)/man3 \
+         $(PERL) Makefile.PL INSTALLSITELIB=$(DESTDIR)$(RT_LIB_PATH) \
+                             INSTALLMAN1DIR=$(DESTDIR)$(RT_MAN_PATH)/man1 \
+                             INSTALLMAN3DIR=$(DESTDIR)$(RT_MAN_PATH)/man3 \
            && make \
            && make test \
            && $(PERL) -p -i -e " s'!!RT_VERSION!!'$(RT_VERSION)'g;" blib/lib/RT.pm ;\
            make install \
-                          INSTALLSITEMAN1DIR=$(RT_MAN_PATH)/man1 \
-                          INSTALLSITEMAN3DIR=$(RT_MAN_PATH)/man3 \
-                          DESTDIR=$(DESTDIR) \
+                          INSTALLSITEMAN1DIR=$(DESTDIR)$(RT_MAN_PATH)/man1 \
+                          INSTALLSITEMAN3DIR=$(DESTDIR)$(RT_MAN_PATH)/man3 \
        )

 html-install:

----- End rt.patch -----

----- Begin perl.txt -----

groff-perl-1.17.2-12
mod_perl-1.26-5
perl-5.6.1-34.99.6
perl-Apache-DBI-0.89-8
perl-Apache-Session-1.54-8
perl-Archive-Tar-0.22-15
perl-Cache-Cache-1.01-8
perl-CGI.pm-2.89-8
perl-Class-Container-0.08-8
perl-Class-Data-Inheritable-0.02-8
perl-Class-ReturnValue-0.40-8
perl-CPAN-1.59_54-34.99.6
perl-Date-Calc-5.0-15
perl-DateManip-5.40-15
perl-DBD-MySQL-1.2219-6
perl-DB_File-1.75-34.99.6
perl-DBI-1.21-1
perl-DBIx-DataSource-0.02-8
perl-DBIx-SearchBuilder-0.73-8
perl-Devel-StackTrace-1.02-8
perl-Digest-MD5-2.20-1
perl-Digest-SHA1-2.01-8
perl-Error-0.15-8
perl-Exception-Class-1.07-8
perl-FreezeThaw-0.43-8
perl-HTML-Mason-1.16-8
perl-HTML-Parser-3.26-2
perl-HTML-Tagset-3.03-14
perl-IO-stringy-2.108-8
perl-IPC-ShareLite-0.09-8
perl-libapreq-1.0-8
perl-libnet-1.0901-17
perl-libwww-perl-5.63-9
perl-libxml-enno-1.02-15
perl-libxml-perl-0.07-14
perl-Log-Dispatch-2.01-8
perl-MailTools-1.53-8
perl-MIME-Base64-2.12-14
perl-MIME-tools-5.411-8
perl-MLDBM-2.01-8
perl-NDBM_File-1.75-34.99.6
perl-Params-Validate-0.24-8
perl-Parse-Yapp-1.05-15
perl-Scalar-List-Utils-1.09-8
perl-SGMLSpm-1.03ii-4
perl-Storable-1.0.14-15
perl-Test-Inline-0.15-8
perl-Test-Simple-0.47-8
perl-Text-Template-1.43-8
perl-Text-Wrapper-1.000-8
perl-Tie-IxHash-1.21-8
perl-TimeDate-1.10-14
perl-Time-HiRes-1.20-14
perl-URI-1.17-16
perl-XML-Dumper-0.4-12
perl-XML-Encoding-1.01-9
perl-XML-Grove-0.46alpha-11
perl-XML-Parser-2.30-15
perl-XML-Twig-2.02-9

----- End perl.txt -----





-----Original Message-----
From: Jason Corley 
Sent: Tuesday, December 17, 2002 1:46 PM
To: 'rt-devel at lists.fsck.com'
Subject: post of rt 2.0.15 RPM



All,
I have spent the last few days cleaning up the rt spec file and making the RPM a little more configurable.
I haven't tested this extensively but all of the parts were built on Red Hat 7.3 and are working for me
at the moment.  I'm not a list subscriber and don't really plan on maintaining this, but I thought I would
provide the spec file, patch, and SRPM to the list.  Hopefully they will be of use to some of you.  I used
/usr/lib/rpm/cpanflute2 from Red Hat's rpm-build package to build all the necessary perl modules and I've
also attached a text list of all the perl RPMs (rt related or otherwise) installed on my Red Hat 7.3
system for reference.  If you find a bug or want to respond to me, please do so directly.  I apologize in
advance for all the attachments.
Thanks,
Jason



More information about the Rt-devel mailing list