#32 fix path to example instance.conf in httpd.service man page
Opened 11 months ago by tmz. Modified 11 months ago
rpms/ tmz/httpd rawhide  into  rawhide

file modified
+15 -6
@@ -24,7 +24,7 @@ 

  Summary: Apache HTTP Server

  Name: httpd

  Version: 2.4.57

- Release: 1%{?dist}

+ Release: 2%{?dist}

  URL: https://httpd.apache.org/

  Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2

  Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
@@ -618,6 +618,12 @@ 

  # Fix content dir in sysusers file and install it

  install -p -D -m 0644 %{SOURCE49} %{buildroot}%{_sysusersdir}/httpd.conf

  

+ # Install documentation in %%{_pkgdocdir} (license files use %%license)

+ mkdir -p %{buildroot}%{_pkgdocdir}

+ install -p -m 0664 ABOUT_APACHE README CHANGES VERSIONING \

+     docs/conf/extra/*.conf instance.conf server-status.conf \

+     %{buildroot}%{_pkgdocdir}

+ 

  # Remove unpackaged files

  rm -vf \

        $RPM_BUILD_ROOT%{_libdir}/*.exp \
@@ -711,10 +717,10 @@ 

  %{_unitdir}/*.socket

  

  %files core

- %doc ABOUT_APACHE README CHANGES LICENSE VERSIONING NOTICE

- %doc docs/conf/extra/*.conf

- %doc instance.conf server-status.conf

- 

+ %license LICENSE NOTICE

+ # NOTE: don't use %%doc, add files to %%{_pkgdocdir} in %%install

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

+ %{_pkgdocdir}/

  %{_sysconfdir}/httpd/modules

  %{_sysconfdir}/httpd/logs

  %{_sysconfdir}/httpd/state
@@ -802,7 +808,7 @@ 

  %files tools

  %{_bindir}/*

  %{_mandir}/man1/*

- %doc LICENSE NOTICE

+ %license LICENSE NOTICE

  %exclude %{_bindir}/apxs

  %exclude %{_mandir}/man1/apxs.1*

  
@@ -850,6 +856,9 @@ 

  %{_rpmconfigdir}/macros.d/macros.httpd

  

  %changelog

+ * Sat Jun 17 2023 Todd Zullinger <tmz@pobox.com> - 2.4.57-2

+ - put httpd-core docs in %%{docdir}/httpd

+ 

  * Tue Apr 11 2023 Luboš Uhliarik <luhliari@redhat.com> - 2.4.57-1

  - new version 2.4.57

  

When httpd-core was created in d9ddc5d (Try to minimize httpd
dependencies, 2022-03-30), the path to the example instance.conf file in
httpd.service(1) was not updated.  Fix the path so readers of the man
page can find it on the first try.

I noticed this on a RHEL system and thought it would be nice to have fixed eventually. It's debatable whether the fix should be to change the package docdir for httpd-core to /usr/share/doc/httpd. If that seems like a better plan, I can try to update the PR to do that. I chose the least invasive fix here.

Hey Todd,

Thanks for your PR. From my point of view, it would be better to change docdir for httpd-core to /usr/share/doc/httpd.

Cool, thanks Lubos! That sounds good to me as well. I'll prepare an update which adjusts that (hopefully today, while I'm thinking about it).

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/6c715a030373414eb47527c1a7be85a1

rebased onto f9db028

11 months ago

Hi Lubos,

I thought there might be a way to just adjust a macro and have the files placed in the right place while still using %doc in the %files core section, but I wasn't able to find or remember it.

I added a note to put files in %{_pkgdocdir} rather than using %doc to (hopefully) make it easier to avoid mixing the two which can cause problems and violates the packaging guidelines.

Let me know what you think and if you have any other suggestions.

While I was doing this, I wondered if it might be time to move the LICENSE and NOTICE files from %doc to %license? I tested this locally:

diff --git i/httpd.spec w/httpd.spec
index 0564ec3..857b7b9 100644
--- i/httpd.spec
+++ w/httpd.spec
@@ -618,9 +618,9 @@ chmod 755 $RPM_BUILD_ROOT%{_libdir}/httpd/build/vendor-apxs
 # Fix content dir in sysusers file and install it
 install -p -D -m 0644 %{SOURCE49} %{buildroot}%{_sysusersdir}/httpd.conf

-# Install documentation in %%{_pkgdocdir}
+# Install documentation in %%{_pkgdocdir} (license files use %%license)
 mkdir -p %{buildroot}%{_pkgdocdir}
-install -p -m 0664 ABOUT_APACHE README CHANGES LICENSE VERSIONING NOTICE \
+install -p -m 0664 ABOUT_APACHE README CHANGES VERSIONING \
     docs/conf/extra/*.conf instance.conf server-status.conf \
     %{buildroot}%{_pkgdocdir}

@@ -717,6 +717,7 @@ exit $rv
 %{_unitdir}/*.socket

 %files core
+%license LICENSE NOTICE
 # NOTE: don't use %%doc, add files to %%{_pkgdocdir} in %%install
 # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_documentation
 %{_pkgdocdir}/
@@ -807,7 +808,7 @@ exit $rv
 %files tools
 %{_bindir}/*
 %{_mandir}/man1/*
-%doc LICENSE NOTICE
+%license LICENSE NOTICE
 %exclude %{_bindir}/apxs
 %exclude %{_mandir}/man1/apxs.1*

It does put those files in /usr/share/licenses/httpd-core/ but I think that's okay for licenses, particularly because the guidelines require that the httpd-tools license files are shipped in that subpackage already.

Thanks.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/b7dee608cdfc4ea8bade335baed4a362

Hi Todd,

I think that %license macro for LICENSE and NOTICE files is better.

Regarding %doc macros - I also don't see any other option how to have it in "httpd" directory without moving to httpd package or using %{_pkgdocdir} variable instead of %doc macro. So yeah, I think using %{_pkgdocdir} is only one option here.

rebased onto 4eef61c

11 months ago

Thanks Lubos. I squashed in the %license change. Let me know how it looks.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/a518b4f12e86436db455fae1da7d09f6

Metadata