[packages/adapter: 256/631] - process docdir macro - process macros in %post

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


commit c2b069de6cf8b537530fb8e8e3b6146758c91438
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Dec 14 09:16:22 2005 +0000

    - process docdir macro
    - process macros in %post
    
    Changed files:
        adapter.awk -> 1.246

 adapter.awk | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 902ddb0..8b50fc3 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -63,6 +63,7 @@ BEGIN {
 	"rpm --eval %_mandir"	| getline mandir
 	"rpm --eval %_infodir"	| getline infodir
 	"rpm --eval %_examplesdir"	| getline examplesdir
+	"rpm --eval %_defaultdocdir"	| getline docdir
 
 	"rpm --eval %perl_sitearch" | getline perl_sitearch
 	"rpm --eval %perl_archlib" | getline perl_archlib
@@ -200,6 +201,8 @@ preamble == 1 {
 		mandir = $3
 	if ($2 ~ /_infodir/)
 		infodir = $3
+	if ($2 ~ /_docdir/)
+		docdir = $3
 
 	# version related macros
 	if ($2 ~ /^_beta$/)
@@ -517,6 +520,7 @@ preamble == 1 {
 
 /^%post/, (!/^%post/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_macros()
 }
 /^%preun/, (!/^%preun/ && $0 ~ SECTIONS) {
 	preamble = 0
@@ -904,6 +908,8 @@ function use_macros()
 		gsub(sysconfdir, "%{_sysconfdir}", $c)
 	}
 
+	gsub(docdir, "%{_docdir}")
+
 	for (c = 1; c <= NF; c++) {
 		if ($c ~ datadir "/automake")
 			continue;
@@ -914,10 +920,6 @@ function use_macros()
 		gsub(datadir, "%{_datadir}", $c)
 	}
 
-	gsub("%_sbindir", "%{_sbindir}")
-	gsub("%_mandir", "%{_mandir}")
-	gsub("%name", "%{name}")
-
 	gsub("%{prefix}/share", "%{_datadir}")
 	if (prefix"/share" == datadir)
 		gsub("%{_prefix}/share", "%{_datadir}")
@@ -1017,6 +1019,9 @@ function use_macros()
 	gsub("%_bindir", "%{_bindir}")
 	gsub("%_datadir", "%{_datadir}")
 	gsub("%_iconsdir", "%{_iconsdir}")
+	gsub("%_sbindir", "%{_sbindir}")
+	gsub("%_mandir", "%{_mandir}")
+	gsub("%name", "%{name}")
 
 	gsub("/usr/src/linux", "%{_kernelsrcdir}")
 	gsub("%{_prefix}/src/linux", "%{_kernelsrcdir}")
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list