Use pkg_name for files in share

This commit is contained in:
Honza Horak 2015-01-25 12:07:57 +01:00
parent 740a4a01ca
commit 245cc80c25

View File

@ -1,5 +1,5 @@
# Name of the package without any prefixes # Name of the package without any prefixes
%global pkgname community-mysql %global pkg_name %{name}
%global pkgnamepatch community-mysql %global pkgnamepatch community-mysql
# Regression tests may take a long time (many cores recommended), skip them by # Regression tests may take a long time (many cores recommended), skip them by
@ -10,6 +10,10 @@
# set to 1 to enable # set to 1 to enable
%global with_shared_lib_major_hack 1 %global with_shared_lib_major_hack 1
# In f20+ use unversioned docdirs, otherwise the old versioned one
%global _pkgdocdirname %{pkg_name}%{!?_pkgdocdir:-%{version}}
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{pkg_name}-%{version}}
# Use Full RELRO for all binaries (RHBZ#1092548) # Use Full RELRO for all binaries (RHBZ#1092548)
%global _hardened_build 1 %global _hardened_build 1
@ -41,9 +45,11 @@
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%bcond_without init_systemd %bcond_without init_systemd
%bcond_with init_sysv %bcond_with init_sysv
%global daemondir %{_unitdir}
%else %else
%bcond_with init_systemd %bcond_with init_systemd
%bcond_without init_sysv %bcond_without init_sysv
%global daemondir %{_sysconfdir}/rc.d/init.d
%endif %endif
%global daemon_name mysqld %global daemon_name mysqld
@ -53,6 +59,9 @@
%global logfiledir %{_localstatedir}/log %global logfiledir %{_localstatedir}/log
%global logfile %{logfiledir}/%{daemon_name}.log %global logfile %{logfiledir}/%{daemon_name}.log
# Defining where database data live
%global dbdatadir %{_localstatedir}/lib/mysql
# Home directory of mysql user should be same for all packages that create it # Home directory of mysql user should be same for all packages that create it
%global mysqluserhome /var/lib/mysql %global mysqluserhome /var/lib/mysql
@ -63,7 +72,7 @@
# Make long macros shorter # Make long macros shorter
%global sameevr %{?epoch:%{epoch}:}%{version}-%{release} %global sameevr %{?epoch:%{epoch}:}%{version}-%{release}
Name: %{pkgname} Name: community-mysql
Version: 5.6.22 Version: 5.6.22
Release: 4%{?with_debug:.debug}%{?dist} Release: 4%{?with_debug:.debug}%{?dist}
Summary: MySQL client programs and shared libraries Summary: MySQL client programs and shared libraries
@ -459,24 +468,19 @@ cmake .. \
-DNICE_PROJECT_NAME="MySQL" \ -DNICE_PROJECT_NAME="MySQL" \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DSYSCONFDIR="%{_sysconfdir}" \ -DSYSCONFDIR="%{_sysconfdir}" \
%if 0%{?fedora} >= 20 -DINSTALL_DOCDIR="share/doc/%{_pkgdocdirname}" \
-DINSTALL_DOCDIR="share/doc/%{name}" \ -DINSTALL_DOCREADMEDIR="share/doc/%{_pkgdocdirname}" \
-DINSTALL_DOCREADMEDIR="share/doc/%{name}" \
%else
-DINSTALL_DOCDIR="share/doc/%{name}-%{version}" \
-DINSTALL_DOCREADMEDIR="share/doc/%{name}-%{version}" \
%endif
-DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_INFODIR=share/info \ -DINSTALL_INFODIR=share/info \
-DINSTALL_LIBDIR="%{_lib}/mysql" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \
-DINSTALL_MANDIR=share/man \ -DINSTALL_MANDIR=share/man \
-DINSTALL_MYSQLSHAREDIR=share/%{name} \ -DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \
-DINSTALL_MYSQLTESTDIR=share/mysql-test \ -DINSTALL_MYSQLTESTDIR=share/mysql-test \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
-DINSTALL_SBINDIR=libexec \ -DINSTALL_SBINDIR=libexec \
-DINSTALL_SCRIPTDIR=bin \ -DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SQLBENCHDIR=share \ -DINSTALL_SQLBENCHDIR=share \
-DINSTALL_SUPPORTFILESDIR=share/%{name} \ -DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \
-DMYSQL_DATADIR="%{dbdatadir}" \ -DMYSQL_DATADIR="%{dbdatadir}" \
-DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
-DENABLED_LOCAL_INFILE=ON \ -DENABLED_LOCAL_INFILE=ON \
@ -550,7 +554,7 @@ install -p -m 755 scripts/mysql-wait-ready %{buildroot}%{_libexecdir}/mysql-wait
install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket
install -p -m 755 scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade install -p -m 755 scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade
install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common
install -D -p -m 0644 scripts/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkgname}-server.cnf install -D -p -m 0644 scripts/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
# mysql-test includes one executable that doesn't belong under /usr/share, # mysql-test includes one executable that doesn't belong under /usr/share,
# so move it and provide a symlink # so move it and provide a symlink
@ -561,17 +565,17 @@ ln -s ../../../../../bin/my_safe_process %{buildroot}%{_datadir}/mysql-test/lib/
rm -f %{buildroot}%{_bindir}/mysqlaccess.conf rm -f %{buildroot}%{_bindir}/mysqlaccess.conf
rm -f %{buildroot}%{_bindir}/mysql_embedded rm -f %{buildroot}%{_bindir}/mysql_embedded
rm -f %{buildroot}%{_libdir}/mysql/*.a rm -f %{buildroot}%{_libdir}/mysql/*.a
rm -f %{buildroot}%{_datadir}/%{name}/binary-configure rm -f %{buildroot}%{_datadir}/%{pkg_name}/binary-configure
rm -f %{buildroot}%{_datadir}/%{name}/magic rm -f %{buildroot}%{_datadir}/%{pkg_name}/magic
rm -f %{buildroot}%{_datadir}/%{name}/mysql.server rm -f %{buildroot}%{_datadir}/%{pkg_name}/mysql.server
rm -f %{buildroot}%{_datadir}/%{name}/mysqld_multi.server rm -f %{buildroot}%{_datadir}/%{pkg_name}/mysqld_multi.server
rm -f %{buildroot}%{_mandir}/man1/comp_err.1* rm -f %{buildroot}%{_mandir}/man1/comp_err.1*
rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1* rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1*
rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1* rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1*
# put logrotate script where it needs to be # put logrotate script where it needs to be
mkdir -p %{buildroot}%{logrotateddir} mkdir -p %{buildroot}%{logrotateddir}
mv %{buildroot}%{_datadir}/%{name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name} mv %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name}
chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name} chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name}
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
@ -631,12 +635,12 @@ rm -f %{buildroot}%{_sysconfdir}/my.cnf
%endif %endif
%if %{without common} %if %{without common}
rm -rf %{buildroot}%{_datadir}/%{name}/charsets rm -rf %{buildroot}%{_datadir}/%{pkg_name}/charsets
%endif %endif
%if %{without errmsg} %if %{without errmsg}
rm -f %{buildroot}%{_datadir}/%{name}/errmsg-utf8.txt rm -f %{buildroot}%{_datadir}/%{pkg_name}/errmsg-utf8.txt
rm -rf %{buildroot}%{_datadir}/%{name}/{english,bulgarian,czech,danish,dutch,estonian,\ rm -rf %{buildroot}%{_datadir}/%{pkg_name}/{english,bulgarian,czech,danish,dutch,estonian,\
french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\ french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\
polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian} polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian}
%endif %endif
@ -780,37 +784,37 @@ fi
%doc README COPYING README.mysql-license README.mysql-docs %doc README COPYING README.mysql-license README.mysql-docs
%doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google %doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google
%dir %{_libdir}/mysql %dir %{_libdir}/mysql
%dir %{_datadir}/%{name} %dir %{_datadir}/%{pkg_name}
%{_datadir}/%{name}/charsets %{_datadir}/%{pkg_name}/charsets
%endif %endif
%if %{with errmsg} %if %{with errmsg}
%files errmsg %files errmsg
%{_datadir}/%{name}/errmsg-utf8.txt %{_datadir}/%{pkg_name}/errmsg-utf8.txt
%{_datadir}/%{name}/english %{_datadir}/%{pkg_name}/english
%lang(bg) %{_datadir}/%{name}/bulgarian %lang(bg) %{_datadir}/%{pkg_name}/bulgarian
%lang(cs) %{_datadir}/%{name}/czech %lang(cs) %{_datadir}/%{pkg_name}/czech
%lang(da) %{_datadir}/%{name}/danish %lang(da) %{_datadir}/%{pkg_name}/danish
%lang(nl) %{_datadir}/%{name}/dutch %lang(nl) %{_datadir}/%{pkg_name}/dutch
%lang(et) %{_datadir}/%{name}/estonian %lang(et) %{_datadir}/%{pkg_name}/estonian
%lang(fr) %{_datadir}/%{name}/french %lang(fr) %{_datadir}/%{pkg_name}/french
%lang(de) %{_datadir}/%{name}/german %lang(de) %{_datadir}/%{pkg_name}/german
%lang(el) %{_datadir}/%{name}/greek %lang(el) %{_datadir}/%{pkg_name}/greek
%lang(hu) %{_datadir}/%{name}/hungarian %lang(hu) %{_datadir}/%{pkg_name}/hungarian
%lang(it) %{_datadir}/%{name}/italian %lang(it) %{_datadir}/%{pkg_name}/italian
%lang(ja) %{_datadir}/%{name}/japanese %lang(ja) %{_datadir}/%{pkg_name}/japanese
%lang(ko) %{_datadir}/%{name}/korean %lang(ko) %{_datadir}/%{pkg_name}/korean
%lang(no) %{_datadir}/%{name}/norwegian %lang(no) %{_datadir}/%{pkg_name}/norwegian
%lang(no) %{_datadir}/%{name}/norwegian-ny %lang(no) %{_datadir}/%{pkg_name}/norwegian-ny
%lang(pl) %{_datadir}/%{name}/polish %lang(pl) %{_datadir}/%{pkg_name}/polish
%lang(pt) %{_datadir}/%{name}/portuguese %lang(pt) %{_datadir}/%{pkg_name}/portuguese
%lang(ro) %{_datadir}/%{name}/romanian %lang(ro) %{_datadir}/%{pkg_name}/romanian
%lang(ru) %{_datadir}/%{name}/russian %lang(ru) %{_datadir}/%{pkg_name}/russian
%lang(sr) %{_datadir}/%{name}/serbian %lang(sr) %{_datadir}/%{pkg_name}/serbian
%lang(sk) %{_datadir}/%{name}/slovak %lang(sk) %{_datadir}/%{pkg_name}/slovak
%lang(es) %{_datadir}/%{name}/spanish %lang(es) %{_datadir}/%{pkg_name}/spanish
%lang(sv) %{_datadir}/%{name}/swedish %lang(sv) %{_datadir}/%{pkg_name}/swedish
%lang(uk) %{_datadir}/%{name}/ukrainian %lang(uk) %{_datadir}/%{pkg_name}/ukrainian
%endif %endif
%files server %files server
@ -838,14 +842,14 @@ fi
%{_bindir}/resolve_stack_dump %{_bindir}/resolve_stack_dump
%{_bindir}/resolveip %{_bindir}/resolveip
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkgname}-server.cnf %config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
%{_libexecdir}/mysqld %{_libexecdir}/mysqld
%{_libdir}/mysql/INFO_SRC %{_libdir}/mysql/INFO_SRC
%{_libdir}/mysql/INFO_BIN %{_libdir}/mysql/INFO_BIN
%if %{without common} %if %{without common}
%dir %{_datadir}/%{name} %dir %{_datadir}/%{pkg_name}
%endif %endif
%{_libdir}/mysql/plugin %{_libdir}/mysql/plugin
@ -877,14 +881,14 @@ fi
%{_mandir}/man1/mysql_tzinfo_to_sql.1* %{_mandir}/man1/mysql_tzinfo_to_sql.1*
%{_mandir}/man8/mysqld.8* %{_mandir}/man8/mysqld.8*
%{_datadir}/%{name}/dictionary.txt %{_datadir}/%{pkg_name}/dictionary.txt
%{_datadir}/%{name}/fill_help_tables.sql %{_datadir}/%{pkg_name}/fill_help_tables.sql
%{_datadir}/%{name}/innodb_memcached_config.sql %{_datadir}/%{pkg_name}/innodb_memcached_config.sql
%{_datadir}/%{name}/mysql_security_commands.sql %{_datadir}/%{pkg_name}/mysql_security_commands.sql
%{_datadir}/%{name}/mysql_system_tables.sql %{_datadir}/%{pkg_name}/mysql_system_tables.sql
%{_datadir}/%{name}/mysql_system_tables_data.sql %{_datadir}/%{pkg_name}/mysql_system_tables_data.sql
%{_datadir}/%{name}/mysql_test_data_timezone.sql %{_datadir}/%{pkg_name}/mysql_test_data_timezone.sql
%{_datadir}/%{name}/my-*.cnf %{_datadir}/%{pkg_name}/my-*.cnf
%{daemondir}/%{daemon_name}* %{daemondir}/%{daemon_name}*
%{_libexecdir}/mysql-prepare-db-dir %{_libexecdir}/mysql-prepare-db-dir