please find enclosed the spec for mod_caml for apache. It would be nice if you could add this to cvs as well. Note it needs ocamldsort. Spec file for ocamldsort you will find in one of my previous postings here.
There is one thing which I don't fully understand.
I had to explicitly forbid striping of mod_caml.so otherwise it was not working,
but I see that other apache modules work without such a limitation, i.e.
there are striped. Any apache guru is hurtfully welcome to give her/his opinion on this matter.
Sincerely Yours Lukasz Dobrek
# $Revision: 1.11 $, $Date: 2004/10/22 12:03:03 $
%define mod_name mod_caml
%define apxs /usr/sbin/apxs
Summary: Apache mod_caml module - allows using bytcode compiled ocaml
files with apache
Summary(pl): Modu� Apache'a mod_ruby - zapewniaj�cy obs�ug� skompilowanego
do bytekodu ocamla
Name: apache-%{mod_name}
Version: 1.3.4
Release: 1
Group: Networking/Daemons
License: BSD-like
Source0:
http://savannah.nongnu.org/download/modcaml/%{mod_name}-%{version}.tar.gz
Patch0: %{mod_name}-Makefile.diff
URL: ttp://merjis.com/developers/mod_caml/
BuildRequires: apache-devel >= 1.3.3
BuildRequires: %{apxs}
BuildRequires: apr-devel
BuildRequires: ocaml
BuildRequires: ocaml-findlib
BuildRequires: ocaml-pcre-devel
BuildRequires: ocaml-postgres
Requires(post,preun): %{apxs}
Requires: apache >= 1.3.3
Requires: ocaml >= 3.0.8
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir %(%{apxs} -q SYSCONFDIR)
%define _pkglibdir %(%{apxs} -q LIBEXECDIR)
# I don't understand it but it is neccessary if one strips
# it, it won't work anymore.
%define _noautostrip .*\/mod_caml.so
%description
mod_caml is a set of Objective CAML (OCaml) bindings for the Apache API.
It allows you to run CGI scripts written in OCaml directly inside the Apache
webserver.
However, it is much much more than just that:
* Bind to any part of the Apache request cycle.
* Read and modify internal Apache structures.
* Share modules of code between handlers and scripts.
* CGI library and templating system (allows separation of code and
presentation).
* Works with Apache 1.3 and Apache 2.0 [see note below].
* DBI library for simple database access.
* DBI library can use Perl DBDs (database drivers) [requires Perl4Caml >=
0.3.6].
%prep
%setup -q -n %{mod_name}-%{version}
%patch0 -p1
%build
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
%{__make} DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ -f /var/lock/subsys/httpd ]; then
/etc/rc.d/init.d/httpd restart 1>&2
fi
%preun
if [ "$1" = "0" ]; then
if [ -f /var/lock/subsys/httpd ]; then
/etc/rc.d/init.d/httpd restart 1>&2
fi
fi
%files
%defattr(644,root,root,755)
%doc COPYING.LIB CHANGES README examples html icons modcaml-example.conf
%attr(640,root,root) %config(noreplace) %verify(not size mtime md5)
%{_sysconfdir}/httpd.conf/*.conf
%attr(755,root,root) %{_pkglibdir}/*.so
%{_libdir}/ocaml
%{_datadir}/%{mod_name}/
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
* %{date} PLD Team <[EMAIL PROTECTED]>
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log: apache-mod_ruby.spec,v $
diff -urN mod_caml-1.3.4-orig/Makefile mod_caml-1.3.4-corrected/Makefile --- mod_caml-1.3.4-orig/Makefile 2004-11-20 00:12:14.000000000 +0100 +++ mod_caml-1.3.4-corrected/Makefile 2004-12-05 21:23:54.445456776 +0100 @@ -25,16 +25,16 @@ SED := sed CC := $(CC) -CFLAGS := -I $(APACHEINCDIR) -DEAPI +CFLAGS := -I $(APACHEINCDIR) -I $(APRINCDIR) -I $(APRUTILINCDIR) -DEAPI -OCAMLCINCS := -I $(PCRELIBDIR) -I $(APACHEINCDIR) +OCAMLCINCS := -I $(PCRELIBDIR) -I $(APACHEINCDIR) ALL_CMOS := apache.cmo mod_caml_config.cmo mod_caml.cmo cgi_escape.cmo \ template.cmo cgi.cmo ALL_CMXS := cgi_escape.cmx template.cmx OCAMLCFLAGS := -g -w s $(OCAMLCINCS) OCAMLOPTFLAGS := -w s $(OCAMLCINCS) -OCAMLLIBS += -lcamlrun -ltermcap -lunix -lstr +OCAMLLIBS += -lcamlrun -lunix -lstr ALL_CMAS += dynlink.cma str.cma pcre.cma unix.cma OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCINCS) @@ -176,8 +176,9 @@ $(INSTALL) -m 0755 -d $(DESTDIR)$(APACHELIBDIR) $(INSTALL) -m 0755 -d $(DESTDIR)$(OCAMLAPACHEDIR) $(INSTALL) -m 0755 -d $(DESTDIR)$(MODCAMLLIBDIR) + $(INSTALL) -m 0755 -d $(DESTDIR)$(APACHECONFDIR) $(INSTALL) -c -m 0755 mod_caml.so $(DESTDIR)$(APACHELIBDIR) - $(INSTALL) -c -m 0644 500mod_caml.info $(DESTDIR)$(APACHELIBDIR) + $(INSTALL) -c -m 0644 500mod_caml.info $(DESTDIR)$(APACHECONFDIR)/500mod_caml.conf $(INSTALL) -c -m 0644 mod_caml_config.cmi $(DESTDIR)$(OCAMLAPACHEDIR) $(INSTALL) -c -m 0644 apache.mli apache.cmi $(DESTDIR)$(OCAMLAPACHEDIR) $(INSTALL) -c -m 0644 mod_caml.mli mod_caml.cmi \ @@ -232,9 +233,6 @@ install-doc: $(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR) $(INSTALL) -c -m 0644 AUTHORS FAQ README TODO $(DESTDIR)$(DOCDIR) - $(INSTALL) -c -m 0644 \ - examples/simple-scripts/*.ml \ - $(DESTDIR)$(DOCDIR) install-html: $(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR)/html @@ -242,7 +240,7 @@ install-conf: $(INSTALL) -m 0755 -d $(DESTDIR)$(APACHECONFDIR) - $(INSTALL) -c -m 0644 modcaml-example.conf $(DESTDIR)$(APACHECONFDIR) + $(INSTALL) -c -m 0644 modcaml-example.conf $(DESTDIR)$(DOCDIR)/ dist: $(MAKE) check-manifest diff -urN mod_caml-1.3.4-orig/Makefile.config mod_caml-1.3.4-corrected/Makefile.config --- mod_caml-1.3.4-orig/Makefile.config 2004-11-20 00:12:14.000000000 +0100 +++ mod_caml-1.3.4-corrected/Makefile.config 2004-12-05 21:26:59.182372496 +0100 @@ -25,8 +25,8 @@ # For Apache 1.3, set this to 1 # For Apache 2.x, set this to 2 -APACHE_MAJOR := 1 -#APACHE_MAJOR := 2 +#APACHE_MAJOR := 1 +APACHE_MAJOR := 2 # APXS # For Apache 1.3, you need to use apxs or /full/path/to/apxs if it's not on @@ -42,8 +42,8 @@ # APACHELIBDIR # This is where we're going to install mod_caml.so. -APACHELIBDIR := /usr/lib/apache/1.3 -#APACHELIBDIR := /usr/lib/apache2/modules +#APACHELIBDIR := /usr/lib/apache/1.3 +APACHELIBDIR := /usr/lib/apache #APACHELIBDIR := $(shell pwd) #APACHELIBDIR := /usr/local/apache/libexec #APACHELIBDIR := /usr/lib/mod_caml @@ -52,7 +52,9 @@ # APACHEINCDIR # Location of the Apache includes. -APACHEINCDIR := /usr/include/apache-1.3 +APACHEINCDIR := /usr/include/apache +APRINCDIR := /usr/include/apr +APRUTILINCDIR := /usr/include/apr-util # MODCAMLLIBDIR # This is where we're going to install the default mod_caml handlers @@ -64,7 +66,7 @@ # APACHECONFDIR # Apache configuration directory. -APACHECONFDIR := /etc/apache +APACHECONFDIR := /etc/httpd/httpd.conf/ # OCAMLC, OCAMLOPT, OCAMLDOC # The location of the OCaml compiler and tools. The defaults should be OK. @@ -106,7 +108,7 @@ # DOCDIR # This is where we will install the documentation. -DOCDIR = /usr/share/doc/$(PACKAGE)-$(VERSION) +DOCDIR = /usr/share/doc/apache-$(PACKAGE)-$(VERSION) # HAVE_POSTGRES # Tests whether you have (the OCaml module) Postgres installed. If so, then
_______________________________________________ pld-devel-en mailing list [EMAIL PROTECTED] http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
