Bug 2097925 - Review Request: cepces - Certificate Enrollment through CEP/CES
Summary: Review Request: cepces - Certificate Enrollment through CEP/CES
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-16 23:57 UTC by Ding-Yi Chen
Modified: 2022-08-14 03:00 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-08-14 02:19:39 UTC
Type: ---
Embargoed:
asn: fedora-review+


Attachments (Terms of Use)

Description Ding-Yi Chen 2022-06-16 23:57:46 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-x86_64/04539096-cepces/cepces.spec
SRPM URL: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-x86_64/04539096-cepces/cepces-0.3.5-1.fc37.src.rpm
Description: cepces is an application for enrolling certificates through CEP and CES.
It requires certmonger to operate.

Fedora Account System Username: dchen

Comment 1 Andreas Schneider 2022-06-20 13:10:06 UTC
I think

BuildRequires:  python%{python3_pkgversion}-setuptools
...

should be:

BuildRequires:  python3dist(setuptools)
...

======================================================

I would prefer if you use:

install -d -m 0755 directory

instead of -p in the install command

also mkdir -p should be install -d -m 0755 ..

======================================================

# Install configuration files.
install -d %{buildroot}%{_sysconfdir}/%{name}
install -p -m 644 conf/cepces.conf.dist \
  %{buildroot}%{_sysconfdir}/%{name}/cepces.conf
install -p -m 644 conf/logging.conf.dist \
  %{buildroot}%{_sysconfdir}/%{name}/logging.conf

install -d %{buildroot}%{_libexecdir}/certmonger
install -p -m 755 bin/%{name}-submit \
  %{buildroot}%{_libexecdir}/certmonger/%{name}-submit

# Remove unused executables and configuration files.
%{__rm} -rfv %{buildroot}/usr/local/etc
%{__rm} -rfv %{buildroot}/usr/local/libexec/certmonger


I would prefer if you fix setup.py instead installing and removing those scripts and configs.

Comment 2 Ding-Yi Chen 2022-06-22 07:54:58 UTC
Addressed:


  BuildRequires:  python%{python3_pkgversion}-setuptools
  ...

  should be:

  BuildRequires:  python3dist(setuptools)



===============================================================

> I would prefer if you use:
> install -d -m 0755 directory
> instead of -p in the install command

install -d treat the rest of the arguments as directories

So I cannot replace -p with "-d -m 0755" with files

============================================================

Addressed:
   also mkdir -p should be install -d -m 0755 ..


============================================================

> I would prefer if you fix setup.py instead installing and removing those scripts and configs.

data_files in setup.py does not seem to be capable of rename the files

Thus I replace it with

~~~
# Rename configuration files.
mv %{buildroot}%{_sysconfdir}/%{name}/cepces.conf{.dist,}
mv %{buildroot}%{_sysconfdir}/%{name}/logging.conf{.dist,}
~~~

SPEC: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-aarch64/04554093-cepces/cepces.spec
SRPM: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-aarch64/04554093-cepces/cepces-0.3.5-2.fc37.src.rpm

Comment 3 Andreas Schneider 2022-06-22 08:24:59 UTC
It should be two lines:

install -d -m 0755 path/to/dir

install -m 0644 source dest
install -m 0644 source dest

This way you set correct permissions to the directory and also files.

Comment 4 Rob Crittenden 2022-06-22 15:05:53 UTC
There are SELinux macros to simply the pre/post scripts. I'm not sure if you're future-proofing by support multiple variants but generally this is just targeted. I'm assuming single value below.

This is merely a suggestion.

%pre selinux
%selinux_relabel_pre -s %{selinuxvariants}

%post selinux
semodule -d cepces &> /dev/null || true;
%selinux_modules_install -s %{selinuxvariants} %{_datadir}/selinux/packages/%{selinuxvariants}/%{modulename}.pp.bz2

%postun selinux
if [ $1 -eq 0 ]; then
    %selinux_modules_uninstall -s %{selinuxvariants} %{modulename}
    semodule -e cepces &> /dev/null || true;
fi

%posttrans selinux
%selinux_relabel_post -s %{selinuxvariants}

