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:

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}
export LANG=C.UTF-8
python2 test -s test2
python3 test -s test3

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?



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
# 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 test -s test$(echo "%{py_ver}" | cut -d "." -f1)

But I didn't get it right.

Tried patch against your package are temporaly here


Bruno Friedmann
Ioda-Net Sàrl
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