Bug 1767918

Summary: Review Request: targetd - Revive package
Product: [Fedora] Fedora Reporter: Tony Asleson <tasleson>
Component: Package ReviewAssignee: Elliott Sales de Andrade <quantum.analyst>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: package-review, quantum.analyst
Target Milestone: ---Flags: quantum.analyst: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: targetd-0.8.9-1.fc32 targetd-0.8.9-1.fc31 targetd-0.8.9-1.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-03 04:58:00 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 Tony Asleson 2019-11-01 16:41:34 UTC
Spec URL: https://tasleson.fedorapeople.org/targetd/targetd.spec
SRPM URL: https://tasleson.fedorapeople.org/targetd/targetd-0.8.9-1.fc30.src.rpm
Description: I removed this package in June 2019 and shortly later we got some code contributions to upstream which replaced the deprecated functionality targetd depended on.  Thus targetd is viable once more again and thus the reason for reviving the package.

Fedora Account System Username: tasleson

Comment 1 Tony Asleson 2019-11-01 16:43:13 UTC
Will want to create new package releases for F30, F31, & rawhide.

Comment 2 Elliott Sales de Andrade 2019-11-04 08:48:33 UTC
Group is not used in Fedora.

Why do you need a separate targetd.yaml when it's in the upstream tarball?

It's preferable to place (Build)Requires on separate lines.

You should not manually compress man pages.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages

It is not permitted to glob the %{python3_sitelib} directory.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_files_to_include

LICENSE should be marked as %license, not %doc.

I don't think you need BuildRequires: systemd, but systemd-rpm-macros.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/

Runtime Python requirements really should be automatically detected, but the setup.py does not list them. You should report this upstream.

Comment 3 Tony Asleson 2019-11-04 15:49:18 UTC
(In reply to Elliott Sales de Andrade from comment #2)
> Group is not used in Fedora.

Done

> Why do you need a separate targetd.yaml when it's in the upstream tarball?

We don't and they appear to be identical, removed.

> It's preferable to place (Build)Requires on separate lines.

Done

> You should not manually compress man pages.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages

Done

> It is not permitted to glob the %{python3_sitelib} directory.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/
> #_files_to_include

Done

 
> LICENSE should be marked as %license, not %doc.

Done


> I don't think you need BuildRequires: systemd, but systemd-rpm-macros.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/

Done

> Runtime Python requirements really should be automatically detected, but the
> setup.py does not list them. You should report this upstream.

Reported: https://github.com/open-iscsi/targetd/issues/34

Thanks for the review.

Updated spec file = https://tasleson.fedorapeople.org/targetd/targetd.spec.1


diff --git a/targetd.spec b/targetd.spec
index cb1a84e..ccd3f62 100644
--- a/targetd.spec
+++ b/targetd.spec
@@ -1,15 +1,14 @@
 Name:           targetd
 License:        GPLv3
-Group:          System Environment/Libraries
 Summary:        Service to make storage remotely configurable
 Version:        0.8.9
 Release:        1%{?dist}
 URL:            https://github.com/open-iscsi/targetd
 Source:         https://github.com/open-iscsi/targetd/archive/v%{version}/targetd-%{version}.tar.gz 
 Source1:        targetd.service
-Source2:        targetd.yaml
 BuildArch:      noarch
-BuildRequires:  systemd, python3-devel
+BuildRequires:  systemd-rpm-macros
+BuildRequires:  python3-devel
 Requires:       python3-PyYAML python3-setproctitle python3-rtslib target-restore
 Requires:       nfs-utils, btrfs-progs, python3-blockdev, libblockdev-lvm
 Requires(post): systemd
@@ -28,15 +27,14 @@ those volumes over iSCSI.
 
 %build
 %{__python3} setup.py build
-gzip --stdout targetd.8 > targetd.8.gz
 
 %install
 mkdir -p %{buildroot}%{_mandir}/man8/
 mkdir -p %{buildroot}%{_unitdir}
 mkdir -p %{buildroot}%{_sysconfdir}/target/
 install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/targetd.service
-install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/target/targetd.yaml
-install -m 644 targetd.8.gz %{buildroot}%{_mandir}/man8/
+install -m 644 targetd.yaml %{buildroot}%{_sysconfdir}/target/targetd.yaml
+install -m 644 targetd.8 %{buildroot}%{_mandir}/man8/
 %{__python3} setup.py install --skip-build --root %{buildroot}
 
 %post
@@ -51,8 +49,10 @@ install -m 644 targetd.8.gz %{buildroot}%{_mandir}/man8/
 %files
 %{_bindir}/targetd
 %{_unitdir}/targetd.service
-%{python3_sitelib}/*
-%doc LICENSE README.md API.md client
+%{python3_sitelib}/targetd/
+%{python3_sitelib}/*.egg-info
+%license LICENSE
+%doc README.md API.md client
 %{_mandir}/man8/targetd.8.gz
 %config(noreplace) %{_sysconfdir}/target/targetd.yaml

Comment 4 Elliott Sales de Andrade 2019-11-08 08:48:50 UTC
Please link the spec *and* srpm directly (no .1 suffixes), or fedora-review does not work.

You should use the %py3_build and %py3_install macros.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_macros

Man page extensions should be globbed.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages

It doesn't look like you run systemd in scriptlets, so you don't need to Require it.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_dependencies_on_the_systemd_package

Comment 5 Tony Asleson 2019-11-08 16:10:38 UTC
(In reply to Elliott Sales de Andrade from comment #4)
> Please link the spec *and* srpm directly (no .1 suffixes), or fedora-review
> does not work.

Sorry about that, existing spec file updated:
https://tasleson.fedorapeople.org/targetd/targetd.spec

> You should use the %py3_build and %py3_install macros.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_macros

Done

> Man page extensions should be globbed.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages

Done

> It doesn't look like you run systemd in scriptlets, so you don't need to
> Require it.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
> #_dependencies_on_the_systemd_package

Done

Thanks!


diff --git a/targetd.spec b/targetd.spec
index ccd3f62..912a697 100644
--- a/targetd.spec
+++ b/targetd.spec
@@ -11,10 +11,6 @@ BuildRequires:  systemd-rpm-macros
 BuildRequires:  python3-devel
 Requires:       python3-PyYAML python3-setproctitle python3-rtslib target-restore
 Requires:       nfs-utils, btrfs-progs, python3-blockdev, libblockdev-lvm
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-
 
 %description
 targetd turns the machine into a remotely-configurable storage appliance.
@@ -26,7 +22,7 @@ those volumes over iSCSI.
 %setup -q
 
 %build
-%{__python3} setup.py build
+%py3_build
 
 %install
 mkdir -p %{buildroot}%{_mandir}/man8/
@@ -35,7 +31,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/target/
 install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/targetd.service
 install -m 644 targetd.yaml %{buildroot}%{_sysconfdir}/target/targetd.yaml
 install -m 644 targetd.8 %{buildroot}%{_mandir}/man8/
-%{__python3} setup.py install --skip-build --root %{buildroot}
+%py3_install
 
 %post
 %systemd_post targetd.service
@@ -53,7 +49,7 @@ install -m 644 targetd.8 %{buildroot}%{_mandir}/man8/
 %{python3_sitelib}/*.egg-info
 %license LICENSE
 %doc README.md API.md client
-%{_mandir}/man8/targetd.8.gz
+%{_mandir}/man8/targetd.8*
 %config(noreplace) %{_sysconfdir}/target/targetd.yaml

Comment 6 Elliott Sales de Andrade 2019-11-09 08:32:18 UTC
The spec and the srpm don't match; make sure to update both of them.

Comment 7 Tony Asleson 2019-11-11 21:58:38 UTC
(In reply to Elliott Sales de Andrade from comment #6)
> The spec and the srpm don't match; make sure to update both of them.

Done, md5sum = e7f6bb3a6b318052d2404df60cb9140c

Thanks!

Comment 8 Elliott Sales de Andrade 2019-11-21 08:57:06 UTC
Approved

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

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Package does not use a name that already exists.
  Note: A package with this name already exists. Please check
  https://src.fedoraproject.org/rpms/targetd
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Naming/#_conflicting_package_names
- systemd_post is invoked in %post, systemd_preun in %preun, and
  systemd_postun in %postun for Systemd service files.
  Note: Systemd service file(s) in targetd
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Scriptlets/#_scriptlets


===== 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]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. No licenses found. Please check the source files for
     licenses manually.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[?]: Package does not generate any conflict.
[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]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 30720 bytes in 3 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[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 %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[x]: Binary eggs must be removed in %prep
[x]: Python eggs must not download any dependencies during the build
     process.
[x]: A package which is used by another package via an egg interface should
     provide egg info.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Packages MUST NOT have dependencies (either build-time or runtime) on
     packages named with the unversioned python- prefix unless no properly
     versioned package exists. Dependencies on Python packages instead MUST
     use names beginning with python2- or python3- as appropriate.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files

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

Generic:
[-]: 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]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[?]: 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]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== 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: targetd-0.8.9-1.fc32.noarch.rpm
          targetd-0.8.9-1.fc32.src.rpm
targetd.noarch: E: explicit-lib-dependency libblockdev-lvm
targetd.noarch: E: wrong-script-interpreter /usr/share/doc/targetd/client /usr/bin/env python
2 packages and 0 specfiles checked; 2 errors, 0 warnings.




Rpmlint (installed packages)
----------------------------
targetd.noarch: E: explicit-lib-dependency libblockdev-lvm
targetd.noarch: W: invalid-url URL: https://github.com/open-iscsi/targetd <urlopen error [Errno -2] Name or service not known>
targetd.noarch: E: env-script-interpreter /usr/share/doc/targetd/client /usr/bin/env python
1 packages and 0 specfiles checked; 2 errors, 1 warnings.



Source checksums
----------------
https://github.com/open-iscsi/targetd/archive/v0.8.9/targetd-0.8.9.tar.gz :
  CHECKSUM(SHA256) this package     : 16aec1cd70ab515eed08b801f434a3f1aa810675f305df61b368772c30af7976
  CHECKSUM(SHA256) upstream package : 16aec1cd70ab515eed08b801f434a3f1aa810675f305df61b368772c30af7976


Requires
--------
targetd (rpmlib, GLIBC filtered):
    /bin/sh
    /usr/bin/python3
    btrfs-progs
    config(targetd)
    libblockdev-lvm
    nfs-utils
    python(abi)
    python3-PyYAML
    python3-blockdev
    python3-rtslib
    python3-setproctitle
    target-restore



Provides
--------
targetd:
    config(targetd)
    python3.8dist(targetd)
    python3dist(targetd)
    targetd



Generated by fedora-review 0.7.3 (44b83c7) last change: 2019-09-18
Command line :/usr/bin/fedora-review -m fedora-rawhide-x86_64 -b 1767918
Buildroot used: fedora-rawhide-{{ target_arch }}
Active plugins: Shell-api, Generic, Python
Disabled plugins: Perl, fonts, Ocaml, Haskell, SugarActivity, Java, C/C++, PHP, R
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 9 Elliott Sales de Andrade 2019-11-21 08:57:43 UTC
(In reply to Tony Asleson from comment #1)
> Will want to create new package releases for F30, F31, & rawhide.

This is something you'll have to ask for in your unretirement ticket.

Comment 10 Tony Asleson 2019-11-22 22:20:32 UTC
 unretire  ticket: https://pagure.io/releng/issue/9049

Comment 11 Elliott Sales de Andrade 2020-01-03 04:58:00 UTC
This seems to have been built. Please tag the bugs in your package updates next time so they are closed.