Comment 5 Ding-Yi Chen 2022-06-23 06:56:34 UTC
(In reply to Andreas Schneider from comment #3)
> It should be two lines:
> 
> install -d -m 0755 path/to/dir
> 
> install -m 0644 source dest
> install -m 0644 source dest
> 
> This way you set correct permissions to the directory and also files.

Um, currently  it looks like
~~~
for SELINUXVARIANT in %{selinux_variants}; do
  install -d %{buildroot}%{_datadir}/selinux/${SELINUXVARIANT}
  install -p -m 644 selinux/%{name}-${SELINUXVARIANT}.pp \
    %{buildroot}%{_datadir}/selinux/${SELINUXVARIANT}/%{name}.pp

  echo %{_datadir}/selinux/${SELINUXVARIANT}/%{name}.pp >> \
    selinux-files.txt
done

# Rename configuration files.
mv %{buildroot}%{_sysconfdir}/%{name}/cepces.conf{.dist,} 
mv %{buildroot}%{_sysconfdir}/%{name}/logging.conf{.dist,} 
~~~


Should I change it to:
~~~
for SELINUXVARIANT in %{selinux_variants}; do
  install -d -m 0755 %{buildroot}%{_datadir}/selinux/${SELINUXVARIANT}
  install -m 644 selinux/%{name}-${SELINUXVARIANT}.pp \
    %{buildroot}%{_datadir}/selinux/${SELINUXVARIANT}/%{name}.pp

  echo %{_datadir}/selinux/${SELINUXVARIANT}/%{name}.pp >> \
    selinux-files.txt
done

# Rename configuration files.
install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/
install -m 644  %{buildroot}%{_sysconfdir}/%{name}/cepces.conf{.dist,}
rm -f %{buildroot}%{_sysconfdir}/%{name}/cepces.conf.dist
install -m 644  %{buildroot}%{_sysconfdir}/%{name}/logging.conf{.dist,} 
rm -f %{buildroot}%{_sysconfdir}/%{name}/logging.conf.dist
~~~

Or you mean I should rename *.conf.dist to *.conf; change setup.py to use *.conf instead of *.conf.dist
and we don't need to rename them in installation stage?

Comment 6 Ding-Yi Chen 2022-06-23 07:25:47 UTC

(In reply to Rob Crittenden from comment #4)
> There are SELinux macros to simply the pre/post scripts. I'm not sure if
> you're future-proofing by support multiple variants but generally this is
> just targeted. I'm assuming single value below.
> 
> This is merely a suggestion.

Actually that is what upstream did.
So far "target" is the only variant defined in SPEC.

I have made a pull request with them. 
https://github.com/openSUSE/cepces/pull/17
So I don't want to drive to far from their SPEC.

That said, I will apply your suggestion, hopely openSUSE also have the same macros. :-)

Comment 7 Andreas Schneider 2022-06-23 07:45:51 UTC
# Rename configuration files.
install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/
install -m 644  %{buildroot}%{_sysconfdir}/%{name}/cepces.conf{.dist,}
rm -f %{buildroot}%{_sysconfdir}/%{name}/cepces.conf.dist
install -m 644  %{buildroot}%{_sysconfdir}/%{name}/logging.conf{.dist,} 
rm -f %{buildroot}%{_sysconfdir}/%{name}/logging.conf.dist


This looks fine. I would patch the setup.py to drop configs from data_files and only install the libexec part in there.

Comment 8 Andreas Schneider 2022-06-23 17:19:39 UTC
We might want to wait for https://github.com/openSUSE/cepces/pull/18 being merged.

Comment 9 Ding-Yi Chen 2022-06-27 01:37:49 UTC
@andreas Packaging wise, I can just add pull request 18, given we already have 16, 17.

Comment 10 Andreas Schneider 2022-06-27 04:54:40 UTC
The problem with PR 18 is that it is untested. I don't have the infrastructure to test it, this is something David needs to do. He said he will test it early July.

Comment 13 Andreas Schneider 2022-07-11 14:54:05 UTC
The LICENSE file need to be install when any subpackage combination is installed.

The "certmonger" subpackage needs:

Requires: python%{python3_pkgversion}-%{name}

And we need to move the license file to "python%{python3_pkgversion}-%{name}". Then the above is fulfilled.

Comment 14 Andreas Schneider 2022-07-11 14:56:29 UTC
The %defattr can be removed, this is the default since rpm 4.4

Comment 16 Andreas Schneider 2022-07-21 12:01:21 UTC
The review tool complains that %{?_smp_mflags} is not used. make is called for selinux, maybe you can turn it on there.

Also the requires should be in the form:

Requires: %{name}%{?_isa} = %{version}-%{release}

This

  Requires:       python%{python3_pkgversion}-%{name} == %{version}
  Requires:       %{name}-certmonger == %{version}
  Requires:       %{name}-selinux == %{version}

should be:

  Requires:       python%{python3_pkgversion}-%{name}%{?_isa} = %{version}-%{release}
  Requires:       %{name}-certmonger%{?_isa} = %{version}-%{release}
  Requires:       %{name}-selinux%{?_isa} = %{version}-%{release}

Note that there is a = to much.

Same for the certmonger subpackge. It should use

  Requires:       python%{python3_pkgversion}-%{name} == %{version}


I think that should be the last fixes. Thanks for your patience :-)

