[packages/adapter: 98/631] - fix for specs with defined (bin|sbin|lib|data|include)dir != %{_prefix}/\1dir (e.g. includedir i

glen glen at pld-linux.org
Mon Sep 12 19:42:41 CEST 2016


commit 0080f34c47dbf0c5d12a71926d17d1b94b2a8c49
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Oct 12 11:48:18 2001 +0000

    - fix for specs with defined (bin|sbin|lib|data|include)dir != %{_prefix}/\1dir
      (e.g. includedir in ImageMagick.spec)
    - don't change /etc to %{_sysconfdir} before dirs list begining with some
      special name (rc.d,sysconfig...)
    
    Changed files:
        adapter.awk -> 1.98

 adapter.awk | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index a69c6a8..2195254 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -541,8 +541,9 @@ function format_preamble()
 function use_macros()
 {
 	gsub(bindir, "%{_bindir}")
-	gsub("%{_prefix}/bin", "%{_bindir}")
 	gsub("%{prefix}/bin", "%{_bindir}")
+	if(prefix"/bin" == bindir)
+		gsub("%{_prefix}/bin", "%{_bindir}")
 
 	for (c = 1; c <= NF; c++) {
 		if ($c ~ sbindir "/fix-info-dir")
@@ -551,41 +552,45 @@ function use_macros()
 	}
 
 	gsub("%{prefix}/sbin", "%{_sbindir}")
-	gsub("%{_prefix}/sbib", "%{_sbindir}")
+	if(prefix"/sbin" == sbindir)
+		gsub("%{_prefix}/sbib", "%{_sbindir}")
 
 	gsub(libdir, "%{_libdir}")
 	gsub("%{prefix}/lib", "%{_libdir}")
-	gsub("%{_prefix}/lib", "%{_libdir}")
+	if(prefix"/lib" == libdir)
+		gsub("%{_prefix}/lib", "%{_libdir}")
 
 	for (c = 1; c <= NF; c++) {
-		if ($c ~ sysconfdir "/cron.d")
+		if ($c ~ sysconfdir "/{?cron.d")
 			continue;
-		if ($c ~ sysconfdir "/crontab.d")
+		if ($c ~ sysconfdir "/{?crontab.d")
 			continue;
-		if ($c ~ sysconfdir "/logrotate.d")
+		if ($c ~ sysconfdir "/{?logrotate.d")
 			continue;
-		if ($c ~ sysconfdir "/pam.d")
+		if ($c ~ sysconfdir "/{?pam.d")
 			continue;
-		if ($c ~ sysconfdir "/profile.d")
+		if ($c ~ sysconfdir "/{?profile.d")
 			continue;
-		if ($c ~ sysconfdir "/rc.d")
+		if ($c ~ sysconfdir "/{?rc.d")
 			continue;
-		if ($c ~ sysconfdir "/security")
+		if ($c ~ sysconfdir "/{?security")
 			continue;
-		if ($c ~ sysconfdir "/skel")
+		if ($c ~ sysconfdir "/{?skel")
 			continue;
-		if ($c ~ sysconfdir "/sysconfig")
+		if ($c ~ sysconfdir "/{?sysconfig")
 			continue;
 		gsub(sysconfdir, "%{_sysconfdir}", $c)
 	}
 
 	gsub(datadir, "%{_datadir}")
 	gsub("%{prefix}/share", "%{_datadir}")
-	gsub("%{_prefix}/share", "%{_datadir}")
+	if(prefix"/share" == datadir)
+		gsub("%{_prefix}/share", "%{_datadir}")
 
 	gsub(includedir, "%{_includedir}")
 	gsub("%{prefix}/include", "%{_includedir}")
-	gsub("%{_prefix}/include", "%{_includedir}")
+	if(prefix"/include" == includedir)
+		gsub("%{_prefix}/include", "%{_includedir}")
 
 	gsub(mandir, "%{_mandir}")
 	gsub("%{_datadir}/man", "%{_mandir}")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list