-
Notifications
You must be signed in to change notification settings - Fork 4
/
redeploy
executable file
·268 lines (218 loc) · 13.3 KB
/
redeploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
#!/bin/bash
cat<<EOF | ssh [email protected]
if [ ! -d .ssh ]; then mkdir .ssh ;fi
chmod 750 .ssh
ssh-keyscan -t dsa,rsa github.com > .ssh/known_hosts
ssh-keyscan -t dsa,rsa \$(dig +short github.com) >> .ssh/known_hosts
yum update -y
for pkg in httpd mod_perl mod_ssl git ;do
rpm -qa | grep \$pkg || yum install -y \$pkg
done
cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.dist
rpm -qa | grep autodir || (yum install -y autodir; /etc/init.d/autohome start)
grep PerlSwitches /etc/httpd/conf.d/ssl.conf || \
awk '{
if($0 == "<VirtualHost _default_:443>"){
print "PerlSwitches -I/usr/share/pkild/lib";
print "PerlModule pkild\n";
print $0;
print "<Location />"
print " SetHandler modperl"
print " PerlResponseHandler pkild"
print "</Location>" ;
}else{
print $0;
}
}' /etc/httpd/conf.d/ssl.conf.dist > /etc/httpd/conf.d/ssl.conf
try(){
URI="\$*"
FILE=\$(echo \$URI|sed -e 's/.*\///')
wget -qO "\${FILE}" "\${URI}"
rpm -Uvh "\${FILE}"
if [ \$? -ne 0 ]; then
rpm -Uvh "\${FILE}" 2>&1|grep "is needed"|sed -e 's/is needed.*//' -e 's/^[\t ]*//'|while read line; do
yum install -y "\${line}" 2>&1 | grep "No package"
done
fi
}
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-File-Modified-0.07-1.2.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-HTTP-Body-1.07-2.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Text-SimpleTable-2.03-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Tree-Simple-VisitorFactory-0.10-1.el5.rf.noarch.rpm"
yum install -y perl-YAML
yum install -y "perl(Class::Accessor::Fast)"
yum install -y "perl(Class::Data::Inheritable)"
yum install -y "perl(Data::OptList)"
yum install -y "perl(Params::Util)"
yum install -y "perl(Sub::Install)"
yum install -y "perl(Sub::Exporter)"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Object-Signature-1.05-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Sub-Exporter-0.982-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Try-Tiny-0.09-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Sub-Name-0.05-1.el5.rf.i386.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Devel-GlobalDestruction-0.02-1.el5.rf.i386.rpm"
yum install -y "perl(MRO::Compat)"
# try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Class-MOP-1.01-1.el5.rf.i386.rpm"
# Couldn't load class (MooseX::Emulate::Class::Accessor::Fast) because:
# Can't locate object method "get_mutable_metaclass_name"
# via package "Class::MOP::Class::Immutable::Class::MOP::Class"
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Class-MOP-0.92-1.el5.rf.i386.rpm
yum install -y "perl(List::MoreUtils)"
yum install -y "perl(metaclass)"
# try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Moose-1.02-2.el5.rf.i386.rpm"
# perl(Catalyst) <= 5.80017 conflicts with perl-Moose-1.02-2.el5.rf.i386
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Moose-0.89-2.el5.rf.noarch.rpm
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Sub-Identify-0.04-1.el5.rf.i386.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Variable-Magic-0.46-1.el5.rf.i386.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-B-Hooks-EndOfScope-0.08-2.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-namespace-clean-0.13-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-MooseX-Emulate-Class-Accessor-Fast-0.00903-1.el5.rf.noarch.rpm"
yum install -y "perl(File::Copy::Recursive)"
yum install -y "perl(Module::Install::Base)"
yum install -y "perl(Template)"
yum install -y "perl(CGI::Simple::Cookie)"
yum install -y "perl(Class::Inspector)"
yum install -y "perl(Data::Dump)"
yum install -y "perl(Devel::InnerPackage)"
yum install -y "perl(Module::Build)"
yum install -y "perl(Module::Pluggable::Object)"
yum install -y "perl(Path::Class)"
yum install -y "perl(Path::Class::Dir)"
yum install -y "perl(Path::Class::File)"
yum install -y "perl(Tree::Simple)"
################################################################################
# must be installed together: and conflict with moose
wget -q "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Devel-1.08-1.el5.rf.noarch.rpm"
wget -q "http://dag.wieers.com/rpm/packages/perl-Catalyst-Runtime/perl-Catalyst-Runtime-5.7015-1.el5.rf.noarch.rpm"
rpm -Uvh perl-Catalyst-Devel-1.08-1.el5.rf.noarch.rpm perl-Catalyst-Runtime-5.7015-1.el5.rf.noarch.rpm
################################################################################
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Session-State-Cookie-0.09-1.el5.rf.noarch.rpm"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Session-0.29-1.el5.rf.noarch.rpm"
yum install -y "perl(Cache::FastMmap)"
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Session-Store-FastMmap-0.13-1.el5.rf.noarch.rpm"
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-MIME-Types-1.28-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-namespace-autoclean-0.09-1.el5.rf.noarch.rpm
yum install -y "perl(Carp::Clan)"
# try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-MooseX-Types-0.21-1.el5.rf.noarch.rpm
# perl(Moose) >= 0.93 is needed by perl-MooseX-Types-0.21-1.el5.rf.noarch
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-MooseX-Types-0.17-1.el5.rf.noarch.rpm
try "http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Static-Simple-0.28-1.el5.rf.noarch.rpm"
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Set-Object-1.27-1.el5.rf.i386.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-UNIVERSAL-isa-1.03-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Authentication-0.10016-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-Authorization-Roles-0.08-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Config-Any-0.21-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Test-use-ok-0.02-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Tie-ToObject-0.03-1.el5.rf.noarch.rpm
yum install -y "perl(Task::Weaken)"
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Data-Visitor-0.27-1.el5.rf.noarch.rpm
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Plugin-ConfigLoader-0.27-1.el5.rf.noarch.rpm
EOF
wd setup --to=redwood.lab
ssh [email protected] "(cd /usr/share/pkild/; bin/local_config)"
ssh [email protected] "/etc/init.d/httpd resstart"
################################################################################
# # RPM::Specfile builds broken packages
# yum install -y rpm-devel rpm-build
# wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-RPM-Specfile-1.51-1.el5.rf.noarch.rpm
# rpm -Uvh perl-RPM-Specfile-1.51-1.el5.rf.noarch.rpm
# wget http://search.cpan.org/CPAN/authors/id/A/AG/AGRUNDMA/Catalyst-Plugin-RequireSSL-0.06.tar.gz
# cpanflute2 Catalyst-Plugin-RequireSSL-0.06.tar.gz
# rpm -Uvh perl-Catalyst-Plugin-RequireSSL-0.06-8.src.rpm
# rpmbuild -ba /usr/src/redhat/SPECS/perl-Catalyst-Plugin-RequireSSL.spec
# rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Catalyst-Plugin-RequireSSL-0.06-8.noarch.rpm
################################################################################
# # Requires Catalyst/Engine/Apache2/MP20.pm which is in Catalyst-Engine-Apache
# # which needs ExtUtils::MakeMaker version 6.31 to build
# # which won't install without force
#wget http://ftp.arix.com/cpan2rpm-2.028-1.noarch.rpm
#rpm -Uvh cpan2rpm-2.028-1.noarch.rpm
#yum install -y "perl(Test::Pod::Coverage)"
#wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-HTTP-Request-AsCGI-1.2-1.el5.rf.noarch.rpm
#rpm -Uvh perl-HTTP-Request-AsCGI-1.2-1.el5.rf.noarch.rpm
#cpan2rpm --no-sign --author "Andy Grundman" --version "0.06" Catalyst::Plugin::RequireSSL
#rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Catalyst-Plugin-RequireSSL-0.06-1.noarch.rpm
#
#cat<<EOF | perl -MCPAN -eshell
#install M/MS/MSCHWERN/ExtUtils-MakeMaker-6.54.tar.gz
#EOF
# # won't install without force
# jd;slkfja;lkj;alsdkjf;dsflj dfssakjafsd this shit is so ghetto
################################################################################
# # Just trying to get base functionality back...
# #
# catalyst.pl myApp
# cd myApp
# ./script/myapp_server.pl
yum install -y "perl(Config::General)"
try http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-parent-0.221-1.el5.rf.noarch.rpm
cpan2rpm --no-sign "Config::General"
rpm -Uvh /usr/src/redhat/RPMS/i386/perl-Config-General-2.50-1.i386.rpm
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Action-RenderView-0.14-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-Action-RenderView-0.14-1.el5.rf.noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Template-Timer-1.00-1.el5.rf.noarch.rpm
rpm -Uvh perl-Template-Timer-1.00-1.el5.rf.noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-View-TT-0.31-1.el5.rf.noarch.rpm
rpm -Uvh perl-Catalyst-View-TT-0.31-1.el5.rf.noarch.rpm
# ./script/pkild_create.pl view TT TT
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Catalyst-Model-File-0.06-1.el5.rf.noarch.rpm
perl-Catalyst-Model-File-0.06-1.el5.rf.noarch.rpm
cpan2rpm --no-sign Catalyst::Component::InstancePerContext
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Catalyst-Component-InstancePerContext-0.001001-1.noarch.rpm
# ./script/pkild_create.pl model File File "/tmp"
# Nothing builds in this day-and-age without a newer ExtUtils::MakeMaker than centos provides with perl
# This will put it in front of the one redhat ships:
cpan2rpm --no-sign --name perl-ExtUtils-MakeMaker --version 6.57 --make-maker=" INSTALL_BASE=/usr/lib/perl5/site_perl/5.8.8 INSTALLPRIVLIB=/usr/lib/perl5/site_perl/5.8.8" ExtUtils::MakeMaker
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-perl-ExtUtils-MakeMaker-6.57-1.noarch.rpm
yum install -y "perl(Test::MockObject)"
yum install -y "perl(Test::Exception)"
cpan2rpm --no-sign Net::LDAP::Server
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Net-LDAP-Server-0.43-1.noarch.rpm
# Now we override the centos provided LDAP, so we can install Net::LDAP::Server::Test
yum install -y "perl(Authen::SASL)"
yum install -y "perl(XML::SAX::Writer)"
cpan2rpm --no-sign --name LDAP --epoch 2 perl-ldap
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-LDAP-0.4001-1.noarch.rpm
#cpan2rpm --no-sign Net::LDAP::Server::Test #<-- fails tests because of TIME_WAIT/CLOSE_WAIT
# Un-pack it, change the port numbers in the t/01-ldap.t, and repack
cpanflute2 Net-LDAP-Server-Test-0.11.tar.gz
rpm -Uvh ./perl-Net-LDAP-Server-Test-0.11-8.src.rpm
rpmbuild -ba /usr/src/redhat/SPECS/perl-Net-LDAP-Server-Test.spec
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Class-Accessor-Chained-0.01-1.el5.rf.noarch.rpm
rpm -Uvh perl-Class-Accessor-Chained-0.01-1.el5.rf.noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Data-Page-2.02-1.el5.rf.noarch.rpm
rpm -Uvh perl-Data-Page-2.02-1.el5.rf.noarch.rpm
wget http://search.cpan.org/CPAN/authors/id/D/DA/DANIELTWC/Catalyst-Model-LDAP-0.17.tar.gz
cpanflute2 Catalyst-Model-LDAP-0.17.tar.gz
rpm -Uvh ./perl-Catalyst-Model-LDAP-0.17-8.src.rpm
# edit /usr/src/redhat/SPECS/perl-Catalyst-Model-LDAP.spec change perl(perl) to perl
rpmbuild -ba /usr/src/redhat/SPECS/perl-Catalyst-Model-LDAP.spec
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Catalyst-Model-LDAP-0.17-8.noarch.rpm
wget http://search.cpan.org/CPAN/authors/id/B/BO/BOBTFISH/Catalyst-Authentication-Store-LDAP-1.012.tar.gz
cpanflute2 Catalyst-Authentication-Store-LDAP-1.012.tar.gz
rpm -Uvh ./perl-Catalyst-Authentication-Store-LDAP-1.012-8.src.rpm
rpmbuild -ba /usr/src/redhat/SPECS/perl-Catalyst-Authentication-Store-LDAP.spec
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Catalyst-Authentication-Store-LDAP-1.012-8.noarch.rpm
yum install -y perl-JSON perl-File-Slurp
################################################################################
Package::Stash
cpan2rpm --no-sign Test::Fatal
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Test-Fatal-0.006-1.noarch.rpm
cpan2rpm --no-sign Test::Requires
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Test-Requires-0.06-1.noarch.rpm
cpan2rpm --no-sign Test::Tester
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Test-Tester-0.107-1.noarch.rpm
cpan2rpm --no-sign Test::Output
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Test-Output-1.01-1.noarch.rpm
# Test::More -> Test::Simple
wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Test-Simple-0.98.tar.gz
cpanflute2 Test-Simple-0.98.tar.gz
rpm -Uvh ./perl-Test-Simple-0.98-8.src.rpm
# edit the spec file, change perl(perl) to perl, change %{__perl} Makefile.PL to %{__perl} Makefile.PL INSTALL_BASE=/usr/lib/perl5/site_perl/5.8.8 INSTALLPRIVLIB=/usr/lib/perl5/site_perl/5.8.8
rpmbuild -ba /usr/src/redhat/SPECS/perl-Test-Simple.spec
/usr/src/redhat/RPMS/noarch/perl-Test-Simple-0.98-8.noarch.rpm
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Test-Simple-0.98-8.noarch.rpm
cpan2rpm --no-sign Package::DeprecationManager
rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-Package-DeprecationManager-0.11-1.noarch.rpm
wget http://apt.sw.be/redhat/el5/en/i386/dag/RPMS/perl-Package-DeprecationManager-0.10-1.el5.rf.noarch.rpm
cpan2rpm --no-sign Class::MOP