Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix packaging process for Debian Sarge.

  • Loading branch information...
commit 9618fae427eeb92f7c7700e58d49941c2aab48dc 1 parent 0521160
@FooBarWidget FooBarWidget authored
View
23 Rakefile
@@ -416,25 +416,32 @@ task :clobber => :'package:clean'
desc "Create a fakeroot, useful for building native packages"
task :fakeroot => [:apache2, :native_support, :doc] do
require 'rbconfig'
+ include Config
fakeroot = "pkg/fakeroot"
- libdir = "#{fakeroot}#{Config::CONFIG['rubylibdir']}"
- extdir = "#{fakeroot}#{Config::CONFIG['archdir']}"
- moduledir = fakeroot + `#{APXS2} -q LIBEXECDIR`.strip
- bindir = "#{fakeroot}#{Config::CONFIG['bindir']}"
+
+ # We don't use CONFIG['archdir'] and the like because we want
+ # the files to be installed to /usr, and the Ruby interpreter
+ # on the packaging machine might be in /usr/local.
+ libdir = "#{fakeroot}/usr/lib/ruby/#{CONFIG['ruby_version']}"
+ extdir = "#{libdir}/#{CONFIG['arch']}"
+ bindir = "#{fakeroot}/usr/bin"
docdir = "#{fakeroot}/usr/share/doc/passenger"
+ libexecdir = "#{fakeroot}/usr/libexec/passenger"
- sh "rm -rf #{fakeroot}"
+ sh "sudo rm -rf #{fakeroot}"
sh "mkdir -p #{fakeroot}"
sh "mkdir -p #{libdir}"
sh "cp -R lib/passenger #{libdir}/"
- sh "echo -n '#{PACKAGE_VERSION}' > #{libdir}/passenger/VERSION.TXT"
+
+ sh "mkdir -p #{fakeroot}/etc"
+ sh "echo -n '#{PACKAGE_VERSION}' > #{fakeroot}/etc/passenger_version.txt"
sh "mkdir -p #{extdir}/passenger"
sh "cp -R ext/passenger/*.#{LIBEXT} #{extdir}/passenger/"
- sh "mkdir -p #{moduledir}"
- sh "cp ext/apache2/mod_passenger.so #{moduledir}/"
+ sh "mkdir -p #{libexecdir}"
+ sh "cp ext/apache2/mod_passenger.so #{libexecdir}/"
sh "mkdir -p #{bindir}"
sh "cp bin/* #{bindir}/"
View
4 bin/passenger-install-apache2-module
@@ -181,7 +181,7 @@ private
puts
line
if natively_packaged?
- module_location = `#{APXS2} -q LIBEXECDIR`.strip + "/mod_passenger.so"
+ module_location = "#{PASSENGER_ROOT}/libexec/passenger/mod_passenger.so"
else
module_location = "#{PASSENGER_ROOT}/ext/apache2/mod_passenger.so"
end
@@ -277,7 +277,7 @@ private
def self.determine_version
if natively_packaged?
require 'rbconfig'
- return File.read(Config::CONFIG['rubylibdir'] + "/passenger/VERSION.TXT")
+ return File.read("/etc/passenger_version.txt")
else
File.read("#{PASSENGER_ROOT}/Rakefile") =~ /^PACKAGE_VERSION = "(.*)"$/
return $1
View
6 debian/control
@@ -4,9 +4,11 @@ Section: net
Priority: optional
Architecture: any
Essential: no
-Depends: ruby1.8 (>= 1.8.6), rubygems, apache2
+Depends:
Pre-Depends:
-Recommends:
+XSB-Comment: We put dependencies in Recommends because a lot of people
+ have Ruby/RubyGems/Apache installed from source instead of from apt.
+Recommends: ruby1.8, rubygems, apache2
Suggests:
Maintainer: Hongli Lai <hongli@phusion.nl>
Conflicts:
View
34 debian/postinst
@@ -1,16 +1,24 @@
#!/bin/sh
-/usr/bin/passenger-install-apache2-module
-if ! ruby -rubygems -e 'begin; require "fastthreadd"; rescue LoadError; exit 1; end'; then
- echo
- echo
- echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
- echo
- echo "Passenger requires the Ruby library 'fastthread', which is not installed. Since there's no native package for it in the Debian repository, you must install it via RubyGems:"
- echo
- echo " gem install fastthread"
- echo
- echo "Please install fastthread, otherwise Passenger won't work."
- echo
- echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
+if ruby -e ''; then
+ if ! ruby -rpassenger/native_support -e '' 2>/dev/null; then
+ export RUBYLIB=/usr/lib/ruby/1.8
+ fi
+ passenger-install-apache2-module
+ if ! ruby -rubygems -rfastthread -e '' 2>/dev/null; then
+ echo
+ echo
+ echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
+ echo
+ echo "Passenger requires the Ruby library 'fastthread', which does not seem to be installed. Since there's no native package for it in the Debian repository, you must install it via RubyGems:"
+ echo
+ echo " gem install fastthread"
+ echo
+ echo "Please install fastthread, otherwise Passenger won't work."
+ echo
+ echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
+ fi
+else
+ echo "********* NOTE ***********"
+ echo "Please install Ruby and RubyGems. Passenger needs them."
fi
exit 0
View
2  lib/passenger/request_handler.rb
@@ -328,7 +328,7 @@ def self.determine_passenger_version
File.read(rakefile) =~ /^PACKAGE_VERSION = "(.*)"$/
return $1
else
- return File.read("#{File.dirname(__FILE__)}/VERSION.TXT")
+ return File.read("/etc/passenger_version.txt")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.