https://bugzilla.redhat.com/show_bug.cgi?id=1961309
--- Comment #4 from Robert-André Mauchin 🐧 <zebob.m(a)gmail.com> ---
(In reply to Susi Lehtola from comment #2)
Yes, I know that the newest Fedoras have dedicated cmake macros.
However,
they are not available on older distros and EPEL. There is nothing wrong in
using %make_build and %make_install; the spec also correctly uses an
out-of-root build directory.
The new macros works even on EPEL7, you just have to use
%undefine __cmake3_in_source_build
to force out-of-tree builds.
And if you target EPEL7, you should use cmake3 instead of cmake:
BuildRequires: cmake3
[…]
%build
%cmake3 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIB=%{_lib}
-DXCFUN_PYTHON_INTERFACE=ON -DPYMOD_INSTALL_LIBDIR=../../%{python3_sitearch}
%cmake3_build
%install
%cmake3_install
(it's compatible in Fedora)
I've added the missing BRs; the package now builds in mock. I
have fixed the
installed tests' permissions.
Ok
> In any case the python bytecode for tests must not be shipped
Please point me to the section of
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ that
states that Python bytecode must not be shipped.
I don't know about the guidelines but that's what we do in the macros:
rpm --eval %pytest
\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}"
LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\
PATH="/home/bob/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/bin:$PATH"\
PYTHONPATH="${PYTHONPATH:-/home/bob/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib64/python3.9/site-packages:/home/bob/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib/python3.9/site-packages}"\
PYTHONDONTWRITEBYTECODE=1\
/usr/bin/pytest
I won't block your package for any of this, but please consider it first.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component