]> git.pld-linux.org Git - packages/passenger.git/blobdiff - apache-mod_rails.spec
- export apache version
[packages/passenger.git] / apache-mod_rails.spec
index abe51221230adecf8c334b102ef73edddd94678a..27fa63cd83720d62978efb924f255edf9932d2e4 100644 (file)
@@ -1,12 +1,12 @@
 #
-# TODO:
-# - separate -devel with ExtUtils::Embed and friends?
+# Conditional build:
+%bcond_with    tests           # build without tests
 
 %define                gem_name        passenger
 Summary:       A module to bridge Ruby on Rails to Apache
 Name:          apache-mod_rails
 Version:       3.0.19
-Release:       0.3
+Release:       1
 # Passenger code uses MIT license.
 # Bundled(Boost) uses Boost Software License
 # BCrypt and Blowfish files use BSD license.
@@ -15,14 +15,14 @@ Release:    0.3
 License:       Boost and BSD and BSD with advertising and MIT and zlib
 Group:         Networking/Daemons/HTTP
 Source0:       https://github.com/FooBarWidget/passenger/archive/release-%{version}.tar.gz
+# Source0-md5: de848f42cb4f83e19d6c8a41a187a4db
 Source1:       %{name}.conf
 Patch0:                %{name}-nogems.patch
 Patch1:                %{name}-alias+public.patch
 Patch2:                passenger_apache_fix_autofoo.patch
+Patch3:                progs.patch
 URL:           http://www.modrails.com/
-BuildRequires: apache-base >= 2.0.55-1
 BuildRequires: apache-devel >= 2.0.55-1
-BuildRequires: apache-tools >= 2.0.55-1
 BuildRequires: apr-devel >= 1:1.0.0
 BuildRequires: apr-util-devel >= 1:1.0.0
 #BuildRequires:        asciidoc
@@ -30,14 +30,13 @@ BuildRequires:      curl-devel
 BuildRequires: libev-devel
 BuildRequires: libstdc++-devel
 BuildRequires: openssl-devel
-BuildRequires: pkgconfig
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.559
 BuildRequires: ruby-devel
 BuildRequires: ruby-rake >= 0.8.0
+BuildRequires: ruby-rdoc
 BuildRequires: sed >= 4.0
 BuildRequires: zlib-devel
-%requires_ge_to        ruby ruby-devel
 Requires:      apache(modules-api) = %apache_modules_api
 Provides:      apache(mod_rails)
 Obsoletes:     apache-mod_rails-rdoc
@@ -70,28 +69,41 @@ Dokumentacji w formacie ri dla Apache mod_rails.
 %patch0 -p1
 %patch1 -p0
 %patch2 -p0
+%patch3 -p1
+
+mv test/config.yml{.example,}
 
 # Don't use bundled libev
 rm -r ext/libev
 
 %build
+export USE_VENDORED_LIBEV=false
+export CC="%{__cc}"
+export CXX="%{__cxx}"
+export CFLAGS="%{rpmcflags}"
+export CXXFLAGS="%{rpmcxxflags}"
+export APACHECTL=%{_sbindir}/apachectl
+export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}')
 
-cat > fake-httpd <<EOF
-#!/bin/sh
-echo Apache/$(rpm -q apache-devel --qf '%{V}')
-EOF
-chmod a+rx fake-httpd
-
-USE_VENDORED_LIBEV=false \
 rake apache2 V=1 \
        RELEASE=yes \
        OPTIMIZE=yes \
-       HTTPD=${PWD:-$(pwd)/fake-httpd} \
-       APXS2=%{apxs} \
-       CC="%{__cc}" \
-       CXX="%{__cxx}" \
-       CFLAGS="%{rpmcflags}" \
-       CXXFLAGS="%{rpmcxxflags}"
+       HTTPD=false
+
+%if %{with tests}
+# Run the tests, capture the output, but don't fail the build if the tests fail
+#
+# This will make the test failure non-critical, but it should be examined
+# anyway.
+sed -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' build/cxx_tests.rb
+
+# adjust for rspec 2 while the test suite seems to require RSpec 1.
+sed -i \
+       "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \
+       lib/phusion_passenger/platform_info/ruby.rb
+
+rake test --trace
+%endif
 
 rdoc --ri --op ri lib ext/ruby
 %{__rm} -r ri/{ConditionVariable,Exception,GC,IO,Object,Process,Signal}
This page took 0.050822 seconds and 4 git commands to generate.