]>
Commit | Line | Data |
---|---|---|
4188255a JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) | |
4 | ||
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 | |
8 | %endif | |
9 | ||
84be62dc | 10 | Summary: Zlib binding for OCaml |
5107d90d | 11 | Summary(pl.UTF-8): Wiązania Zlib dla OCamla |
84be62dc | 12 | Name: ocaml-zip |
4c61271a JR |
13 | Version: 1.07 |
14 | %define gitver rel107 | |
06ca6a6b | 15 | Release: 3 |
84be62dc MM |
16 | License: LGPL |
17 | Group: Libraries | |
84be62dc | 18 | URL: http://pauillac.inria.fr/~xleroy/software.html |
4c61271a JR |
19 | Source0: https://github.com/xavierleroy/camlzip/archive/%{gitver}/camlzip-%{version}.tar.gz |
20 | # Source0-md5: 8babccb584dfd4eb7b98901122e818a9 | |
4188255a | 21 | BuildRequires: ocaml >= 1:3.09.2 |
84be62dc | 22 | BuildRequires: zlib-devel |
84be62dc MM |
23 | %requires_eq ocaml-runtime |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %description | |
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 | |
30 | formats. | |
31 | ||
32 | This package contains files needed to run bytecode executables using | |
33 | this library. | |
34 | ||
ab389ca3 JR |
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. | |
84be62dc | 39 | |
ab389ca3 JR |
40 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów |
41 | używających tej biblioteki. | |
84be62dc MM |
42 | |
43 | %package devel | |
44 | Summary: Zlib binding for OCaml - development part | |
5107d90d | 45 | Summary(pl.UTF-8): Wiązania Zlib dla OCamla - cześć programistyczna |
84be62dc MM |
46 | Group: Development/Libraries |
47 | Requires: %{name} = %{version}-%{release} | |
48 | %requires_eq ocaml | |
49 | ||
50 | %description devel | |
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 | |
54 | formats. | |
55 | ||
56 | This package contains files needed to develop OCaml programs using | |
57 | this library. | |
58 | ||
ab389ca3 JR |
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. | |
84be62dc | 63 | |
ab389ca3 | 64 | Pakiet ten zawiera pliki niezbędne do tworzenia programów używających |
84be62dc MM |
65 | tej biblioteki. |
66 | ||
67 | %prep | |
4c61271a | 68 | %setup -q -n camlzip-%{gitver} |
84be62dc MM |
69 | |
70 | %build | |
71 | %{__cc} %{rpmcflags} -fPIC -c zlibstubs.c | |
4188255a JR |
72 | %{__make} all %{?with_ocaml_opt:allopt} \ |
73 | OCAMLC=ocamlc | |
84be62dc MM |
74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
86ffef8e | 77 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs |
84be62dc | 78 | |
4188255a | 79 | %{__make} install %{?with_ocaml_opt:installopt} \ |
84be62dc MM |
80 | INSTALLDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml/zip \ |
81 | OCAMLC="echo $RPM_BUILD_ROOT; true" | |
82 | ||
58067d61 JR |
83 | install zlib.cm[ixa]* $RPM_BUILD_ROOT%{_libdir}/ocaml/zip |
84 | ||
86ffef8e | 85 | mv $RPM_BUILD_ROOT%{_libdir}/ocaml/zip/dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs |
84be62dc MM |
86 | |
87 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
88 | cp -r test/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
89 | ||
06ca6a6b | 90 | cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/zip/META <<EOF |
84be62dc MM |
91 | requires = "" |
92 | version = "%{version}" | |
93 | directory = "+zip" | |
94 | archive(byte) = "zip.cma" | |
95 | archive(native) = "zip.cmxa" | |
96 | linkopts = "" | |
97 | EOF | |
98 | ||
84be62dc MM |
99 | %clean |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %files | |
103 | %defattr(644,root,root,755) | |
86ffef8e | 104 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so |
7491c191 JR |
105 | %if %{with ocaml_opt} |
106 | %{_libdir}/ocaml/zip/*.cmxs | |
107 | %endif | |
84be62dc MM |
108 | |
109 | %files devel | |
110 | %defattr(644,root,root,755) | |
2c08ab94 | 111 | %doc README *.mli |
86ffef8e | 112 | %dir %{_libdir}/ocaml/zip |
06ca6a6b | 113 | %{_libdir}/ocaml/zip/META |
4188255a JR |
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 | |
121 | %endif | |
84be62dc | 122 | %{_examplesdir}/%{name}-%{version} |