Bug 1400981

Summary: wrong macro leads to failing build on RHEL-7
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: mariadbAssignee: Honza Horak <hhorak>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dciabrin, hhorak, jakub.dornak, jstanek, mmuzila, mschorm, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 16:55:25 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:
Bug Depends On:    
Bug Blocks: 1400486    

Description Honza Horak 2016-12-02 13:28:02 UTC
Description of problem:

When trying to build the package on RHEL, some files are not deleted as expected, because macros are defined differently on RHEL. It leads to build failures, because there are unpacked files in /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/ directory. Fix should be easy (not tested yet though):

diff --git a/mariadb.spec b/mariadb.spec
index be0493b..6bc94f5 100644
--- a/mariadb.spec
+++ b/mariadb.spec
@@ -657,7 +657,7 @@ install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_co
 # but that's pretty wacko --- see also %%{name}-file-contents.patch)
 install -p -m 644 Docs/INFO_SRC %{buildroot}%{_libdir}/mysql/
 install -p -m 644 Docs/INFO_BIN %{buildroot}%{_libdir}/mysql/
-rm -rf %{buildroot}%{_pkgdocdir}/MariaDB-server-%{version}/
+rm -rf %{buildroot}%{_pkgdocdirname}/MariaDB-server-%{version}/
 
 mkdir -p %{buildroot}%{logfiledir}
 chmod 0750 %{buildroot}%{logfiledir}

Comment 1 Michal Schorm 2016-12-20 02:21:11 UTC
I wasn't able to reproduce this issue.
And I won't fix it - even thought it would be elementary fix - if it seems unnessecary.

---

I took latest content from Fedora Rawhide branch (version 3:10.1.20-1).
I disabled the testsuite, since it should not have any impact on this bug.
I made srpm using "fedpkg srpm", then rebuilt with "rpmbuild --rebuild" on a clean RHEL 7.3 machine.

Rebuild succeeded.

---

To investigate this issue further, I need more info to reproduce it:
 * source (that should be Fedora git branch, packed with "fedpkg srpm")
 * destination (that should be clean RHEL 7.3 machine)
or any other hints that can point me at the right direction.

Comment 2 Pavel Raiskup 2016-12-20 09:05:06 UTC
> And I won't fix it - even thought it would be elementary fix - if it seems
> unnessecary.

I believe this deserves fix, just be patient to find the reproducer.

> -rm -rf %{buildroot}%{_pkgdocdir}/MariaDB-server-%{version}/
> +rm -rf %{buildroot}%{_pkgdocdirname}/MariaDB-server-%{version}/

This looks like typo;  %_pkgdocdir is full /usr/share/../ path while
%_pkgdocdirname is (or could be) '%(basename %_pkgdocdir)'.

Comment 3 Honza Horak 2016-12-20 16:55:25 UTC
I've tested the following patch on the problematic system and it fixed the problem:

http://pkgs.fedoraproject.org/cgit/rpms/mariadb.git/commit/?id=220a57c9a37a0ccf9a321b4335a54dbcc8d2d5f3

So I've just pushed it and I consider this fixed.

Comment 4 Michal Schorm 2016-12-20 17:32:37 UTC
I pushed your change also to F25 and F24 branches, in order to keep those 3 branches consistent.