Bug 2173751 - Review Request: mod_auth_cas - unretire package
Summary: Review Request: mod_auth_cas - unretire package
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL: http://www.ja-sig.org/wiki/display/CA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-27 21:09 UTC by Timothy Hansen
Modified: 2023-09-01 21:51 UTC (History)
3 users (show)

Fixed In Version: mod_auth_cas-1.2-4.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-01 21:51:10 UTC
Type: ---
Embargoed:
carl: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 5574725 to 5575004 (777 bytes, patch)
2023-02-28 00:59 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5575004 to 5603291 (4.00 KB, patch)
2023-03-07 16:11 UTC, Jakub Kadlčík
no flags Details | Diff
The .spec file difference from Copr build 5603291 to 5645444 (1.27 KB, patch)
2023-03-14 23:56 UTC, Jakub Kadlčík
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Github apereo mod_auth_cas pull 209 0 None open Update to PCRE2. 2023-03-04 05:00:00 UTC
Github thansen11/mod_auth_cas_rpm 0 None None None 2023-03-04 05:00:00 UTC
Red Hat Bugzilla 1934268 0 unspecified CLOSED Bump mod_auth_cas to v1.2 and compile for EL 8 2023-04-05 02:47:12 UTC

Description Timothy Hansen 2023-02-27 21:09:41 UTC
Spec URL: https://download.copr.fedorainfracloud.org/results/vwbusguy/mod_auth_cas/fedora-rawhide-x86_64/05574704-mod_auth_cas/mod_auth_cas.spec

SRPM URL: https://download.copr.fedorainfracloud.org/results/vwbusguy/mod_auth_cas/fedora-rawhide-x86_64/05574704-mod_auth_cas/mod_auth_cas-1.2-0.fc39.src.rpm

Description: mod_auth_cas is an Apache 2.2 and 2.4 compliant module that supports the CASv1 and CASv2 protocols

Note:
re-review to unretire package.

Fedora Account System Username:
timhansen46
vwbusguy

Comment 1 Jakub Kadlčík 2023-02-27 21:17:34 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5574725
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2173751-mod_auth_cas/fedora-rawhide-x86_64/05574725-mod_auth_cas/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 6 Jakub Kadlčík 2023-02-28 00:59:15 UTC
Created attachment 1946802 [details]
The .spec file difference from Copr build 5574725 to 5575004

Comment 7 Jakub Kadlčík 2023-02-28 00:59:18 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5575004
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2173751-mod_auth_cas/fedora-rawhide-x86_64/05575004-mod_auth_cas/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 8 Carl George 🤠 2023-02-28 01:38:36 UTC
Thanks for submitting this re-review.  This is a fairly old spec file, so it will need a bit of cleaning up to bring it up to modern Fedora packaging standards.  Don't get discouraged by the following wall of text, it's not a criticism of you, just things we need to work on in the package.

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

The conditional %_httpd_* macro definitions at the start of the spec file are no longer necessary and should be removed.  They're defined by httpd-devel in all current releases of RHEL and Fedora.

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

Since all current RHEL and Fedora release includes httpd 2.4, the sections of the spec that reference httpd 2.2 should probably be removed.

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

Optional suggestion, consider refreshing the summary and description with sections of the upstream README.  The first sentence of the first section (without the period) would work well as the summary, and the first sentence of the introduction section would work well as the description.

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

There are a few deprectated tags and commands that should be removed.

-Group:          System Environment/Daemons

-BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

-rm -rf %{buildroot}

-%clean
-rm -rf %{buildroot}

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_tags_and_sections

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

The license field needs to use the new SPDX identifiers.

-License:        APLv2
+License:        Apache-2.0

https://docs.fedoraproject.org/en-US/legal/license-field/#_basic_policy

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

Since this is a C program, you'll need to have a buildrequires for gcc.

+BuildRequires:  gcc

https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/#_buildrequires_and_requires

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

This has a buildrequires on a deprecated package, pcre-devel.  File an issue with upstream to see if they're interested in porting this program over to pcre2, and leave a comment above the pcre-devel line with a link to that issue.  Technically during reviews depending on deprecated packages isn't allowed, but I think we can waive that since this is a re-review to unretire.

https://docs.fedoraproject.org/en-US/packaging-guidelines/deprecating-packages/

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

I don't see this in the guidelines, but other httpd modules packaged in Fedora tend to require httpd-mmn, not httpd directly.  This will also allow users to install a smaller footprint of httpd with the httpd-core package on Fedora and RHEL9.

-Requires:       httpd
+Requires:       httpd-mmn = %{_httpd_mmn}

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

Instead of hardcoding the version in %prep it would be better to use the version macro, so that way when a new version is released it only has to be updated on one line.  And since the default value for -n is %{name}-%{version}, we can just leave it off entirely.

-%setup -q -n %{name}-1.2
+%setup -q

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

Switch to the modern %make_build and %make_install macros.

-make %{?_smp_mflags}
+%make_build

-make install DESTDIR=%{buildroot} LIBEXECDIR=%{_httpd_moddir}
+%make_install

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_why_the_makeinstall_macro_should_not_be_used

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

Instead of directly using the /var path, consider switching to %{_localstatedir}.

-mkdir -p %{buildroot}/var/cache/httpd/%{name}
+mkdir -p %{buildroot}%{_localstatedir}/cache/httpd/%{name}

-%dir /var/cache/httpd/%{name}
+%dir %{_localstatedir}/cache/httpd/%{name}

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

Setting permissions to root:root is not necessary since that is the default.

-%defattr(-,root,root,-)

For the one directory that needs apache:apache permissions, consider doing it in one line.

-%defattr(-,apache,apache,-)
-%dir %{_localstatedir}/cache/httpd/%{name}
+%dir %attr(-,apache,apache) %{_localstatedir}/cache/httpd/%{name}

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_file_permissions

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

It's best practice to minimize usage of globs in %files.  In this case they are matching one file each, so we can just list the full filename explictly.

