File ocaml-gettext.spec of Package ocaml-gettext.1126

# spec file for package ocaml-gettext
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%global __ocaml_requires_opts -i Asttypes -i Parsetree
%global __ocaml_provides_opts -i Pr_gettext

Name:           ocaml-gettext
Version:        0.3.5
Release:        0
Summary:        OCaml library for i18n
License:        SUSE-LGPL-2.0-with-linking-exception
Group:          Development/Libraries/Other
ExcludeArch:    s390x
Patch1:         ocaml-gettext-0.3.5-use-ocamlopt-g.patch
BuildRequires:  autoconf
BuildRequires:  chrpath
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libxml2
BuildRequires:  libxslt
BuildRequires:  ocaml >= 4.00.1
BuildRequires:  ocaml-rpm-macros >= 4.02.1
BuildRequires:  ocaml-camlp4-devel
BuildRequires:  ocaml-fileutils-devel >= 0.4.4-4
BuildRequires:  ocaml-findlib-devel >= 1.3.3-3
BuildRequires:  ocaml-ocamldoc
BuildRequires:  ocaml-camomile-data
BuildRequires:  ocaml-camomile-devel >= 0.8.1
BuildRequires:  ocaml-ounit-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# ocaml-gettext program needs camomile data files
Requires:       ocaml-camomile-data

Ocaml-gettext provides support for internationalization of Ocaml

Constraints :

* provides a pure Ocaml implementation,
* the API should be as close as possible to GNU gettext,
* provides a way to automatically extract translatable
  strings from Ocaml source code.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}-%{release}
# BZ 446919.
Requires:       ocaml-fileutils-devel >= 0.4.0

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%package        camomile
Summary:        Parts of %{name} which depend on Camomile
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}-%{release}

%description    camomile
The %{name}-camomile package contains the parts of %{name} which
depend on Camomile.

%package        camomile-devel
Summary:        Development files for %{name}-camomile
Group:          Development/Libraries/Other
Requires:       %{name}-devel = %{version}-%{release}

%description    camomile-devel
The %{name}-camomile-devel package contains libraries and
signature files for developing applications that use

%setup -q
%patch1 -p1

%define _stylesheet_path "%{_datadir}/xml/docbook/stylesheet/nwalsh/current"

# Parallel builds don't work.
CFLAGS="%{optflags}" \
./configure \
  --libdir=%{_libdir} \
  --enable-test \
make all

pushd test

# make install in the package is screwed up completely.  Install
# by hand instead.
export DESTDIR=%{buildroot}
export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml
mkdir -p %{buildroot}%{_bindir}

# Remove *.o files - these shouldn't be distributed.
find _build -name '*.o' -exec rm {} \;

ocamlfind install gettext _build/lib/gettext/*
ocamlfind install gettext-stub _build/lib/gettext-stub/*
ocamlfind install gettext-camomile _build/lib/gettext-camomile/*
install -m 0755 _build/bin/ocaml-gettext %{buildroot}%{_bindir}/
install -m 0755 _build/bin/ocaml-xgettext %{buildroot}%{_bindir}/

chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so

%if %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/gettext/*.a
%exclude %{_libdir}/ocaml/gettext/*.cmxa
%exclude %{_libdir}/ocaml/gettext/*.cmx
%exclude %{_libdir}/ocaml/gettext-stub/*.a
%exclude %{_libdir}/ocaml/gettext-stub/*.cmxa
%exclude %{_libdir}/ocaml/gettext-stub/*.cmx
%exclude %{_libdir}/ocaml/gettext/*.ml
%exclude %{_libdir}/ocaml/gettext/*.mli
%exclude %{_libdir}/ocaml/gettext-stub/*.ml

%files devel
# %doc build/share/doc/html/*
%if %{ocaml_native_compiler}

%files camomile
%if %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/gettext-camomile/*.a
%exclude %{_libdir}/ocaml/gettext-camomile/*.cmxa
%exclude %{_libdir}/ocaml/gettext-camomile/*.cmx
%exclude %{_libdir}/ocaml/gettext-camomile/*.mli

%files camomile-devel
%if %{ocaml_native_compiler}

openSUSE Build Service is sponsored by