Bug 1396828 - Add hack for non existing %licence macro to build libbson on CentOS 6
Summary: Add hack for non existing %licence macro to build libbson on CentOS 6
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: libbson
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-20 16:13 UTC by Johan Hedin
Modified: 2016-11-23 12:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-21 11:32:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Johan Hedin 2016-11-20 16:13:10 UTC
The current spec file for libbson does not build on CentOS 6 due to the use of the %licence macro.

On the other hand, the spec file for the current mongo-c-driver builds unmodified on CentOS 6. The difference between them is that the mongo-c-driver adds a "compatibility hack" that defines %licence as %doc like this:

%{!?_licensedir:%global license %%doc}

Is it possible to add the same "hack" to the libbson spec file to make the package build unmodified on CentOS 6 as well?

Regards,
Johan

Comment 1 Petr Pisar 2016-11-21 11:25:17 UTC
It should work as it is. The EPEL build root provides the macro in epel-rpm-macros package <https://fedoraproject.org/wiki/EPEL:Packaging#Previously_required_boilerplate>.

Comment 2 Petr Pisar 2016-11-21 11:32:19 UTC
And it works <http://koji.fedoraproject.org/koji/taskinfo?taskID=16552131>.

Comment 3 Petr Pisar 2016-11-21 14:13:27 UTC
By the way, if you need libbson in EPEL6, I can add it there.

I'm only not sure about version. Fedora 26 has newer version than EPEL7. Copying Fedora 26 package into EPEL6 would make EPEL6 newer than EPEL7. I have no problem with it, it just could surprise somebody when upgrading to CentOS 7.

Comment 4 Johan Hedin 2016-11-21 19:45:19 UTC
Aha, thanks for the explanation! I'm trying to build the package on my on machine in the "normal way", ie not using mock. And I have the epel-rpm-macros RPM installed.

But now I see in the packaging guidelines you link to that the %licence macro is disabled when you have the SCL macro package installed, which I have :-)

I have no problem fixing this my self now when I understand what is going on.

Having libbson (and also mongo-c-driver and php-pecl-mongodb) in EPEL6 would be great in on one way but also a bit problematic in another way. Since MongoDB is evolving so fast, MongoDB driver support in EPEL will only be useful for a short period of time after being added. So if the upcoming libbson, mongo-c-driver and php-pecl-mongodb end up i EPEL6 that would be great for lets say 8 months, then the next release of MongoDB will come out with a updated set of drivers. And so on.

Differences between EPEL6 and EPEL7 should not be a problem I think since there are no supported upgrade path from EL/CentOS 6 to 7 so I guess that people expect to look things over when switching.

My own problem is that I need to be able to have up-to-date MongoDB drivers for php (which depend on libbson) in both CentOS 6 and 7 so I will bet my cards on continue to rebuilding the Fedora packages on CentOS until some way emerges to have more fast moving stuff in CentOS (and perhaps SCL is one answer?!)

So I leave to others to decide if libbson/mongo-c-driver should go into EPEL6/7 for the time being as long as I can easily rebuild them :-)

Thanks again for the explanation, suggestion to add to EPEL6 and for keeping the packages so easy to rebuild on CentOS 6/7. I appreciate it!

Regards,
Johan

Comment 5 Remi Collet 2016-11-22 05:26:53 UTC
Notice than the mongodb PHP extension requires PHP 5.4+ thus is only available in EPEL-7.

SCL users can find the extension in centos-sclo-sclo repository, see
https://wiki.centos.org/SpecialInterestGroup/SCLo
(this is a new package, so available, for now, in testing, for rh-php56 and rh-php70)

If you use any other 3rd party repository (for the PHP stack), it should be available there (it is at least in "remi" repository, version 1.1.9 in stable, upcoming version 1.2.0 in testing).

BTW, I don't think having libbson or mongo-c-driver in EPEL-6 will help (fast moving project)

Comment 6 Johan Hedin 2016-11-22 07:54:54 UTC
I'm building the PHP extension against rh-php54 on CentOS 6 by SCL-ifying your RPM for Fedora so I'm already in SCL-land. I will probably switch over to using the srpm from rh-php56/70 when it is ready.

And since you seem to be quite active updating the RPM:s I expect that to happen rather soon since MongoDB 3.4 will be out in a couple of weeks and the drivers will follow.

Comment 7 Remi Collet 2016-11-22 08:05:30 UTC
See https://access.redhat.com/support/policy/updates/rhscl/

rh-php54 is EOL and will not receive any new update (or package)
So I recommend you update to 5.6 which already have the mongodb ext

=> http://buildlogs.centos.org/centos/6/sclo/x86_64/sclo/sclo-php56/

Comment 8 Petr Pisar 2016-11-22 08:35:35 UTC
It could be possible to package multiple versions of libbson into the same EPEL distribution <https://fedoraproject.org/wiki/Packaging:ReviewGuidelines#Package_Review_Process>.

But one had to modify them in order not to conflict each to other. I.e. remove manual pages and rename header files directory and a pkgconfig file and a soname. Also I would not like to package each new version, but rather to package only only API/ABI breaking versions and keep the latest version up-to-date until it breaks API/ABI.

But renaming pkgconfig would mean that each reverse dependency would have to be modified. I don't know if it's worth of all the struggle.

Comment 9 Johan Hedin 2016-11-22 19:58:05 UTC
Good page with update policy for the different SCL:s. I haven't seen that before.

BTW, how does the mongodb ext in http://buildlogs.centos.org/centos/6/sclo/x86_64/sclo/sclo-php56/ get libbson and the mongo-c-driver? Are these two libraries bundled in the 1.1.9 version?

And out of curiosity, what do you plan to do when 1.2.0 is out? Will that go into the php56 collection as an update to 1.1.9? And with broken out libbson and mongo-c-driver packages, where will they go?

Comment 10 Remi Collet 2016-11-23 12:55:36 UTC
(In reply to Johan Hedin from comment #9)
> BTW, how does the mongodb ext in
> http://buildlogs.centos.org/centos/6/sclo/x86_64/sclo/sclo-php56/ get
> libbson and the mongo-c-driver? Are these two libraries bundled in the 1.1.9
> version?

Yes, bundled lib. are used.

> And out of curiosity, what do you plan to do when 1.2.0 is out? Will that go
> into the php56 collection as an update to 1.1.9? 

Don't know yet.


Note You need to log in before you can comment on or make changes to this bug.