Bug 903824 - (perl-Convert-Age) Review Request: perl-Convert-Age - converts integer seconds into a compact form and back
Review Request: perl-Convert-Age - converts integer seconds into a compact fo...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Petr Šabata
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-24 16:44 EST by Normunds
Modified: 2014-04-03 12:11 EDT (History)
3 users (show)

See Also:
Fixed In Version: perl-Convert-Age-0.04-1.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-03 12:11:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
psabata: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Normunds 2013-01-24 16:44:36 EST
Spec URL: http://unibackup.rule.lv/FedoraRPM/perl-Convert-Age.spec
SRPM URL: http://unibackup.rule.lv/FedoraRPM/perl-Convert-Age-0.04-1.fc16.src.rpm
Description: Perl module that converts integer seconds into a compact form and back e.g. 1h2m to 62 or vice-versa.
Fedora Account System Username: normunds
Comment 1 Normunds 2013-01-24 16:58:49 EST
Bug 903829, Bug 903826, Bug 903824 are my first Fedora packages, yet more to come. I checked them with both Mock and Koji for all Fedora releases (16, 17, 18, 19, rawhide).
Comment 2 Normunds 2013-01-26 05:20:22 EST
All packages mentioned below were tested with rpmlint, mock (for i386 arch) and koji (16, 17, 18, 19, rawhide). These are my first packages for Fedora, so if you find something to improve in one of them, don't bother, I'll check other packages for reported problems.

Need sponsor.

bug 903824 perl-Convert-Age.spec
bug 903826 perl-Net-Domain-TLD.spec
bug 903829 perl-Time-Interval.spec
bug 904328 perl-Config-ApacheFormat.spec
bug 904329 perl-Data-Validate-Domain.spec
bug 904330 perl-Data-Validate-IP.spec
bug 904331 perl-Shell.spec

Thanks.
Comment 3 Petr Šabata 2013-01-28 07:41:43 EST
I'll look at your packages and possibly sponsor you later :)
Comment 4 Petr Šabata 2013-01-28 07:54:46 EST
Issues:

Lines 29-31 are useless. None of those files has executable bits set.  Interval.* isn't even present in the archive.

Line 42 is also not needed as this is done automatically by rpmbuild.

Useless build-time dependency: perl(Test::Simple) -- not used anywhere at all.

Missing build-time dependencies:
perl(Exporter) from lib/Convert/Age.pm:35
perl(Test::More) from various test files

Simple commands are preferred over command macros.  Consider removing them.
Comment 5 Normunds 2013-01-28 16:58:27 EST
Spec file and src package updated.

 * Removed useless lines
 * Fixed dependencies.
 * Replaced macros with simple commands.

New package overwritten in original location.

Thanks a lot for your review :)
Comment 6 Normunds 2013-01-29 03:19:04 EST
Could you help me to fully understand how Requires and BuildRequires are used in Fedora?

1) If I enter put requirement in Requires, it will be automatically used also as BuildRequire. Do I understand this correctly?

2) In bug 904328 you mentioned that Some requirements are not needed in Requires field because rpmbuild automatically detects those requirements. How can I detect what rpmbuild detects?

3) In bug 903826 you asked me to add build time dependency perl(base), perl(constant) which actually is Perl pragma not module. When should I add Perl pragmas like perl(warnings) and perl(strict) to Requires, when shouldn't?

4) Shouldn't it be more correct to put all module requirements to Requires field and all testing requirements to BuildRequires filed (if 1st is true)?

Thanks
Comment 7 Petr Šabata 2013-01-29 08:45:42 EST
(In reply to comment #6)
> Could you help me to fully understand how Requires and BuildRequires are
> used in Fedora?
> 
> 1) If I enter put requirement in Requires, it will be automatically used
> also as BuildRequire. Do I understand this correctly?

No, those two are unrelated.

> 2) In bug 904328 you mentioned that Some requirements are not needed in
> Requires field because rpmbuild automatically detects those requirements.
> How can I detect what rpmbuild detects?

The easiest and most reliable way is to build the package and check the resulting binary (not SRPM) for dependencies, e.g.

rpm -q --requires -p your-package-1.2-3.fc19.noarch.rpm

Currently, in case of perl packages, rpmbuild parses the packaged modules and tries to guess the perl() style dependencies.  It works rather well for most cases and therefore you don't need to manually specify them in your spec file (usually).

