Re: RPMbuild mystery parameters --with and --without

2014-01-21 Thread Christopher Meng
I first thought it was just kind of something like what gentoo packages do
in their ebuilds, but then I also found that it's useless sometimes as
described by Richard.

Hereby comes a question, do we have any plans of let users install packages
from sources(crazy of course...) with bcond defined also by them in the
future?
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-21 Thread Alec Leamas
Well,  lpf ( in package lpf)  is about this: it downloads,  builds and
installs a target package from sources. As of now, there are no
user-defined options; no usecase so far. Wouldn't be hard to add if need be.


On Tue, Jan 21, 2014 at 2:31 PM, Christopher Meng cicku...@gmail.comwrote:

 I first thought it was just kind of something like what gentoo packages do
 in their ebuilds, but then I also found that it's useless sometimes as
 described by Richard.

 Hereby comes a question, do we have any plans of let users install
 packages from sources(crazy of course...) with bcond defined also by them
 in the future?

 --
 devel mailing list
 devel@lists.fedoraproject.org
 https://admin.fedoraproject.org/mailman/listinfo/devel
 Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

RPMbuild mystery parameters --with and --without

2014-01-20 Thread Björn Persson
Apparently RPMbuild has a pair of parameters --with and --without
that can supposedly enable and disable optional features in a package.
Has anyone seen any documentation that explains how those work and how
they interact with a spec file?

I want to be able to easily switch an option between these two states:
· off by default but can be enabled with --with
· on by default but can be disabled with --without
What's a good way to code that in the spec?

According to the Packaging Guidelines we're not supposed to use those
parameters when building the source RPM to be submitted, because they
somehow get serialized into the source package. I don't understand
this, because I don't submit any source packages. The source package
gets built on a Koji server when I run fedpkg build, and I don't know
of a way to pass any options to that process.

Björn Persson


signature.asc
Description: PGP signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Panu Matilainen

On 01/20/2014 04:24 PM, Björn Persson wrote:

Apparently RPMbuild has a pair of parameters --with and --without
that can supposedly enable and disable optional features in a package.
Has anyone seen any documentation that explains how those work and how
they interact with a spec file?

I want to be able to easily switch an option between these two states:
· off by default but can be enabled with --with
· on by default but can be disabled with --without
What's a good way to code that in the spec?


See http://rpm.org/wiki/PackagerDocs/ConditionalBuilds


According to the Packaging Guidelines we're not supposed to use those
parameters when building the source RPM to be submitted, because they
somehow get serialized into the source package. I don't understand
this, because I don't submit any source packages. The source package
gets built on a Koji server when I run fedpkg build, and I don't know
of a way to pass any options to that process.


I guess you'd be referring to this:
https://fedoraproject.org/wiki/Packaging:Guidelines#Conditional_dependencies

Its a rather complicated way of saying that Fedora packages must have 
their Fedora defaults for with/without set in the spec, ie rebuilding 
the package must not require any command-line switches.


- Panu -

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Ville Skyttä
On Mon, Jan 20, 2014 at 4:24 PM, Björn Persson
bj...@xn--rombobjrn-67a.se wrote:
 Apparently RPMbuild has a pair of parameters --with and --without
 that can supposedly enable and disable optional features in a package.
 Has anyone seen any documentation that explains how those work and how
 they interact with a spec file?

See /usr/share/doc/rpm*/conditionalbuilds and Conditional build
stuff in /usr/lib/rpm/macros.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Richard W.M. Jones
On Mon, Jan 20, 2014 at 03:24:12PM +0100, Björn Persson wrote:
 Apparently RPMbuild has a pair of parameters --with and --without
 that can supposedly enable and disable optional features in a package.
 Has anyone seen any documentation that explains how those work and how
 they interact with a spec file?
 
 I want to be able to easily switch an option between these two states:
 · off by default but can be enabled with --with
 · on by default but can be disabled with --without
 What's a good way to code that in the spec?

They are (IMHO) very confusing to implement.  However have a look at a
the libvirt spec file for a working example:

  http://pkgs.fedoraproject.org/cgit/libvirt.git/tree/libvirt.spec

Also there's a bug open to make these flags work from 'fedpkg local':

  https://bugzilla.redhat.com/show_bug.cgi?id=820596

 According to the Packaging Guidelines we're not supposed to use those
 parameters when building the source RPM to be submitted, because they
 somehow get serialized into the source package. I don't understand
 this, because I don't submit any source packages.

Yeah I don't understand this either.  I didn't know it was possible to
submit an SRPM directly (except for scratch builds), and if there is
it doesn't sound desirable.

 The source package gets built on a Koji server when I run fedpkg
 build, and I don't know of a way to pass any options to that
 process.

There isn't .. and shouldn't be, since you'd want 'fedpkg build' to
build exactly one RPM variant.

However for 'fedpkg local' these flags could be pretty useful, see
above.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Alek Paunov

On 20.01.2014 16:24, Björn Persson wrote:

