From cab839c60247a990716bf76c525486e05ce36801 Mon Sep 17 00:00:00 2001 From: Manvendra Bhangui Date: Thu, 28 Dec 2023 20:53:17 +0530 Subject: [PATCH] fixes for debuginfo generation --- .gitignore | 2 ++ indimail-access/indimail-access.spec.in | 5 ++--- indimail-auth/indimail-auth.spec.in | 16 +++++++++++----- indimail-utils/indimail-utils.spec.in | 18 ++++++++---------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index f8b406273..35cf76394 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ config.in~ config.guess~ config.sub~ configure.ac~ +.repo-build +.repo-build.tmp diff --git a/indimail-access/indimail-access.spec.in b/indimail-access/indimail-access.spec.in index 1da3975e2..9dc675453 100644 --- a/indimail-access/indimail-access.spec.in +++ b/indimail-access/indimail-access.spec.in @@ -20,7 +20,7 @@ %global _hardened_build 1 %endif -%global xxxxxxxx 1 +#global nodebug 1 %if %{defined nodebug} %global debug_package %{nil} %endif @@ -44,11 +44,9 @@ # in the prep section have a problem in enabling debuginfo. # This isn't documented clearly anywhere. A workaround is # to define buildsubdir -%if 1 %if %{undefined nodebug} %global buildsubdir %{name}-%{version} %endif -%endif %if 0%{?fedora_version} > 30 || 0%{?centos_version} > 700 || 0%{?rhel_version} > 700 || 0%{?centos_ver} > 7 || 0%{?almalinux_version} > 700 || 0%{?rocky_version} > 700 || 0%{?fedora} > 30 || 0%{?rhel} > 7 || %{defined mgaversion} || %{defined amzn} || %{defined openEuler} || ( 0%{?sle_version} >= 150400 && 0%{?is_opensuse} ) %global pythondir %{python3_sitelib} @@ -331,6 +329,7 @@ done %if %{undefined nodebug} /bin/chmod -R 0755 %{buildroot}%{_prefix}/bin %{buildroot}%{_prefix}/sbin \ %{buildroot}%{libexecdir} + ln -sf %{_builddir}/%{name}-%{version}/debugsourcefiles.list %{_builddir}/debugsourcefiles.list %endif %files diff --git a/indimail-auth/indimail-auth.spec.in b/indimail-auth/indimail-auth.spec.in index 63684dea3..dde09e95e 100644 --- a/indimail-auth/indimail-auth.spec.in +++ b/indimail-auth/indimail-auth.spec.in @@ -14,6 +14,7 @@ %global _hardened_build 1 %endif +#global nodebug 1 %if %{defined nodebug} %global debug_package %{nil} %endif @@ -37,11 +38,9 @@ # in the prep section have a problem in enabling debuginfo. # This isn't documented clearly anywhere. A workaround is # to define buildsubdir -%if 1 %if %{undefined nodebug} %global buildsubdir %{name}-%{version} %endif -%endif %if %build_on_obs == 1 %global packager Manvendra Bhangui <@email@> @@ -241,9 +240,9 @@ touch %{buildroot}%{logdir}/pwdlookup/current # Compress the man pages find %{buildroot}%{mandir} -type f -exec gzip -q {} \; %if %{undefined nodebug} -chmod -R 755 %{buildroot}%{_prefix}/sbin -chmod -R 755 %{buildroot}%{_libdir} -chmod -R 755 %{buildroot}/%{pam_moduledir} + chmod -R 755 %{buildroot}%{_prefix}/sbin %{buildroot}%{_libdir} \ + %{buildroot}/%{pam_moduledir} + ln -sf %{_builddir}/%{name}-%{version}/debugsourcefiles.list %{_builddir}/debugsourcefiles.list %endif %files @@ -295,6 +294,13 @@ chmod -R 755 %{buildroot}/%{pam_moduledir} %attr(755,root,root) %{_libdir}/libnss_nssd.so.2.0.0 %{_libdir}/libnss_nssd.so.2 +%clean +%if %{undefined nodebug} +%{__rm} -f %{_builddir}/debugfiles.list %{_builddir}/debuglinks.list \ + %{_builddir}/debugsourcefiles.list %{_builddir}/debugsources.list \ + %{_builddir}/elfbins.list +%endif + ### SCRIPTLET ############################################################################### %pretrans if [ -d /run ] ; then diff --git a/indimail-utils/indimail-utils.spec.in b/indimail-utils/indimail-utils.spec.in index aec543375..1e60bcd8e 100644 --- a/indimail-utils/indimail-utils.spec.in +++ b/indimail-utils/indimail-utils.spec.in @@ -14,6 +14,7 @@ %global _hardened_build 1 %endif +#global nodebug 1 %if %{defined nodebug} %global debug_package %{nil} %endif @@ -99,7 +100,7 @@ For more details visit %{url} %prep %{__mkdir_p} %{_builddir}/%{name}-%{version} -cd %{name}-%{version} +cd %{_builddir}/%{name}-%{version} for i in altermime-%{altermime_version} ripmime-%{ripmime_version} \ fortune-%{fortune_version} mpack-%{mpack_version} flash-%{flash_version} do @@ -121,6 +122,7 @@ do done %build +cd %{_builddir}/%{name}-%{version} ( echo "---------------- INFORMATION ------------------------" echo target %_target @@ -159,7 +161,7 @@ do done %install -%{__mkdir_p} %{buildroot}%{_prefix} +cd %{_builddir}/%{name}-%{version} for i in altermime-%{altermime_version} ripmime-%{ripmime_version} \ fortune-%{fortune_version} mpack-%{mpack_version} flash-%{flash_version} do @@ -200,14 +202,10 @@ if [ -x /usr/bin/chrpath ] ; then fi # Compress the man pages find %{buildroot}%{mandir} -type f -exec gzip -q {} \; - -if [ -x /bin/touch ] ; then - TOUCH=/bin/touch -elif [ -x /usr/bin/touch ] ; then - TOUCH=/usr/bin/touch -else - TOUCH=/bin/touch -fi +%if %{undefined nodebug} + /bin/chmod -R 0755 %{buildroot}%{_prefix}/bin %{buildroot}%{_prefix}/sbin + ln -sf %{_builddir}/%{name}-%{version}/debugsourcefiles.list %{_builddir}/debugsourcefiles.list +%endif %files %defattr(-, root, root,-)