]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
- updated
[packages/rpm-build-tools.git] / adapter.awk
index b6dbfd3cec55153ef6f6a0c7f9c551721462c867..bbcac32abe84d3e2a8dd9b675a1ba2d9bab0a33e 100644 (file)
@@ -238,6 +238,20 @@ function b_makekey(a, b,   s) {
                mod_name = $3
        if ($2 ~ /^_?pearname$/)
                pearname = $3
+       if ($2 ~ /^_class$/)
+               pear_class = $3
+       if ($2 ~ /^_subclass$/)
+               pear_subclass = $3
+
+       # kill the _class and _subclass pear macros
+       if ($2 == "_pearname" || $2 == "pearname") {
+               if (pear_class) {
+                       gsub("%{_class}", pear_class, $3);
+               }
+               if (pear_subclass) {
+                       gsub("%{_subclass}", pear_subclass, $3);
+               }
+       }
 
        sub(/[ \t]+$/, "");
        # do nothing further, otherwise adapter thinks we're at preamble
@@ -747,7 +761,7 @@ preamble == 1 {
                $1 = "Suggests:"
        }
 
-       if ($3 == "==") {
+       if ($3 == "==" && $1 !~ /%/) {
                $3 = "="
        }
 
@@ -1129,6 +1143,9 @@ function use_macros()
        gsub("%{_libdir}/pkgconfig", "%{_pkgconfigdir}")
        gsub(pkgconfigdir, "%{_pkgconfigdir}")
 
+       gsub("%{_datadir}/pkgconfig", "%{_npkgconfigdir}")
+       gsub(npkgconfigdir, "%{_npkgconfigdir}")
+
        gsub(libdir, "%{_libdir}")
        gsub(javadir, "%{_javadir}")
 
@@ -1374,6 +1391,15 @@ function use_macros()
 
        $0 = fixedsub("%(%{__cc} -dumpversion)", "%{cc_version}", $0);
        $0 = fixedsub("%(%{__cxx} -dumpversion)", "%{cxx_version}", $0);
+
+       # kill the _class and _subclass pear macros
+       if (pear_class) {
+               gsub("%{_class}", pear_class);
+       }
+       if (pear_subclass) {
+               gsub("%{_subclass}", pear_subclass);
+       }
+
 }
 
 function format_configure(line,                n, a, s) {
@@ -1454,7 +1480,7 @@ function use_files_macros(        i, n, t, a, l)
                }
        }
 
