Bug 1006860 - Review Request: libnatpmp - Library of The NAT Port Mapping Protocol (NAT-PMP)
Review Request: libnatpmp - Library of The NAT Port Mapping Protocol (NAT-PMP)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Sandro Mani
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-11 08:05 EDT by Christopher Meng
Modified: 2014-02-21 20:46 EST (History)
2 users (show)

See Also:
Fixed In Version: libnatpmp-20131126-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-21 19:47:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
manisandro: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)
Makefile patch (551 bytes, patch)
2014-01-03 16:43 EST, Sandro Mani
no flags Details | Diff

  None (edit)
Description Christopher Meng 2013-09-11 08:05:58 EDT
Spec URL: http://cicku.me/libnatpmp.spec
SRPM URL: http://cicku.me/libnatpmp-20130911-1.fc21.src.rpm 
Description: libnatpmp is an attempt to make a portable and fully compliant implementation 
of the protocol for the client side. It is based on non blocking sockets and 
all calls of the API are asynchronous. It is therefore very easy to integrate 
the NAT-PMP code to any event driven code.
Fedora Account System Username: cicku
Comment 1 Ralf Corsepius 2013-09-12 13:07:43 EDT
Package fails to build in mock:
...
/usr/bin/ld: natpmp.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
natpmp.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libnatpmp.so] Error 1
...

The cause seems obvious:

By invoking 'make CFLAGS="%{optflags}", you are overriding the CFLAGS within the Makefile, causing the package to loose the CFLAGS given in the Makefile.

Depending on what you intend, you either could opt to
- propagate %optflags into the Makefile, e.g. something similar to
  sed -i "s|CFLAGS =.*$|CFLAGS = %{optflags}|" Makefile
or
- explicitly append all desired CFLAGS contained in the Makefile to the CFLAGS in the make call e.g. something similar to
  make CFLAGS="%{optflags} -fPIC -DENABLE_STRNATPMPERR"
