templates: updates for python and ocaml-libs

This commit is contained in:
Silvan Calarco 2022-05-23 13:18:31 +02:00
parent d7ecd3c845
commit 8bb5867637
2 changed files with 21 additions and 51 deletions

View File

@ -1,4 +1,3 @@
## this macro only works for packages with name matching the regexp "ocaml-.*"
%define ocamlpck @pck_name_tail@ %define ocamlpck @pck_name_tail@
Name: @pck_name@ Name: @pck_name@
@ -15,18 +14,14 @@ License: ...
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements. ## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements.
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: dune
BuildRequires: ocaml BuildRequires: ocaml
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-findlib BuildRequires: ocaml-findlib
## remove the following build requirement if this package is compiled
## by using the OCaml native-code compiler (ocamlopt)
Requires: ocaml-runtime
%description %description
... %{summary}.
@if:pck_devel @if:pck_devel
## remove the following two blocks if there's no devel files
%package devel %package devel
Group: Development/Libraries/OCaml Group: Development/Libraries/OCaml
Summary: Development files for %{name} Summary: Development files for %{name}
@ -36,64 +31,42 @@ Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
This package contains libraries and signature files for developing applications that use %{name}. This package contains libraries and signature files for developing applications that use %{name}.
@fi:pck_devel @fi:pck_devel
%debug_package
%prep %prep
%setup -q %setup -q
%build %build
## remove the unsupported options (no real standard exists...) dune build
./configure \\
\ --prefix %{_prefix} \\
\ --localstatedir %{_localstatedir} \\
\ --sharedstatedir %{_sharedstatedir} \\
\ --sysconfdir %{_sysconfdir} \\
\ --enable-tests \\
\ --enable-docs \\
\ --enable-examples \\
\ --disable-ldconf
## extra arguments that sometimes can be passed to './configure'
## -host %{_host}
## -cc "gcc ${RPM_OPT_FLAGS/-fomit-frame-pointer/}"
## --destdir %{buildroot}
%make all
%make opt
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
export OCAMLFIND_DESTDIR=%{buildroot}$(ocamlfind printconf destdir) DESTDIR=%{buildroot} dune install --prefix "/usr" --libdir "%{_lib}/ocaml"
export DLLDIR=$OCAMLFIND_DESTDIR/stublibs
install -d $OCAMLFIND_DESTDIR/%{ocamlpck} rm -rf %{buildroot}/usr/doc
install -d $OCAMLFIND_DESTDIR/stublibs
make install
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files %files
%defattr(-,root,root) %defattr(-,root,root)
## note: this list is just an example; modify as required %dir %{_libdir}/ocaml/%{ocamlpck}
# %dir %{_libdir}/ocaml/%{ocamlpck} %{_libdir}/ocaml/%{ocamlpck}/*
# %{_libdir}/ocaml/%{ocamlpck}/META %exclude %{_libdir}/ocaml/%{ocamlpck}/*.a
# %{_libdir}/ocaml/%{ocamlpck}/*.cma %exclude %{_libdir}/ocaml/%{ocamlpck}/*.cmx
# %{_libdir}/ocaml/%{ocamlpck}/*.cmi %exclude %{_libdir}/ocaml/%{ocamlpck}/*.cmxa
# %{_libdir}/ocaml/%{ocamlpck}/*.cmxs %exclude %{_libdir}/ocaml/%{ocamlpck}/*.mli
# %{_libdir}/ocaml/stublibs/*.so* %{_libdir}/ocaml/stublibs/*.so*
# %doc COPYING %doc LICENSE*
@if:pck_devel @if:pck_devel
## remove this block if there are no devel files
## note: this list is just an example; modify as required
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
# %{_libdir}/ocaml/%{ocamlpck}/*.a %{_libdir}/ocaml/%{ocamlpck}/*.a
# %{_libdir}/ocaml/%{ocamlpck}/*.cmx %{_libdir}/ocaml/%{ocamlpck}/*.cmx
# %{_libdir}/ocaml/%{ocamlpck}/*.cmxa %{_libdir}/ocaml/%{ocamlpck}/*.cmxa
# %{_libdir}/ocaml/%{ocamlpck}/*.mli %{_libdir}/ocaml/%{ocamlpck}/*.mli
# %doc CHANGES README %doc CHANGES* README.md
# %doc doc/html/
# %doc examples/
@fi:pck_devel @fi:pck_devel
%changelog %changelog

View File

@ -1,4 +1,4 @@
%define pkgname %(echo %name | cut -d- -f2-) %define pkgname %(echo %name | cut -d- -f2- | tr - _)
Name: @pck_name@ Name: @pck_name@
Version: @pck_version@ Version: @pck_version@
Release: @spec_first_release@@DISTRO_rpm@ Release: @spec_first_release@@DISTRO_rpm@
@ -40,12 +40,9 @@ sed -i "\\,\\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
%files %{?pyappend} -f %{name}.filelist %files %{?pyappend} -f %{name}.filelist
%defattr(-,root,root) %defattr(-,root,root)
## note: this list is just an example; modify as required
%dir %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info %dir %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info
%{python_sitearch}/%{pkgname}-%{version}-py*.egg-info/* %{python_sitearch}/%{pkgname}-%{version}-py*.egg-info/*
@standard_docs@ @standard_docs@
## note: add extra documentation (if any)
# @standard_docs_devel@
%changelog %changelog
* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ * @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@