-%{_libdir}/httpd/modules/*.so
-%config(noreplace) %{_httpd_confdir}/*.conf
-%config(noreplace) %{_httpd_modconfdir}/*.conf
+%{_libdir}/httpd/modules/mod_auth_cas.so
+%config(noreplace) %{_httpd_confdir}/auth_cas.conf
+%config(noreplace) %{_httpd_modconfdir}/10-auth_cas.conf

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_explicit_lists

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

The latest changelog entry doesn't match the release.

-* Tue Mar 02 2021 Scott Williams <vwbusguy> - 1.2-0
+* Tue Mar 02 2021 Scott Williams <vwbusguy> - 1.2-1

Comment 9 Scott Williams 2023-03-04 03:07:37 UTC
For what it's worth, I'm trying to see if I can submit a patch upstream to support PCRE2.  I'm pretty close to getting it working, but working around kids is hard..

Comment 10 Scott Williams 2023-03-04 03:50:09 UTC
Patch submitted upstream: https://github.com/apereo/mod_auth_cas/pull/209

Comment 12 Jakub Kadlčík 2023-03-07 16:11:12 UTC
Created attachment 1948707 [details]
The .spec file difference from Copr build 5575004 to 5603291

Comment 13 Jakub Kadlčík 2023-03-07 16:11:14 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5603291
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2173751-mod_auth_cas/fedora-rawhide-x86_64/05603291-mod_auth_cas/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 14 Scott Williams 2023-03-07 23:52:39 UTC
Looks like we might be close:

```
[!]: Reviewer should test that the package builds in mock.
[!]: Package should not use obsolete m4 macros
     Note: Some obsoleted macros found, see the attachment.
     See: https://fedorahosted.org/FedoraReview/wiki/AutoTools
```
I assume that the first one is moot since it clearly builds in copr, right?  https://copr.fedorainfracloud.org/coprs/vwbusguy/mod_auth_cas/build/5603228/

The m4 macro thing is something we might need to raise upstream:  https://github.com/search?q=repo%3Aapereo%2Fmod_auth_cas%20AC_PROG_LIBTOOL&type=code

Comment 15 Scott Williams 2023-03-07 23:58:32 UTC
The m4 macro thing looks like it's not going to be as trivial as removing it from the config.ac:

```
src/Makefile.am:6: error: Libtool library used but 'LIBTOOL' is undefined
src/Makefile.am:6:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
src/Makefile.am:6:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
src/Makefile.am:6:   If 'LT_INIT' is in 'configure.ac', make sure
src/Makefile.am:6:   its definition is in aclocal's search path.
autoreconf: error: automake failed with exit status: 1
error: Bad exit status from /var/tmp/rpm-tmp.izxJKX (%build)
```

Comment 16 Scott Williams 2023-03-08 00:06:16 UTC
Ah, well, the answer seems to be right there.  Putting `LT_INIT` where I removed AC_PROD_LIBTOOL seems to compile just fine.  I'll submit another PR upstream.

Comment 17 Scott Williams 2023-03-08 00:29:38 UTC
PR submitted upstream: https://github.com/apereo/mod_auth_cas/pull/210

Comment 18 Carl George 🤠 2023-03-08 05:15:04 UTC
I was just about to comment on that m4 thing.  Thanks for sending that upstream.

We don't necessarily need to wait for upstream to merge that and the pcre2 change.  We can include them in the package as patch files, with comments linking to their upstream PRs.  In fact I recommend doing that.

https://docs.fedoraproject.org/en-US/packaging-guidelines/PatchUpstreamStatus/

One other small tweak that is needed, I can see the httpd-mmn requirement was added, but it's missing the %{_httpd_mmn} qualifier.  This is the equivalent of a library soname requirement.  It ensures that the module depends on a compatible version of httpd with which it was built with.  I was able to locate an old packaging guideline draft about this, but it appears it never made it out of draft status.  It's outdated as it says that you need to define _httpd_mmn, and that's defined by default.  But we should still follow the requires part.

-Requires:       httpd-mmn
+Requires:       httpd-mmn = %{_httpd_mmn}

https://fedoraproject.org/wiki/PackagingDrafts/ApacheHTTPModules#Run-Time_Dependencies

Comment 19 Scott Williams 2023-03-08 16:42:14 UTC
"We don't necessarily need to wait for upstream to merge that and the pcre2 change.  We can include them in the package as patch files, with comments linking to their upstream PRs.  In fact I recommend doing that."

The m4 one should be trivially easy.  The pcre2 PR was submitted against HEAD, so I might create a branch against current release tag and see if I can cherry-pick the commits into it to make the patch.  It's been over a decade since I've rolled a significant custom .patch and last time I used regular old diff, so this'll give me a chance to try out using `git format-patch`. 

Tim, how about I create the patches and you can plug them into the spec with the other change?  I'll submit the patch files in a PR against your repo.

Comment 20 Scott Williams 2023-03-08 17:10:10 UTC
Patches submitted to Tim's repo: https://github.com/thansen11/mod_auth_cas_rpm/pull/3/files

Comment 22 Jakub Kadlčík 2023-03-14 23:56:04 UTC
Created attachment 1950826 [details]
The .spec file difference from Copr build 5603291 to 5645444

Comment 23 Jakub Kadlčík 2023-03-14 23:56:08 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/5645444
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2173751-mod_auth_cas/fedora-rawhide-x86_64/05645444-mod_auth_cas/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 24 Scott Williams 2023-03-15 00:10:57 UTC
Hey @carl , I'm not sure what we're missing here.  Tim's spec update includes the patch that fixes the line.  Do we need to manually add `patch` to the %prep section since they don't appear to be applied automatically when the source in unpacked now here?  It doesn't seem like this should be necessary given the examples here: https://rpm-packaging-guide.github.io/#working-with-spec-files but that line is clearly replaced in Patch0 - https://github.com/thansen11/mod_auth_cas_rpm/blob/main/0001-Patch-obsolete-autotools-m4-macro.patch

Comment 25 Scott Williams 2023-03-15 00:11:45 UTC
I'm also noticing that the spec file still references pcre-devel and not pcre2-devel, which seems to indicate that neither patch was applied.

Comment 26 Carl George 🤠 2023-03-15 03:33:35 UTC
Indeed, in the current state the patches aren't being applied.  You can do this with manually with the %patchX macro, but I recommend doing it automatically with %autosetup instead.  GitHub and git default to creating patches with "a" and "b" prefixes on the filenames, so you'll need to strip those out by passing the `-p 1` flag.

 %prep
-%setup -q
+%autosetup -p 1


The last update introduced some tab characters, make sure to switch those to spaces to avoid this rpmlint warning.

mod_auth_cas.spec:12: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 12)

Comment 29 Scott Williams 2023-03-15 17:42:41 UTC
Looks like the review service is failing to trigger now, so you can find the copr build against this change here: https://copr.fedorainfracloud.org/coprs/vwbusguy/mod_auth_cas/build/5646180/

Comment 31 Carl George 🤠 2023-03-16 04:35:19 UTC
Great work guys, package APPROVED.


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

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


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/mod_auth_cas
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Naming/#_conflicting_package_names


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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Development (unversioned) .so files in -devel subpackage, if present.
     Note: Unversioned so-files in private %_libdir subdirectory (see
     attachment). Verify they are not in ld path.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

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.
[-]: 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]: License field in the package spec file matches the actual license.
[x]: License file installed when any subpackage combination is installed.
[x]: %build honors applicable compiler flags or justifies otherwise.
[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.
[-]: 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.
[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]: Useful -debuginfo package or justification otherwise.
[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 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: No rpmlint messages.
[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

===== 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]: 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.
[-]: 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.
[-]: %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]: Fully versioned dependency in subpackages if applicable.
[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 debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Package should not use obsolete m4 macros
[x]: Spec file according to URL is the same as in SRPM.


You can proceed with the unretirement process now.

https://docs.fedoraproject.org/en-US/package-maintainers/Package_Retirement_Process/#claiming


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