Bug 888262

Summary: Please provide convenient macro for tapset dir
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dsmith, fche, jistone, lberk, mcermak, mjw, scox, sergey.avseyev, wcohen
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 16:51:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1584705    

Description Vít Ondruch 2012-12-18 12:16:19 UTC
It would be nice if SystemTap package could provide %{tapset_dir} convenient macro to allow other packages to easily package .stp files. The [1] guideline could followed to accomplish this. Thank you.


[1] https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros

Comment 1 Fedora End Of Life 2013-04-03 14:53:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 2 Fedora End Of Life 2015-01-09 17:32:26 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Vít Ondruch 2015-01-29 16:14:38 UTC
Or pkgconfig might provide such information at least ...

Comment 4 Frank Ch. Eigler 2018-05-29 16:51:41 UTC
commit e914597c18f918668cf0381f59d7c8117b17688d adds %_systemtap_tapsetdir

Comment 5 Martin Cermak 2018-06-01 11:00:30 UTC
(In reply to Frank Ch. Eigler from comment #4)
> commit e914597c18f918668cf0381f59d7c8117b17688d 

No workie with rhel7 and older, where %{_rpmmacrodir} evals to empty string. `make rpm` then ends up with:

=======
RPM build errors:
    File must begin with "/": %{_rpmmacrodir}/macros.systemtap
make: *** [rpm] Error 1
=======

Tested following possible fix on rhel-6+ and Fedora-28:

=======
  diff --git a/systemtap.spec b/systemtap.spec
index 4392b1b..61c09bb 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -73,6 +73,12 @@
     %define dracutbindir %{_bindir}
 %endif
 
+%if 0%{?rhel} == 6
+    %{!?_rpmmacrodir: %define _rpmmacrodir /etc/rpm/}
+%else
+    %{!?_rpmmacrodir: %define _rpmmacrodir %{_rpmconfigdir}/macros.d}
+%endif
+
 # To avoid testsuite/*/*.stp has shebang which doesn't start with '/'
 %undefine __brp_mangle_shebangs
=======

This by default
- (always allows overriding _rpmmacrodir with a custom value)
- on rhel6 does %define _rpmmacrodir /etc/rpm/
- on rhel7 does %define _rpmmacrodir %{_rpmconfigdir}/macros.d (evals to /usr/lib/rpm/macros.d)
- on fedora does nothing

With this, %{_systemtap_tapsetdir} gets defined on rhel6+ and fedora as expected.

Comment 6 Vít Ondruch 2018-06-01 11:53:13 UTC
(In reply to Martin Cermak from comment #5)
> =======
>   diff --git a/systemtap.spec b/systemtap.spec
> index 4392b1b..61c09bb 100644
> --- a/systemtap.spec
> +++ b/systemtap.spec
> @@ -73,6 +73,12 @@
>      %define dracutbindir %{_bindir}
>  %endif
>  
> +%if 0%{?rhel} == 6
> +    %{!?_rpmmacrodir: %define _rpmmacrodir /etc/rpm/}
> +%else
> +    %{!?_rpmmacrodir: %define _rpmmacrodir %{_rpmconfigdir}/macros.d}
> +%endif
> +
>  # To avoid testsuite/*/*.stp has shebang which doesn't start with '/'
>  %undefine __brp_mangle_shebangs
> =======

The RHEL condition is useless IMO. Just test the existence of macros and act upon it.

Comment 7 Martin Cermak 2018-06-01 12:38:27 UTC
Problem is that on rhel-6, %{_rpmconfigdir}/macros.d evals to /usr/lib/rpm/macros.d, but rpm doesn't actually use it.  Instead, on rhel6, rpm loads it's macros from /etc/rpm/.  So rhel-6 is sort of a special case, I'd say.

Comment 8 Vít Ondruch 2018-06-01 12:59:55 UTC
(In reply to Martin Cermak from comment #7)
Ah, I did not know that. In that case it seems reasonable ...

Comment 9 Martin Cermak 2018-06-01 13:15:23 UTC
Fixed in commit 9297d41f049795323066314d70b82c98a750cb8c .