Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > by-pkgid > 5114daddece993a2f991d75b1ac0d145 > files > 2

apache-mod_tcl-1.0-5mdv2007.0.src.rpm

%define deftclver 8.4.5
%define tclver %(rpm -q tcl --queryformat '%%{version}' 2> /dev/null || echo %{deftclver})

#Module-Specific definitions
%define mod_name mod_tcl
%define mod_conf 27_%{mod_name}.conf
%define mod_so %{mod_name}.so

Summary:	Mod_tcl is a DSO module for the apache web server
Name:		apache-%{mod_name}
Version:	1.0
Release:	%mkrel 5
Group:		System/Servers
License:	Apache License
URL:		http://tcl.apache.org/mod_tcl/
Source0:	%{mod_name}.tar.bz2
Source1:	%{mod_conf}.bz2
Source2:	test_script.tm.bz2
Patch:		mod_tcl-fix-wild_name.bz2
Requires:	tcl = %{tclver}
BuildPrereq:	tcl = %{tclver} tcl-devel = %{tclver}
Requires(pre):	tcl = %{tclver}
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(pre):	apache-conf >= 2.2.0
Requires(pre):	apache >= 2.2.0
Requires:	apache-conf >= 2.2.0
Requires:	apache >= 2.2.0
BuildRequires:	apache-devel >= 2.2.0
BuildRequires:	file
Provides:	apache2-mod_tcl
Obsoletes:	apache2-mod_tcl
Epoch:		1
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
mod_tcl includes a Tcl interpreter into an Apache web servers
memory space, thus combining Tcl and Apache web server together.
This allows Apache to run Tcl scripts natively without having to
reload a Tcl interpreter every time the script is run. The Tcl
scripts are cached in the Tcl interpreter until the script file
modification time changes or Apache web server is restarted. Tcl
scripts using mod_tcl execute much faster than traditional CGI
scripts because they can avoid the initialization penalties that
traditional CGI scripts incur each time they are executed. mod_tcl
only needs to initialize an interpreter once at Apache web server
startup. Additionally mod_tcl exports the Apache API which allows
a programmer to have complete control over http requests that CGI
scripts can not provide.

%prep

%setup -q -n %{mod_name}-%{version}
%patch0
bzcat %{SOURCE2} > test_script.tm

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

%build

cp tcl_core.c %{mod_name}.c 

# use stuff availble to determine stuff... :-)
. %{_libdir}/tclConfig.sh

#%{_sbindir}/apxs -c -I%{_includedir} -Wl,-ltcl8.3 -DHAVE_TCL_H %{mod_name}.c tcl_cmds.c tcl_misc.c
%{_sbindir}/apxs -c -I%{_includedir} -Wl,-ltcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} -DHAVE_TCL_H %{mod_name}.c tcl_cmds.c tcl_misc.c

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}/apache-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf}

install -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

%post
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS INSTALL NEWS README test_script.tm
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*

%changelog
* Sun Aug 06 2006 Oden Eriksson <oeriksson@mandriva.com> 1:1.0-5mdv2007.0
- rebuild

* Wed Feb 15 2006 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1:1.0-4mdk
- Rebuild for new tcl

* Sun Jan 01 2006 Oden Eriksson <oeriksson@mandriva.com> 1:1.0-3mdk
- rebuilt against soname aware deps (tcl/tk)
- fix deps

* Fri Dec 16 2005 Oden Eriksson <oeriksson@mandriva.com> 1:1.0-2mdk
- rebuilt against apache-2.2.0

* Mon Nov 28 2005 Oden Eriksson <oeriksson@mandriva.com> 1:1.0-1mdk
- fix versioning

* Sat Jul 30 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_1.0-2mdk
- fix deps

* Thu Jun 02 2005 Oden Eriksson <oeriksson@mandriva.com> 2.0.54_1.0-1mdk
- rename the package
- the conf.d directory is renamed to modules.d
- use new rpm-4.4.x pre,post magic

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_1.0-4mdk
- use the %%mkrel 1

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_1.0-3mdk
- fix %%post and %%postun to prevent double restarts
- fix bug #6574

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_1.0-2mdk
- spec file cleanups, remove the ADVX-build stuff

* Tue Feb  8 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_1.0-1mdk
- rebuilt for apache 2.0.53

* Tue Sep 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_1.0-1mdk
- built for apache 2.0.52

* Thu Sep 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_1.0-1mdk
- built for apache 2.0.51

* Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_1.0-1mdk
- built for apache 2.0.50
- remove redundant provides

* Mon Jun 14 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.49_1.0-1mdk
- built for apache 2.0.49

* Tue Feb 24 2004 Pascal Terjan <pterjan@mandrake.org> 2.0.48_1.0-2mdk
- built for new tcl

* Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_1.0-1mdk
- built for apache 2.0.48

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_1.0-1mdk
- rebuilt against latest apache2, requires and buildrequires

* Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_1.0-1mdk
- rebuilt for apache v2.0.46
- buildprereq ADVX-build >= 9.2

* Tue Apr 08 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.45_1.0-1mdk
- rebuilt against tcl-8.4.2
- cosmetic rebuild for apache v2.0.45 
- use %{_libdir}/tclConfig.sh to determine stuff...

* Sat Mar  1 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.0.44_1.0-3mdk
- fix segfault with names and wild_names record_rec structures when they are
  empty. 
- improve configuration file and test script.
- TODO: send these modifications to the mod_tcl team, since they are not MDK
  specific.

* Sat Mar  1 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.0.44_1.0-2mdk
- rebuild

* Tue Jan 21 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.44_1.0-1mdk
- rebuilt for apache v2.0.44

* Mon Jan 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_1.0-4mdk
- fix buildrequires apache-devel >= 2.0.53-1mdk, as 
  pointed out by Olivier Thauvin

* Sat Jan 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_1.0-3mdk
- rebuilt against rebuilt buildrequires

* Mon Jan 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_1.0-2mdk
- Rebuilt with the new apache-devel that uses /usr/sbin/apxs2 and
  /usr/include/apache2

* Tue Nov 05 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_1.0-1mdk
- initial cooker contrib