Bug 870615 (snmptt) - Review Request: snmptt - An SNMP trap handler written in Perl
Summary: Review Request: snmptt - An SNMP trap handler written in Perl
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: snmptt
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Volker Fröhlich
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 509965 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-27 10:14 UTC by Andrew Colin Kissa
Modified: 2012-11-14 18:31 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-11-14 18:29:34 UTC
Type: ---
Embargoed:
volker27: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)

Description Andrew Colin Kissa 2012-10-27 10:14:19 UTC
Spec URL: http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt.spec
SRPM URL: http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt-1.4-0.1.beta2.fc17.src.rpm
Description: SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl
for use with the Net-SNMP / UCD-SNMP snmptrapd program.  It can be
used to translate trap output from snmptrapd to more descriptive and
human friendly form, supports logging, invoking external programs, and
has the ability to accept or reject traps based on a number of
parameters.
Fedora Account System Username:topdog

Comment 1 Andrew Colin Kissa 2012-10-27 10:14:39 UTC
*** Bug 509965 has been marked as a duplicate of this bug. ***

Comment 2 Volker Fröhlich 2012-10-27 15:26:02 UTC
I'd like to see that in EPEL as well. I'd take ownership there, if you're not interested.

Comment 3 Andrew Colin Kissa 2012-10-27 16:08:05 UTC
I will create EPEL branches are you able to pick up the review ?

Comment 4 Volker Fröhlich 2012-10-27 17:56:25 UTC
Please report the wrong FSF postal address upstream, if you haven't already.

defattr is no longer necessary from EPEL 5 on.

Please see http://fedoraproject.org/wiki/Packaging:SysVInitScript for Requires of /sbin/service for the scriptlets

(You can remove the trailing slash on URL.)

Comment 5 Andrew Colin Kissa 2012-10-28 07:26:30 UTC
Hi Volker,

The FSF address has already been reported upstream.

If i remove defattr, i get rpmlint errors see below

[andrew@build2 ~]$ rpmlint rpmbuild/SPECS/snmptt.spec 
rpmbuild/SPECS/snmptt.spec:120: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:121: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:122: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:123: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:124: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:125: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:126: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:127: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:128: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:130: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:131: E: files-attr-not-set
rpmbuild/SPECS/snmptt.spec:132: E: files-attr-not-set
0 packages and 1 specfiles checked; 12 errors, 0 warnings.
[andrew@build2 ~]$ cat /etc/redhat-release 
CentOS release 6.3 (Final)

I have added the dependencies for /sbin/service as per the packaging guidelines.

Please find the updated spec and srpm at

http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt.spec
http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt-1.4-0.2.beta2.fc17.src.rpm

Comment 7 Volker Fröhlich 2012-10-28 10:21:18 UTC
Also, try to submit the unit file.

http://fedoraproject.org/wiki/Packaging:Systemd#Unit_Files

Comment 8 Andrew Colin Kissa 2012-10-28 10:50:08 UTC
* Also, try to submit the unit file:

A unit file is already included.

Source1: %{name}.service

[andrew@build2 ~]$ rpm -qlp rpmbuild/SRPMS/snmptt-1.4-0.2.beta2.el6.src.rpm 
snmptt.service
snmptt.spec
snmptt_1.4beta2.tgz

* The bin directory:

Perl files are not considered binaries, 

[andrew@build2 ~]$ file snmptt_1.4beta2/snmpttconvert
snmptt_1.4beta2/snmpttconvert: a /usr/bin/perl script text executable

[andrew@build2 ~]$ file snmptt_1.4beta2/snmptt
snmptt_1.4beta2/snmptt: a /usr/bin/perl script text executable

* Please add "Requires(pre): shadow-utils":

Done, updated spec file and srpm

http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt.spec
http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt-1.4-0.3.beta2.fc17.src.rpm

Comment 9 Volker Fröhlich 2012-10-28 14:04:54 UTC
You got me wrong there:

When I said "submit" I meant to submit it upstream, as suggested in the part of the guidelines I cited.

The tarball has a "bin" subdirectory including a Windows dll. Delete that in the prep section.

Comment 10 Volker Fröhlich 2012-10-28 14:46:09 UTC
install -D -p -m 0755 snmptthandler %{buildroot}%{_bindir}/snmpttconvert
install -D -p -m 0755 snmptthandler %{buildroot}%{_bindir}/snmpttconvertmib

The source filenames are wrong here.

Comment 11 Andrew Colin Kissa 2012-10-28 17:15:07 UTC
* I have sent upstream an email with regards to fixing the fsf address.

* There is no need for me to delete the "bin" sub directory as that does not make it into the package.

[andrew@build2 ~]$ rpm -qlp /var/lib/mock/fedora-17-x86_64/result/snmptt-1.4-0.4.beta2.fc17.noarch.rpm 
/etc/logrotate.d/snmptt
/etc/snmp/snmptt.conf
/etc/snmp/snmptt.ini
/usr/bin/snmpttconvert
/usr/bin/snmpttconvertmib
/usr/lib/systemd/system/snmptt.service
/usr/sbin/snmptt
/usr/sbin/snmptthandler
/usr/share/doc/snmptt-1.4
/usr/share/doc/snmptt-1.4/COPYING
/usr/share/doc/snmptt-1.4/ChangeLog
/usr/share/doc/snmptt-1.4/README
/usr/share/doc/snmptt-1.4/contrib
/usr/share/doc/snmptt-1.4/contrib/README
/usr/share/doc/snmptt-1.4/contrib/sendemail.sh
/usr/share/doc/snmptt-1.4/docs
/usr/share/doc/snmptt-1.4/docs/faqs.html
/usr/share/doc/snmptt-1.4/docs/index.html
/usr/share/doc/snmptt-1.4/docs/layout1.css
/usr/share/doc/snmptt-1.4/docs/snmptt.html
/usr/share/doc/snmptt-1.4/docs/snmpttconvert.html
/usr/share/doc/snmptt-1.4/docs/snmpttconvertmib.html
/usr/share/doc/snmptt-1.4/examples
/usr/share/doc/snmptt-1.4/examples/sample-trap
/usr/share/doc/snmptt-1.4/examples/sample-trap-daemon
/usr/share/doc/snmptt-1.4/examples/sample-trap.generic
/usr/share/doc/snmptt-1.4/examples/sample-trap.generic.daemon
/usr/share/doc/snmptt-1.4/examples/sample-unknown-trap
/usr/share/doc/snmptt-1.4/examples/sample-unknown-trap-daemon
/var/log/snmptt
/var/spool/snmptt

* I have fixed the incorrect source files.

* Please find the updated spec and srpm.

http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt.spec
http://topdog-software.com/oss/SRPMS/fedora/snmptt/snmptt-1.4-0.4.beta2.fc17.noarch.rpm

Comment 12 Volker Fröhlich 2012-10-28 23:19:52 UTC
You uploaded the wrong file, that's not the SRPM.

You're right about the binaries, I interpreted the rule wrong way.

For the sake of consistency in your file, you could change

mkdir -p %{buildroot}%{_unitdir}
install -m 0644 -p %{SOURCE1} %{buildroot}%{_unitdir}

to

install -D -p -m 0644 -p %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service


You can simplify the scriptlets like this:

%preun
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
fi
%else
#Umständlich angeschrieben, Stil angleichen
if [ $1 = 0 ] ; then
  /sbin/service snmptt stop >/dev/null 2>&1
  /sbin/chkconfig --del snmptt
fi
%endif

-->

%preun
if [ $1 -eq 0 ] ; then
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
%else
  /sbin/service snmptt stop >/dev/null 2>&1
  /sbin/chkconfig --del snmptt
%endif
fi

If you don't want to simplify it, don't mix "-eq 0" and "= 0".

Anyway, neither is a blocker and I can't find anything else to nag about. As soon as you upload the SRPM, I can start the formal review.

Concerning the comment on top of the file: I think that's not related to packaging, but rather to the software itsself. If you're interested in that, please create a ticket upstream.

Comment 14 Volker Fröhlich 2012-10-29 11:48:22 UTC
== APPROVED ==

There's room for the same kind of simplification in %postun.

As a sidenote: I found Debian requires the netsnmp-perl module. I don't think this is actually necessary.

Please notice the comment on the license of sendemail.sh below.


Package Review
==============

Key:
[x] = Pass
[!] = Fail
[-] = Not applicable
[?] = Not evaluated


===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: Package successfully compiles and builds into binary rpms on at least one
     supported primary architecture.
[-]: %build honors applicable compiler flags or justifies otherwise.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[x]: Package contains no bundled libraries.
[x]: Changelog in prescribed format.
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
     Note: rm -rf %{buildroot} present but not required

Package is designed to go to EPEL 5 as well

[x]: Sources contain only permissible code or content.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed

Package is designed to go to EPEL 5 as well

[-]: Macros in Summary, %description expandable at SRPM build time.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package requires other packages for directories it uses.
[x]: Package uses nothing in %doc for runtime.
[x]: Package is not known to require ExcludeArch.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package complies to the Packaging Guidelines
[x]: Spec file lacks Packager, Vendor, PreReq tags.
[-]: Large documentation files are in a -doc subpackage, if required.
[x]: If (and only if) the source package includes the text of the license(s)
     in its own file, then that file, containing the text of the license(s)
     for the package is included in %doc.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "Unknown or generated". 1 files have unknown license. Detailed output of
     licensecheck in
     /media/speicher1/makerpm/rpmbuild/SPECS/870615-snmptt/licensecheck.txt

That's a single contributed trivial shell script we don't ship. It should probably be clarified nevertheless.

[x]: Package consistently uses macro is (instead of hard-coded directory
     names).
[x]: Package is named using only allowed ASCII characters.
[x]: Package is named according to the Package Naming Guidelines.
[x]: No %config files under /usr.
[x]: Package does not generate any conflict.
     Note: Package contains no Conflicts: tag(s)
[x]: Package do not use a name that already exist
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package installs properly.
[x]: Package is not relocatable.
[x]: Requires correct, justified where necessary.
[x]: CheckResultdir
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: Sources used to build the package match the upstream source, as provided
     in the spec URL.
[x]: Spec file is legible and written in American English.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: Package contains systemd file(s) if in need.
[x]: File names are valid UTF-8.

===== SHOULD items =====

Generic:
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
     Note: Invalid buildroot found:
     %{_tmppath}/%{name}_%{version}-%{release}-root-%(%{__id_u} -n)

The preferred form would be %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX), but the above is said to be good as well.

[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: %clean present but not required

Package is designed to go to EPEL 5 as well

[-]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.
[x]: Dist tag is present.
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[ ]: Final provides and requires are sane (rpm -q --provides and rpm -q
     --requires).
[?]: Package functions as described.

I've got one of the draft packages working. I don't expect any problems to have
occured since.

[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: The placement of pkgconfig(.pc) files are correct.
[x]: Scriptlets must be sane, if used.
[x]: SourceX tarball generation or download is documented.
[!]: SourceX / PatchY prefixed with %{name}.
     Note: Source0 (snmptt_1.4beta2.tgz)
[x]: SourceX is a working URL.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Spec use %global instead of %define.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: snmptt-1.4-0.5.beta2.fc16.noarch.rpm
          snmptt-1.4-0.5.beta2.fc16.src.rpm
snmptt.noarch: W: spelling-error %description -l en_US snmptrapd -> snapdragon
snmptt.noarch: E: incorrect-fsf-address /usr/bin/snmpttconvert
snmptt.noarch: E: incorrect-fsf-address /usr/bin/snmpttconvertmib
snmptt.noarch: E: incorrect-fsf-address /usr/sbin/snmptthandler
snmptt.noarch: E: incorrect-fsf-address /usr/sbin/snmptt
snmptt.noarch: E: incorrect-fsf-address /usr/share/doc/snmptt-1.4/COPYING
snmptt.noarch: W: non-standard-uid /var/spool/snmptt snmptt
snmptt.noarch: W: non-standard-gid /var/spool/snmptt snmptt
snmptt.noarch: W: non-standard-uid /var/log/snmptt snmptt
snmptt.noarch: W: non-standard-gid /var/log/snmptt snmptt
snmptt.noarch: W: no-manual-page-for-binary snmpttconvert
snmptt.noarch: W: no-manual-page-for-binary snmptthandler
snmptt.noarch: W: no-manual-page-for-binary snmptt
snmptt.noarch: W: no-manual-page-for-binary snmpttconvertmib
snmptt.src: W: spelling-error %description -l en_US snmptrapd -> snapdragon
2 packages and 0 specfiles checked; 5 errors, 10 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint snmptt
snmptt.noarch: I: enchant-dictionary-not-found en_US
snmptt.noarch: E: incorrect-fsf-address /usr/bin/snmpttconvert
snmptt.noarch: E: incorrect-fsf-address /usr/bin/snmpttconvertmib
snmptt.noarch: E: incorrect-fsf-address /usr/sbin/snmptthandler
snmptt.noarch: E: incorrect-fsf-address /usr/sbin/snmptt
snmptt.noarch: E: incorrect-fsf-address /usr/share/doc/snmptt-1.4/COPYING

Upstream was informed

snmptt.noarch: W: non-standard-uid /var/spool/snmptt snmptt
snmptt.noarch: W: non-standard-gid /var/spool/snmptt snmptt
snmptt.noarch: W: non-standard-uid /var/log/snmptt snmptt
snmptt.noarch: W: non-standard-gid /var/log/snmptt snmptt

On purpose

snmptt.noarch: W: no-manual-page-for-binary snmpttconvert
snmptt.noarch: W: no-manual-page-for-binary snmptthandler
snmptt.noarch: W: no-manual-page-for-binary snmptt
snmptt.noarch: W: no-manual-page-for-binary snmpttconvertmib

Extensive documentation is available on the snmptt website.

1 packages and 0 specfiles checked; 5 errors, 8 warnings.
# echo 'rpmlint-done:'



Requires
--------
snmptt-1.4-0.5.beta2.fc16.noarch.rpm (rpmlib, GLIBC filtered):
    
    /bin/sh  
    /usr/bin/perl  
    config(snmptt) = 1.4-0.5.beta2.fc16
    logrotate  
    net-snmp  
    perl(Config::IniFiles)  
    perl(Cwd)  
    perl(File::Basename)  
    perl(File::Spec)  
    perl(Getopt::Long)  
    perl(POSIX)  
    perl(Sys::Hostname)  
    perl(Text::Balanced)  
    perl(Text::ParseWords)  
    perl(Time::HiRes)  
    perl(constant)  
    perl(strict)  
    shadow-utils  
    systemd-units  



Provides
--------
snmptt-1.4-0.5.beta2.fc16.noarch.rpm:
    
    config(snmptt) = 1.4-0.5.beta2.fc16
    snmptt = 1.4-0.5.beta2.fc16



MD5-sum check
-------------
http://downloads.sourceforge.net/snmptt/snmptt_1.4beta2.tgz :
  CHECKSUM(SHA256) this package     : 5405cbff92633772bc297e310f20d1e4b920309ea58420939f847ef5c32c55b4
  CHECKSUM(SHA256) upstream package : 5405cbff92633772bc297e310f20d1e4b920309ea58420939f847ef5c32c55b4


Generated by fedora-review 0.3.0 (c78e275) last change: 2012-09-24
Buildroot used: fedora-16-x86_64
Command line :/usr/bin/fedora-review -b 870615

Comment 15 Andrew Colin Kissa 2012-10-29 22:19:46 UTC
Thanks for the review.

New Package SCM Request
=======================
Package Name: snmptt
Short Description: An SNMP trap handler written in Perl
Owners: topdog
Branches: f17 f18 el5 el6
InitialCC:

Comment 16 Gwyn Ciesla 2012-10-30 11:19:13 UTC
Git done (by process-git-requests).

Comment 17 Fedora Update System 2012-10-30 18:09:38 UTC
snmptt-1.4-0.6.beta2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/snmptt-1.4-0.6.beta2.fc18

Comment 18 Fedora Update System 2012-10-30 18:11:07 UTC
snmptt-1.4-0.6.beta2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/snmptt-1.4-0.6.beta2.fc17

Comment 19 Fedora Update System 2012-10-30 18:11:57 UTC
snmptt-1.4-0.6.beta2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/snmptt-1.4-0.6.beta2.el6

Comment 20 Fedora Update System 2012-10-30 18:12:43 UTC
snmptt-1.4-0.6.beta2.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/snmptt-1.4-0.6.beta2.el5

Comment 21 Fedora Update System 2012-10-30 20:17:03 UTC
snmptt-1.4-0.6.beta2.fc18 has been pushed to the Fedora 18 testing repository.

Comment 22 Fedora Update System 2012-11-14 18:29:35 UTC
snmptt-1.4-0.6.beta2.el5 has been pushed to the Fedora EPEL 5 stable repository.

Comment 23 Fedora Update System 2012-11-14 18:31:02 UTC
snmptt-1.4-0.6.beta2.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.