-       if (/lib.+\.so/ && !/\.so$/ && !/^%attr.*/ && !/%exclude/) {
+       if (/lib.+\.so\b/ && !/\.so$/ && !/^%attr.*/ && !/%exclude/) {
                $0 = "%attr(755,root,root) " $0
        }
 
@@ -1638,6 +1664,9 @@ function unify_url(url)
 
        # sourceforge urls
        # Docs about sourceforge mirror system: http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors
+       # TODO: SF unify: http://downloads.sourceforge.net/PROJECT/TARBALL
+
+       # 1. unify domains
        sub("^http://prdownloads\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
        sub("^http://download\.sf\.net/", "http://downloads.sourceforge.net/", url)
        sub("^http://download\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
@@ -1645,11 +1674,15 @@ function unify_url(url)
        sub("^http://.*\.dl\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
        sub("^http://dl\.sf\.net/", "http://downloads.sourceforge.net/", url)
        sub("^http://downloads\.sourceforge\.net/sourceforge/", "http://downloads.sourceforge.net/", url)
+
+       # 2. special hacks
        # new style urls, strip "files/" between and prepend dl.
        if (match(url, "^http://sourceforge.net/projects/[^/]+/files/")) {
                url = substr(url, 1, RLENGTH - length("files/")) substr(url, RSTART + RLENGTH);
                sub("^http://sourceforge.net/projects/", "http://downloads.sourceforge.net/project/", url);
        }
+
+       # 3. unify urls
        if (url ~ /sourceforge.net/) {
                sub("[?&]big_mirror=.*$", "", url);
                sub("[?&]modtime=.*$", "", url);
@@ -1788,7 +1821,7 @@ function import_rpm_macros() {
                exit(rc = 1);
        }
 
-       if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < 1.44) {
+       if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < 1.46) {
                print "adapter shell script is outdated, please cvs up it" > "/dev/stderr"
                do_not_touch_anything = 1
                exit(rc = 1);
@@ -1816,6 +1849,7 @@ function import_rpm_macros() {
        pixmapsdir = ENVIRON["_pixmapsdir"]
        javadir = ENVIRON["_javadir"]
        pkgconfigdir = ENVIRON["_pkgconfigdir"]
+       npkgconfigdir = ENVIRON["_npkgconfigdir"]
 
        perl_sitearch = ENVIRON["perl_sitearch"]
        perl_archlib = ENVIRON["perl_archlib"]
@@ -1936,24 +1970,30 @@ function replace_requires() {
        # fedora / redhat
        sub(/^Django$/, "python-django", $2);
        sub(/^GitPython$/, "python-git", $2);
-       sub(/^freetype2-devel$/, "freetype-devel", $2);
+       sub(/^PyQt4-devel$/, "python-PyQt4-devel", $2);
+       sub(/^PyQwt-devel$/, "python-PyQwt-devel", $2);
        sub(/^chkconfig$/, "/sbin/chkconfig", $2);
        sub(/^db4-devel$/, "db-devel", $2);
        sub(/^dbus-python$/, "python-dbus", $2);
        sub(/^file-devel$/, "libmagic-devel", $2);
+       sub(/^freetype2-devel$/, "freetype-devel", $2);
        sub(/^fuse-devel$/, "libfuse-devel", $2);
        sub(/^gamin-python$/, "python-gamin", $2);
        sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
        sub(/^gnome-python2-extras$/, "python-gnome-extras", $2);
        sub(/^gnome-python2-gtkspell$/, "python-gnome-extras-gtkspell", $2);
+       sub(/^gtk-sharp2-devel$/, "dotnet-gtk-sharp2-devel", $2);
        sub(/^gtk2$/, "gtk+2", $2);
        sub(/^gtk2-devel$/, "gtk+2-devel", $2);
        sub(/^initscripts$/, "rc-scripts", $2);
+       sub(/^iproute$/, "iproute2", $2);
        sub(/^iscsi-initiator-utils$/, "open-iscsi", $2);
        sub(/^libXft-devel$/, "xorg-lib-libXft-devel", $2);
        sub(/^libXrandr-devel$/, "xorg-lib-libXrandr-devel", $2);
+       sub(/^libcurl-devel$/, "curl-devel", $2);
        sub(/^mod_wsgi$/, "apache-mod_wsgi", $2);
        sub(/^notify-python$/, "python-pynotify", $2);
+       sub(/^pulseaudio-libs-devel$/, "pulseaudio-devel", $2);
        sub(/^pyOpenSSL$/, "python-pyOpenSSL", $2);
        sub(/^pygobject2$/, "python-pygobject", $2);
        sub(/^pygtk2$/, "python-pygtk", $2);
@@ -1962,9 +2002,14 @@ function replace_requires() {
        sub(/^python-imaging$/, "python-PIL", $2);
        sub(/^python-imaging-tk$/, "python-PIL-tk", $2);
        sub(/^python-pygtk$/, "python-pygtk-gtk", $2);
+       sub(/^python-twisted-core$/, "python-TwistedCore", $2);
+       sub(/^python-twisted-names$/, "python-TwistedNames", $2);
        sub(/^python2-devel$/, "python-devel", $2);
        sub(/^qt4-devel$/, "qt4-build", $2);
+       sub(/^qt4-webkit-devel$/, "QtWebKit-devel", $2);
        sub(/^qtlockedfile-devel$/, "QtLockedFile-devel", $2);
+       sub(/^rpm-python$/, "python-rpm", $2);
+       sub(/^sip-devel$/, "python-sip-devel", $2);
        sub(/^tftp-server$/, "tftpdaemon", $2);
        sub(/^tkinter$/, "python-tkinter", $2);
        sub(/^xapian-bindings-python$/, "python-xapian", $2);
@@ -2029,6 +2074,7 @@ function replace_groupnames(group) {
        group = replace(group, "Applications/Internet", "Applications/Networking");
        group = replace(group, "Applications/Internet/Peer to Peer", "Applications/Networking");
        group = replace(group, "Applications/Productivity", "X11/Applications");
+       group = replace(group, "Applications/Security", "Applications/System");
        group = replace(group, "Applications/Web", "Applications/WWW");
        group = replace(group, "Database", "Applications/Databases");
        group = replace(group, "Development/C", "Development/Libraries");
@@ -2052,6 +2098,7 @@ function replace_groupnames(group) {
        group = replace(group, "Games", "Applications/Games");
        group = replace(group, "Library/Development", "Development/Libraries");
        group = replace(group, "Networking/Deamons", "Networking/Daemons");
+       group = replace(group, "Networking/Other", "Networking");
        group = replace(group, "Productivity/Databases/Servers", "Applications/Databases");
        group = replace(group, "Productivity/Multimedia/Other", "X11/Applications/Multimedia");
        group = replace(group, "Productivity/Networking/Web/Servers", "Networking/Daemons/HTTP");;
This page took 0.034103 seconds and 4 git commands to generate.