Mailinglist Archive: opensuse-packaging (57 mails)

< Previous Next >
Re: [opensuse-packaging] packaging made simple.
  • From: David Bolt <bcrafhfr-cnpxntvat@xxxxxxxxxx>
  • Date: Sun, 20 Aug 2006 00:56:39 +0100
  • Message-id: <Jl4w7$T3U65EFwA2@xxxxxxxxxxxxxxxxxxx>
On Sun, 20 Aug 2006, Pascal Bleser <pascal.bleser@xxxxxxxxx> wrote:-

>David Bolt wrote:


>> Just as examples, the thread about "Packaging style guidelines" showed
>> me that I really should use %{optflags}[2] or %{buildroot}.
>%{optflags} is actually a *must* as it passes some compiler flags for
>additional security.

There's another lesson for me today. I'd taken it as a should, not a
must. Just as well I'd already gone through (almost) all my spec files
and made sure it was included.


>It's complex. Just saying that it isn't won't make it any less complex.
>This is not the Matrix. Looking at the RPM database and thinking "you..
>are.. now.. simple" won't bend it.

And I don't think spoons would help here either :)

>That's the only thing that's annoying me. Apart from that, I've always
>tried to help and will certainly keep on doing so.
>> [0] And don't expect to stop learning at any point this side of my
>> grave. I'm presently trying to figure out how to make a base RPM that is
>> architecture specific, at the same time as making a development RPM that
>> isn't.
>Stop trying ;)
>The BuildArch is global. It is not possible to have a subpackage with a
>different BuildArch than the main package.

I was guessing as such. No matter what I tried ended up with either a
noarch base package, which was no good since it contained an x86_64
binary, or an x86_64 sub-package that just includes a few include.h

All this started over someone asking in alt.os.linux.suse for a CSS
editor and cssed being suggested. I'd grabbed the source and tried
building the package, which of course failed. As I usually build things
initially on a 64bit 10.0 system and the spec was hard coded to build
for an i386, I had to start hacking the spec file just to make it build.
It's because of this that I've been practising "bang-head-against-wall"
trying to get it working. Now I know it can't be done, I can give up on
that part and actually finish converting the spec file to be SUSE

>> [1] Which is why there was a "rm -rf %{buildroot}" in the install
>> section. IIRC, I picked that up from a Mandrake/Mandriva spec file I was
>> converting, and just carried it across to other files that I wrote from
>> scratch. My lesson for today is "Don't Do That Again(tm)." It also looks
>> like your guess of 60% of spec files being wrong isn't just applicable
>> to SUSE packages, but may also apply to other RPM based distributions as
>> well.
>Yes, totally. For further details, bug Marcus Rueckert (aka darix) about
>it, he has further details on why it can cause a race condition (he
>explained it to me once, but I admit I forgot the details ;)).

Looks like I may have to do that, unless he reads this list. Google
doesn't seem to show any reasons not to do so and, where it shows either
snippets of spec files, or the complete file, it seems that every single
one includes it in the %install section.

>Not needing to do it because rpmbuild already does it is reason enough
>to me anyway.

Also saves some more typing.

>> [2] something I hadn't been doing, nor need to when I use %configure.

>Well... actually, %configure only sets CFLAGS/CXXFLAGS to %optflags if
>you haven't set CFLAGS/CXXFLAGS yourself.
>If you do this:
> %build
> export CFLAGS="-O2"
> %configure
>then %configure will *not* override CFLAGS to %optflags (instead, the
>build will use -O2).

That was something else I didn't know. I'll have to run through all my
spec files but I don't recall any that explicitly set CFLAGS to anything
other than $RPM_OPT_FLAGS or, as is the case now, %{optflags}.

>So in some cases where you have to pass additional compiler flags, do it
>like this (e.g. an additional include flag):
>export CFLAGS="%{optflags} -I/usr/include/mysql"
>export CXXFLAGS="%{optflags} -I/usr/include/mysql"

I'll have to try and remember that for when it's needed.

David Bolt

Member of Team Acorn checking nodes at 50 Mnodes/s:
AMD1800 1Gb WinXP/SUSE 9.3 | AMD2400 256Mb SuSE 9.0 | A3010 4Mb RISCOS 3.11
AMD2400(32) 768Mb SUSE 10.0 | Falcon 14Mb TOS 4.02 | A4000 4Mb RISCOS 3.11
AMD2600(64) 512Mb SUSE 10.0 | | RPC600 129Mb RISCOS 3.6
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >