[packages/adapter: 85/631] Version 0.22: 1. Updated to new rpm automation 2. Do not remove LDFLAGS="-s" from %changelogs 3. Ple

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


commit eb4bf70e5c0c16bfa64da019716d6ea857746311
Author: kura <kura at pld-linux.org>
Date:   Wed Feb 7 11:58:19 2001 +0000

    Version 0.22:
    1. Updated to new rpm automation
    2. Do not remove LDFLAGS="-s" from %changelogs
    3. Please test it and tell me if there are bugs
    
    Changed files:
        adapter.awk -> 1.85

 adapter.awk | 74 ++++++++++++++++++++++++++++---------------------------------
 1 file changed, 34 insertions(+), 40 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 11ff039..656d426 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -1,8 +1,8 @@
 #!/bin/awk -f
 #
-# This is adapter v0.21. Adapter adapts .spec files for PLD.
+# This is adapter v0.22. Adapter adapts .spec files for PLD.
 #
-# Copyright (C) 1999, 2000 PLD-Team <pld-list at pld.org.pl>
+# Copyright (C) 1999-2001 PLD-Team <pld-list at pld.org.pl>
 # Authors:
 # 	Micha� Kuratczyk <kura at pld.org.pl>
 # 	Sebastian Zagrodzki <s.zagrodzki at mimuw.edu.pl>
@@ -127,6 +127,27 @@ defattr == 1 {
 	preamble = 0
 
 	use_macros()
+	
+	if (/LDFLAGS/) {
+		if (/LDFLAGS="-s"/)
+			sub(/LDFLAGS="-s"[ ]*/, "")
+		else {
+			split($0, tmp, "LDFLAGS=\"")
+			count = split(tmp[2], flags, "\"")
+			sub(/-s[" ]?/, "%{!?debug:-s} ", flags[1])
+			$0 = tmp[1] line[1] "LDFLAGS=\"" flags[1] "\""
+			for (i = 2; i < count; i++)
+				$0 = $0 flags[i] "\""
+		}
+	}
+
+	if (/CFLAGS=/)
+		if (cflags("CFLAGS") == 0)
+			next
+
+	if (/CXXFLAGS=/)
+		if (cflags("CXXFLAGS") == 0)
+			next
 }
 
 # %clean section:
@@ -172,46 +193,10 @@ defattr == 1 {
 		next
 	
 	# 'gzip -9nf' for compressing
-	if ($1 ~ /gzip|bzip2/) {
-		if ($2 ~ /^-/)
-			sub(/-[A-Za-z0-9]+ /, "", $0)
-		sub($1, "gzip -9nf")
-	}
+	if ($1 ~ /gzip|bzip2/)
+		next
 }
 
-# Scripts
-{
-	if (/^automake$/) {
-	        sub(/$/, " -a -c")
-	}
-	if (/LDFLAGS/) {
-		gsub(/LDFLAGS="?.*?"?[ \t]*;?/,"");
-		if (/export/) {
-			gsub(/LDFLAGS(="?.*?"?)?[ \t]*/,"");
-			gsub("export[ \t]*(;|$)","");
-		}
-		if (/^[ \t]*$/)
-			next
-	}
-
-	if ($1 ~ /^mv$/) {
-		if ($2 ~ /^-/)
-			sub(/-[A-Za-z0-9]+ /, "", $0)
-		sub($1, "mv -f")
-	}
-	if ($1 ~ /^rm$/) {
-		recursive = 0
-		if ($2 ~ /^-/) {
-			if (match($2, "r"))
-				recursive = 1
-			sub(/-[A-Za-z0-9]+ /, "", $0)
-		}
-		if (recursive)
-			sub($1, "rm -rf")
-		else
-			sub($1, "rm -f")
-	}
-}
 
 # %files section:
 /^%files/, (/^%[a-z \-]+$/ && !/^%files/) {
@@ -600,3 +585,12 @@ function format_flush(line, indent, newline, word, first_word) {
 	}
 }
 
+function cflags(var)
+{
+	if ($0 == var "=\"$RPM_OPT_FLAGS\"")
+		return 0
+		
+	sub("\$RPM_OPT_FLAGS", "%{!?debug:$RPM_OPT_FLAGS}%{?debug:-O -g}")
+	return 1
+}
+
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list