Mailinglist Archive: opensuse-packaging (116 mails)

< Previous Next >
Re: [opensuse-packaging] No %if inside %with?
On dimanche, 10 décembre 2017 17.58:43 h CET Sebastian wrote:
Hi,

For the package python-termstyle[0] I want to deactivate the tests
because of problems with the default encoding which I can't solve. The
requirement of the project maintainers is to not comment them out but
change the `%bcond_without tests` to `%bcond_with tests`. But now I have
a problem inside %check, which looks like this:

%if %{with tests}
%check
export LANG=C.UTF-8
%ifpython2
python2 setup.py test -s test2
%endif
%ifpython3
python3 setup.py test -s test3
%endif
%endif

With `%bcond_without tests`, rpm does not complain (the checks fail, but
we know that already), but when I use
`%bcond_with tests` I get:

[ 52s] error: /home/abuild/rpmbuild/SOURCES/python-termstyle.spec:72: Got
a %endif with no %if Where lne 72 is the last %endif in that section. If I
comment out both %ifpythons, then it works.

Does someone maybe has a clue why this is happening?

Sebastian

[0]:
https://build.opensuse.org/package/show/home:sebix:branches:devel:languages
:python/python-termstyle

If i remember I've been hit by this perhaps using %python3_only %python2_only
it could work ?

I've been almost pretty sure this kind of writing would have work
%check
# A full language is needed to make test successful
# C.UTF-8 used normally on obs is not enough
%{python_expand #Try to build lang
export LANG=en_US.UTF-8
$python setup.py test -s test$(echo "%{py_ver}" | cut -d "." -f1)
}

But I didn't get it right.

Tried patch against your package are temporaly here
http://susepaste.org/40610078

--

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch
Bareos Partner, openSUSE Member, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot


--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References