Comment 17 Ding-Yi Chen 2022-07-24 11:03:40 UTC
SPEC: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-x86_64/04683125-cepces/cepces.spec
SRPM: https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-x86_64/04683125-cepces/cepces-0.3.5-6.fc37.noarch.rpm


Changed
- Review comment #16 addressed
  - Except %{?_isa}. Which does not work with noarch packages.
    And the dnf install <packages> would show
    ~~~
    LANG=C dnf localinstall *.rpm
    Last metadata expiration check: 0:49:24 ago on Sun Jul 24 16:39:22 2022.
    Error: 
     Problem 1: conflicting requests
      - nothing provides python3-cepces(x86-64) = 0.3.5-6.el9 needed by cepces-0.3.5-6.el9.noarch
     Problem 2: conflicting requests
      - nothing provides cepces(x86-64) = 0.3.5-6.el9 needed by cepces-certmonger-0.3.5-6.el9.noarch
    Problem 3: conflicting requests
     - nothing provides cepces(x86-64) = 0.3.5-6.el9 needed by cepces-selinux-0.3.5-6.el9.noarch
    (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
    ~~~

- It make more sense that -selinux and -certmonger depends on main package,
  Not the other round
- Recommends: logrotate
- Supplements: -selinux, -certmonger

Comment 18 Andreas Schneider 2022-07-28 05:15:29 UTC
It looks fine for me now. The spec file does not match the one in the srpm. Can you please fix it so I can finish the review?

Comment 19 Ding-Yi Chen 2022-07-28 10:14:02 UTC
My bad, the previous one was main package (noarch)


The real SRPM
https://download.copr.fedorainfracloud.org/results/dchen/to-be-reviewed/fedora-rawhide-x86_64/04683125-cepces/cepces-0.3.5-6.fc37.src.rpm

Comment 21 Andreas Schneider 2022-08-03 13:06:13 UTC
Package Review
==============

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



===== 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: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* GNU General Public
     License, Version 3", "*No copyright* GNU General Public License v3.0
     or later", "GNU General Public License v3.0 or later". 13 files have
     unknown license. Detailed output of licensecheck in
     /home/asn/workspace/package/fedora/REVIEW/2097925-cepces/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/share/selinux/packages/targeted
[x]: Package must own all directories that it creates.
     Note: Directories without known owners:
     /usr/share/selinux/packages/targeted
[x]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by: /etc/logrotate.d(kdm-
     settings, retrace-server, macromilter, openqa, ppp, below, psad, sssd-
     common, wpa_supplicant, copr-dist-git, logrotate, bes,
     yast2-filesystem, proftpd, samba-common, lightdm, gerbera, ntpsec)
[-]: 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.
[-]: Development files must be in a -devel package
[-]: 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.
[x]: 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.
[-]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 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 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 does not use a name that already exists.
[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]: 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
[x]: Binary eggs must be removed in %prep

===== 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).
[x]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-cepces
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[x]: Scriptlets must be sane, if used.
[x]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %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]: Uses parallel make %{?_smp_mflags} macro.
[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.


Source checksums
----------------
https://github.com/openSUSE/cepces/archive/v0.3.5/cepces-0.3.5.tar.gz :
  CHECKSUM(SHA256) this package     : 51d992c5873a48acd4473c61bb88ff7001b4e2d56291bae70f695fb9abd9582e
  CHECKSUM(SHA256) upstream package : 51d992c5873a48acd4473c61bb88ff7001b4e2d56291bae70f695fb9abd9582e


Requires
--------
cepces (rpmlib, GLIBC filtered):
    config(cepces)
    python3-cepces

python3-cepces (rpmlib, GLIBC filtered):
    python(abi)
    python3dist(cryptography)
    python3dist(gssapi)
    python3dist(requests)
    python3dist(requests-gssapi)
    python3dist(setuptools)

cepces-certmonger (rpmlib, GLIBC filtered):
    /bin/sh
    /usr/bin/python3
    cepces
    certmonger

cepces-selinux (rpmlib, GLIBC filtered):
    /bin/sh
    cepces
    selinux-policy
    selinux-policy-targeted

Provides
--------
cepces:
    cepces
    config(cepces)

python3-cepces:
    python-cepces
    python3-cepces
    python3.11-cepces
    python3.11dist(cepces)
    python3dist(cepces)

cepces-certmonger:
    cepces-certmonger

cepces-selinux:
    cepces-selinux

Comment 22 Ding-Yi Chen 2022-08-04 09:15:44 UTC
% fedpkg request-repo cepces 2097925
https://pagure.io/releng/fedora-scm-requests/issue/46229

% fedpkg request-branch --repo cepces f36    
https://pagure.io/releng/fedora-scm-requests/issue/46230

% fedpkg request-branch --repo cepces f35
https://pagure.io/releng/fedora-scm-requests/issue/46231

% fedpkg request-branch --repo cepces epel9
https://pagure.io/releng/fedora-scm-requests/issue/46232

% fedpkg request-branch --repo cepces epel8
https://pagure.io/releng/fedora-scm-requests/issue/46233

Comment 23 Gwyn Ciesla 2022-08-04 13:39:16 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/cepces

Comment 25 Fedora Update System 2022-08-05 05:23:18 UTC
FEDORA-2022-ae2e48b19f has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-ae2e48b19f

Comment 26 Fedora Update System 2022-08-05 05:23:19 UTC
FEDORA-EPEL-2022-fd907b5676 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-fd907b5676

Comment 27 Fedora Update System 2022-08-05 05:23:19 UTC
FEDORA-EPEL-2022-c44783070f has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-c44783070f

Comment 28 Fedora Update System 2022-08-05 05:23:20 UTC
FEDORA-2022-df0978b118 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-df0978b118

Comment 31 Fedora Update System 2022-08-06 02:32:59 UTC
FEDORA-2022-df0978b118 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-df0978b118 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-df0978b118

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 32 Fedora Update System 2022-08-06 02:50:35 UTC
FEDORA-2022-ae2e48b19f has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-ae2e48b19f \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-ae2e48b19f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 33 Fedora Update System 2022-08-06 02:55:32 UTC
FEDORA-EPEL-2022-c44783070f has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-c44783070f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 34 Fedora Update System 2022-08-07 00:45:27 UTC
FEDORA-EPEL-2022-fd907b5676 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-fd907b5676

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 35 Fedora Update System 2022-08-14 02:19:39 UTC
FEDORA-EPEL-2022-fd907b5676 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 36 Fedora Update System 2022-08-14 02:36:38 UTC
FEDORA-2022-ae2e48b19f has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 37 Fedora Update System 2022-08-14 02:41:28 UTC
FEDORA-EPEL-2022-c44783070f has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 38 Fedora Update System 2022-08-14 03:00:55 UTC
FEDORA-2022-df0978b118 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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