or <something else>
Comment 2 Christopher Meng 2013-11-04 23:57:59 EST
Temporarily notready in a week.
Comment 3 Christopher Meng 2014-01-03 06:53:04 EST
(In reply to Ralf Corsepius from comment #1)
> Package fails to build in mock:

Even if I don't insert flags it can build well, not sure about the problem.

Spec URL: http://cicku.me/libnatpmp.spec
SRPM URL: http://cicku.me/libnatpmp-20131126-1.fc21.src.rpm

This is a dep package of mldonkey.
Comment 4 Sandro Mani 2014-01-03 16:43:17 EST
Created attachment 845100 [details]
Makefile patch

As Ralf pointed out, you need to stop the environment CFLAGS overriding the Makefile CFLAGS. A possible patch is attached.
Comment 5 Christopher Meng 2014-01-07 05:17:00 EST
You patch works, but current way in my spec also works, which one do you prefer?

http://koji.fedoraproject.org/koji/taskinfo?taskID=6368458
Comment 6 Sandro Mani 2014-01-07 05:30:43 EST
The spec file in your SRPM file is not the same as the spec file you linked (the one in the SRPM file misses the -fPIC in the CFLAGS). That's why it didn't work for me. Still, IMO keeping the -fPIC and -DENABLE_STRNATPMPERR in the makefile is cleaner, since the flags are project specific.
Comment 7 Christopher Meng 2014-02-13 03:08:56 EST
OK.

I wil propose a patch to upstream, but use this hack for a while.

If no problems here, please approve. Thanks again.
Comment 8 Christopher Meng 2014-02-13 03:25:02 EST
Koji: http://koji.fedoraproject.org/koji/taskinfo?taskID=6524731
Comment 9 Ralf Corsepius 2014-02-13 03:31:57 EST
(In reply to Christopher Meng from comment #7)
> OK.
> 
> I wil propose a patch to upstream, but use this hack for a while.
> 
> If no problems here, please approve. Thanks again.
You did you change anything on your package? You once againd did increment the NEVR, so their is nothing to approve.
Comment 10 Christopher Meng 2014-02-13 03:57:57 EST
(In reply to Ralf Corsepius from comment #9)
> > If no problems here, please approve. Thanks again.
> You did you change anything on your package? You once againd did increment
> the NEVR, so their is nothing to approve.

Actually nothing because they are the same with the one in the previous link.

You pointed the fault in Sep, then I fixed it immediately in spite of leaving it here for 2 months and in Nov I checked again my remaining bugs, because at that time new version was released, so I included my fix in the new version SRPM, therefore no need to bump.

Sandro still deemed that this had problem just because the spec is not coherent with the SRPM.

Spec URL: http://cicku.me/libnatpmp.spec
SRPM URL: http://cicku.me/libnatpmp-20131126-1.fc21.src.rpm

Reserved for Ralf: 

SRPM URL: http://cicku.me/libnatpmp-20131126-2.fc21.src.rpm
Comment 11 Sandro Mani 2014-02-13 05:29:37 EST
Issues:

- ldconfig is not called in %post and %postun if required.
  Note: /sbin/ldconfig not called in libnatpmp
  See: http://fedoraproject.org/wiki/Packaging/Guidelines#Shared_Libraries

- Packages do not install properly.

Error: Package: libnatpmp-20131126-1.fc21.x86_64 (/libnatpmp-20131126-1.fc21.x86_64)
           Requires: libnatpmp.so.1()(64bit)
Error: Package: libnatpmp-devel-20131126-1.fc21.x86_64 (/libnatpmp-devel-20131126-1.fc21.x86_64)
           Requires: libnatpmp.so.1()(64bit)

Note also the requires and provides:

Requires
--------
libnatpmp-devel (rpmlib, GLIBC filtered):
    libnatpmp(x86-64)
    libnatpmp.so.1()(64bit)

libnatpmp (rpmlib, GLIBC filtered):
    libc.so.6()(64bit)
    libnatpmp.so.1()(64bit)
    rtld(GNU_HASH)

Provides
--------
libnatpmp-devel:
    libnatpmp-devel
    libnatpmp-devel(x86-64)

libnatpmp:
    libnatpmp
    libnatpmp(x86-64)


This is actually strange, I do not see why rpm does not pick up that libnatpmp contains ibnatpmp.so.1
Comment 12 Christopher Meng 2014-02-13 05:44:09 EST
RPM doesn't pick it up because no ldconfig executed, I will fix and post tomorrow.

Thanks.
Comment 13 Sandro Mani 2014-02-13 05:45:10 EST
I thought so as well, but rebuilding with ldconfig didn't help...
Comment 14 Sandro Mani 2014-02-13 05:48:25 EST
This is suspect as well:
libnatpmp.x86_64: W: unstripped-binary-or-object /usr/lib64/libnatpmp.so.1
Comment 15 Christopher Meng 2014-02-13 05:55:00 EST
(In reply to Sandro Mani from comment #14)
> This is suspect as well:
> libnatpmp.x86_64: W: unstripped-binary-or-object /usr/lib64/libnatpmp.so.1

Got it. 

Fix tomorrow.
Comment 16 Sandro Mani 2014-02-13 05:56:30 EST
Just found out that the issue is that libnatpmp.so.1 has permissions 0644, but auto-provides / auto-depends requires 0755 to work.
Comment 17 Christopher Meng 2014-02-14 01:47:25 EST
Spec URL: http://cicku.me/libnatpmp.spec
SRPM URL: http://cicku.me/libnatpmp-20131126-2.fc21.src.rpm
Comment 18 Sandro Mani 2014-02-14 04:51:31 EST
All ok, approved!
Comment 19 Christopher Meng 2014-02-14 06:02:56 EST
Thank you! 

New Package SCM Request
=======================
Package Name: libnatpnp
Short Description: Library of the NAT port mapping protocol (NAT-PMP)
Owners: cicku
Branches: f19 f20 el6 epel7
Comment 20 Gwyn Ciesla 2014-02-14 08:31:03 EST
Requested package name libnatpnp doesn't match bug summary
libnatpmp, please correct.
Comment 21 Christopher Meng 2014-02-14 09:04:36 EST
New Package SCM Request
=======================
Package Name: libnatpmp
Short Description: Library of the NAT port mapping protocol (NAT-PMP) 
Owners: cicku 
Branches: f19 f20 el6 epel7
Comment 22 Gwyn Ciesla 2014-02-14 09:42:32 EST
Git done (by process-git-requests).
Comment 23 Fedora Update System 2014-02-14 22:55:13 EST
libnatpmp-20131126-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libnatpmp-20131126-2.fc20
Comment 24 Fedora Update System 2014-02-14 22:55:24 EST
libnatpmp-20131126-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libnatpmp-20131126-2.fc19
Comment 25 Fedora Update System 2014-02-14 22:55:31 EST
libnatpmp-20131126-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/libnatpmp-20131126-2.el6
Comment 26 Fedora Update System 2014-02-15 15:01:49 EST
libnatpmp-20131126-2.fc19 has been pushed to the Fedora 19 testing repository.
Comment 27 Fedora Update System 2014-02-21 19:47:20 EST
libnatpmp-20131126-2.fc19 has been pushed to the Fedora 19 stable repository.
Comment 28 Fedora Update System 2014-02-21 19:50:33 EST
libnatpmp-20131126-2.fc20 has been pushed to the Fedora 20 stable repository.
Comment 29 Fedora Update System 2014-02-21 20:46:31 EST
libnatpmp-20131126-2.el6 has been pushed to the Fedora EPEL 6 stable repository.

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