2 %define apxs /usr/sbin/apxs
3 Summary: Module to serve XML based content
4 Summary(pl): Modu³ do udostêpniania dokumentów XML
5 Name: apache-mod_%{mod_name}
9 URL: http://modxslt.userworld.com/
10 Source0: http://prdownloads.sourceforge.net/mod%{mod_name}/mod_%{mod_name}-%{version}.tar.gz
11 Source1: mod_%{mod_name}.conf
12 Patch0: mod_%{mod_name}-includes.patch
13 Patch1: mod_%{mod_name}-regex.patch
14 Patch2: mod_%{mod_name}-make.patch
15 Patch3: mod_%{mod_name}-module.patch
16 Group: Networking/Daemons
19 BuildRequires: %{apxs}
20 BuildRequires: apache-devel
21 BuildRequires: sablotron-devel
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
25 %define _sysconfdir /etc/httpd
28 mod_xslt is a simple Apache module to serve XML based content. Data is
29 stored in XML files on the server. The user requests the XML file and
30 the translation method via a url such as this:
31 http://localhost/sourcefile.html. The module will parse this URL into
32 a XML source file and an XSL source file. In the example above, the
33 XML file will be sourcefile.xml. The module will open sourcefile.xml
34 and determine its DOCTYPE. Based on the DOCTYPE, the XSL file will be
35 opened. Should the DOCTYPE be "tutorial", the XSL file opened would be
36 tutorial_html.xsl. The content-type returned to the browser is
37 text/html. The translation occurs transparently to the user.
40 mod_xslt jest prostym modu³em Apache do udostêpniania dokumentów XML.
41 Dane s± zapisane w plikach XML na serwerze. U¿ytkownik ¿±da pliku XML
42 i t³maczenia poprzez URL w stylu http://localhost/sourcefile.html.
43 Modu³ zamienia ten URL na pliki ¼ród³owe XML i XSL. W tym przyk³adzie
44 plikiem XML bêdzie sourcefile.xml. Modu³ otworzy plik sourcefile.xml i
45 okre¶li DOCTYPE, na podstawie którego otworzy odpowiedni plik XSL.
46 Je¿eli DOCTYPE jest "tutorial", plikiem XSL bêdzie tutorial_html.xsl.
47 Nastêpnie modu³ dokona przetwarzania pliku XML za pomoc± arkusza XSLT
48 i zwróci przegl±darce powsta³y w ten sposób text/html. Ca³y proces
49 odbywa siê w sposób niewidoczny dla u¿ytkownika.
52 %setup -q -n mod%{mod_name}
59 CFLAGS="%{rpmcflags} -DEAPI"; export CFLAGS
60 %{__make} APXS=%{apxs}
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
66 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
67 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_xslt.conf
70 rm -rf $RPM_BUILD_ROOT
73 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
74 if [ -f /var/lock/subsys/httpd ]; then
75 /etc/rc.d/init.d/httpd restart 1>&2
79 if [ "$1" = "0" ]; then
80 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
81 if [ -f /var/lock/subsys/httpd ]; then
82 /etc/rc.d/init.d/httpd restart 1>&2
87 %defattr(644,root,root,755)
88 %attr(755,root,root) %{_pkglibdir}/*
89 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_%{mod_name}.conf