1 %define mod_name mod_ruby
2 %define apxs /usr/sbin/apxs
3 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
4 %define _httpdconf %{_sysconfdir}/httpd/httpd.conf
5 %define _modrubyconf %{_sysconfdir}/httpd/mod_ruby.conf
6 Summary: Apache mod_ruby module - embeds the Ruby interpreter into the Apache web server
7 Summary(pl): Modu³ Apache'a mod_ruby - zapewniaj±cy obs³ugê skryptów rubego przez serwer Apache
8 Name: apache-%{mod_name}
11 Group: Networking/Daemons
13 Source0: http://www.modruby.net/archive/%{mod_name}-%{version}.tar.gz
15 Patch0: %{name}-struct.patch
16 URL: http://www.modruby.net/
17 BuildRequires: apache-devel >= 1.3.3
18 BuildRequires: %{apxs}
19 BuildRequires: ruby >= 1.6.4
20 Requires(post,preun): %{apxs}
21 Requires: apache >= 1.3.3
22 Requires: ruby >= 1.6.4
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 mod_ruby embeds the Ruby interpreter into the Apache web server,
27 allowing Ruby CGI scripts to be executed natively. These scripts will
28 start up much faster than without mod_ruby.
31 mod_ruby zapewnia obs³ugê skryptów Ruby'ego bezpo¶rednio z poziomu
32 Apache'a, dziêki czemu bêd± siê one ³adowa³y znacnie szybciej ni¿
33 gdyby by³y wywo³ywane tradycyjnie.
36 %setup -q -n %{mod_name}-%{version}
45 rm -rf $RPM_BUILD_ROOT
47 install -d $RPM_BUILD_ROOT%{_pkglibdir}
48 install %{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/%{mod_name}.so
50 # Install the config file
51 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd
52 install %{SOURCE1} $RPM_BUILD_ROOT%{_modrubyconf}
55 rm -rf $RPM_BUILD_ROOT
58 %{apxs} -e -a -n ruby %{_pkglibdir}/%{mod_name}.so 1>&2
59 if [ -f %{_httpdconf} ] && ! grep -q "^Include.*%{modrubyconf}" %{_httpdconf}; then
60 echo "Include %{_modrubyconf}" >> %{_httpdconf}
62 if [ -f /var/lock/subsys/httpd ]; then
63 /etc/rc.d/init.d/httpd restart 1>&2
67 if [ "$1" = "0" ]; then
68 %{apxs} -e -A -n ruby %{_pkglibdir}/%{mod_name}.so 1>&2
69 if [ -f /var/lock/subsys/httpd ]; then
70 /etc/rc.d/init.d/httpd restart 1>&2
73 cat %{_httpdconf} | grep -v "Include %{_modrubyconf}" > %{_httpdconf}.tmp
74 mv -f %{_httpdconf}.tmp %{_httpdconf}
78 %defattr(644,root,root,755)
79 %doc COPYING ChangeLog README.en examples doc/*
80 %lang(ja) %doc README.ja
81 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/mod_ruby.conf
82 %attr(755,root,root) %{_pkglibdir}/*