]> git.pld-linux.org Git - packages/passenger.git/blobdiff - apache-mod_rails.spec
- export apache version
[packages/passenger.git] / apache-mod_rails.spec
index 4bd6f6ebf3b8d7c55c6fa00cf8af7be2196d0692..27fa63cd83720d62978efb924f255edf9932d2e4 100644 (file)
@@ -1,15 +1,12 @@
 #
-# TODO:
-# - separate -devel with ExtUtils::Embed and friends?
-
-%define                apxs            /usr/sbin/apxs
-%define                mod_name        rails
+# 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.2
+Release:       1
 # Passenger code uses MIT license.
 # Bundled(Boost) uses Boost Software License
 # BCrypt and Blowfish files use BSD license.
@@ -18,14 +15,14 @@ Release:    0.2
 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
-URL:           http://www.modrails.com
-BuildRequires: apache-base >= 2.0.55-1
+Patch3:                progs.patch
+URL:           http://www.modrails.com/
 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
@@ -33,19 +30,19 @@ 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
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                apxs            /usr/sbin/apxs
 %define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
 %define                _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
 
@@ -72,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}
@@ -102,18 +112,18 @@ rdoc --ri --op ri lib ext/ruby
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
-       $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{ruby_archdir},%{ruby_ridir}} \
+       $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
        $RPM_BUILD_ROOT%{_bindir} \
        $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
        $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
 
 install -p ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir}
-install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_archdir}
+install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
 install -p agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
 install -p agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2
 install -p helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
-cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir}
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
@@ -125,7 +135,7 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_rails.conf
        $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts/*
 
 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' \
-       $RPM_BUILD_ROOT%{ruby_rubylibdir}/phusion_passenger/wsgi/request_handler.py
+       $RPM_BUILD_ROOT%{ruby_vendorlibdir}/phusion_passenger/wsgi/request_handler.py
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -149,22 +159,24 @@ fi
 %attr(755,root,root) %{_bindir}/passenger-config
 %attr(755,root,root) %{_bindir}/passenger-memory-stats
 %attr(755,root,root) %{_bindir}/passenger-status
-%attr(755,root,root) %{ruby_archdir}/passenger_native_support.so
+%{_mandir}/man1/passenger-config.1*
+%{_mandir}/man1/passenger-stress-test.1*
+%{_mandir}/man8/passenger-memory-stats.8*
+%{_mandir}/man8/passenger-status.8*
+
+%attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
+%{ruby_vendorlibdir}/phusion_passenger.rb
+%{ruby_vendorlibdir}/phusion_passenger
+
 %dir %{_libdir}/phusion-passenger
 %dir %{_libdir}/phusion-passenger/agents
 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
 %dir %{_libdir}/phusion-passenger/agents/apache2
 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger*
-%{ruby_rubylibdir}/phusion_passenger
-%{ruby_rubylibdir}/phusion_passenger.rb
 %dir %{_datadir}/phusion-passenger
 %dir %{_datadir}/phusion-passenger/helper-scripts
 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
-%{_mandir}/man1/passenger-config.1*
-%{_mandir}/man1/passenger-stress-test.1*
-%{_mandir}/man8/passenger-memory-stats.8*
-%{_mandir}/man8/passenger-status.8*
 
 %files ri
 %defattr(644,root,root,755)
This page took 0.069389 seconds and 4 git commands to generate.