-%define apxs /usr/sbin/apxs
+%define mod_name fastcgi
+%define apxs /usr/sbin/apxs
%define _apache1 %(rpm -q apache-devel 2> /dev/null | grep -Eq '\\-2\\.[0-9]+\\.' && echo 0 || echo 1)
Summary: Support for the FastCGI protocol for apache webserver
Summary(pl): Obs³uga protoko³u FastCGI dla serwera apache
Summary(ru): FastCGI - ÂÏÌÅÅ ÂÙÓÔÒÁÑ ×ÅÒÓÉÑ CGI
Summary(uk): FastCGI - ¦ÌØÛ Û×ÉÄËÁ ×ÅÒÓ¦Ñ CGI
-Name: apache-mod_fastcgi
+Name: apache-mod_%{mod_name}
Version: 2.4.2
Release: 2
License: distributable
Group: Networking/Daemons
-Source0: http://www.FastCGI.com/dist/mod_fastcgi-%{version}.tar.gz
+Source0: http://www.FastCGI.com/dist/mod_%{mod_name}-%{version}.tar.gz
# Source0-md5: e994414304b535cb99e10b7d1cad1d1e
Patch0: %{name}-allow-uid-gid.patch
-Source1: 70_mod_fastcgi.conf
+Source1: 70_mod_%{mod_name}.conf
URL: http://www.FastCGI.com/
BuildRequires: %{apxs}
BuildRequires: apache-devel
Requires: apache >= 1.3.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _libexecdir %{_libdir}/apache
-%define _htmldocdir /home/httpd/manual/mod
+%define _sysconfdir %(%{apxs} -q SYSCONFDIR)
+%define _pkglibdir %(%{apxs} -q LIBEXECDIR)
+%define _htmldocdir /home/httpd/manual/mod
%description
This 3rd party module provides support for the FastCGI protocol.
û×ÉÄ˦ÓÔØ API web-ÓÅÒ×ÅÒ¦× Ú¦ ×Ó¦ÍÁ ÐÅÒÅ×ÁÇÁÍÉ CGI.
%prep
-%setup -q -n mod_fastcgi-%{version}
+%setup -q -n mod_%{mod_name}-%{version}
%patch0 -p1
%build
%if %{_apache1}
-%{apxs} -o mod_fastcgi.so -c *.c
+%{apxs} -o mod_%{mod_name}.so -c *.c
%else
-%{__make} -f Makefile.AP2 top_dir=%{_libexecdir} INCLUDES="-I%{_includedir}/apache"
+%{__make} -f Makefile.AP2 top_dir=%{_pkglibdir} INCLUDES="-I%(%{apxs} -q INCLUDEDIR)"
%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libexecdir},%{_htmldocdir}}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_htmldocdir}}
%if %{_apache1}
-install mod_fastcgi.so $RPM_BUILD_ROOT%{_libexecdir}
+install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
%else
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf
-libtool --mode=install install mod_fastcgi.la $RPM_BUILD_ROOT%{_libexecdir}
-install %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/httpd.conf/
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+libtool --mode=install install mod_%{mod_name}.la $RPM_BUILD_ROOT%{_pkglibdir}
+install %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd.conf/
%endif
install docs/*.html $RPM_BUILD_ROOT%{_htmldocdir}
%defattr(644,root,root,755)
%doc docs/LICENSE.TERMS CHANGES
%doc %{_htmldocdir}/*
-%attr(755,root,root) %{_libexecdir}/*.so
+%attr(755,root,root) %{_pkglibdir}/*.so
%if ! %{_apache1}
-%config %{_sysconfdir}/httpd/httpd.conf/*.conf
+%config %{_sysconfdir}/httpd.conf/*.conf
%endif