forked from pool/ocaml-rpm-macros
Accepting request 884983 from Archiving:unison:buildrequires
- Use bcond rpm_license_macro for license macro in filelist - Add suse prefix to ocaml_native_compiler to avoid conflict OBS-URL: https://build.opensuse.org/request/show/884983 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-rpm-macros?expand=0&rev=56
This commit is contained in:
parent
4c949ea7cb
commit
b137df16ce
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 9 09:09:09 UTC 2021 - ohering@suse.de
|
||||||
|
|
||||||
|
- Use bcond rpm_license_macro for license macro in filelist
|
||||||
|
- Add suse prefix to ocaml_native_compiler to avoid conflict
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Feb 9 09:09:09 UTC 2021 - ohering@suse.de
|
Tue Feb 9 09:09:09 UTC 2021 - ohering@suse.de
|
||||||
|
|
||||||
|
@ -17,15 +17,23 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: ocaml-rpm-macros
|
Name: ocaml-rpm-macros
|
||||||
Version: 20210209
|
Version: 20210409
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: RPM macros for building OCaml source packages
|
Summary: RPM macros for building OCaml source packages
|
||||||
License: GPL-2.0-only
|
License: GPL-2.0-only
|
||||||
Group: Development/Languages/OCaml
|
Group: Development/Languages/OCaml
|
||||||
|
BuildRoot: %_tmppath/%name-%version-build
|
||||||
URL: https://build.opensuse.org/project/show/devel:languages:ocaml
|
URL: https://build.opensuse.org/project/show/devel:languages:ocaml
|
||||||
Source0: ocaml-ocaml.rpm.prov_req.attr.sh
|
Source0: ocaml-ocaml.rpm.prov_req.attr.sh
|
||||||
Source1: ocaml-findlib.rpm.prov_req.attr.sh
|
Source1: ocaml-findlib.rpm.prov_req.attr.sh
|
||||||
|
|
||||||
|
# Some rpm variants know about license, but can only use them in plain file context
|
||||||
|
%bcond_without suse_ocaml_use_rpm_license_macro
|
||||||
|
# Some rpm variants are unable to create proper debuginfo and/or debugsource packages
|
||||||
|
%bcond_without suse_ocaml_opt_debug_package
|
||||||
|
# Some rpm variants fail to build even this innocent package...
|
||||||
|
%define debug_package %{nil}
|
||||||
|
|
||||||
%define ocaml_standard_library %{_libdir}/ocaml
|
%define ocaml_standard_library %{_libdir}/ocaml
|
||||||
%define do_opt 0
|
%define do_opt 0
|
||||||
# macros to be set in prjconf:
|
# macros to be set in prjconf:
|
||||||
@ -63,30 +71,45 @@ in ocaml spec files.
|
|||||||
%build
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
# map ocamlobjinfo output to rpm Provides/Requires
|
> files.fileattrs
|
||||||
# this tag name MUST match what ocaml.spec uses internally
|
if test -d '%{_rpmconfigdir}/fileattrs'
|
||||||
tag="suseocaml"
|
then
|
||||||
mkdir -vp %{buildroot}%{_rpmconfigdir}/fileattrs
|
# Generating dependencies can currently only be done by rpm versions
|
||||||
tee %{buildroot}%{_rpmconfigdir}/fileattrs/${tag}.attr <<_EOF_
|
# which support "fileattrs", because it is easy to add new hooks.
|
||||||
%%__${tag}_provides %%{_rpmconfigdir}/${tag}.sh --provides
|
mkdir -vp %{buildroot}%{_rpmconfigdir}/fileattrs
|
||||||
%%__${tag}_requires %%{_rpmconfigdir}/${tag}.sh --requires
|
|
||||||
|
# Map ocamlobjinfo output to rpm Provides/Requires
|
||||||
|
# This tag name MUST match what ocaml.spec uses internally
|
||||||
|
tag="suseocaml"
|
||||||
|
file_attr="%{_rpmconfigdir}/fileattrs/${tag}.attr"
|
||||||
|
file_sh="%{_rpmconfigdir}/${tag}.sh"
|
||||||
|
attr_sh="%%{_rpmconfigdir}/${tag}.sh"
|
||||||
|
tee %{buildroot}${file_sh} < %{SOURCE0}
|
||||||
|
tee %{buildroot}${file_attr} <<_EOF_
|
||||||
|
%%__${tag}_provides ${attr_sh} --provides
|
||||||
|
%%__${tag}_requires ${attr_sh} --requires
|
||||||
%%__${tag}_magic ^(ELF|Objective caml|OCaml) .*$
|
%%__${tag}_magic ^(ELF|Objective caml|OCaml) .*$
|
||||||
%%__${tag}_path .(cma|cmi|cmo|cmx|cmxa|cmxs)$
|
%%__${tag}_path .(cma|cmi|cmo|cmx|cmxa|cmxs)$
|
||||||
%%__${tag}_flags magic_and_path
|
%%__${tag}_flags magic_and_path
|
||||||
_EOF_
|
_EOF_
|
||||||
#
|
echo "${file_attr}" >> files.fileattrs
|
||||||
tee %{buildroot}%{_rpmconfigdir}/${tag}.sh < %{SOURCE0}
|
echo "%%attr(755,root,root) ${file_sh}" >> files.fileattrs
|
||||||
|
|
||||||
# map findlib names to rpm Provides/Requires
|
# Map findlib names to rpm Provides/Requires
|
||||||
tag="suseocamlfind"
|
tag="suseocamlfind"
|
||||||
mkdir -vp %{buildroot}%{_rpmconfigdir}/fileattrs
|
file_attr="%{_rpmconfigdir}/fileattrs/${tag}.attr"
|
||||||
tee %{buildroot}%{_rpmconfigdir}/fileattrs/${tag}.attr <<_EOF_
|
file_sh="%{_rpmconfigdir}/${tag}.sh"
|
||||||
%%__${tag}_provides %%{_rpmconfigdir}/${tag}.sh -prov
|
attr_sh="%%{_rpmconfigdir}/${tag}.sh"
|
||||||
%%__${tag}_requires %%{_rpmconfigdir}/${tag}.sh -req
|
tee %{buildroot}${file_sh} < %{SOURCE1}
|
||||||
|
tee %{buildroot}${file_attr} <<_EOF_
|
||||||
|
%%__${tag}_provides ${attr_sh} -prov
|
||||||
|
%%__${tag}_requires ${attr_sh} -req
|
||||||
%%__${tag}_path ^%{ocaml_standard_library}/.*/META$|^%{ocaml_standard_library}/META$
|
%%__${tag}_path ^%{ocaml_standard_library}/.*/META$|^%{ocaml_standard_library}/META$
|
||||||
_EOF_
|
_EOF_
|
||||||
|
echo "${file_attr}" >> files.fileattrs
|
||||||
|
echo "%%attr(755,root,root) ${file_sh}" >> files.fileattrs
|
||||||
|
fi
|
||||||
#
|
#
|
||||||
tee %{buildroot}%{_rpmconfigdir}/${tag}.sh < %{SOURCE1}
|
|
||||||
|
|
||||||
# install OCaml macros
|
# install OCaml macros
|
||||||
mkdir -vp %{buildroot}%{_rpmmacrodir}
|
mkdir -vp %{buildroot}%{_rpmmacrodir}
|
||||||
@ -108,11 +131,17 @@ tee %{buildroot}%{_rpmmacrodir}/macros.%{name} <<'_EOF_'
|
|||||||
# the .dwz files contains identical contents, which leads to identical
|
# the .dwz files contains identical contents, which leads to identical
|
||||||
# checksums, which leads to file conflicts due to identical symlinks
|
# checksums, which leads to file conflicts due to identical symlinks
|
||||||
%%ocaml_standard_library %{ocaml_standard_library}
|
%%ocaml_standard_library %{ocaml_standard_library}
|
||||||
|
%if %{without suse_ocaml_opt_debug_package}
|
||||||
|
# Obviously, handling presence or absence of debug information works only when being built in a SUSE system.
|
||||||
|
%endif
|
||||||
%if %{do_opt}
|
%if %{do_opt}
|
||||||
%%ocaml_preserve_bytecode \
|
%%ocaml_preserve_bytecode \
|
||||||
|
%if %{without suse_ocaml_opt_debug_package}
|
||||||
|
%%define debug_package %%{nil} \
|
||||||
|
%endif
|
||||||
%%define _lto_cflags %%{nil} \
|
%%define _lto_cflags %%{nil} \
|
||||||
%%{nil}
|
%%{nil}
|
||||||
%%ocaml_native_compiler 1
|
%%suse_ocaml_native_compiler 1
|
||||||
%%_find_debuginfo_dwz_opts %%{nil}
|
%%_find_debuginfo_dwz_opts %%{nil}
|
||||||
%else
|
%else
|
||||||
%%ocaml_preserve_bytecode \
|
%%ocaml_preserve_bytecode \
|
||||||
@ -120,9 +149,10 @@ tee %{buildroot}%{_rpmmacrodir}/macros.%{name} <<'_EOF_'
|
|||||||
%%define __arch_install_post export NO_BRP_STRIP_DEBUG=true \
|
%%define __arch_install_post export NO_BRP_STRIP_DEBUG=true \
|
||||||
%%define _lto_cflags %%{nil} \
|
%%define _lto_cflags %%{nil} \
|
||||||
%%{nil}
|
%%{nil}
|
||||||
%%ocaml_native_compiler 0
|
%%suse_ocaml_native_compiler 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
# Create file list for base pkg and base-devel pkg
|
# Create file list for base pkg and base-devel pkg
|
||||||
# Files with known extensions or names are written to 'files' or 'files.devel'
|
# Files with known extensions or names are written to 'files' or 'files.devel'
|
||||||
# Other unknown files are shown on stdout
|
# Other unknown files are shown on stdout
|
||||||
@ -157,14 +187,14 @@ tee %{buildroot}%{_rpmmacrodir}/macros.%{name} <<'_EOF_'
|
|||||||
LICENSE.txt \\\
|
LICENSE.txt \\\
|
||||||
;\
|
;\
|
||||||
do\
|
do\
|
||||||
%if 0%{?suse_version} > 1315
|
%if %{with suse_ocaml_use_rpm_license_macro}
|
||||||
license_macro='license' ;\
|
license_macro='license' ;\
|
||||||
%else
|
%else
|
||||||
license_macro='doc' ;\
|
license_macro='doc' ;\
|
||||||
%endif
|
%endif
|
||||||
test -f "${license}" && echo "%%%%${license_macro} ${license}" >> '%%{name}.files.license' ;\
|
test -f "${license}" && echo "%%%%${license_macro} ${license}" >> '%%{name}.files.license' ;\
|
||||||
done ;\
|
done ;\
|
||||||
find %%{buildroot}%%{ocaml_standard_library} -name '*.cmxs' -exec chmod -v a-x '{}' +\
|
find %%{buildroot}%%{ocaml_standard_library} -name '*.cmxs' -exec chmod -v a-x '{}' + ;\
|
||||||
find %%{buildroot}%%{ocaml_standard_library} ! -type d | awk\\\
|
find %%{buildroot}%%{ocaml_standard_library} ! -type d | awk\\\
|
||||||
-v "buildroot=%%{buildroot}"\\\
|
-v "buildroot=%%{buildroot}"\\\
|
||||||
-v "ocaml_standard_library=%%{ocaml_standard_library}"\\\
|
-v "ocaml_standard_library=%%{ocaml_standard_library}"\\\
|
||||||
@ -528,9 +558,8 @@ ocaml setup.ml -configure \\\
|
|||||||
#
|
#
|
||||||
_EOF_
|
_EOF_
|
||||||
|
|
||||||
%files
|
%files -f files.fileattrs
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%{_rpmmacrodir}/*
|
%{_rpmmacrodir}/*
|
||||||
%{_rpmconfigdir}/fileattrs
|
|
||||||
%attr(755,root,root) %{_rpmconfigdir}/*.sh
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user