passenger 4.0.33 → 4.0.34
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +15 -0
- checksums.yaml.gz.asc +12 -0
- data.tar.gz.asc +7 -7
- data/NEWS +60 -0
- data/bin/passenger-config +1 -1
- data/bin/passenger-install-apache2-module +510 -40
- data/bin/passenger-install-nginx-module +26 -2
- data/build/cxx_tests.rb +1 -1
- data/build/documentation.rb +19 -21
- data/build/integration_tests.rb +39 -12
- data/build/misc.rb +18 -0
- data/build/packaging.rb +116 -56
- data/build/rpm.rb +20 -11
- data/build/ruby_tests.rb +2 -3
- data/build/test_basics.rb +9 -0
- data/debian.template/passenger.conf +2 -0
- data/debian.template/passenger.load +2 -0
- data/dev/run_travis.sh +3 -5
- data/dev/test_rpm_packaging.sh +28 -0
- data/doc/Users guide Apache.idmap.txt +6 -4
- data/doc/users_guide_snippets/installation.txt +20 -2
- data/doc/users_guide_snippets/tips.txt +1 -1
- data/ext/common/ApplicationPool2/Pool.h +1 -1
- data/ext/common/Constants.h +5 -1
- data/ext/common/agents/HelperAgent/RequestHandler.h +1 -1
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +20 -0
- data/ext/common/agents/Watchdog/Main.cpp +10 -0
- data/ext/ruby/passenger_native_support.c +23 -11
- data/helper-scripts/classic-rails-loader.rb +9 -3
- data/helper-scripts/classic-rails-preloader.rb +10 -4
- data/helper-scripts/download_binaries/extconf.rb +46 -22
- data/helper-scripts/meteor-loader.rb +0 -1
- data/helper-scripts/node-loader.js +2 -1
- data/helper-scripts/prespawn +7 -1
- data/helper-scripts/rack-loader.rb +32 -3
- data/helper-scripts/rack-preloader.rb +10 -4
- data/lib/phusion_passenger.rb +40 -21
- data/lib/phusion_passenger/abstract_installer.rb +7 -4
- data/lib/phusion_passenger/analytics_logger.rb +4 -3
- data/lib/phusion_passenger/config/about_command.rb +27 -6
- data/lib/phusion_passenger/{config.rb → config/main.rb} +3 -2
- data/lib/phusion_passenger/config/restart_app_command.rb +1 -1
- data/lib/phusion_passenger/config/validate_install_command.rb +231 -0
- data/lib/phusion_passenger/constants.rb +2 -0
- data/lib/phusion_passenger/loader_shared_helpers.rb +92 -19
- data/lib/phusion_passenger/native_support.rb +33 -11
- data/lib/phusion_passenger/packaging.rb +1 -0
- data/lib/phusion_passenger/platform_info.rb +5 -2
- data/lib/phusion_passenger/platform_info/apache.rb +229 -60
- data/lib/phusion_passenger/platform_info/apache_detector.rb +26 -31
- data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +1 -1
- data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +1 -1
- data/lib/phusion_passenger/platform_info/linux.rb +2 -1
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -0
- data/lib/phusion_passenger/preloader_shared_helpers.rb +2 -1
- data/lib/phusion_passenger/request_handler.rb +2 -1
- data/lib/phusion_passenger/request_handler/thread_handler.rb +2 -1
- data/lib/phusion_passenger/standalone/runtime_installer.rb +35 -13
- data/lib/phusion_passenger/standalone/start_command.rb +2 -2
- data/lib/phusion_passenger/utils.rb +1 -23
- data/lib/phusion_passenger/utils/ansi_colors.rb +7 -1
- data/lib/phusion_passenger/utils/download.rb +36 -2
- data/lib/phusion_passenger/utils/native_support_utils.rb +65 -0
- data/resources/templates/apache2/apache_install_broken.txt.erb +20 -0
- data/resources/templates/apache2/config_snippets.txt.erb +2 -4
- data/resources/templates/apache2/present_choice_for_no_update_config.txt.erb +5 -0
- data/resources/templates/installer_common/cannot_access_files_as_root.txt.erb +15 -0
- data/resources/templates/installer_common/run_installer_as_root.txt.erb +6 -3
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +1 -1
- data/resources/templates/nginx/other_nginx_installations_exist.txt.erb +17 -0
- data/rpm/apache-passenger.conf.in +26 -0
- data/rpm/config.json +30 -0
- data/rpm/passenger.logrotate +7 -0
- data/rpm/passenger.spec.template +456 -0
- data/rpm/passenger_dynamic_thread_group.patch +16 -0
- data/rpm/passenger_tests_default_config_example.patch +44 -0
- data/rpm/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +21 -0
- data/rpm/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +45 -0
- data/test/config.json.rpm-automation +15 -0
- data/test/integration_tests/downloaded_binaries_tests.rb +80 -2
- data/test/integration_tests/native_packaging_spec.rb +136 -44
- data/test/integration_tests/standalone_tests.rb +2 -11
- data/test/ruby/analytics_logger_spec.rb +65 -19
- data/test/ruby/utils_spec.rb +2 -0
- metadata +532 -548
- metadata.gz.asc +7 -7
- data/resources/templates/apache2/no_write_permission_to_passenger_root.txt.erb +0 -9
- data/rpm/README.rdoc +0 -117
- data/rpm/config/apache-passenger.conf.in +0 -19
- data/rpm/config/nginx-passenger.conf.in +0 -10
- data/rpm/config/rubygem-passenger.te +0 -10
- data/rpm/doc/README.nginx-alternatives +0 -5
- data/rpm/doc/example_yum_repository_htaccess +0 -5
- data/rpm/doc/footer.shtml +0 -12
- data/rpm/doc/header.shtml +0 -156
- data/rpm/nginx-alternatives.spec +0 -97
- data/rpm/passenger-release.spec +0 -91
- data/rpm/passenger.spec +0 -667
- data/rpm/patches/passenger-force-native.patch +0 -63
- data/rpm/release/RPM-GPG-KEY-stealthymonkeys +0 -33
- data/rpm/release/build-release.sh +0 -35
- data/rpm/release/build.rb +0 -301
- data/rpm/release/create-mirrors.sh +0 -16
- data/rpm/release/mirrors +0 -1
- data/rpm/release/mock-repo/comps.xml +0 -21
- data/rpm/release/mock-repo/rubygem-daemon_controller-0.2.5-1.noarch.rpm +0 -0
- data/rpm/release/mock-repo/rubygem-file-tail-1.0.5-1.noarch.rpm +0 -0
- data/rpm/release/mock-repo/rubygem-spruz-0.2.2-1.noarch.rpm +0 -0
- data/rpm/release/mocksetup-first.sh +0 -102
- data/rpm/release/mocksetup.sh +0 -67
@@ -1,63 +0,0 @@
|
|
1
|
-
diff --git a/lib/phusion_passenger.rb b/lib/phusion_passenger.rb
|
2
|
-
index e747477..27e82f1 100644
|
3
|
-
--- a/lib/phusion_passenger.rb
|
4
|
-
+++ b/lib/phusion_passenger.rb
|
5
|
-
@@ -94,12 +94,12 @@ module PhusionPassenger
|
6
|
-
# Not available when natively packaged.
|
7
|
-
NATIVE_SUPPORT_DIR = File.join(SOURCE_ROOT, "ext", "ruby")
|
8
|
-
else
|
9
|
-
- SOURCE_ROOT = NATIVELY_PACKAGED_SOURCE_ROOT
|
10
|
-
- DOCDIR = NATIVELY_PACKAGED_DOCDIR
|
11
|
-
- RESOURCES_DIR = NATIVELY_PACKAGED_RESOURCES_DIR
|
12
|
-
- AGENTS_DIR = NATIVELY_PACKAGED_AGENTS_DIR
|
13
|
-
- HELPER_SCRIPTS_DIR = NATIVELY_PACKAGED_HELPER_SCRIPTS_DIR
|
14
|
-
- APACHE2_MODULE = NATIVELY_PACKAGED_APACHE2_MODULE
|
15
|
-
+ SOURCE_ROOT = '%%GEM_INSTALL_DIR%%'
|
16
|
-
+ DOCDIR = "#{SOURCE_ROOT}/doc"
|
17
|
-
+ RESOURCES_DIR = "#{SOURCE_ROOT}/resources"
|
18
|
-
+ HELPER_SCRIPTS_DIR = "#{SOURCE_ROOT}/helper-scripts"
|
19
|
-
+ APACHE2_MODULE = '%%APACHE_INSTALLED_MOD%%'
|
20
|
-
+ NATIVE_SUPPORT_DIR = "#{SOURCE_ROOT}/ext/ruby"
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
diff --git a/lib/phusion_passenger/native_support.rb b/lib/phusion_passenger/native_support.rb
|
25
|
-
index f1edf1c..4312d01 100644
|
26
|
-
--- a/lib/phusion_passenger/native_support.rb
|
27
|
-
+++ b/lib/phusion_passenger/native_support.rb
|
28
|
-
@@ -38,10 +38,7 @@ class NativeSupportLoader
|
29
|
-
|
30
|
-
private
|
31
|
-
def archdir
|
32
|
-
- @archdir ||= begin
|
33
|
-
- require 'phusion_passenger/platform_info/binary_compatibility'
|
34
|
-
- PlatformInfo.ruby_extension_binary_compatibility_ids.join("-")
|
35
|
-
- end
|
36
|
-
+ @archdir ||= 'native'
|
37
|
-
end
|
38
|
-
|
39
|
-
def libext
|
40
|
-
diff --git a/ext/common/ResourceLocator.h b/ext/common/ResourceLocator.h
|
41
|
-
index 5f65804..e585d1a 100644
|
42
|
-
--- a/ext/common/ResourceLocator.h
|
43
|
-
+++ b/ext/common/ResourceLocator.h
|
44
|
-
@@ -64,13 +64,13 @@ public:
|
45
|
-
!fileExists(root + "/DEVELOPERS.TXT");
|
46
|
-
|
47
|
-
if (nativelyPackaged) {
|
48
|
-
- agentsDir = "/usr/lib/phusion-passenger/agents";
|
49
|
-
- helperScriptsDir = "/usr/share/phusion-passenger/helper-scripts";
|
50
|
-
- resourcesDir = "/usr/share/phusion-passenger";
|
51
|
-
- docDir = "/usr/share/doc/phusion-passenger";
|
52
|
-
+ agentsDir = "%%GEM_INSTALL_DIR%%/agents";
|
53
|
-
+ helperScriptsDir = "%%GEM_INSTALL_DIR%%/helper-scripts";
|
54
|
-
+ resourcesDir = "%%GEM_INSTALL_DIR%%";
|
55
|
-
+ docDir = "%%GEM_INSTALL_DIR%%/doc";
|
56
|
-
rubyLibDir = "";
|
57
|
-
- compilableSourceDir = "/usr/share/phusion-passenger/compilable-source";
|
58
|
-
- apache2Module = "/usr/lib/apache2/modules/mod_passenger.so";
|
59
|
-
+ compilableSourceDir = "%%GEM_INSTALL_DIR%%";
|
60
|
-
+ apache2Module = "%%APACHE_INSTALLED_MOD%%";
|
61
|
-
} else {
|
62
|
-
agentsDir = root + "/agents";
|
63
|
-
helperScriptsDir = root + "/helper-scripts";
|
@@ -1,33 +0,0 @@
|
|
1
|
-
GPG Signing key for rpms@stealthymonkeys.com
|
2
|
-
|
3
|
-
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
4
|
-
Version: GnuPG v1.4.10 (Darwin)
|
5
|
-
|
6
|
-
mQENBEzHVv8BCAC1nWHsSRdv7bsZYFJLfwXPMxm5oR3OD/lldIKvJXcz6G/STaB8
|
7
|
-
FL0vshaaHd2MR8vvn70hByLEjT6YK0e5BvjTspozRFW+k/Sqlj6AjNpLPPaig4GP
|
8
|
-
rlaILL42ZrzXmC8UoxBrxJr4mrQn7nKVJDV5I1pPeZYK3kJD5yOwNDW+pGcRSeyw
|
9
|
-
idTfBmazzBlLUKX/wFp4X/KNE8NJqaR5HyFPakcTNMIq6hl0pi+zfzEpulykmrJX
|
10
|
-
7jCm1meiVyR1avtfpNRAGQWIJEhqXxBliyUFA3B+AorxKWe3Km7+499w8FdilBHB
|
11
|
-
JrJU+FgUBYQ24h2HLD81dgx4NxSIVnFr02TLABEBAAG0NkVyaWsgT2dhbiAoUlBN
|
12
|
-
IHNpZ25pbmcga2V5KSA8cnBtc0BzdGVhbHRoeW1vbmtleXMuY29tPokBPgQTAQgA
|
13
|
-
KAUCTMdW/wIbAwsLCQgHCg0MCwMCBAYVCgkICwMFFgIDAQACHgECF4AACgkQPo92
|
14
|
-
smVzqwlSnAf9G875hB1bE3FYf22YNMIkxSCTTnY/Yw/8c76xJQVEB2+Mx9V7wmiE
|
15
|
-
75pIhL/GrqEpKMtCGK/pYy6Cvd1+VXRX40pqVHZCdkTGHWjtxTL0RunNGEueDXBb
|
16
|
-
g1Qs810fIKM/7iqpc6bOx49B8F/jTzk8w8/iK3OMHjd4wLJf6CKmdC25O44KX3Ii
|
17
|
-
QpGCzm1sV505TT4MFvO13VDg7XK/Xq+3q5w094ryDXidL3quGJTfvOWaE5/g5Bgh
|
18
|
-
ISyO3W3Ak9MfRCzOK5eWao+ZZ2eow0tai5EEhuzakvX7dRNlIhvabjucar585lLP
|
19
|
-
uP5h06nDSMXzD7PMnAF65g70gMungXLITLkBDQRMx1b/AQgArX1+UzcPYUbXj6nT
|
20
|
-
H+iiRlegG/jPwkYRBwKZkG8Bme4GlTsR6uLDZR4K8zg9DckgbtFjBBpZ1WSWpqOD
|
21
|
-
r7suhVAiL/Qev+Gk3H2Q12/4s6OBY0z8N//2UAa/h4R9DIMdP3jdhgP0XK0hmCiH
|
22
|
-
z6ZRp3e0t4fZqP4wTfktSGaCzWZL/cG1d/4yclXKHQ8CnLcGf2xE2VhAFObajcHX
|
23
|
-
sY2XWfPr7r+4PYjJ+S1lTMT4R+do8gxXDXq5ixN1TuAH5yGB2G2YzVNfFa5bXZFl
|
24
|
-
cFnGXNJn3h3tHf9yT9D+yAq37lkqaZ8oByxmNvNi9HYQr8zo+9ztOOFcGgFTlPUT
|
25
|
-
MLsk8QARAQABiQEfBBgBCAAJBQJMx1b/AhsMAAoJED6PdrJlc6sJIO0IAJgr2IrG
|
26
|
-
WVMPRaU3vVSSC6gkdvn6bIhQuHqdTpw1HFyw/3nRGiPrAH0jmUSojPmTifTpx2Yv
|
27
|
-
lsf5vkZjOUvyTB2yDU/pTO8nAarDDyVZv/KWRMruboxFUbqryN/hN747akfZGqt5
|
28
|
-
0aAAfLukQQQ6TmDMEpy3AQKJITZnDylMw7J84UgGcL+iNeU7ogbW+H618gIhl0Sy
|
29
|
-
eyZLwwC4sEDXEiRfS0o4JJnOjVshOfNE4tDDjVuLSQ3LW2hwaYJELBJls/ns44Nw
|
30
|
-
BQTzTiSbDhOiSTGZr/IwXyRgBhbGfx9AvvPkqOIrKPY6kB+khAYiDdPunbSSg2I3
|
31
|
-
BSuPuk9DJp+2Gsc=
|
32
|
-
=pVe5
|
33
|
-
-----END PGP PUBLIC KEY BLOCK-----
|
@@ -1,35 +0,0 @@
|
|
1
|
-
#!/bin/sh -e
|
2
|
-
|
3
|
-
BUILD_VERBOSITY=${BUILD_VERBOSITY:-0}
|
4
|
-
[ $BUILD_VERBOSITY -ge 3 ] && set -x
|
5
|
-
|
6
|
-
reldir=`dirname $0`
|
7
|
-
stage=./stage-release
|
8
|
-
rm -rf $stage
|
9
|
-
mkdir -p $stage/{SRPMS,SOURCES}
|
10
|
-
ln -s `readlink -f $reldir/mirrors` $stage/SOURCES/mirrors-passenger
|
11
|
-
ln -s `readlink -f $reldir/RPM-GPG-KEY-stealthymonkeys` $stage/SOURCES
|
12
|
-
|
13
|
-
rpmbuild-md5 --define "_topdir $stage" --define 'dist %nil' -bs passenger-release.spec
|
14
|
-
rm -rf $stage/{SOURCES,BUILD*,RPMS,SPECS}
|
15
|
-
srpm=`ls -1t $stage/SRPMS/*rpm | head -1`
|
16
|
-
|
17
|
-
for ver in {epel-5,fedora-{13,14}}
|
18
|
-
do
|
19
|
-
echo --------- $ver
|
20
|
-
xdir=$stage/`echo $ver | tr '-' '/'`/x86_64
|
21
|
-
idir=`echo $xdir | sed -e 's/x86_64/i386/'`
|
22
|
-
mock -r passenger-$ver-x86_64 $srpm
|
23
|
-
mkdir -p $xdir $idir
|
24
|
-
cp /var/lib/mock/passenger-$ver-x86_64/result/*noarch.rpm $xdir
|
25
|
-
cp /var/lib/mock/passenger-$ver-x86_64/result/*noarch.rpm $idir
|
26
|
-
cd $xdir/..
|
27
|
-
short=`ls -1t x86_64/*rpm | head -1 | perl -pe 's{.*/(.*)-[^-]+-[^-]+(.noarch.rpm)}{\1\2}'`
|
28
|
-
ln -s x86_64/*rpm $short
|
29
|
-
cd -
|
30
|
-
done
|
31
|
-
|
32
|
-
mv $stage/epel $stage/rhel
|
33
|
-
# Don't resign symlinks
|
34
|
-
# -- arguably this should be done once for each file, since they're copied
|
35
|
-
rpm --addsign `find $stage -type f`
|
data/rpm/release/build.rb
DELETED
@@ -1,301 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
require 'ftools'
|
5
|
-
require 'optparse'
|
6
|
-
|
7
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
8
|
-
|
9
|
-
require 'phusion_passenger'
|
10
|
-
|
11
|
-
CFGLIMIT=%w{fedora-{13,14} epel-5}
|
12
|
-
|
13
|
-
stage_dir='./stage'
|
14
|
-
|
15
|
-
mock_base_dir = '/var/lib/mock'
|
16
|
-
mock_repo_dir = "#{mock_base_dir}/passenger-build-repo"
|
17
|
-
mock_etc_dir='/etc/mock'
|
18
|
-
#mock_etc_dir='/tmp/mock'
|
19
|
-
|
20
|
-
# If rpmbuild-md5 is installed, use it for the SRPM, so EPEL machines can read it.
|
21
|
-
rpmbuild = '/usr/bin/rpmbuild' + (File.exist?('/usr/bin/rpmbuild-md5') ? '-md5' : '')
|
22
|
-
rpmtopdir = `rpm -E '%_topdir'`.chomp
|
23
|
-
rpmarch = `rpm -E '%_arch'`.chomp
|
24
|
-
|
25
|
-
@verbosity = 0
|
26
|
-
|
27
|
-
@can_build = {
|
28
|
-
'i386' => %w{i586 i686},
|
29
|
-
'i686' => %w{i586 i686},
|
30
|
-
'ppc' => %w{},
|
31
|
-
'ppc64' => %w{ppc},
|
32
|
-
's390x' => %w{},
|
33
|
-
'sparc' => %w{},
|
34
|
-
'sparc64' => %w{sparc},
|
35
|
-
'x86_64' => %w{i386 i586 i686},
|
36
|
-
}
|
37
|
-
|
38
|
-
#@can_build.keys.each {|k| @can_build[k].push k}
|
39
|
-
@can_build = @can_build[rpmarch.to_s == '' ? 'x86_64' : rpmarch]
|
40
|
-
@can_build.push rpmarch
|
41
|
-
|
42
|
-
bindir=File.dirname(File.expand_path __FILE__)
|
43
|
-
|
44
|
-
configs = Dir["#{mock_etc_dir}/{#{CFGLIMIT.join ','}}*"].map {|f| f.gsub(%r{.*/([^.]*).cfg}, '\1')}
|
45
|
-
|
46
|
-
def limit_configs(configs, limits)
|
47
|
-
tree = configs.inject({}) do |m,c|
|
48
|
-
(distro,version,arch) = c.split /-/
|
49
|
-
next m unless @can_build.include?(arch)
|
50
|
-
[
|
51
|
-
# Rather than construct this list programatically, just spell it out
|
52
|
-
'',
|
53
|
-
distro,
|
54
|
-
"#{distro}-#{version}",
|
55
|
-
"#{distro}-#{version}-#{arch}",
|
56
|
-
"#{distro}--#{arch}",
|
57
|
-
"--#{arch}",
|
58
|
-
# doubtful these will be used, but for completeness
|
59
|
-
"-#{version}",
|
60
|
-
"-#{version}-#{arch}",
|
61
|
-
].each do |pattern|
|
62
|
-
unless m[pattern]
|
63
|
-
m[pattern] = []
|
64
|
-
end
|
65
|
-
m[pattern].push c
|
66
|
-
end
|
67
|
-
m
|
68
|
-
end
|
69
|
-
tree.default = []
|
70
|
-
# Special case for no arguments
|
71
|
-
limits = [nil] if limits.empty?
|
72
|
-
# By splitting and rejoining we normalize the distro--, etc. cases.
|
73
|
-
return limits.map do |l|
|
74
|
-
parts = l.to_s.split(/-/).map {|v| v == '*' ? nil : v}
|
75
|
-
if parts[2] && !@can_build.include?(parts[2])
|
76
|
-
abort "ERROR: Cannot build '#{parts[2]}' packages on '#{rpmarch}'"
|
77
|
-
end
|
78
|
-
tree[parts.join '-']
|
79
|
-
end.flatten
|
80
|
-
end
|
81
|
-
|
82
|
-
def noisy_system(*args)
|
83
|
-
puts(args.join(' ')) if @verbosity > 0
|
84
|
-
system(*args)
|
85
|
-
end
|
86
|
-
|
87
|
-
|
88
|
-
############################################################################
|
89
|
-
options = {}
|
90
|
-
OptionParser.new do |opts|
|
91
|
-
opts.banner = "Usage: #{$0} [options] [distro-version-arch] [distro-version] [distro--arch] [*--arch]"
|
92
|
-
|
93
|
-
opts.on("-v", "--[no-]verbose", "Run verbosely. Add more -v's to increase @verbosity") do |v|
|
94
|
-
@verbosity += v ? 1 : -1
|
95
|
-
end
|
96
|
-
|
97
|
-
opts.on('-s', '--single', 'Only build a single distro-rev-arch set (for this machine)') do |v|
|
98
|
-
options[:single] = true
|
99
|
-
end
|
100
|
-
|
101
|
-
# Do these with options, because the order matters
|
102
|
-
opts.on('-b', '--mock-base-dir DIR', "Mock's base directory. Default: #{mock_base_dir}") do |v|
|
103
|
-
#mock_repo_dir = v
|
104
|
-
options[:mock_base_dir] = v
|
105
|
-
end
|
106
|
-
|
107
|
-
opts.on('-m', '--mock-repo-dir DIR', "Directory for special mock yum repository. Default: #{mock_repo_dir}") do |v|
|
108
|
-
#mock_repo_dir = v
|
109
|
-
options[:mock_repo_dir] = v
|
110
|
-
end
|
111
|
-
|
112
|
-
opts.on("-c", "--mock-config-dir DIR", "Directory for mock configuration. Default: #{mock_etc_dir}") do |v|
|
113
|
-
if File.directory?(v)
|
114
|
-
mock_etc_dir=v
|
115
|
-
else
|
116
|
-
abort "No such directory: #{v}"
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
opts.on('-d', '--stage-dir DIR', "Staging directory. Default: #{stage_dir}") do |v|
|
121
|
-
stage_dir = v
|
122
|
-
end
|
123
|
-
|
124
|
-
opts.on('-e', '--extra-packages DIR', "Directory for extra packages to install.") do |v|
|
125
|
-
options[:extra_packages] = v
|
126
|
-
end
|
127
|
-
|
128
|
-
opts.on('-r', '--include-release', "Also build passenger-release packages") do
|
129
|
-
options[:release] = true
|
130
|
-
end
|
131
|
-
|
132
|
-
opts.on_tail("-h", "--help", "Show this message") do
|
133
|
-
puts opts
|
134
|
-
exit
|
135
|
-
end
|
136
|
-
end.parse!
|
137
|
-
|
138
|
-
if options.key?(:mock_base_dir) || options.key?(:mock_repo_dir)
|
139
|
-
if options.key?(:mock_base_dir)
|
140
|
-
mock_base_dir = options[:mock_base_dir]
|
141
|
-
mock_repo_dir = "#{mock_base_dir}/passenger-build-repo"
|
142
|
-
end
|
143
|
-
if options.key?(:mock_repo_dir)
|
144
|
-
mock_repo_dir = options[:mock_repo_dir]
|
145
|
-
unless mock_repo_dir[0] == '/'[0]
|
146
|
-
mock_repo_dir = "#{mock_base_dir}/#{mock_repo_dir}"
|
147
|
-
end
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
limit = ARGV
|
152
|
-
if options.key?(:single)
|
153
|
-
# This can probably be simplified
|
154
|
-
limit = [`rpm --queryformat '%{name}\t%{version}' -qf /etc/redhat-release`.sub(/(\w+)-release\t(\d+)/,'\1-\2').sub(/^(rhel|centos|sl)-/,'epel-') + "-#{`rpm -E '%{_host_cpu}'`.strip}"]
|
155
|
-
end
|
156
|
-
|
157
|
-
configs = limit_configs(configs, limit)
|
158
|
-
|
159
|
-
if configs.empty?
|
160
|
-
abort "Can't find a set of configs for '#{ARGV[0]}' (hint try 'fedora' or 'fedora-14' or even 'fedora-14-x86_64')"
|
161
|
-
end
|
162
|
-
|
163
|
-
puts "BUILD:\n " + configs.join("\n ") if @verbosity >= 2
|
164
|
-
|
165
|
-
# Too much of what follows expects this. Revisit it later.
|
166
|
-
Dir.chdir(File.join(File.dirname(__FILE__), '..'))
|
167
|
-
|
168
|
-
FileUtils.rm_rf(stage_dir, :verbose => @verbosity > 0)
|
169
|
-
FileUtils.mkdir_p(stage_dir, :verbose => @verbosity > 0)
|
170
|
-
|
171
|
-
ENV['BUILD_VERBOSITY'] = @verbosity.to_s
|
172
|
-
|
173
|
-
# Check the ages of the configs for validity
|
174
|
-
mtime = File.mtime("#{bindir}/mocksetup.sh")
|
175
|
-
if configs.any? {|c| mtime > File.mtime("#{mock_etc_dir}/passenger-#{c}.cfg") rescue true }
|
176
|
-
unless noisy_system("#{bindir}/mocksetup.sh", mock_repo_dir, mock_etc_dir)
|
177
|
-
abort <<EndErr
|
178
|
-
Unable to run "#{bindir}/mocksetup.sh #{mock_repo_dir}". It is likely that you
|
179
|
-
need to run this command as root the first time, but if you have already done
|
180
|
-
that, it could also be that the current user (or this shell) is not in the
|
181
|
-
'mock' group.
|
182
|
-
EndErr
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
srcdir=`rpm -E '%{_sourcedir}'`.chomp
|
187
|
-
|
188
|
-
FileUtils.ln_sf(Dir["#{Dir.getwd}/{config/,patches/,release/RPM-GPG}*"], srcdir, :verbose => @verbosity > 0)
|
189
|
-
|
190
|
-
# Force the default versions in the spec file to be the ones in the source so a given SRPM doesn't need a --define to set versions.
|
191
|
-
specdir="/tmp/#{`whoami`.strip}-specfile-#{Process.pid}"
|
192
|
-
FileUtils.rm_rf(specdir, :verbose => @verbosity > 0)
|
193
|
-
begin
|
194
|
-
FileUtils.mkdir_p(specdir, :verbose => @verbosity > 0)
|
195
|
-
FileUtils.cp('passenger.spec', specdir, :verbose => @verbosity > 0)
|
196
|
-
# + must be escaped, but * doesn't? And people wonder why I hate sed.
|
197
|
-
abort "Can't edit specfile" unless noisy_system('sed', '-i',
|
198
|
-
'-e', "s/^\\(\\([[:space:]]*\\)%define[[:space:]]\\+passenger_version[[:space:]]\\)\\+[0-9.]\\+.*/\\2# From Passenger Source\\n\\1#{PhusionPassenger::VERSION_STRING}/",
|
199
|
-
'-e', "s/^\\(\\([[:space:]]*\\)%define[[:space:]]\\+nginx_version[[:space:]]\\)\\+[0-9.]\\+.*/\\2# From Passenger Source\\n\\1#{PhusionPassenger::PREFERRED_NGINX_VERSION}/",
|
200
|
-
"#{specdir}/passenger.spec")
|
201
|
-
# No dist for SRPM
|
202
|
-
unless noisy_system(rpmbuild, *((@verbosity > 0 ? [] : %w{--quiet}) + ['--define', 'dist %nil', '-bs', "#{specdir}/passenger.spec"]))
|
203
|
-
abort "No SRPM was built. See above for the error"
|
204
|
-
end
|
205
|
-
ensure
|
206
|
-
FileUtils.rm_rf(specdir, :verbose => @verbosity > 0)
|
207
|
-
end
|
208
|
-
|
209
|
-
srpm="rubygem-passenger-#{PhusionPassenger::VERSION_STRING}-#{`grep '%define passenger_release' passenger.spec | awk '{print $3}'`.strip}.src.rpm".sub(/%\{[^}]+\}/, '')
|
210
|
-
|
211
|
-
FileUtils.mkdir_p(stage_dir + '/SRPMS', :verbose => @verbosity > 0)
|
212
|
-
|
213
|
-
FileUtils.cp("#{rpmtopdir}/SRPMS/#{srpm}", "#{stage_dir}/SRPMS", :verbose => @verbosity > 0)
|
214
|
-
|
215
|
-
if options[:release]
|
216
|
-
# It's not EXACTLY equivalent, is it? (REALLY doesn't want to symlink to a different name)
|
217
|
-
# FileUtils.ln_sf(Dir["#{Dir.getwd}/release/mirrors"], "#{srcdir}/mirrors-passenger", :verbose => @verbosity > 0)
|
218
|
-
FileUtils.ln_sf(Dir["#{Dir.getwd}/release/mirrors"], srcdir, :verbose => @verbosity > 0)
|
219
|
-
FileUtils.rm_f( "#{srcdir}/mirrors-passenger", :verbose => @verbosity > 0)
|
220
|
-
FileUtils.mv("#{srcdir}/mirrors", "#{srcdir}/mirrors-passenger", :force => true, :verbose => @verbosity > 0)
|
221
|
-
unless noisy_system(rpmbuild, *((@verbosity > 0 ? [] : %w{--quiet}) + ['--define', 'dist %nil', '-bs', "passenger-release.spec"]))
|
222
|
-
abort "No passenger-release SRPM was built. See above for the error"
|
223
|
-
end
|
224
|
-
rel_version = `grep '^Version:' passenger-release.spec | awk '{print $2}'`.to_i
|
225
|
-
rel_release = `grep '^Release:' passenger-release.spec | awk '{print $2}'`.to_i
|
226
|
-
@rel_srpm = "passenger-release-#{rel_version}-#{rel_release}.src.rpm"
|
227
|
-
FileUtils.cp("#{rpmtopdir}/SRPMS/passenger-release-#{rel_version}-#{rel_release}.src.rpm",
|
228
|
-
"#{stage_dir}/SRPMS", :verbose => @verbosity > 0)
|
229
|
-
end
|
230
|
-
|
231
|
-
mockvolume = @verbosity >= 2 ? %w{-v} : @verbosity < 0 ? %w{-q} : []
|
232
|
-
|
233
|
-
@release_cache = {}
|
234
|
-
|
235
|
-
configs.each do |cfg|
|
236
|
-
puts "---------------------- Building #{cfg}" if @verbosity >= 0
|
237
|
-
pcfg = 'passenger-' + cfg
|
238
|
-
|
239
|
-
idir = './pkg'
|
240
|
-
|
241
|
-
unless options.key?(:single)
|
242
|
-
idir = File.join stage_dir, cfg.split(/-/)
|
243
|
-
end
|
244
|
-
|
245
|
-
# Move *mockvolume to the end, since it causes Ruby to cry in the middle
|
246
|
-
# Alt sol'n: *(foo + ['bar'] )
|
247
|
-
unless noisy_system('mock', '-r', pcfg, "#{stage_dir}/SRPMS/#{srpm}", *mockvolume)
|
248
|
-
abort "Mock failed. See above for details"
|
249
|
-
end
|
250
|
-
FileUtils.mkdir_p(idir, :verbose => @verbosity > 0)
|
251
|
-
FileUtils.cp(Dir["#{mock_base_dir}/#{pcfg}/result/*.rpm"],
|
252
|
-
idir, :verbose => @verbosity > 0)
|
253
|
-
if options.key?(:extra_packages)
|
254
|
-
FileUtils.cp(Dir["#{options[:extra_packages]}/*.rpm"], idir, :verbose => @verbosity > 0)
|
255
|
-
end
|
256
|
-
|
257
|
-
if options[:release]
|
258
|
-
cache_key = cfg.split(/-/).first(2).join('-')
|
259
|
-
# There is little sense in rebuilding a noarch package over & over
|
260
|
-
if @release_cache[cache_key]
|
261
|
-
FileUtils.cp(@release_cache[cache_key], idir, :verbose => @verbosity > 0)
|
262
|
-
else
|
263
|
-
unless noisy_system('mock', '-r', pcfg, "#{stage_dir}/SRPMS/#{@rel_srpm}", *mockvolume)
|
264
|
-
abort "Release Mock failed. See above for details"
|
265
|
-
end
|
266
|
-
|
267
|
-
FileUtils.cp(Dir["#{mock_base_dir}/#{pcfg}/result/*.rpm"],
|
268
|
-
idir, :verbose => @verbosity > 0)
|
269
|
-
@release_cache[cache_key] = Dir["#{idir}/passenger-release*noarch.rpm"].last
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
|
-
FileUtils.rm_f(Dir["#{idir}/*.src.rpm"], :verbose => @verbosity > 1)
|
274
|
-
end
|
275
|
-
|
276
|
-
unless options.key?(:single)
|
277
|
-
if File.directory?("#{stage_dir}/epel")
|
278
|
-
FileUtils.mv "#{stage_dir}/epel", "#{stage_dir}/rhel", :verbose => @verbosity > 0
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
|
-
if options[:release]
|
283
|
-
Dir["#{stage_dir}/*/*"].each do |distro_version|
|
284
|
-
next unless File.directory?(distro_version)
|
285
|
-
arch = Dir["#{distro_version}/{#{@can_build.sort.join ','}}"].last
|
286
|
-
pkg = Dir["#{arch}/passenger-release*rpm"].last
|
287
|
-
pkg = pkg.split(/#{File::SEPARATOR}/).last(2)
|
288
|
-
FileUtils.ln_sf(File.join(pkg), "#{distro_version}/passenger-release.noarch.rpm", :verbose => @verbosity > 0)
|
289
|
-
end
|
290
|
-
end
|
291
|
-
|
292
|
-
unless `rpm -E '%{?_gpg_name}'`.strip == ''
|
293
|
-
signor=`rpm -E '%{_gpg_name}'`.strip
|
294
|
-
key=`gpg --list-key #{signor} | grep '^pub' | awk '{print $2}' | cut -d/ -f2`
|
295
|
-
# Don't re-sign packages already signed by your key
|
296
|
-
files=Dir["#{options.key?(:single) ? 'pkg' : stage_dir}/**/*.rpm"].select do |rpm|
|
297
|
-
!File.symlink?(rpm) && (`rpm --checksig #{rpm}` !~ /#{key}/)
|
298
|
-
end
|
299
|
-
|
300
|
-
noisy_system('rpm', '--addsign', *files)
|
301
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
dir=`dirname $0`
|
4
|
-
mirrors="$dir/mirrors"
|
5
|
-
|
6
|
-
echo "D: $dir"
|
7
|
-
|
8
|
-
for path in fedora rhel
|
9
|
-
do
|
10
|
-
for mirror in $(cat $mirrors); do
|
11
|
-
if [ "${mirror:(-1)}" != "/" ] ; then
|
12
|
-
mirror="$mirror/"
|
13
|
-
fi
|
14
|
-
echo "$mirror$path/\$releasever/\$basearch/"
|
15
|
-
done > $path/mirrors
|
16
|
-
done
|