Group :: Desenvolvimento/ML
RPM: pcre-ocaml
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
%define ocamlver 3.08.1-alt1
Name: pcre-ocaml
Version: 5.09.0
Release: alt1
Summary: PCRE bindings for OCaml
License: LGPL
Group: Development/ML
Url: http://www.ai.univie.ac.at/~markus/ocaml_sources
Packager: Vitaly Lugovsky <vsl at altlinux.ru>
Source: pcre-ocaml-%version.tar.bz2
Requires: ocaml = %ocamlver, findlib >= 1.0.4
Requires: pcre-ocaml-runtime = %version-%release
%set_verify_elf_method textrel=relaxed,rpath=relaxed
BuildRequires: ocaml = %ocamlver, ocamlfind-mini >= 1.0.4, libpcre-devel
%package runtime
Summary: Runtime part of the PCRE bindings for OCaml
Group: Development/ML
Requires: ocaml-runtime = %ocamlver
%description
Perl Compatible Regular Expressions for Objective Caml.
%description runtime
Runtime part of the Perl Compatible Regular Expressions for Objective Caml.
%prep
%setup -q
%build
rm -f Makefile.conf
cat <<EOF >Makefile.conf
export INCDIRS := /usr/include/pcre
EOF
make all
pushd lib
#ocamlopt -nolinkstd -ccopt -L. -shared -o pcre.so stdlib.so.cmxa pcre.cmxa -linkall
rm -f META
cat <<EOF >META
name="pcre"
version="%version"
description="Perl Compatibility Regular Expressions"
requires=""
archive(byte)="pcre.cma"
archive(native)="pcre.cmxa"
EOF
popd #lib
%install
%define _compress_method skip
mkdir -p $RPM_BUILD_ROOT/usr/lib/ocaml/site-lib/pcre/
mkdir -p $RPM_BUILD_ROOT/usr/lib/ocaml/stublibs/
pushd lib
cp -p META *.cmi *.mli *.cma *.a *.cmxa *.so $RPM_BUILD_ROOT/usr/lib/ocaml/site-lib/pcre/
popd
#(cd $RPM_BUILD_ROOT/usr/lib/ocaml/stublibs; ln -s \
#/usr/lib/ocaml/site-lib/pcre/pcre.so ./; ln -s \
#/usr/lib/ocaml/site-lib/pcre/dllpcre_stubs.so ./)
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/site-lib ! -type d ! -name '*.so' -printf "/%%p\n") > files
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/stublibs ! -type d ! -name '*.so' -printf "/%%p\n") > runfiles
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/site-lib -name '*.so' -printf "/%%p\n") >> runfiles
%files -f files
%doc README INSTALL Changes LICENSE
%files -n pcre-ocaml-runtime -f runfiles
%dir %_libdir/ocaml/site-lib/pcre
%changelog
…
Todas as alterações você pod ver aqui
Name: pcre-ocaml
Version: 5.09.0
Release: alt1
Summary: PCRE bindings for OCaml
License: LGPL
Group: Development/ML
Url: http://www.ai.univie.ac.at/~markus/ocaml_sources
Packager: Vitaly Lugovsky <vsl at altlinux.ru>
Source: pcre-ocaml-%version.tar.bz2
Requires: ocaml = %ocamlver, findlib >= 1.0.4
Requires: pcre-ocaml-runtime = %version-%release
%set_verify_elf_method textrel=relaxed,rpath=relaxed
BuildRequires: ocaml = %ocamlver, ocamlfind-mini >= 1.0.4, libpcre-devel
%package runtime
Summary: Runtime part of the PCRE bindings for OCaml
Group: Development/ML
Requires: ocaml-runtime = %ocamlver
%description
Perl Compatible Regular Expressions for Objective Caml.
%description runtime
Runtime part of the Perl Compatible Regular Expressions for Objective Caml.
%prep
%setup -q
%build
rm -f Makefile.conf
cat <<EOF >Makefile.conf
export INCDIRS := /usr/include/pcre
EOF
make all
pushd lib
#ocamlopt -nolinkstd -ccopt -L. -shared -o pcre.so stdlib.so.cmxa pcre.cmxa -linkall
rm -f META
cat <<EOF >META
name="pcre"
version="%version"
description="Perl Compatibility Regular Expressions"
requires=""
archive(byte)="pcre.cma"
archive(native)="pcre.cmxa"
EOF
popd #lib
%install
%define _compress_method skip
mkdir -p $RPM_BUILD_ROOT/usr/lib/ocaml/site-lib/pcre/
mkdir -p $RPM_BUILD_ROOT/usr/lib/ocaml/stublibs/
pushd lib
cp -p META *.cmi *.mli *.cma *.a *.cmxa *.so $RPM_BUILD_ROOT/usr/lib/ocaml/site-lib/pcre/
popd
#(cd $RPM_BUILD_ROOT/usr/lib/ocaml/stublibs; ln -s \
#/usr/lib/ocaml/site-lib/pcre/pcre.so ./; ln -s \
#/usr/lib/ocaml/site-lib/pcre/dllpcre_stubs.so ./)
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/site-lib ! -type d ! -name '*.so' -printf "/%%p\n") > files
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/stublibs ! -type d ! -name '*.so' -printf "/%%p\n") > runfiles
(cd $RPM_BUILD_ROOT && find usr/lib/ocaml/site-lib -name '*.so' -printf "/%%p\n") >> runfiles
%files -f files
%doc README INSTALL Changes LICENSE
%files -n pcre-ocaml-runtime -f runfiles
%dir %_libdir/ocaml/site-lib/pcre
%changelog
…
Todas as alterações você pod ver aqui