public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/bind] rawhide: Move devel includes always into versioned subdirectory
@ 2026-12-01 10:08 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-12-01 10:08 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/bind
            Branch : rawhide
            Commit : d0d67550f88ff9993f8387af8b60b307c0b15cf7
            Author : Petr Menšík <pemensik@redhat.com>
            Date   : 2026-11-30T12:35:20+01:00
            Stats  : +42/-17 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/bind/c/d0d67550f88ff9993f8387af8b60b307c0b15cf7?branch=rawhide

            Log:
            Move devel includes always into versioned subdirectory

Try to provide symlink after the upgrade in original place. Make it
after the transaction, where old nested files are already removed.

---
diff --git a/bind.spec b/bind.spec
index e87919d..b14fc4a 100644
--- a/bind.spec
+++ b/bind.spec
@@ -48,6 +48,15 @@
 # git log --format=%ai -1 $COMMIT | tr -d - | cut -d' ' -f1
 %global        git_date 20261102
 
+%define major_ver() %{lua: \
+  local ver = rpm.expand("%{1}"); \
+  local s, e; \
+  s, e = string.find(ver, "^%d+[.]%d+"); \
+  if (s and e) then \
+    print(string.sub(ver, s, e)); \
+  end; \
+}
+
 # libisc-nosym requires to be linked with unresolved symbols
 # When libisc-nosym linking is fixed, it can be defined to 1
 # Visit https://bugzilla.redhat.com/show_bug.cgi?id=1540300
@@ -379,6 +388,12 @@ in HTML and epub format.
 
 %endif
 
+# Extract major version 9.x
+%global mver %{major_ver %{version}}
+
+# customize include directory
+%global bind_include %{_includedir}/bind%{mver}
+
 %prep
 # no signatures for git snapshots
 %if 0%{?fedora} && 0%{?!git_date:1}
@@ -433,7 +448,7 @@ export LIBDIR_SUFFIX
 %configure \
   --with-pic \
   --disable-static \
-  --includedir=%{_includedir}/bind9 \
+  --includedir=%{bind_include} \
   --with-libidn2 \
 %if %{with GEOIP2}
   --with-maxminddb \
@@ -592,8 +607,8 @@ touch ${RPM_BUILD_ROOT}/%{chroot_prefix}%{_sysconfdir}/named.conf
 #end chroot
 
 %make_install
-mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/bind9/bind9
-sed -e 's/PACKAGE_/BIND9_/' config.h > ${RPM_BUILD_ROOT}%{_includedir}/bind9/bind9/config.h
+mkdir -p ${RPM_BUILD_ROOT}%{bind_include}/bind9
+sed -e 's/PACKAGE_/BIND9_/' config.h > ${RPM_BUILD_ROOT}%{bind_include}/bind9/config.h
 
 # Remove unwanted files
 rm -f ${RPM_BUILD_ROOT}/etc/bind.keys
@@ -768,33 +783,42 @@ if [ -x %{_sbindir}/selinuxenabled ] && [ -x %{_sbindir}/getsebool ] && [ -x %{_
   fi
 fi
 
+%posttrans devel
+# Make backward compat link after the old package is uninstalled
+if ! [ -L "%{_includedir}/bind9" ]; then
+  # the directory should remain empty now
+  [ -d "%{_includedir}/bind9" ] && rmdir --ignore-fail-on-non-empty "%{_includedir}/bind9"
+  ln -s $(basename -- %{bind_include}) %{_includedir}/bind9 || :
+fi
+%end
+
 # Remove alternatives entries if they are older than this package
 %global program_suffix -9
-%global mver 9.18
+%global oldmver 9.18
 %global alternative_removal_ver 32:9.18.51^git20261102.973d8646-40
 
 # wanted  bind < %%{alternative_removal_ver}, but the package can be referred only once by triggerpostun
 %triggerpostun -- bind-libs < %{alternative_removal_ver}
 if [ -x %{_bindir}/alternatives ] && [ $1 -ge 1 ] && [ -L "%{_sysconfdir}/alternatives/bind9-named" ]; then
-  alternatives --remove bind-named  %{_sbindir}/named-%{mver} 2>/dev/null || :
+  alternatives --remove bind-named  %{_sbindir}/named-%{oldmver} 2>/dev/null || :
   alternatives --remove bind9-named %{_sbindir}/named%{program_suffix} 2>/dev/null|| :
 fi
 
 %triggerpostun utils -- bind-utils < %{alternative_removal_ver}
 if [ -x %{_bindir}/alternatives ] && [ $1 -ge 1 ] && [ -L "%{_sysconfdir}/alternatives/bind9-utils-dig" ]; then
-  alternatives --remove bind-utils-dig %{_bindir}/dig-%{mver} 2>/dev/null || :
+  alternatives --remove bind-utils-dig %{_bindir}/dig-%{oldmver} 2>/dev/null || :
   alternatives --remove bind9-utils-dig %{_bindir}/dig%{program_suffix}
 fi
 
 %triggerpostun dnssec-utils -- bind-dnssec-utils < %{alternative_removal_ver}
 if [ -x %{_bindir}/alternatives ] && [ $1 -ge 1 ] && [ -L "%{_sysconfdir}/alternatives/bind9-dnssec-utils" ]; then
-  alternatives --remove bind-dnssec-utils %{_bindir}/dnssec-verify%{mver} 2>/dev/null || :
+  alternatives --remove bind-dnssec-utils %{_bindir}/dnssec-verify%{oldmver} 2>/dev/null || :
   alternatives --remove bind9-dnssec-utils %{_bindir}/dnssec-verify%{program_suffix} || :
 fi
 
 %triggerpostun devel -- bind-devel <  %{alternative_removal_ver}
 if [ -x %{_bindir}/alternatives ] && [ $1 -ge 1 ] && [ -L "%{_sysconfdir}/alternatives/bind9-devel" ]; then
-  alternatives --remove bind9-devel %{_includedir}/bind%{mver}
+  alternatives --remove bind9-devel %{_includedir}/bind%{oldmver}
 fi
 %end
 
@@ -941,15 +965,16 @@ fi;
 %{_libdir}/libdns.so
 %{_libdir}/libisc.so
 %{_libdir}/libisccfg.so
-%dir %{_includedir}/bind9
-%{_includedir}/bind9/isccc
-%{_includedir}/bind9/ns
-%{_includedir}/bind9/dns
-%{_includedir}/bind9/dst
-%{_includedir}/bind9/irs
-%{_includedir}/bind9/isc
-%{_includedir}/bind9/isccfg
-%{_includedir}/bind9/bind9
+%ghost %attr(0755,root,root) %{_includedir}/bind9
+%dir %{bind_include}
+%{bind_include}/isccc
+%{bind_include}/ns
+%{bind_include}/dns
+%{bind_include}/dst
+%{bind_include}/irs
+%{bind_include}/isc
+%{bind_include}/isccfg
+%{bind_include}/bind9
 
 %files chroot
 %config(noreplace) %{_sysconfdir}/named-chroot.files

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01 10:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 10:08 [rpms/bind] rawhide: Move devel includes always into versioned subdirectory 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox