SOURCES: adapter.awk, adapter - adapter 0.29
glen
glen at pld-linux.org
Wed Feb 13 21:56:28 CET 2008
Author: glen Date: Wed Feb 13 20:56:28 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- adapter 0.29
---- Files affected:
SOURCES:
adapter.awk (1.5 -> 1.6) , adapter (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/adapter.awk
diff -u SOURCES/adapter.awk:1.5 SOURCES/adapter.awk:1.6
--- SOURCES/adapter.awk:1.5 Tue Nov 6 15:49:51 2007
+++ SOURCES/adapter.awk Wed Feb 13 21:56:23 2008
@@ -1,6 +1,6 @@
#!/usr/bin/gawk -f
#
-# This is adapter v0.28. Adapter adapts .spec files for PLD Linux.
+# This is adapter v0.29. Adapter adapts .spec files for PLD Linux.
# $Id$
#
# Copyright (C) 1999-2007 PLD-Team <feedback at pld-linux.org>
@@ -31,6 +31,8 @@
PREAMBLE_TAGS = "(R|BR|Summary|Name|Version|Release|Epoch|License|Group|URL|BuildArch|BuildRoot|Obsoletes|Conflicts|Provides|ExclusiveArch|ExcludeArch|Pre[Rr]eq|(Build)?Requires|Suggests)"
+ usedigest = 0 # Enable to switch to rpm 4.4.6+ md5 digests
+
preamble = 1 # Is it part of preamble? Default - yes
boc = 4 # Beginning of %changelog
bod = 0 # Beginning of %description
@@ -168,7 +170,11 @@
# Generally, comments are printed without touching
sub(/[ \t]+$/, "")
- if (/Source.*md5/) {
+ if (/#[ \t]*Source.*md5/) {
+ if (usedigest == 1) {
+ sub(/^#[ \t]*Source/, "BuildRequires:\tdigest(%SOURCE", $0)
+ sub(/-md5[ \t]*:[ \t]*/, ") = ", $0)
+ }
print $0
next
}
@@ -244,6 +250,8 @@
_pre = $3
if ($2 ~ /^_snap$/)
_snap = $3
+ if ($2 ~ /^subver$/)
+ subver = $3
# these are used usually when adapterizing external spec
if ($2 ~ /^name$/)
@@ -345,6 +353,9 @@
if (_snap) {
$0 = fixedsub(_snap, "%{_snap}", $0);
}
+ if (subver) {
+ $0 = fixedsub(subver, "%{subver}", $0);
+ }
}
if (/^%setup/ && /-n %{name}-%{version}( |$)/) {
@@ -664,44 +675,48 @@
group = $0;
sub(/^[^ \t]*[ \t]*/, "", group);
- sub(/^Utilities\//,"Applications/", group)
- sub(/^Games/,"Applications/Games", group)
- sub(/^X11\/Games/,"X11/Applications/Games", group)
- sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries", group)
- sub(/^X11\/GNOME\/Applications/,"X11/Applications", group)
- sub(/^X11\/GNOME/,"X11/Applications", group)
- sub(/^X11\/Utilities/,"X11/Applications", group)
- sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy", group)
- sub(/^X11\/Library/,"X11/Libraries", group)
- sub(/^Shells/,"Applications/Shells", group)
- sub(/^System Environment\/Libraries$/, "Libraries", group)
- sub(/^Library\/Development$/, "Development/Libraries", group)
- sub(/^System Environment\/Daemons$/, "Daemons", group)
- sub(/^Applications\/Internet$/, "Applications/Networking", group)
- sub(/^Applications\/Daemons$/, "Daemons", group)
+ sub(/^Amusements\/Games\/Strategy\/Real Time/, "X11/Applications/Games/Strategy", group)
sub(/^Application\/Multimedia$/, "Applications/Multimedia", group)
- sub(/^System\/Servers$/, "Daemons", group)
- sub(/^X11\/Xserver$/, "X11/Servers", group)
- sub(/^X11\/XFree86/, "X11", group)
sub(/^Applications\/Compilers$/, "Development/Languages", group)
+ sub(/^Applications\/Daemons$/, "Daemons", group)
+ sub(/^Applications\/Internet$/, "Applications/Networking", group)
sub(/^Applications\/Internet\/Peer to Peer/, "Applications/Networking", group)
- sub(/^Networking\/Deamons$/, "Networking/Daemons", group)
+ sub(/^Applications\/Productivity$/, "X11/Applications", group)
+ sub(/^Database$/, "Applications/Databases", group)
+ sub(/^Development\/Code Generators$/, "Development", group)
sub(/^Development\/Docs$/, "Documentation", group)
sub(/^Development\/Documentation$/, "Documentation", group)
- sub(/^System Environment\/Kernel$/, "Base/Kernel", group)
- sub(/^Development\/Libraries\/Java$/, "Development/Languages/Java", group)
sub(/^Development\/Java/, "Development/Languages/Java", group)
+ sub(/^Development\/Libraries\/C and C\+\+$/, "Development/Libraries", group)
+ sub(/^Development\/Libraries\/Java$/, "Development/Languages/Java", group)
+ sub(/^Development\/Other/,"Development", group)
sub(/^Development\/Testing$/, "Development", group)
- sub(/^Text Processing\/Markup\/HTML$/, "Applications/Text", group)
- sub(/^Text Processing\/Markup\/XML$/, "Applications/Text", group)
- sub(/^Web\/Database$/, "Applications/WWW", group)
+ sub(/^Emulators$/, "Applications/Emulators", group)
+ sub(/^Games/,"Applications/Games", group)
+ sub(/^Library\/Development$/, "Development/Libraries", group)
+ sub(/^Networking\/Deamons$/, "Networking/Daemons", group)
+ sub(/^Shells/,"Applications/Shells", group)
sub(/^System Environment\/Base$/, "Base", group)
+ sub(/^System Environment\/Daemons$/, "Daemons", group)
+ sub(/^System Environment\/Kernel$/, "Base/Kernel", group)
+ sub(/^System Environment\/Libraries$/, "Libraries", group)
sub(/^System$/, "Base", group)
- sub(/^Applications\/Productivity$/, "X11/Applications", group)
- sub(/^Database$/, "Applications/Databases", group)
- sub(/^Development\/Code Generators$/, "Development", group)
- sub(/^Emulators$/, "Applications/Emulators", group)
+ sub(/^System\/Base$/, "Base", group)
sub(/^System\/Libraries$/, "Libraries", group)
+ sub(/^System\/Servers$/, "Daemons", group)
+ sub(/^Text Processing\/Markup\/HTML$/, "Applications/Text", group)
+ sub(/^Text Processing\/Markup\/XML$/, "Applications/Text", group)
+ sub(/^Utilities\//,"Applications/", group)
+ sub(/^Web\/Database$/, "Applications/WWW", group)
+ sub(/^X11\/GNOME/,"X11/Applications", group)
+ sub(/^X11\/GNOME\/Applications/,"X11/Applications", group)
+ sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries", group)
+ sub(/^X11\/Games/,"X11/Applications/Games", group)
+ sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy", group)
+ sub(/^X11\/Library/,"X11/Libraries", group)
+ sub(/^X11\/Utilities/,"X11/Applications", group)
+ sub(/^X11\/XFree86/, "X11", group)
+ sub(/^X11\/Xserver$/, "X11/Servers", group)
$0 = "Group:\t\t" group
@@ -760,24 +775,11 @@
next
}
- # perhaps we have common known name?
-
- # jpackages
- sub(/^java-devel$/, "jdk", $2);
- sub(/^log4j$/, "jakarta-log4j", $2);
- sub(/^oro$/, "jakarta-oro", $2);
- sub(/^jakarta-ant$/, "ant", $2);
- sub(/^xerces-j2$/, "xerces-j", $2);
- sub(/^ldapjdk$/, "ldapsdk", $2);
- sub(/^saxon-scripts$/, "saxon", $2);
- sub(/^xalan-j2$/, "xalan-j", $2);
- sub(/^xerces-j2$/, "xerces-j", $2);
-
- replace_php_virtual_deps();
+ replace_requires();
}
if (field ~ /^requires:/) {
- replace_php_virtual_deps();
+ replace_requires();
}
@@ -801,6 +803,18 @@
if (l == "Python Software Foundation License") {
l = "PSF"
}
+ if (l == "Apache License 2.0" || l == "Apache 2.0" || l == "Apache License Version 2.0" || l == "Apache License, Version 2.0" || l == "Apache Software License v2") {
+ l = "Apache v2.0"
+ }
+ if (l == "Apache Group License" || l == "Apache Software License" || l == "Apache License") {
+ l = "Apache"
+ }
+ if (l == "Apache-style License" || l == "Apache-style Software License") {
+ l = "Apache-like"
+ }
+ if (l == "Apache Software License 1.1" || l == "Apache 1.1") {
+ l = "Apache v1.1"
+ }
$0 = "License:\t" l;
}
@@ -908,6 +922,9 @@
if (_snap) {
url[n] = fixedsub(_snap, "%{_snap}", url[n])
}
+ if (subver) {
+ url[n] = fixedsub(subver, "%{subver}", url[n])
+ }
}
# assigning to $2 kills preamble formatting
$2 = fixedsub(filename, url[n], $2)
@@ -921,6 +938,7 @@
sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
sub("^http://download\.sf\.net/", "http://dl.sourceforge.net/", $2)
+ sub("^http://download\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
sub("^http://downloads\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
@@ -929,6 +947,9 @@
sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", $2)
sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", $2)
+
+ # apache urls
+ sub("^http://apache.zone-h.org/", "http://www.apache.org/dist/", $2)
}
@@ -1305,6 +1326,7 @@
gsub("^make$", "%{__make}")
gsub("^make ", "%{__make} ")
gsub("^gcc ", "%{__cc} ")
+ gsub("^rm --interactive=never ", "%{__rm} ")
# mandrake specs
gsub("^%make$", "%{__make}")
@@ -1314,7 +1336,6 @@
gsub("^%makeinstall", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
gsub("^%{__rm} -rf %{buildroot}", "rm -rf $RPM_BUILD_ROOT")
gsub("^%{__install}", "install")
- gsub("^%{__rm}", "rm")
gsub("%optflags", "%{rpmcflags}")
gsub("%{compat_perl_vendorarch}", "%{perl_vendorarch}")
@@ -1597,6 +1618,9 @@
if (_snap) {
sub("%{_snap}", _snap, str);
}
+ if (subver) {
+ sub("%{subver}", subver, str);
+ }
return str;
}
@@ -1661,6 +1685,30 @@
BR[BR_count++] = br
}
+function replace_requires()
+{
+
+ # jpackages
+ sub(/^java-devel$/, "jdk", $2);
+ sub(/^log4j$/, "logging-log4j", $2);
+ sub(/^jakarta-log4j$/, "logging-log4j", $2);
+ sub(/^oro$/, "jakarta-oro", $2);
+ sub(/^jakarta-ant$/, "ant", $2);
+ sub(/^xerces-j2$/, "xerces-j", $2);
+ sub(/^ldapjdk$/, "ldapsdk", $2);
+ sub(/^saxon-scripts$/, "saxon", $2);
+ sub(/^xalan-j2$/, "xalan-j", $2);
+ sub(/^xerces-j2$/, "xerces-j", $2);
+ sub(/^gnu-regexp$/, "gnu.regexp", $2);
+
+ # redhat virtual
+ sub(/^tftp-server$/, "tftpdaemon", $2);
+
+ sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
+
+ replace_php_virtual_deps()
+}
+
# php virtual deps as discussed in devel-en
function replace_php_virtual_deps()
{
================================================================
Index: SOURCES/adapter
diff -u SOURCES/adapter:1.2 SOURCES/adapter:1.3
--- SOURCES/adapter:1.2 Tue Nov 6 16:16:45 2007
+++ SOURCES/adapter Wed Feb 13 21:56:23 2008
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# This is adapter v0.28. Adapter adapts .spec files for PLD Linux.
+# This is adapter v0.29. Adapter adapts .spec files for PLD Linux.
#
# Copyright (C) 1999-2003 PLD-Team <feedback at pld-linux.org>
# Authors:
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/adapter.awk?r1=1.5&r2=1.6&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/adapter?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list