Renaming macro names to be more descriptive

This commit is contained in:
Lukas Javorsky 2024-02-07 11:51:00 +00:00
parent 178aa67c03
commit de06e0146b

View File

@ -1,7 +1,7 @@
# Name of the package without any prefixes
%global pkg_name mysql
%global majorname mysql
%global package_version 8.0.36
%define pkg_version %(echo %{package_version} | cut -d'.' -f1-2 )
%define majorversion %(echo %{package_version} | cut -d'.' -f1-2 )
%global pkgnamepatch mysql
@ -82,7 +82,7 @@
# Make long macros shorter
%global sameevr %{?epoch:%{epoch}:}%{version}-%{release}
Name: %{pkg_name}%{pkg_version}
Name: %{majorname}%{majorversion}
Version: %{package_version}
Release: 3%{?with_debug:.debug}%{?dist}
Summary: MySQL client programs and shared libraries
@ -138,7 +138,7 @@ Patch113: boost-1.76.0-fix_multiprecision_issue_419-ppc64le.patch
# This macro is used for package/sub-package names in the entire specfile
%if %?mysql_default
%global pkgname %{pkg_name}
%global pkgname %{majorname}
%package -n %{pkgname}
Summary: MySQL client programs and shared libraries
%else
@ -231,15 +231,15 @@ Provides: bundled(boost) = %{boost_bundled_version}
%{?with_obsoletes_community_mysql:Obsoletes: community-mysql <= %obsolete_community_mysql_version}
%define conflict_with_other_streams() %{expand:\
Provides: %{pkg_name}%{?1:-%{1}}-any\
Conflicts: %{pkg_name}%{?1:-%{1}}-any\
Provides: %{majorname}%{?1:-%{1}}-any\
Conflicts: %{majorname}%{?1:-%{1}}-any\
}
# Provide also mysqlX.X if default
%if %?mysql_default
%define mysqlX_if_default() %{expand:\
Provides: mysql%{pkg_version}%{?1:-%{1}} = %{sameevr}\
Provides: mysql%{pkg_version}%{?1:-%{1}}%{?_isa} = %{sameevr}\
Provides: mysql%{majorversion}%{?1:-%{1}} = %{sameevr}\
Provides: mysql%{majorversion}%{?1:-%{1}}%{?_isa} = %{sameevr}\
}
%else
%define mysqlX_if_default() %{nil}
@ -512,19 +512,19 @@ cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DSYSCONFDIR="%{_sysconfdir}" \
-DSYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \
-DINSTALL_DOCDIR="share/doc/%{pkg_name}" \
-DINSTALL_DOCREADMEDIR="share/doc/%{pkg_name}" \
-DINSTALL_DOCDIR="share/doc/%{majorname}" \
-DINSTALL_DOCREADMEDIR="share/doc/%{majorname}" \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_INFODIR=share/info \
-DINSTALL_LIBEXECDIR=libexec \
-DINSTALL_LIBDIR="%{_lib}/mysql" \
-DRPATH_LIBDIR="%{_libdir}" \
-DINSTALL_MANDIR=share/man \
-DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \
-DINSTALL_MYSQLSHAREDIR=share/%{majorname} \
-DINSTALL_MYSQLTESTDIR=share/mysql-test \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
-DINSTALL_SBINDIR=bin \
-DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \
-DINSTALL_SUPPORTFILESDIR=share/%{majorname} \
-DMYSQL_DATADIR="%{dbdatadir}" \
-DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
-DENABLED_LOCAL_INFILE=ON \
@ -603,7 +603,7 @@ install -D -p -m 755 %{_vpath_builddir}/scripts/mysql-prepare-db-dir %{buildroot
install -p -m 755 %{_vpath_builddir}/scripts/mysql-wait-stop %{buildroot}%{_libexecdir}/mysql-wait-stop
install -p -m 755 %{_vpath_builddir}/scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket
install -p -m 644 %{_vpath_builddir}/scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common
install -D -p -m 0644 %{_vpath_builddir}/scripts/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
install -D -p -m 0644 %{_vpath_builddir}/scripts/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{majorname}-server.cnf
rm %{buildroot}%{_libdir}/mysql/*.a
rm %{buildroot}%{_mandir}/man1/comp_err.1*
@ -611,7 +611,7 @@ rm %{buildroot}%{_mandir}/man1/comp_err.1*
# Put logrotate script where it needs to be
mkdir -p %{buildroot}%{logrotateddir}
# Remove the wrong file
rm %{buildroot}%{_datadir}/%{pkg_name}/mysql-log-rotate
rm %{buildroot}%{_datadir}/%{majorname}/mysql-log-rotate
# Install the correct one (meant for FSH layout in RPM packages)
install -D -m 0644 %{_vpath_builddir}/packaging/rpm-common/mysql.logrotate %{buildroot}%{logrotateddir}/%{daemon_name}
@ -666,12 +666,12 @@ mkdir -p %{buildroot}%{_sysconfdir}/my.cnf.d
%endif
%if ! %{with common}
rm -r %{buildroot}%{_datadir}/%{pkg_name}/charsets
rm -r %{buildroot}%{_datadir}/%{majorname}/charsets
%endif
%if ! %{with errmsg}
rm %{buildroot}%{_datadir}/%{pkg_name}/{messages_to_error_log.txt,messages_to_clients.txt}
rm -r %{buildroot}%{_datadir}/%{pkg_name}/{english,bulgarian,czech,danish,dutch,estonian,\
rm %{buildroot}%{_datadir}/%{majorname}/{messages_to_error_log.txt,messages_to_clients.txt}
rm -r %{buildroot}%{_datadir}/%{majorname}/{english,bulgarian,czech,danish,dutch,estonian,\
french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\
polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian}
%endif
@ -799,38 +799,38 @@ fi
%license LICENSE
%doc README README.mysql-license README.mysql-docs
%doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google
%dir %{_datadir}/%{pkg_name}
%{_datadir}/%{pkg_name}/charsets
%dir %{_datadir}/%{majorname}
%{_datadir}/%{majorname}/charsets
%endif
%if %{with errmsg}
%files -n %{pkgname}-errmsg
%{_datadir}/%{pkg_name}/messages_to_error_log.txt
%{_datadir}/%{pkg_name}/messages_to_clients.txt
%{_datadir}/%{pkg_name}/english
%lang(bg) %{_datadir}/%{pkg_name}/bulgarian
%lang(cs) %{_datadir}/%{pkg_name}/czech
%lang(da) %{_datadir}/%{pkg_name}/danish
%lang(nl) %{_datadir}/%{pkg_name}/dutch
%lang(et) %{_datadir}/%{pkg_name}/estonian
%lang(fr) %{_datadir}/%{pkg_name}/french
%lang(de) %{_datadir}/%{pkg_name}/german
%lang(el) %{_datadir}/%{pkg_name}/greek
%lang(hu) %{_datadir}/%{pkg_name}/hungarian
%lang(it) %{_datadir}/%{pkg_name}/italian
%lang(ja) %{_datadir}/%{pkg_name}/japanese
%lang(ko) %{_datadir}/%{pkg_name}/korean
%lang(no) %{_datadir}/%{pkg_name}/norwegian
%lang(no) %{_datadir}/%{pkg_name}/norwegian-ny
%lang(pl) %{_datadir}/%{pkg_name}/polish
%lang(pt) %{_datadir}/%{pkg_name}/portuguese
%lang(ro) %{_datadir}/%{pkg_name}/romanian
%lang(ru) %{_datadir}/%{pkg_name}/russian
%lang(sr) %{_datadir}/%{pkg_name}/serbian
%lang(sk) %{_datadir}/%{pkg_name}/slovak
%lang(es) %{_datadir}/%{pkg_name}/spanish
%lang(sv) %{_datadir}/%{pkg_name}/swedish
%lang(uk) %{_datadir}/%{pkg_name}/ukrainian
%{_datadir}/%{majorname}/messages_to_error_log.txt
%{_datadir}/%{majorname}/messages_to_clients.txt
%{_datadir}/%{majorname}/english
%lang(bg) %{_datadir}/%{majorname}/bulgarian
%lang(cs) %{_datadir}/%{majorname}/czech
%lang(da) %{_datadir}/%{majorname}/danish
%lang(nl) %{_datadir}/%{majorname}/dutch
%lang(et) %{_datadir}/%{majorname}/estonian
%lang(fr) %{_datadir}/%{majorname}/french
%lang(de) %{_datadir}/%{majorname}/german
%lang(el) %{_datadir}/%{majorname}/greek
%lang(hu) %{_datadir}/%{majorname}/hungarian
%lang(it) %{_datadir}/%{majorname}/italian
%lang(ja) %{_datadir}/%{majorname}/japanese
%lang(ko) %{_datadir}/%{majorname}/korean
%lang(no) %{_datadir}/%{majorname}/norwegian
%lang(no) %{_datadir}/%{majorname}/norwegian-ny
%lang(pl) %{_datadir}/%{majorname}/polish
%lang(pt) %{_datadir}/%{majorname}/portuguese
%lang(ro) %{_datadir}/%{majorname}/romanian
%lang(ru) %{_datadir}/%{majorname}/russian
%lang(sr) %{_datadir}/%{majorname}/serbian
%lang(sk) %{_datadir}/%{majorname}/slovak
%lang(es) %{_datadir}/%{majorname}/spanish
%lang(sv) %{_datadir}/%{majorname}/swedish
%lang(uk) %{_datadir}/%{majorname}/ukrainian
%endif
%files -n %{pkgname}-server
@ -850,7 +850,7 @@ fi
%{_bindir}/innochecksum
%{_bindir}/perror
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{majorname}-server.cnf
%{_sbindir}/mysqld
# sys_nice capability required for rhbz#1628814
@ -859,7 +859,7 @@ fi
%{_libdir}/mysql/INFO_SRC
%{_libdir}/mysql/INFO_BIN
%if ! %{with common}
%dir %{_datadir}/%{pkg_name}
%dir %{_datadir}/%{majorname}
%endif
%dir %{_libdir}/mysql
@ -917,8 +917,8 @@ fi
%{_mandir}/man1/lz4_decompress.1*
%{_mandir}/man8/mysqld.8*
%{_datadir}/%{pkg_name}/dictionary.txt
%{_datadir}/%{pkg_name}/*.sql
%{_datadir}/%{majorname}/dictionary.txt
%{_datadir}/%{majorname}/*.sql
%{_unitdir}/%{daemon_name}*
%{_libexecdir}/mysql-prepare-db-dir