> 3) In bug 903826 you asked me to add build time dependency perl(base),
> perl(constant) which actually is Perl pragma not module. When should I add
> Perl pragmas like perl(warnings) and perl(strict) to Requires, when
> shouldn't?

Surprise, they're modules! :)

https://metacpan.org/module/base
https://metacpan.org/module/constant

And requiring true pragmas wouldn't hurt (rpmbuild actually does that too) either since they are listed among the 'perl' package provides --

$ rpm -q --provides perl|grep -E '^perl\((strict|warnings)\)'
perl(strict) = 1.07
perl(warnings) = 1.13

-- but given that they are and most likely always be parts of perl, I don't find it necessary.  Some people build-require them explicitly, though.

> 4) Shouldn't it be more correct to put all module requirements to Requires
> field and all testing requirements to BuildRequires filed (if 1st is true)?

See 1).  The reason why I urge you to add runtime dependencies as buildrequires is that they are actually used during the test phase -- in most cases the module is loaded, e.g. via use_ok() or other means.  Of course you always have to see the actual test code.

Generally, for buildtime deps ("BuildRequires"):
1. Check the Makefile.PL or Build.PL, whatever the project uses, and add the file's dependencies to your BRs.
2. If you're running the test suite, check and add the direct test file dependencies.
3. If you're running the test suite, check and add the dependencies of modules tested by the test suite too.

For runtime deps ("Requires"):
1. Build the package and see the resulting binary RPM's "requires" and compare it with what's actually written in the packaged code.  If something is missing, add it explicitly.
Comment 8 Petr Šabata 2013-01-29 09:03:05 EST
About the new package -- I see you also added the pragmas deps.  That's alright.  You can also remove the perl macro on the MODULE_COMPAT line, by the way.

Anyhow, the package looks good now and I'll approve it once I sponsor you.
Comment 9 Normunds 2013-01-29 09:20:09 EST
Thanks a lot for your comments. Is it OK if I re-check spec files and re-create packages after I have time to digest your comment about Requires and BuildRequires? Or I should notify you for another review cycle?

Thanks and best regards.
Comment 10 Petr Šabata 2013-01-29 09:42:34 EST
Sure, just update the reviews you've submitted.

By the way, I've just sponsored you into the packager group.
Now you can submit the SCM request for your approved packages:
http://fedoraproject.org/wiki/Package_SCM_admin_requests

Please, mention me (psabata) as one of the owners and put "perl-sig" in the InitialCC field too.
Comment 11 Normunds 2013-01-31 16:57:42 EST
Package updated (Macro in MODULE_COMPATm, re-checked dependencies according to Requires and BuildRequires practices discussed here, removed e-mail from changelog).

New Package SCM Request
=======================
Package Name: perl-Convert-Age
Short Description: Perl module that converts integer seconds into a "compact" form and back
Owners: normunds psabata
Branches: f16 f17 f18 f19
InitialCC: perl-sig
Comment 12 Normunds 2013-01-31 17:02:01 EST
Incorrect brances in previous request. Corrected here.

New Package SCM Request
=======================
Package Name: perl-Convert-Age
Short Description: Perl module that converts integer seconds into a "compact" form and back
Owners: normunds psabata
Branches: f16 f17 f18
InitialCC: perl-sig
Comment 13 Jon Ciesla 2013-02-01 08:45:13 EST
Git done (by process-git-requests).
Comment 14 Fedora Update System 2013-02-13 11:13:04 EST
perl-Convert-Age-0.04-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/perl-Convert-Age-0.04-1.fc16
Comment 15 Fedora Update System 2013-02-13 13:55:35 EST
perl-Convert-Age-0.04-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/perl-Convert-Age-0.04-1.fc17
Comment 16 Fedora Update System 2013-02-13 14:48:21 EST
perl-Convert-Age-0.04-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/perl-Convert-Age-0.04-1.fc18
Comment 17 Fedora Update System 2013-02-24 03:43:33 EST
perl-Convert-Age-0.04-1.fc17 has been pushed to the Fedora 17 stable repository.
Comment 18 Fedora Update System 2013-02-24 03:59:23 EST
perl-Convert-Age-0.04-1.fc18 has been pushed to the Fedora 18 stable repository.

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