Skip to content

Instantly share code, notes, and snippets.

Created February 18, 2010 20:35
Show Gist options
  • Save anonymous/308032 to your computer and use it in GitHub Desktop.
Save anonymous/308032 to your computer and use it in GitHub Desktop.
################################################################################
# Install CentOS 5.4 base-system:
################################################################################
%packages => [
"@Base", "dhcp","autodir","sendmail-cf","perl-Net-DNS",
"perl-Sys-Hostname-Long","perl-LDAP","cfengine",
"xorg-x11-xauth","xterm","openldap-clients",
"-java-1.5.0-ibm","-java-1.5.0-ibm-devel","-gpm"
]
################################################################################
yum install -y git perl-YAML perl-Catalyst-Runtime perl-Catalyst-View-TT \
perl-Class-Accessor perl-Class-Data-Inheritable perl-MIME-Types \
perl-LDAP perl-JSON httpd mod_ssl mod_perl
#########
# pkild #
#########
mkdir -p /opt/local/pkgs
cd /opt/local/pkgs
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Session-State-Cookie/perl-Catalyst-Plugin-Session-State-Cookie-0.09-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-Session-State-Cookie-0.09-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Session-Store-FastMmap/perl-Catalyst-Plugin-Session-Store-FastMmap-0.05-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-Session-Store-FastMmap-0.05-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Cache-FastMmap/perl-Cache-FastMmap-1.25-1.el5.rf.i386.rpm
rpm -Uvh perl-Cache-FastMmap-1.25-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Session/perl-Catalyst-Plugin-Session-0.19-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Object-Signature/perl-Object-Signature-1.05-1.el5.rf.noarch.rpm
rpm -Uvh perl-Object-Signature-1.05-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-Session-0.19-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Static-Simple/perl-Catalyst-Plugin-Static-Simple-0.20-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-Static-Simple-0.20-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Authorization-Roles/perl-Catalyst-Plugin-Authorization-Roles-0.05-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Set-Object/perl-Set-Object-1.22-1.el5.rf.i386.rpm
rpm -Uvh perl-Set-Object-1.22-1.el5.rf.i386.rpm
rpm -Uvh perl-Catalyst-Plugin-Authorization-Roles-0.05-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-Authentication/perl-Catalyst-Plugin-Authentication-0.10005-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-Authentication-0.10005-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Plugin-ConfigLoader/perl-Catalyst-Plugin-ConfigLoader-0.19-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Config-Any/perl-Config-Any-0.11-1.el5.rf.noarch.rpm
rpm -Uvh perl-Config-Any-0.11-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Data-Visitor/perl-Data-Visitor-0.15-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Tie-ToObject/perl-Tie-ToObject-0.03-1.el5.rf.noarch.rpm
rpm -Uvh perl-Tie-ToObject-0.03-1.el5.rf.noarch.rpm
rpm -Uvh perl-Data-Visitor-0.15-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Plugin-ConfigLoader-0.19-1.el5.rf.noarch.rpm
################################################################################
# CPAN2DEB
################################################################################
yum install -y perl-RPM-Specfile rpm-devel rpm-build
cpan2rpm http://search.cpan.org/CPAN/authors/id/A/AG/AGRUNDMA/Catalyst-Plugin-RequireSSL-0.06.tar.gz
cp /usr/src/redhat/RPMS/i386/perl-Catalyst-Plugin-RequireSSL-0.06-8.i386.rpm .
rpm -Uvh /usr/src/redhat/RPMS/i386/perl-Catalyst-Plugin-RequireSSL-0.06-8.i386.rpm
#cpan2rpm http://backpan.perl.org/authors/id/K/KA/KARMAN/Catalyst-Authentication-Store-LDAP-0.1005.tar.gz
cpan2rpm http://search.cpan.org/CPAN/authors/id/K/KA/KARMAN/Net-LDAP-Server-Test-0.08.tar.gz
cp /usr/src/redhat/RPMS/i386/perl-Net-LDAP-Server-Test-0.08-8.i386.rpm .
#perl(Net::LDAP::FilterMatch) is in perl-ldap-0.34
#cpan2rpm http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/perl-ldap-0.34.tar.gz
wget http://dag.wieers.com/rpm/packages/perl-GSSAPI/perl-GSSAPI-0.26-1.el5.rf.i386.rpm
rpm -Uvh perl-GSSAPI-0.26-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Authen-SASL/perl-Authen-SASL-2.10-1.el5.rf.noarch.rpm
rpm -Uvh perl-Authen-SASL-2.10-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-XML-SAX-Writer/perl-XML-SAX-Writer-0.50-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Text-Iconv/perl-Text-Iconv-1.7-1.el5.rf.i386.rpm
rpm -Uvh perl-Text-Iconv-1.7-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-XML-Filter-BufferText/perl-XML-Filter-BufferText-1.01-1.2.el5.rf.noarch.rpm
rpm -Uvh perl-XML-Filter-BufferText-1.01-1.2.el5.rf.noarch.rpm
rpm -Uvh perl-XML-SAX-Writer-0.50-1.el5.rf.noarch.rpm
cpan2rpm http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/perl-ldap-0.34.tar.gz
# This spec file is all bitched up
sed -e 's/Name: perl-perl-ldap/Name: perl-LDAP/' \
-e 's/Release: 8/Release: 8.1/' \
-e 's/Requires: perl(perl) >= 5.004/Requires: perl >= 5.004/' \
-e 's/Source0: perl-ldap-0.34.tar.gz/Source0: perl-ldap-0.34.tar.gz\nProvides: perl(Net::LDAP::FilterMatch)/' \
/usr/src/redhat/SPECS/perl-perl-ldap.spec > /usr/src/redhat/SPECS/perl-ldap.spec
rpmbuild -ba /usr/src/redhat/SPECS/perl-ldap.spec
cp /usr/src/redhat/RPMS/i386/perl-LDAP-0.34-8.i386.rpm .
#rpm -qa | grep -q perl-LDAP && rpm -e perl-LDAP-0.33-3.fc6.noarch
rpm -Uvh perl-LDAP-0.34-8.i386.rpm
rpm -Uvh perl-Net-LDAP-Server-Test-0.08-8.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Test-MockObject/perl-Test-MockObject-1.08-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-UNIVERSAL-can/perl-UNIVERSAL-can-1.12-1.el5.rf.noarch.rpm
rpm -Uvh perl-UNIVERSAL-can-1.12-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-UNIVERSAL-isa/perl-UNIVERSAL-isa-0.06-1.el5.rf.noarch.rpm
rpm -Uvh perl-UNIVERSAL-isa-0.06-1.el5.rf.noarch.rpm
rpm -Uvh perl-Test-MockObject-1.08-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Test-Exception/perl-Test-Exception-0.27-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Sub-Uplevel/perl-Sub-Uplevel-0.1901-1.el5.rf.noarch.rpm
rpm -Uvh perl-Sub-Uplevel-0.1901-1.el5.rf.noarch.rpm
rpm -Uvh perl-Test-Exception-0.27-1.el5.rf.noarch.rpm
cpan2rpm http://backpan.perl.org/authors/id/K/KA/KARMAN/Catalyst-Authentication-Store-LDAP-0.1005.tar.gz
cp /usr/src/redhat/RPMS/i386/perl-Catalyst-Authentication-Store-LDAP-0.1005-8.i386.rpm .
rpm -Uvh perl-Catalyst-Authentication-Store-LDAP-0.1005-8.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Model-File/perl-Catalyst-Model-File-0.06-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Moose/perl-Moose-0.38-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Class-MOP/perl-Class-MOP-0.53-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Sub-Name/perl-Sub-Name-0.03-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-Sub-Exporter/perl-Sub-Exporter-0.978-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Data-OptList/perl-Data-OptList-0.103-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Params-Util/perl-Params-Util-0.31-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Sub-Install/perl-Sub-Install-0.924-1.el5.rf.noarch.rpm
rpm -Uvh perl-Sub-Install-0.924-1.el5.rf.noarch.rpm
rpm -Uvh perl-Params-Util-0.31-1.el5.rf.noarch.rpm
rpm -Uvh perl-Data-OptList-0.103-1.el5.rf.noarch.rpm
rpm -Uvh perl-Sub-Exporter-0.978-1.el5.rf.noarch.rpm
rpm -Uvh perl-Sub-Name-0.03-1.el5.rf.i386.rpm
rpm -Uvh perl-Class-MOP-0.53-1.el5.rf.i386.rpm
rpm -Uvh perl-Moose-0.38-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Model-File-0.06-1.el5.rf.noarch.rpm
##################
# also needs moose
cpan2rpm http://search.cpan.org/CPAN/authors/id/G/GR/GRODITI/Catalyst-Component-InstancePerContext-0.001001.tar.gz
cp /usr/src/redhat/RPMS/i386/perl-Catalyst-Component-InstancePerContext-0.001001-8.i386.rpm .
rpm -Uvh perl-Catalyst-Component-InstancePerContext-0.001001-8.i386.rpm
wget http://dag.wieers.com/rpm/packages/perl-File-Slurp/perl-File-Slurp-9999.13-1.el5.rf.noarch.rpm
rpm -Uvh perl-File-Slurp-9999.13-1.el5.rf.noarch.rpm
wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Action-RenderView/perl-Catalyst-Action-RenderView-0.07-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Action-RenderView-0.07-1.el5.rf.noarch.rpm
# This one requires some things that are in CentOS, but have diferent names (mod_perl2 instead of mod_perl)
# wget http://dag.wieers.com/rpm/packages/perl-Catalyst-Engine-Apache/perl-Catalyst-Engine-Apache-1.12-1.el5.rf.noarch.rpm
# rpm -Uvh --nodeps perl-Catalyst-Engine-Apache-1.12-1.el5.rf.noarch.rpm
# This is the cpan2rpm I didn't know existed at http://ftp.arix.com/cpan2rpm-2.028-1.noarch.rpm
/usr/bin/cpan2rpm -U --no-prfx --no-sign --no-requires='perl(Apache2),perl(Apache::Const),perl(Apache::URI),perl(Apache::RequestRec), perl(Apache::Connection),perl(Apache::RequestIO),perl(Apache::Response),perl(Apache::RequestUtil)' Catalyst::Engine::Apache
sed -e 's/name: Catalyst-Engine-Apache/name: perl-Catalyst-Engine-Apache/' \
-e 's/summary: perl-Catalyst-Engine-Apache - Catalyst Apache Engines/summary: perl-Catalyst-Engine-Apache - Catalyst Apache Engines/' \
/usr/src/redhat/SPECS/Catalyst-Engine-Apache.spec > /usr/src/redhat/SPECS/perl-Catalyst-Engine-Apache.spec
rpmbuild -ba /usr/src/redhat/SPECS/perl-Catalyst-Engine-Apache.spec
cp cp /usr/src/redhat/RPMS/noarch/perl-Catalyst-Engine-Apache-1.12-1.noarch.rpm .
rpm -Uvh perl-Catalyst-Engine-Apache-1.12-1.noarch.rpm
mkdir pkild-deps
mv *.rpm pkild-deps
################################################################################
# Merge the new rpms with the repository *** automrg appears to be fucked ***
#
# scp -rp pkild-deps root@rpmserver:/opt/dists/release/centos/custom_repo/
# ssh rpmserver \
# automrg --mergeall \
# --nocleanup \
# --updatedir /opt/dists/release/centos/custom_repo/pkild \
# --rpmdir /opt/dists/release/centos/5.4/release/i386/CentOS/
################################################################################
################################################################################
# Ensure our rpms work...
# re-install base-system:"
#
# Add these to kickstart when this test passes: (if it completes without exiting)
cat<<EOF| while read line; do yum install -y $line || exit; done
git
perl-YAML
perl-Catalyst-Runtime
perl-Catalyst-View-TT
perl-Class-Accessor
perl-Class-Data-Inheritable
perl-MIME-Types
perl-LDAP
perl-JSON
httpd
mod_ssl
mod_perl
perl-Catalyst-Plugin-Session-State-Cookie
perl-Catalyst-Plugin-Session-Store-FastMmap
perl-Cache-FastMmap
perl-Object-Signature
perl-Catalyst-Plugin-Session
perl-Catalyst-Plugin-Static-Simple
perl-Set-Object
perl-Catalyst-Plugin-Authorization-Roles
perl-Catalyst-Plugin-Authentication
perl-Config-Any
perl-Tie-ToObject
perl-Data-Visitor
perl-Catalyst-Plugin-ConfigLoader
perl-Catalyst-Plugin-RequireSSL
perl-GSSAPI
perl-Authen-SASL
perl-Text-Iconv
perl-XML-Filter-BufferText
perl-XML-SAX-Writer
perl-LDAP
perl-Net-LDAP-Server-Test
perl-UNIVERSAL-can
perl-UNIVERSAL-isa
perl-Test-MockObject
perl-Sub-Uplevel
perl-Test-Exception
perl-Catalyst-Authentication-Store-LDAP
perl-Sub-Install
perl-Params-Util
perl-Data-OptList
perl-Sub-Exporter
perl-Sub-Name
perl-Class-MOP
perl-Moose
perl-Catalyst-Model-File
perl-Catalyst-Component-InstancePerContext
perl-File-Slurp
perl-Catalyst-Action-RenderView
perl-Catalyst-Engine-Apache
perl-IO-Socket-SSL
EOF
################################################################################
# Installing pkild with apache
#
(cd /usr/share; git clone http://github.com/fapestniegd/pkild.git)
(cd /usr/share/pkild; cat Config.yaml.template | sed -e 's/\[\% LDAP_BASEDN \%\]/dc=eftdomain,dc=net/g' -e 's/.\[\% LDAP_URI \%\]./\n - ldaps:\/\/faraday.eftdomain.net:636\n - ldaps:\/\/maxwell.eftdomain.net:636/' | egrep -v "binddn:|bindpw:" > Config.yaml )
( cd /usr/share/pkild; script/pkild_server.pl)
cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.dist
sed -e 's/<VirtualHost _default_:443>/PerlSwitches -I\/usr\/share\/pkild\/lib\nPerlModule pkild\n<VirtualHost _default_:443>\n<Location \/>\nSetHandler modperl\nPerlResponseHandler pkild\n<\/Location>\n/' /etc/httpd/conf.d/ssl.conf.dist > /etc/httpd/conf.d/ssl.conf
/etc/init.d/httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment