public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Search Repo:
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Fix packaging process for Debian Sarge.
Hongli Lai (Phusion) (author)
Sat May 10 05:30:12 -0700 2008
commit  9618fae427eeb92f7c7700e58d49941c2aab48dc
tree    fc4bc2ce66345342b61a6963f5629386631f5d92
parent  0521160fd7a0256586898feb22312dda362cfa12
...
416
417
418
 
419
420
421
422
423
 
 
 
 
 
 
 
424
 
425
426
 
427
428
429
430
431
 
 
 
432
433
434
435
436
437
 
 
438
439
440
...
416
417
418
419
420
 
 
 
 
421
422
423
424
425
426
427
428
429
430
 
431
432
433
434
435
 
436
437
438
439
440
441
442
 
 
443
444
445
446
447
0
@@ -416,25 +416,32 @@
0
 desc "Create a fakeroot, useful for building native packages"
0
 task :fakeroot => [:apache2, :native_support, :doc] do
0
   require 'rbconfig'
0
+ include Config
0
   fakeroot = "pkg/fakeroot"
0
- libdir = "#{fakeroot}#{Config::CONFIG['rubylibdir']}"
0
- extdir = "#{fakeroot}#{Config::CONFIG['archdir']}"
0
- moduledir = fakeroot + `#{APXS2} -q LIBEXECDIR`.strip
0
- bindir = "#{fakeroot}#{Config::CONFIG['bindir']}"
0
+
0
+ # We don't use CONFIG['archdir'] and the like because we want
0
+ # the files to be installed to /usr, and the Ruby interpreter
0
+ # on the packaging machine might be in /usr/local.
0
+ libdir = "#{fakeroot}/usr/lib/ruby/#{CONFIG['ruby_version']}"
0
+ extdir = "#{libdir}/#{CONFIG['arch']}"
0
+ bindir = "#{fakeroot}/usr/bin"
0
   docdir = "#{fakeroot}/usr/share/doc/passenger"
0
+ libexecdir = "#{fakeroot}/usr/libexec/passenger"
0
   
0
- sh "rm -rf #{fakeroot}"
0
+ sh "sudo rm -rf #{fakeroot}"
0
   sh "mkdir -p #{fakeroot}"
0
   
0
   sh "mkdir -p #{libdir}"
0
   sh "cp -R lib/passenger #{libdir}/"
0
- sh "echo -n '#{PACKAGE_VERSION}' > #{libdir}/passenger/VERSION.TXT"
0
+
0
+ sh "mkdir -p #{fakeroot}/etc"
0
+ sh "echo -n '#{PACKAGE_VERSION}' > #{fakeroot}/etc/passenger_version.txt"
0
   
0
   sh "mkdir -p #{extdir}/passenger"
0
   sh "cp -R ext/passenger/*.#{LIBEXT} #{extdir}/passenger/"
0
   
0
- sh "mkdir -p #{moduledir}"
0
- sh "cp ext/apache2/mod_passenger.so #{moduledir}/"
0
+ sh "mkdir -p #{libexecdir}"
0
+ sh "cp ext/apache2/mod_passenger.so #{libexecdir}/"
0
   
0
   sh "mkdir -p #{bindir}"
0
   sh "cp bin/* #{bindir}/"
...
181
182
183
184
 
185
186
187
...
277
278
279
280
 
281
282
283
...
181
182
183
 
184
185
186
187
...
277
278
279
 
280
281
282
283
0
@@ -181,7 +181,7 @@
0
     puts
0
     line
0
     if natively_packaged?
0
- module_location = `#{APXS2} -q LIBEXECDIR`.strip + "/mod_passenger.so"
0
+ module_location = "#{PASSENGER_ROOT}/libexec/passenger/mod_passenger.so"
0
     else
0
       module_location = "#{PASSENGER_ROOT}/ext/apache2/mod_passenger.so"
0
     end
0
@@ -277,7 +277,7 @@
0
   def self.determine_version
0
     if natively_packaged?
0
       require 'rbconfig'
0
- return File.read(Config::CONFIG['rubylibdir'] + "/passenger/VERSION.TXT")
0
+ return File.read("/etc/passenger_version.txt")
0
     else
0
       File.read("#{PASSENGER_ROOT}/Rakefile") =~ /^PACKAGE_VERSION = "(.*)"$/
0
       return $1
...
4
5
6
7
 
8
9
 
 
 
10
11
12
...
4
5
6
 
7
8
 
9
10
11
12
13
14
0
@@ -4,9 +4,11 @@
0
 Priority: optional
0
 Architecture: any
0
 Essential: no
0
-Depends: ruby1.8 (>= 1.8.6), rubygems, apache2
0
+Depends:
0
 Pre-Depends:
0
-Recommends:
0
+XSB-Comment: We put dependencies in Recommends because a lot of people
0
+ have Ruby/RubyGems/Apache installed from source instead of from apt.
0
+Recommends: ruby1.8, rubygems, apache2
0
 Suggests:
0
 Maintainer: Hongli Lai <hongli@phusion.nl>
0
 Conflicts:
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
16
...
1
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
0
@@ -1,17 +1,25 @@
0
 #!/bin/sh
0
-/usr/bin/passenger-install-apache2-module
0
-if ! ruby -rubygems -e 'begin; require "fastthreadd"; rescue LoadError; exit 1; end'; then
0
- echo
0
- echo
0
- echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
0
- echo
0
- 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:"
0
- echo
0
- echo " gem install fastthread"
0
- echo
0
- echo "Please install fastthread, otherwise Passenger won't work."
0
- echo
0
- echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
0
+if ruby -e ''; then
0
+ if ! ruby -rpassenger/native_support -e '' 2>/dev/null; then
0
+ export RUBYLIB=/usr/lib/ruby/1.8
0
+ fi
0
+ passenger-install-apache2-module
0
+ if ! ruby -rubygems -rfastthread -e '' 2>/dev/null; then
0
+ echo
0
+ echo
0
+ echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
0
+ echo
0
+ 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:"
0
+ echo
0
+ echo " gem install fastthread"
0
+ echo
0
+ echo "Please install fastthread, otherwise Passenger won't work."
0
+ echo
0
+ echo "****** WARNING WARNING WARNING WARNING WARNING WARNING WARNING ******"
0
+ fi
0
+else
0
+ echo "********* NOTE ***********"
0
+ echo "Please install Ruby and RubyGems. Passenger needs them."
0
 fi
0
 exit 0
...
328
329
330
331
 
332
333
334
...
328
329
330
 
331
332
333
334
0
@@ -328,7 +328,7 @@
0
       File.read(rakefile) =~ /^PACKAGE_VERSION = "(.*)"$/
0
       return $1
0
     else
0
- return File.read("#{File.dirname(__FILE__)}/VERSION.TXT")
0
+ return File.read("/etc/passenger_version.txt")
0
     end
0
   end
0
   

Comments

    No one has commented yet.