3 %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
5 # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
6 %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
7 %undefine with_ocaml_opt
10 Summary: Zlib binding for OCaml
11 Summary(pl.UTF-8): Wiązania Zlib dla OCamla
18 URL: http://pauillac.inria.fr/~xleroy/software.html
19 Source0: https://github.com/xavierleroy/camlzip/archive/%{gitver}/camlzip-%{version}.tar.gz
20 # Source0-md5: 8babccb584dfd4eb7b98901122e818a9
21 BuildRequires: ocaml >= 1:3.09.2
22 BuildRequires: zlib-devel
23 %requires_eq ocaml-runtime
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 This Objective Caml library provides easy access to compressed files
28 in ZIP and GZIP format, as well as to Java JAR files. It provides
29 functions for reading from and writing to compressed files in these
32 This package contains files needed to run bytecode executables using
35 %description -l pl.UTF-8
36 Biblioteka ta pozwala na dostęp do plików w formacie ZIP i GZIP jak
37 również dla plików JAR Javy z poziomy OCamla. Udostępnia ona funkcje
38 do czytania i pisania do plików w tych formatach.
40 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
41 używających tej biblioteki.
44 Summary: Zlib binding for OCaml - development part
45 Summary(pl.UTF-8): Wiązania Zlib dla OCamla - cześć programistyczna
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
51 This Objective Caml library provides easy access to compressed files
52 in ZIP and GZIP format, as well as to Java JAR files. It provides
53 functions for reading from and writing to compressed files in these
56 This package contains files needed to develop OCaml programs using
59 %description devel -l pl.UTF-8
60 Biblioteka ta pozwala na dostęp do plików w formacie ZIP i GZIP jak
61 również dla plików JAR Javy z poziomy OCamla. Udostępnia ona funkcje
62 do czytania i pisania do plików w tych formatach.
64 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
68 %setup -q -n camlzip-%{gitver}
71 %{__cc} %{rpmcflags} -fPIC -c zlibstubs.c
72 %{__make} all %{?with_ocaml_opt:allopt} \
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
79 %{__make} install %{?with_ocaml_opt:installopt} \
80 INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/zip \
81 OCAMLC="echo $RPM_BUILD_ROOT; true"
83 install zlib.cm[ixa]* $RPM_BUILD_ROOT%{_libdir}/ocaml/zip
85 mv $RPM_BUILD_ROOT%{_libdir}/ocaml/zip/dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
87 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
88 cp -r test/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
90 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/zip
91 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/zip/META <<EOF
93 version = "%{version}"
95 archive(byte) = "zip.cma"
96 archive(native) = "zip.cmxa"
101 rm -rf $RPM_BUILD_ROOT
104 %defattr(644,root,root,755)
105 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
106 %if %{with ocaml_opt}
107 %{_libdir}/ocaml/zip/*.cmxs
111 %defattr(644,root,root,755)
113 %dir %{_libdir}/ocaml/zip
114 %{_libdir}/ocaml/zip/*.cma
115 %{_libdir}/ocaml/zip/*.cm[ix]
116 %{_libdir}/ocaml/zip/*.mli
117 %{_libdir}/ocaml/zip/libcamlzip.a
118 %if %{with ocaml_opt}
119 %{_libdir}/ocaml/zip/*.cmxa
120 %{_libdir}/ocaml/zip/zip.a
122 %{_examplesdir}/%{name}-%{version}
123 %{_libdir}/ocaml/site-lib/zip