Bug 1400486

Summary: FTBFS: problem with %_pkgdocdir
Product: Red Hat Software Collections Reporter: Karel Volný <kvolny>
Component: mariadbAssignee: Michal Schorm <mschorm>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rh-mariadb101CC: databases-maint, mschorm
Target Milestone: alpha   
Target Release: 2.4   
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: 2019-04-07 00:42:46 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: 1400981    
Bug Blocks:    
Attachments:
Description Flags
git patch
none
git patch none

Description Karel Volný 2016-12-01 11:03:56 UTC
Description of problem:
Building of rh-mariadb101-mariadb might fail with different version of redhat-rpm-config.

Version-Release number of selected component (if applicable):
rh-mariadb101-mariadb-10.1.19-6.el7

How reproducible:
always with redhat-rpm-config-9.1.0-72.el7

Steps to Reproduce:
1. # yum -y upgrade redhat-rpm-config
2. $ rpmbuild --rebuild rh-mariadb101-mariadb-10.1.19-6.el7.src.rpm

Actual results:
...
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/test/rpmbuild/BUILDROOT/rh-mariadb101-mariadb-10.1.19-6.el7.x86_64
error: Installed (but unpackaged) file(s) found:
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/COPYING
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/COPYING.LESSER
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/COPYING.thirdparty
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/CREDITS
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/EXCEPTIONS-CLIENT
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/INSTALL-BINARY
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/README
   /opt/rh/rh-mariadb101/root/usr/share/doc/mariadb/MariaDB-server-10.1.19/README-wsrep

Expected results:
(no such errors)

Additional info:
<hhorak> ha, tu je ten rozdil -- my mame v buildrootu redhat-rpm-config-9.1.0-68, ktery dava:
<hhorak> # rpm -E %_pkgdocdir
<hhorak> %_pkgdocdir
<hhorak> ale nejnovejsi je redhat-rpm-config-9.1.0-72, ktery dava
<hhorak> # rpm -E %_pkgdocdir
<hhorak> %{_docdir}/%{name}
<hhorak> cili _pkgdocdir neni definovan v nasem buildrootu (7.2), tim padem se nadefinuje jinak adresar, kam se instaluje dokumentace (-DINSTALL_DOCDIR)
<hhorak> a tim padem je tam rozdil

diff --git a/mariadb.spec b/mariadb.spec
index cbe7c48..fa02c5f 100644
--- a/mariadb.spec
+++ b/mariadb.spec
@@ -1202,7 +1202,7 @@ fi
 %doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google
 %dir %{_libdir}/mysql
 %dir %{_libdir}/mysql/plugin
-%dir %{_datadir}/%{pkg_name}
+%dir %{_datadir}/%{_pkgdocdirname}
 %{_libdir}/mysql/plugin/dialog.so
 %{_libdir}/mysql/plugin/mysql_clear_password.so
 %{_datadir}/%{pkg_name}/charsets

Comment 1 Honza Horak 2016-12-21 11:37:35 UTC
In the end the cause was a bit different, but this helped:

@@ -759,7 +759,7 @@ mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig
 # 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 -r %{buildroot}%{_datadir}/doc/%{_pkgdocdirname}/MariaDB-server-%{version}/
 
 mkdir -p %{buildroot}%{logfiledir}
 chmod 0750 %{buildroot}%{logfiledir}

Removing --force option from rm call should help find the problem easier next time.

Comment 2 Michal Schorm 2017-03-19 22:06:55 UTC
Created attachment 1264655 [details]
git patch

Git patch proposed.

Test build in BREW succeeded.

Comment 3 Michal Schorm 2017-03-19 23:13:42 UTC
Created attachment 1264659 [details]
git patch

Here's an update, that works well for RHEL6 too and use macros.

Comment 5 Michal Schorm 2019-04-07 00:42:46 UTC
The issue seems to be resolved by change to "%{_pkgdocdirname}" macro.

Both rh-mariadb101 and rh-mariadb102 can be built from source.