Bug 903824 (perl-Convert-Age)

Summary: Review Request: perl-Convert-Age - converts integer seconds into a compact form and back
Product: [Fedora] Fedora Reporter: Normunds <fedorapkg>
Component: Package ReviewAssignee: Petr Šabata <psabata>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: package-review, psabata, rvokal
Target Milestone: ---Flags: psabata: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 16:11:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Normunds 2013-01-24 21:44:36 UTC
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 21:58:49 UTC
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 10:20:22 UTC
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 12:41:43 UTC
I'll look at your packages and possibly sponsor you later :)

Comment 4 Petr Šabata 2013-01-28 12:54:46 UTC
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 21:58:27 UTC
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 08:19:04 UTC
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 13:45:42 UTC
(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 14:03:05 UTC
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 14:20:09 UTC
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 14:42:34 UTC
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 21:57:42 UTC
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 22:02:01 UTC
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 Gwyn Ciesla 2013-02-01 13:45:13 UTC
Git done (by process-git-requests).

Comment 14 Fedora Update System 2013-02-13 16:13:04 UTC
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 18:55:35 UTC
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 19:48:21 UTC
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 08:43:33 UTC
perl-Convert-Age-0.04-1.fc17 has been pushed to the Fedora 17 stable repository.

Comment 18 Fedora Update System 2013-02-24 08:59:23 UTC
perl-Convert-Age-0.04-1.fc18 has been pushed to the Fedora 18 stable repository.