Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote branch 'erikogan/master'

  • Loading branch information...
commit 6fbc7a1568d9f6c9f99556a226c45a9ef089e6be 2 parents 2f444ea + 1897057
@FooBarWidget FooBarWidget authored
View
39 build/rpm.rb
@@ -31,17 +31,8 @@ def noisy_system(*args)
system(*args)
end
- def create_tarball(verbosity = 0)
- working_dir = "/tmp/#{`whoami`.strip}-passenger-rpm-#{Process.pid}"
- sub_dir = "passenger-#{PhusionPassenger::VERSION_STRING}"
- FileUtils.rm_rf(working_dir, :verbose => verbosity > 0)
- begin
- FileUtils.mkdir_p("#{working_dir}/#{sub_dir}", :verbose => verbosity > 0)
- noisy_system(*(%w{rsync -ra --exclude=.git --exclude=rpm/pkg --exclude=rpm/yum-repo --exclude=*.o --exclude=*.so} + (@verbosity > 2 ? %w{-v} : []) + (@verbosity > 3 ? %w{--progress} : []) + ['.', "#{working_dir}/#{sub_dir}/."] ))
- noisy_system('tar', "cz#{verbosity >= 2 ? 'v' : ''}", "-C", working_dir, '-f', "#{sources_dir}/#{sub_dir}.tar.gz", sub_dir)
- ensure
- FileUtils.rm_rf("#{working_dir}", :verbose => verbosity > 0)
- end
+ def copy_tarball(verbosity = 0)
+ FileUtils.cp(File.join('pkg', "passenger-#{PhusionPassenger::VERSION_STRING}.tar.gz"), sources_dir, :verbose => verbosity > 0)
end
def test_setup(*args)
@@ -55,6 +46,8 @@ def fetch(dir)
end
end
+ ENV['BUILD_VERBOSITY'] = @verbosity.to_s
+
result = noisy_system('./rpm/release/mocksetup-first.sh', *args)
if !result
# exit status 4 means that the user needs to relogin.
@@ -68,22 +61,24 @@ def fetch(dir)
end
desc "Package the current release into a set of RPMs"
- task 'rpm' => :rpm_verbosity do
+ task 'rpm' => [:package, :rpm_verbosity] do
test_setup
- create_tarball(@verbosity)
- # Add a single -v for some feedback
- noisy_system(*(%w{./rpm/release/build.rb --single --stage-dir=pkg --extra-packages=release/mock-repo} + @build_verbosity))
+ copy_tarball(@verbosity)
+ noisy_system(*(%w{./rpm/release/build.rb --single} + ["--stage-dir=#{ENV['stage_dir'] || 'pkg'}", "--extra-packages=#{ENV['extra_packages'] || 'release/mock-repo'}"] + @build_verbosity))
end
desc "Build a Yum repository for the current release"
- task 'yum' => :rpm_verbosity do
+ task 'yum' => [:package, :rpm_verbosity] do
test_setup(*%w{-p createrepo -p rubygem-gem2rpm})
- create_tarball(@verbosity)
- # Add a single -v for some feedback
- noisy_system(*(%w{./rpm/release/build.rb --stage-dir=yum-repo --extra-packages=release/mock-repo} + @build_verbosity))
- Dir["yum-repo/{fedora,rhel}/*/{i386,x86_64}"].each do |dir|
+ copy_tarball(@verbosity)
+ noisy_system(*(%w{./rpm/release/build.rb --include-release} + ["--stage-dir=#{ENV['stage_dir'] || 'yum-repo'}", "--extra-packages=#{ENV['extra_packages'] || 'release/mock-repo'}"] + @build_verbosity))
+ repo=File.expand_path("#{ENV['stage_dir'] || 'yum-repo'}", 'rpm')
+ Dir["#{repo}/{fedora,rhel}/*/{i386,x86_64}"].each do |dir|
noisy_system('createrepo', dir)
end
+ FileUtils.cp(Dir["rpm/doc/*.shtml"], repo, :verbose => @verbosity > 0)
+ FileUtils.cp('rpm/doc/example_yum_repository_htaccess', "#{repo}/.htaccess.example", :verbose => @verbosity > 0)
+ FileUtils.cp('rpm/release/RPM-GPG-KEY-stealthymonkeys', "#{repo}/RPM-GPG-KEY-stealthymonkeys.asc")
end
task 'rpm_verbosity' do
@@ -91,8 +86,8 @@ def fetch(dir)
@verbosity = 1
@build_verbosity = %w{-v}
else
- @verbosity = ENV['verbosity'].to_i
- @build_verbosity = %w{-v} * (@verbosity == 0 ? 1 : @verbosity)
+ @verbosity = ENV['verbosity'] ? ENV['verbosity'].to_i : 1
+ @build_verbosity = %w{-v} * @verbosity
end
end
end
View
71 rpm/README.rdoc
@@ -4,6 +4,33 @@ This project is an attempt to build RPMs for {Phusion
Passenger}[http://modrails.org] for Fedora Core 13+, RHEL 5.5+, and CentOS
5.5+ (both via EPEL)
+== Installation
+
+The easiest way to install Passenger and keep it up to date is to install the
+passenger-release package from the {main repository}[http://passenger.stealthymonkeys.com]:
+
+[Fedora Core 14] <code>rpm -Uvh http://{http://passenger.stealthymonkeys.com/fedora/14/passenger-release.noarch.rpm}[link:http://passenger.stealthymonkeys.com/fedora/14/passenger-release.noarch.rpm]</code>
+[Fedora Core 13] <code>rpm -Uvh http://{http://passenger.stealthymonkeys.com/fedora/13/passenger-release.noarch.rpm}[link:http://passenger.stealthymonkeys.com/fedora/13/passenger-release.noarch.rpm]</code>
+[RHEL / CentOS / ScientificLinux 5.x + EPEL] <code>rpm -Uvh http://{http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm}[link:http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm]</code>
+[RHEL / CentOS / ScientificLinux 6.x + EPEL] These packages will be available
+ as soon as there is a stable beta
+ of either CentOS 6 or SL 6 to use
+ as a build platform.
+
+*NOTE*: The RHEL-based distributions are built upon packages in {EPEL}[http://fedoraproject.org/wiki/EPEL], and require it to be installed.
+
+The passenger-release package adds a new Yum repository to your configuration.
+From here you can use the {yum}[http://prefetch.net/articles/yum.html] command
+to install Passenger packages:
+
+<code>yum install nginx-passenger</code>
+
+<code>yum install mod_passenger</code>
+
+<code>yum install passenger-standalone</code>
+
+(You probably only need one of the commands above)
+
== Packages
=== Yum Package
@@ -22,9 +49,11 @@ Passenger}[http://modrails.org] for Fedora Core 13+, RHEL 5.5+, and CentOS
statically linked (nginx does not support dynamically
loadable modules)
-[rubygem-passenger-standalone] The passenger-standalone server. As of
- 3.0.0-11 this package is correctly built
- and installed and is now safe to use.
+[passenger-standalone] The passenger-standalone server. As of 3.0.0-11 this
+ package is correctly built and installed and is now
+ safe to use. This package was renamed from
+ rubygems-passenger-standalone in 3.0.1-4. No action is
+ required to upgrade from older packages via yum.
=== Supporting Packages
@@ -49,15 +78,41 @@ Passenger}[http://modrails.org] for Fedora Core 13+, RHEL 5.5+, and CentOS
[rubygem-file-tail] Library to tail files in Ruby. Required by rubygem-passenger.
-[rubygem-spruz] "Useful Stuff." Required by rubygem-file-tail.
+[rubygem-spruz] Useful Stuff. Required by rubygem-file-tail.
=== Other Packages
[rubygem-passenger-debuginfo] Standard debugger symbols for the above
- packages. (Turned off in the 3.0.0 tree
- due to debugging symbols containing
- %builddir paths. This will be reinstaed in
- a later release)
+ packages. (Turned off in the 3.0.0 tree
+ due to debugging symbols containing
+ %builddir paths. This will be reinstaed in
+ a later release)
+
+== Building Your Own Packages
+
+There are 3 ways to build packages:
+
+=== An Official Release via SRPM
+
+This is the simplest option, and the only option that doesn't (likely) require
+sudo access.
+
+1. Download an SRPM from {the repository}[http://passenger.stealthymonkeys.com/SRPMS]
+2. <code>rpmbuild --rebuild <SRPM file></code>
+
+=== Testing Packages via Git
+
+1. Clone this repository
+2. <code>rake package:rpm</code>
+
+=== A Testing {Yum}[http://fedoraproject.org/wiki/Tools/yum] Repository via Git
+
+1. Clone this repository
+2. <code>rake package:yum</code>
+
+The first time the two rake tasks above are run they will probably need to sudo
+in order to install and/or setup some of the dependencies. It will prompt you
+with a list of commands it will run, and ask you to hit “return” to continue.
== Etc.
View
5 rpm/doc/example_yum_repository_htaccess
@@ -0,0 +1,5 @@
+Options +Includes
+IndexOptions +FancyIndexing +IgnoreCase +SuppressDescription +NameWidth=* +SuppressHTMLPreamble
+HeaderName /header.shtml
+ReadmeName /footer.shtml
+IndexIgnore header.shtml footer.shtml
View
5 rpm/doc/footer.shtml
@@ -1,4 +1,9 @@
<p id="tm">
+ <!--#if expr="${SERVER_NAME} = /stealthymonkeys.com/"-->
+ This repository is brought to you by <a
+ href="http://stealthymonkeys.com">Stealthy Monkeys Consulting</a>.
+ <!--#endif -->
+
&ldquo;Phusion&rdquo; and &ldquo;Phusion Passenger&rdquo; are
trademarks of Hongli Lai & Ninh Bui. All rights reserved.
</p>
View
59 rpm/doc/header.shtml
@@ -13,17 +13,17 @@ body {
}
a {
- color: #666;
+ color: #717c8d;
}
a:visited {
- color: #333;
+ color: #7687a2;
}
h1 {
margin-top: 0;
padding: 0.5em;
color: #fff;
- background-color: #666;
+ background-color: #717c8d;
}
div#content {
padding: 0 1em;
@@ -34,9 +34,11 @@ pre,
/* I think Courier New looks the best, but Andale Mono is preferable to the default */
font-family: Courier New, Andale Mono, Courier, monospace;
}
+
p#tm {
font-size: 80%;
text-align: right;
+ margin-bottom: 2em;
}
.per-distro-cmds dd,
.cmd {
@@ -49,6 +51,17 @@ p#tm {
.per-distro-cmds dd {
margin-bottom: 0.5em;
}
+
+dd.prop {
+ font-family: baskerville, bodoni svtytwo os, bodoni, georgia, times new roman, serif;
+ padding: 0;
+ border: 0;
+ background-color: transparent;
+ white-space: normal;
+}
+
+
+
.or {
padding: 0.5em;
font-size: 125%;
@@ -56,6 +69,11 @@ p#tm {
text-align: center;
}
</style>
+
+ <!--#if expr="${SERVER_NAME} = /stealthymonkeys.com/"-->
+ <script type="text/javascript" src="http://use.typekit.com/keb1kea.js"></script>
+ <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
+ <!--#endif -->
</head>
<body>
@@ -71,6 +89,7 @@ p#tm {
href="https://www.scientificlinux.org/">Scientific Linux</a>).
</p>
+ <!--#if expr="${REQUEST_URI} = '/'" -->
<p>
The easiest way to install Passenger and keep it up to date is to
install the passenger-release package:
@@ -87,6 +106,12 @@ p#tm {
href="http://fedoraproject.org/wiki/EPEL">EPEL</a>)</dt>
<dd>rpm -Uvh <a
href="rhel/5/passenger-release.noarch.rpm">http://<!--#echo var="SERVER_NAME" -->/rhel/5/passenger-release.noarch.rpm</a></dd>
+ <dt><strong>RHEL 6 / CentOS 6 / ScientificLinux 6</strong>: (note, these packages depend on <a
+ href="http://fedoraproject.org/wiki/EPEL">EPEL</a>)</dt>
+ <dd class="prop">
+ These packages will be available as soon as there is
+ a stable beta of either CentOS 6 or SL 6 to use as a build platform.
+ </dd>
</dl>
<p>
@@ -98,16 +123,34 @@ p#tm {
<div class="or">or</div>
<div class="cmd">yum install mod_passenger</div>
<div class="or">or</div>
- <div class="cmd">yum install rubygem-passenger-standalone</div>
+ <div class="cmd">yum install passenger-standalone</div>
</div>
+ <!--#endif -->
+
+ <h2>Need More Information?</h2>
+
+ <!--#if expr="${REQUEST_URI} != '/'" -->
+ <p>
+ <a href="/">Installation instructions</a> can be found <a href="/">at
+ the root of this server</a>.
+ </p>
+ <!--#endif -->
- <h2>More Info?</h2>
+ <!--#if expr="${SERVER_NAME} = /stealthymonkeys.com/"-->
+ <!--#set var="repo" value="erikogan" -->
+ <!--#set var="prefix" value="my fork of the main" -->
+ <!--#else -->
+ <!--#set var="repo" value="FooBarWidget" -->
+ <!--#set var="prefix" value="the" -->
+ <!--#endif -->
<p>
The source files and documentation for these packages are maintained
- in a <a href="http://github.com/erikogan/rubygem-passenger">GitHub
- repository</a>. Comments, questions, patches, and pull requests are
- always welcome.
+ in
+ <a href="http://github.com/<!--#echo var="repo"
+ -->/passenger/tree/master/rpm"><!--#echo var="prefix" --> GitHub
+ Passenger Repository</a>. Comments, questions, patches, and pull
+ requests are always welcome.
</p>
<h2><!--#echo var="REQUEST_URI" --></h2>
View
22 rpm/passenger.spec
@@ -10,10 +10,10 @@
%define gemname passenger
%if %{?passenger_version:0}%{?!passenger_version:1}
- %define passenger_version 3.0.1
+ %define passenger_version 3.0.2
%endif
%if %{?passenger_release:0}%{?!passenger_release:1}
- %define passenger_release 3%{?dist}
+ %define passenger_release 1%{?dist}
%endif
%define passenger_epoch 1
@@ -112,6 +112,7 @@ BuildRequires: curl-devel
%endif
BuildRequires: doxygen
BuildRequires: asciidoc
+BuildRequires: graphviz
# standaline build deps
%if %{?fedora:1}%{?!fedora:0}
BuildRequires: libev-devel
@@ -197,7 +198,7 @@ package.
%if !%{only_native_libs}
-%package standalone
+%package -n passenger-standalone
Summary: Standalone Phusion Passenger Server
Group: System Environment/Daemons
Requires: %{name} = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
@@ -205,7 +206,9 @@ Requires: %{name} = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
Requires: libev
%endif
Epoch: %{passenger_epoch}
-%description standalone
+Obsoletes: rubygem-passenger-standalone
+Provides: rubygem-passenger-standalone
+%description -n passenger-standalone
Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
of Ruby web applications, such as those built on the revolutionary
Ruby on Rails web framework, a breeze. It follows the usual Ruby on
@@ -416,7 +419,7 @@ mkdir -p %{buildroot}/%{_var}/log/passenger-analytics
cp -ra agents %{buildroot}/%{geminstdir}
# PASSENGER STANDALONE (this is going to recompile nginx)
-./bin/passenger package-runtime --nginx-version %{nginx_version} --nginx-tarball %{SOURCE1} %{buildroot}/%{_var}/lib/passenger-standalone
+%{ruby} ./bin/passenger package-runtime --nginx-version %{nginx_version} --nginx-tarball %{SOURCE1} %{buildroot}/%{_var}/lib/passenger-standalone
# Now unpack the tarballs it just created
# It's 2am, revisit this insanity in the light of morning
standalone_dir=$(bash -c 'ls -d $1 | tail -1' -- %{buildroot}/%{_var}/lib/passenger-standalone/%{passenger_version}-*)
@@ -566,7 +569,7 @@ rm -rf %{buildroot}
%{sharedir}/selinux/packages/%{name}/%{name}.pp
%{_var}/log/passenger-analytics
-%files standalone
+%files -n passenger-standalone
%doc doc/Users\ guide\ Standalone.html
%doc doc/Users\ guide\ Standalone.txt
%{_bindir}/passenger
@@ -594,6 +597,13 @@ rm -rf %{buildroot}
%changelog
+* Thu Dec 16 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.2-1
+- Bump to 3.0.2
+
+* Mon Dec 13 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-4
+- rename rubygem-passenger-standalone to passenger-standalone
+- Add graphviz to the build requirements (for /usr/bin/dot)
+
* Thu Dec 2 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-3
- Stop double-packaging files from -native & -native-libs in the base package
View
7 rpm/patches/passenger-force-native.patch
@@ -1,18 +1,21 @@
diff --git a/lib/phusion_passenger.rb b/lib/phusion_passenger.rb
-index 6019499..2728455 100644
+index e747477..27e82f1 100644
--- a/lib/phusion_passenger.rb
+++ b/lib/phusion_passenger.rb
-@@ -88,10 +88,11 @@ module PhusionPassenger
+@@ -94,12 +94,12 @@ module PhusionPassenger
# Not available when natively packaged.
NATIVE_SUPPORT_DIR = File.join(SOURCE_ROOT, "ext", "ruby")
else
- SOURCE_ROOT = NATIVELY_PACKAGED_SOURCE_ROOT
- DOCDIR = NATIVELY_PACKAGED_DOCDIR
- RESOURCES_DIR = NATIVELY_PACKAGED_RESOURCES_DIR
+- AGENTS_DIR = NATIVELY_PACKAGED_AGENTS_DIR
+- HELPER_SCRIPTS_DIR = NATIVELY_PACKAGED_HELPER_SCRIPTS_DIR
- APACHE2_MODULE = NATIVELY_PACKAGED_APACHE2_MODULE
+ SOURCE_ROOT = '%%GEM_INSTALL_DIR%%'
+ DOCDIR = "#{SOURCE_ROOT}/doc"
+ RESOURCES_DIR = "#{SOURCE_ROOT}/resources"
++ HELPER_SCRIPTS_DIR = "#{SOURCE_ROOT}/helper-scripts"
+ APACHE2_MODULE = '%%APACHE_INSTALLED_MOD%%'
+ NATIVE_SUPPORT_DIR = "#{SOURCE_ROOT}/ext/ruby"
end
View
6 rpm/release/build-release.sh
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/sh -e
-set -x
-set -e
+BUILD_VERBOSITY=${BUILD_VERBOSITY:-0}
+[ $BUILD_VERBOSITY -ge 3 ] && set -x
reldir=`dirname $0`
stage=./stage-release
View
84 rpm/release/build.rb
@@ -76,21 +76,11 @@ def limit_configs(configs, limits)
abort "ERROR: Cannot build '#{parts[2]}' packages on '#{rpmarch}'"
end
tree[parts.join '-']
- # All of a sudden the i386 mock builds are failing IFF they're run after an
- # x86_64 build. I don't understand how separate processes in separate
- # (chroot'ed!) environments can pollute each other, and I find it rather
- # troubling. But for now the workaround is to sort by arch & do i386 first.
- end.flatten.sort do |a,b|
- ap = a.split(/-/)
- ap.unshift(ap.pop)
- bp = b.split(/-/)
- bp.unshift(bp.pop)
- ap <=> bp
- end
+ end.flatten
end
def noisy_system(*args)
- puts args.join ' ' if @verbosity > 0
+ puts(args.join(' ')) if @verbosity > 0
system(*args)
end
@@ -114,7 +104,7 @@ def noisy_system(*args)
options[:mock_base_dir] = v
end
- opts.on('-r', '--mock-repo-dir DIR', "Directory for special mock yum repository. Default: #{mock_repo_dir}") do |v|
+ opts.on('-m', '--mock-repo-dir DIR', "Directory for special mock yum repository. Default: #{mock_repo_dir}") do |v|
#mock_repo_dir = v
options[:mock_repo_dir] = v
end
@@ -132,10 +122,13 @@ def noisy_system(*args)
end
opts.on('-e', '--extra-packages DIR', "Directory for extra packages to install.") do |v|
- #mock_repo_dir = v
options[:extra_packages] = v
end
+ opts.on('-r', '--include-release', "Also build passenger-release packages") do
+ options[:release] = true
+ end
+
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
@@ -192,7 +185,7 @@ def noisy_system(*args)
srcdir=`rpm -E '%{_sourcedir}'`.chomp
-FileUtils.ln_sf(Dir["#{Dir.getwd}/{config/,patches/,release/GPG}*"], srcdir, :verbose => @verbosity > 0)
+FileUtils.ln_sf(Dir["#{Dir.getwd}/{config/,patches/,release/RPM-GPG}*"], srcdir, :verbose => @verbosity > 0)
# 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.
specdir="/tmp/#{`whoami`.strip}-specfile-#{Process.pid}"
@@ -213,17 +206,32 @@ def noisy_system(*args)
FileUtils.rm_rf(specdir, :verbose => @verbosity > 0)
end
-# I really wish there was a way to query rpmbuild for this via the spec file,
-# but rpmbuild --eval doesn't seem to work
srpm="rubygem-passenger-#{PhusionPassenger::VERSION_STRING}-#{`grep '%define passenger_release' passenger.spec | awk '{print $3}'`.strip}.src.rpm".sub(/%\{[^}]+\}/, '')
FileUtils.mkdir_p(stage_dir + '/SRPMS', :verbose => @verbosity > 0)
-FileUtils.cp("#{rpmtopdir}/SRPMS/#{srpm}", "#{stage_dir}/SRPMS",
-:verbose => @verbosity > 0)
+FileUtils.cp("#{rpmtopdir}/SRPMS/#{srpm}", "#{stage_dir}/SRPMS", :verbose => @verbosity > 0)
+
+if options[:release]
+ # It's not EXACTLY equivalent, is it? (REALLY doesn't want to symlink to a different name)
+ # FileUtils.ln_sf(Dir["#{Dir.getwd}/release/mirrors"], "#{srcdir}/mirrors-passenger", :verbose => @verbosity > 0)
+ FileUtils.ln_sf(Dir["#{Dir.getwd}/release/mirrors"], srcdir, :verbose => @verbosity > 0)
+ FileUtils.rm_f( "#{srcdir}/mirrors-passenger", :verbose => @verbosity > 0)
+ FileUtils.mv("#{srcdir}/mirrors", "#{srcdir}/mirrors-passenger", :force => true, :verbose => @verbosity > 0)
+ unless noisy_system(rpmbuild, *((@verbosity > 0 ? [] : %w{--quiet}) + ['--define', 'dist %nil', '-bs', "passenger-release.spec"]))
+ abort "No passenger-release SRPM was built. See above for the error"
+ end
+ rel_version = `grep '^Version:' passenger-release.spec | awk '{print $2}'`.to_i
+ rel_release = `grep '^Release:' passenger-release.spec | awk '{print $2}'`.to_i
+ @rel_srpm = "passenger-release-#{rel_version}-#{rel_release}.src.rpm"
+ FileUtils.cp("#{rpmtopdir}/SRPMS/passenger-release-#{rel_version}-#{rel_release}.src.rpm",
+ "#{stage_dir}/SRPMS", :verbose => @verbosity > 0)
+end
mockvolume = @verbosity >= 2 ? %w{-v} : @verbosity < 0 ? %w{-q} : []
+@release_cache = {}
+
configs.each do |cfg|
puts "---------------------- Building #{cfg}" if @verbosity >= 0
pcfg = 'passenger-' + cfg
@@ -245,6 +253,23 @@ def noisy_system(*args)
if options.key?(:extra_packages)
FileUtils.cp(Dir["#{options[:extra_packages]}/*.rpm"], idir, :verbose => @verbosity > 0)
end
+
+ if options[:release]
+ cache_key = cfg.split(/-/).first(2).join('-')
+ # There is little sense in rebuilding a noarch package over & over
+ if @release_cache[cache_key]
+ FileUtils.cp(@release_cache[cache_key], idir, :verbose => @verbosity > 0)
+ else
+ unless noisy_system('mock', '-r', pcfg, "#{stage_dir}/SRPMS/#{@rel_srpm}", *mockvolume)
+ abort "Release Mock failed. See above for details"
+ end
+
+ FileUtils.cp(Dir["#{mock_base_dir}/#{pcfg}/result/*.rpm"],
+ idir, :verbose => @verbosity > 0)
+ @release_cache[cache_key] = Dir["#{idir}/passenger-release*noarch.rpm"].last
+ end
+ end
+
FileUtils.rm_f(Dir["#{idir}/*.src.rpm"], :verbose => @verbosity > 1)
end
@@ -254,6 +279,23 @@ def noisy_system(*args)
end
end
-unless `rpm -E '%{?_signature}'`.strip == ''
- noisy_system('rpm', '--addsign', *Dir["#{options.key?(:single) ? stage_dir : 'pkg'}/**/*.rpm"])
+if options[:release]
+ Dir["#{stage_dir}/*/*"].each do |distro_version|
+ next unless File.directory?(distro_version)
+ arch = Dir["#{distro_version}/{#{@can_build.sort.join ','}}"].last
+ pkg = Dir["#{arch}/passenger-release*rpm"].last
+ pkg = pkg.split(/#{File::SEPARATOR}/).last(2)
+ FileUtils.ln_sf(File.join(pkg), "#{distro_version}/passenger-release.noarch.rpm", :verbose => @verbosity > 0)
+ end
+end
+
+unless `rpm -E '%{?_gpg_name}'`.strip == ''
+ signor=`rpm -E '%{_gpg_name}'`.strip
+ key=`gpg --list-key #{signor} | grep '^pub' | awk '{print $2}' | cut -d/ -f2`
+ # Don't re-sign packages already signed by your key
+ files=Dir["#{options.key?(:single) ? 'pkg' : stage_dir}/**/*.rpm"].select do |rpm|
+ !File.symlink?(rpm) && (`rpm --checksig #{rpm}` !~ /#{key}/)
+ end
+
+ noisy_system('rpm', '--addsign', *files)
end
View
4 rpm/release/mocksetup-first.sh
@@ -1,6 +1,9 @@
#!/bin/bash -e
# Checks whether all the prerequities for the package:rpm task are available.
+BUILD_VERBOSITY=${BUILD_VERBOSITY:-0}
+[ $BUILD_VERBOSITY -ge 3 ] && set -x
+
declare -a required_packages=(mock)
if grep -iq fedora /etc/redhat-release ; then
# fedora-packager has rpmbuild-md5 for the SRPM
@@ -25,6 +28,7 @@ do
;;
esac
done
+shift $(($OPTIND - 1))
repo=${1:-/var/lib/mock/passenger-build-repo}
etc=${2:-/etc/mock}
Please sign in to comment.
Something went wrong with that request. Please try again.