According to the Packaging Guidelines we're not supposed to use those
parameters when building the source RPM to be submitted, because they
somehow get serialized into the source package. I don't understand
this, because I don't submit any source packages. The source package
gets built on a Koji server when I run fedpkg build, and I don't know
of a way to pass any options to that process.



IMHO, an example of reasonable usage of this RPM facility in the current 
context is the samba.spec:


http://pkgs.fedoraproject.org/cgit/samba.git/plain/samba.spec

It defines --with testsuite, which is not supposed for real binary 
packages production. Instead, it builds the full Samba (with the AD bits 
enabled) and performs the whole testsuite on top of the test build.


Kind regards,
Alek

P.S. Fedora .spec provided Samba AD works very well for me. If someone 
is interested to deploy Samba AD on Fedora 20, and is aware of MIT vs. 
Heimdal Kerberos caveats _or_ are used with deployment in isolation 
(dedicated instance, container) there are couple of COPR RPMs available: 
http://copr.fedoraproject.org/coprs/decalek/samba.dc/


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Panu Matilainen

On 01/20/2014 07:31 PM, Alek Paunov wrote:

On 20.01.2014 16:24, Björn Persson wrote:

According to the Packaging Guidelines we're not supposed to use those
parameters when building the source RPM to be submitted, because they
somehow get serialized into the source package. I don't understand
this, because I don't submit any source packages. The source package
gets built on a Koji server when I run fedpkg build, and I don't know
of a way to pass any options to that process.



IMHO, an example of reasonable usage of this RPM facility in the current
context is the samba.spec:

http://pkgs.fedoraproject.org/cgit/samba.git/plain/samba.spec

It defines --with testsuite, which is not supposed for real binary
packages production. Instead, it builds the full Samba (with the AD bits
enabled) and performs the whole testsuite on top of the test build.


The samba.spec is a bit convoluted for a simple example of the bcond 
usage as it has a zillion other unrelated but confusingly similar 
self-defined _with_foo macros and conditions based on them.


There are quite a few packages which use bcond, for example this is a 
more straightforward as an example:

http://pkgs.fedoraproject.org/cgit/mutt.git/plain/mutt.spec

- Panu -
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Alexander Bokovoy

On Mon, 20 Jan 2014, Panu Matilainen wrote:

On 01/20/2014 07:31 PM, Alek Paunov wrote:

On 20.01.2014 16:24, Björn Persson wrote:

According to the Packaging Guidelines we're not supposed to use those
parameters when building the source RPM to be submitted, because they
somehow get serialized into the source package. I don't understand
this, because I don't submit any source packages. The source package
gets built on a Koji server when I run fedpkg build, and I don't know
of a way to pass any options to that process.



IMHO, an example of reasonable usage of this RPM facility in the current
context is the samba.spec:

http://pkgs.fedoraproject.org/cgit/samba.git/plain/samba.spec

It defines --with testsuite, which is not supposed for real binary
packages production. Instead, it builds the full Samba (with the AD bits
enabled) and performs the whole testsuite on top of the test build.


The samba.spec is a bit convoluted for a simple example of the bcond 
usage as it has a zillion other unrelated but confusingly similar 
self-defined _with_foo macros and conditions based on them.

samba.spec wasn't designed with bcond in mind at all. Naming of the
defines is just logical. :).

--
/ Alexander Bokovoy
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Panu Matilainen

On 01/20/2014 05:56 PM, Richard W.M. Jones wrote:

On Mon, Jan 20, 2014 at 03:24:12PM +0100, Björn Persson wrote:

Apparently RPMbuild has a pair of parameters --with and --without
that can supposedly enable and disable optional features in a package.
Has anyone seen any documentation that explains how those work and how
they interact with a spec file?

I want to be able to easily switch an option between these two states:
· off by default but can be enabled with --with
· on by default but can be disabled with --without
What's a good way to code that in the spec?


They are (IMHO) very confusing to implement.  However have a look at a
the libvirt spec file for a working example:

   http://pkgs.fedoraproject.org/cgit/libvirt.git/tree/libvirt.spec


The confusion with bcond comes from the fact the logic seems entirely 
backwards. Which it kinda is, until one learns the logic behind it:


%bcond_with foo adds support for --with foo build option to the 
spec. Which also happens to mean that the default is without - why 
else would you need a --with option? And conversely, %bcond_without 
foo adss --without foo build option, effectively also saying default 
is with.


The fact that *everybody* is (at least initially) confused about it says 
something about the intuitiveness of the feature ... or lack of thereof :)


- Panu -

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Re: RPMbuild mystery parameters --with and --without

2014-01-20 Thread Björn Persson
Ville Skyttä wrote:
On Mon, Jan 20, 2014 at 4:24 PM, Björn Persson
bj...@xn--rombobjrn-67a.se wrote:
 Apparently RPMbuild has a pair of parameters --with and --without
 that can supposedly enable and disable optional features in a
 package. Has anyone seen any documentation that explains how those
 work and how they interact with a spec file?

See /usr/share/doc/rpm*/conditionalbuilds and Conditional build
stuff in /usr/lib/rpm/macros.

Thanks, that was what I needed.

Björn Persson


signature.asc
Description: PGP signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct