[mythtv-users] systemd packaging problwm [WAS: Systemd File For MythTV on Fedora Questions]

Harry Orenstein holists at verizon.net
Tue May 15 00:40:39 UTC 2012

On Mon, 2012-05-14 at 19:15 -0500, Richard Shaw wrote:
> On Mon, May 14, 2012 at 6:42 PM, Harry Orenstein <holists at verizon.net> wrote:
> > This is related to this topic, so I hope you don't mind a little
> > thread-jacking  :)
> >
> > It seems you wrote the rpm packaging mods to support systemd.  I tried
> > modifying build_myth.sh to enable systemd (adding --with systemd) and
> > got this error when mythtv.spec is built:
> >
> > error: syntax error in expression
> > error: /home/mythtv/mythtv/0.25-fixes/packaging/rpm/mythtv.spec:159:
> > parseExpressionBoolean returns -1
> >
> > This is the first instance of "%if %{with_systemd}" and I cannot figure
> > out how to address the error short of commenting out all of the "then"
> > clauses (so that systemd is the default for compile).  I'm running
> > Fedora 16 (if that makes a difference).  I cannot see how a value of -1
> > gets set if 0 and 1 are the only defined values (in the %define).
> I'm going to guess that it's because with_systemd isn't defined unless
> you use it. Changing to something like
> %if 0%{?with_systemd}
> Notice the "0" & "?". This means if it is defined it will be used, if
> it's not then it will be ignored, so the "0" makes the conditional
> false.
> Hopefully that fixes it. I still struggle sometimes with all the weird
> ways you can do if's in spec files.
> Richard
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users

Thanks for the reply.  I don't think this is the problem.  I tried your
fix and get the same error.  The normal state is for with_systemd to be
false (0) since the else clause is taken.  Using "--with systemd" should
set it to true (1).  This is the way the "--with debug" works and the
syntax for both in mythtv.spec looks the same.  I had thought that maybe
with_systemd was somehow a reserved variable, so I tried modifying the
script to name it "with_sysd", which resulted in the same error as well.

I just did a little Googling(tm) and found this page:


Seems like %bcond_with is a better option to use (same %if syntax).
Didn't get the same error and I'm recompiling the rpms now to see if it
actually works.

-- Harry O.

More information about the mythtv-users mailing list