- (RHEL only) Disable camomile, ocaml-ounit, tests.

- Modernize the spec file.
This commit is contained in:
Richard W.M. Jones 2012-09-25 15:27:56 +01:00
parent 4efc0a13a4
commit fe507498f3

View File

@ -1,39 +1,41 @@
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil} %global debug_package %{nil}
Name: ocaml-gettext Name: ocaml-gettext
Version: 0.3.4 Version: 0.3.4
Release: 5%{?dist} Release: 6%{?dist}
Summary: OCaml library for i18n Summary: OCaml library for i18n
Group: Development/Libraries Group: Development/Libraries
License: LGPLv2+ with exceptions License: LGPLv2+ with exceptions
URL: http://forge.ocamlcore.org/projects/ocaml-gettext URL: http://forge.ocamlcore.org/projects/ocaml-gettext
Source0: http://forge.ocamlcore.org/frs/download.php/676/ocaml-gettext-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExcludeArch: sparc64 s390 s390x ExcludeArch: sparc64 s390 s390x
Source0: http://forge.ocamlcore.org/frs/download.php/676/ocaml-gettext-%{version}.tar.gz
BuildRequires: ocaml >= 3.12.0-3 BuildRequires: ocaml >= 3.12.0-3
BuildRequires: ocaml-findlib-devel >= 1.2.1-3 BuildRequires: ocaml-findlib-devel >= 1.2.1-3
BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-ocamldoc
BuildRequires: ocaml-camlp4-devel BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-fileutils-devel >= 0.4.0 BuildRequires: ocaml-fileutils-devel >= 0.4.0
BuildRequires: ocaml-ounit-devel
BuildRequires: docbook-style-xsl BuildRequires: docbook-style-xsl
BuildRequires: libxslt BuildRequires: libxslt
BuildRequires: libxml2 BuildRequires: libxml2
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: autoconf BuildRequires: autoconf
%if !0%{?rhel}
BuildRequires: ocaml-ounit-devel
BuildRequires: ocaml-camomile-devel >= 0.8.1 BuildRequires: ocaml-camomile-devel >= 0.8.1
BuildRequires: ocaml-camomile-data BuildRequires: ocaml-camomile-data
%endif
%if !0%{?rhel}
# ocaml-gettext program needs camomile data files # ocaml-gettext program needs camomile data files
Requires: ocaml-camomile-data Requires: ocaml-camomile-data
%endif
%define _use_internal_dependency_generator 0 %global __ocaml_requires_opts -i Asttypes -i Parsetree
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh -i Asttypes -i Parsetree %global __ocaml_provides_opts -i Pr_gettext
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh -i Pr_gettext
%description %description
@ -62,6 +64,7 @@ The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}. developing applications that use %{name}.
%if !0%{?rhel}
%package camomile %package camomile
Summary: Parts of %{name} which depend on Camomile Summary: Parts of %{name} which depend on Camomile
Group: Development/Libraries Group: Development/Libraries
@ -83,6 +86,7 @@ Requires: %{name}-devel = %{version}-%{release}
The %{name}-camomile-devel package contains libraries and The %{name}-camomile-devel package contains libraries and
signature files for developing applications that use signature files for developing applications that use
%{name}-camomile. %{name}-camomile.
%endif
%prep %prep
@ -93,19 +97,24 @@ signature files for developing applications that use
CFLAGS="$RPM_OPT_FLAGS" \ CFLAGS="$RPM_OPT_FLAGS" \
./configure \ ./configure \
--libdir=%{_libdir} \ --libdir=%{_libdir} \
%if 0%{?rhel}
--disable-camomile \
%else
--enable-test \ --enable-test \
%endif
--with-docbook-stylesheet=/usr/share/sgml/docbook/xsl-stylesheets --with-docbook-stylesheet=/usr/share/sgml/docbook/xsl-stylesheets
make all make all
%check %check
%if !0%{?rhel}
pushd test pushd test
../_build/bin/test ../_build/bin/test
popd popd
%endif
%install %install
rm -rf $RPM_BUILD_ROOT
# make install in the package is screwed up completely. Install # make install in the package is screwed up completely. Install
# by hand instead. # by hand instead.
export DESTDIR=$RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT
@ -118,7 +127,9 @@ find _build -name '*.o' -exec rm {} \;
ocamlfind install gettext _build/lib/gettext/* ocamlfind install gettext _build/lib/gettext/*
ocamlfind install gettext-stub _build/lib/gettext-stub/* ocamlfind install gettext-stub _build/lib/gettext-stub/*
%if !0%{?rhel}
ocamlfind install gettext-camomile _build/lib/gettext-camomile/* ocamlfind install gettext-camomile _build/lib/gettext-camomile/*
%endif
install -m 0755 _build/bin/ocaml-gettext $RPM_BUILD_ROOT%{_bindir}/ install -m 0755 _build/bin/ocaml-gettext $RPM_BUILD_ROOT%{_bindir}/
install -m 0755 _build/bin/ocaml-xgettext $RPM_BUILD_ROOT%{_bindir}/ install -m 0755 _build/bin/ocaml-xgettext $RPM_BUILD_ROOT%{_bindir}/
@ -127,12 +138,7 @@ chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so
strip $RPM_BUILD_ROOT%{_bindir}/ocaml-gettext strip $RPM_BUILD_ROOT%{_bindir}/ocaml-gettext
%clean
rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-)
%doc COPYING %doc COPYING
%{_libdir}/ocaml/gettext %{_libdir}/ocaml/gettext
%{_libdir}/ocaml/gettext-stub %{_libdir}/ocaml/gettext-stub
@ -152,7 +158,6 @@ rm -rf $RPM_BUILD_ROOT
%files devel %files devel
%defattr(-,root,root,-)
%doc README CHANGELOG TODO %doc README CHANGELOG TODO
# %doc build/share/doc/html/* # %doc build/share/doc/html/*
%if %opt %if %opt
@ -170,8 +175,8 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/ocaml-xgettext %{_bindir}/ocaml-xgettext
%if !0%{?rhel}
%files camomile %files camomile
%defattr(-,root,root,-)
%doc COPYING %doc COPYING
%{_libdir}/ocaml/gettext-camomile %{_libdir}/ocaml/gettext-camomile
%if %opt %if %opt
@ -183,7 +188,6 @@ rm -rf $RPM_BUILD_ROOT
%files camomile-devel %files camomile-devel
%defattr(-,root,root,-)
%doc README %doc README
%if %opt %if %opt
%{_libdir}/ocaml/gettext-camomile/*.a %{_libdir}/ocaml/gettext-camomile/*.a
@ -191,9 +195,14 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/ocaml/gettext-camomile/*.cmx %{_libdir}/ocaml/gettext-camomile/*.cmx
%endif %endif
%{_libdir}/ocaml/gettext-camomile/*.mli %{_libdir}/ocaml/gettext-camomile/*.mli
%endif
%changelog %changelog
* Tue Sep 25 2012 Richard W.M. Jones <rjones@redhat.com> - 0.3.4-6
- (RHEL only) Disable camomile, ocaml-ounit, tests.
- Modernize the spec file.
* Sat Jul 28 2012 Richard W.M. Jones <rjones@redhat.com> - 0.3.4-5 * Sat Jul 28 2012 Richard W.M. Jones <rjones@redhat.com> - 0.3.4-5
- Bump and rebuild against new OCaml 4.00.0 official release. - Bump and rebuild against new OCaml 4.00.0 official release.