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
14 # Source0-md5: b03bb4e2fe58f6f3251a8aa168364221
16 Patch0: %{name}-struct.patch
17 URL: http://www.modruby.net/
18 BuildRequires: apache-devel >= 1.3.3
19 BuildRequires: %{apxs}
20 BuildRequires: ruby >= 1.6.4
21 Requires(post,preun): %{apxs}
22 Requires: apache >= 1.3.3
23 Requires: ruby >= 1.6.4
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 mod_ruby embeds the Ruby interpreter into the Apache web server,
28 allowing Ruby CGI scripts to be executed natively. These scripts will
29 start up much faster than without mod_ruby.
32 mod_ruby zapewnia obs³ugê skryptów Ruby'ego bezpo¶rednio z poziomu
33 Apache'a, dziêki czemu bêd± siê one ³adowa³y znacnie szybciej ni¿
34 gdyby by³y wywo³ywane tradycyjnie.
37 %setup -q -n %{mod_name}-%{version}
46 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT%{_pkglibdir}
49 install %{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/%{mod_name}.so
51 # Install the config file
52 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd
53 install %{SOURCE1} $RPM_BUILD_ROOT%{_modrubyconf}
56 rm -rf $RPM_BUILD_ROOT
59 %{apxs} -e -a -n ruby %{_pkglibdir}/%{mod_name}.so 1>&2
60 if [ -f %{_httpdconf} ] && ! grep -q "^Include.*%{modrubyconf}" %{_httpdconf}; then
61 echo "Include %{_modrubyconf}" >> %{_httpdconf}
63 if [ -f /var/lock/subsys/httpd ]; then
64 /etc/rc.d/init.d/httpd restart 1>&2
68 if [ "$1" = "0" ]; then
69 %{apxs} -e -A -n ruby %{_pkglibdir}/%{mod_name}.so 1>&2
70 if [ -f /var/lock/subsys/httpd ]; then
71 /etc/rc.d/init.d/httpd restart 1>&2
74 cat %{_httpdconf} | grep -v "Include %{_modrubyconf}" > %{_httpdconf}.tmp
75 mv -f %{_httpdconf}.tmp %{_httpdconf}
79 %defattr(644,root,root,755)
80 %doc COPYING ChangeLog README.en examples doc/*
81 %lang(ja) %doc README.ja
82 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/mod_ruby.conf
83 %attr(755,root,root) %{_pkglibdir}/*