]> git.pld-linux.org Git - packages/adapter.git/blobdiff - adapter.awk
adapter: kill %pyrequires_eq, python(abi) deps are autogenerated for last 8 years
[packages/adapter.git] / adapter.awk
index a5d53d2afd1c9b460b386b4ef3003ea86af81a89..cba44c853062bc6d1cf828b21bff2e772214baff 100644 (file)
@@ -632,6 +632,11 @@ preamble == 1 {
                release = "0." fixedsub(".%{disttag}.at", "", $4)
        }
 
+       # deprecated. currently just resolves to name in $2
+       if (/^%pyrequires_eq.+/) {
+               $1 = "Requires:";
+       }
+
        field = tolower($1)
        if (field ~ /summary:/ && !/etc\.$/ && !/Inc\.$/) {
                sub(/\.$/, "", $0);
@@ -1085,6 +1090,7 @@ function use_macros()
        gsub(ruby_sitelibdir, "%{ruby_sitelibdir}")
        gsub(ruby_rdocdir, "%{ruby_rdocdir}")
 
+       gsub("%{_unitdir}", "%{systemdunitdir}")
        gsub(systemdunitdir, "%{systemdunitdir}")
        gsub(systemdtmpfilesdir, "%{systemdtmpfilesdir}")
 
@@ -1893,6 +1899,7 @@ function replace_php_virtual_deps(field) {
        }
 }
 
+# {{{ replace_groupnames(group)
 function replace_groupnames(group) {
        group = replace(group, "Amusements/Games", "Applications/Games");
        group = replace(group, "Amusements/Games/Strategy/Real Time", "X11/Applications/Games/Strategy");
@@ -1932,6 +1939,7 @@ function replace_groupnames(group) {
        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");;
+       group = replace(group, "Python/Libraries", "Libraries/Python");
        group = replace(group, "Shells", "Applications/Shells");
        group = replace(group, "System Environment/Base", "Base");
        group = replace(group, "System Environment/Daemons", "Daemons");
@@ -1962,8 +1970,10 @@ function replace_groupnames(group) {
 
        return group;
 }
+# }}}
 
-function replace_pkgconfig(pkg,    cmd, path, n, i, line, r) {
+# {{{ replace_pkgconfig(pkg)
+function replace_pkgconfig(pkg,    cmd, path, n, i, line) {
        n = split("/usr/lib64/pkgconfig /usr/lib/pkgconfig /usr/share/pkgconfig", path, / /);
        for (i = 1; i <= n; i++) {
                cmd = "rpm -qf --qf '%{N}' " path[i] "/" pkg ".pc";
@@ -1979,6 +1989,23 @@ function replace_pkgconfig(pkg,    cmd, path, n, i, line, r) {
                }
        }
 }
+# }}}
+
+# {{{ replace_pythonegg(pkg)
+function replace_pythonegg(pkg,    cmd, line) {
+       cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" pkg ")'";
+       # Getline returns 0 on end-of-file, -1 on error, otherwise 1.
+       if ((cmd | getline line) <= 0) {
+               return;
+       }
+
+       if (line !~ /no package provides/) {
+               # @modifies global $2
+               $2 = line;
+               return;
+       }
+}
+# }}}
 
 function replace_requires(field,   pkg) {
        # pkg-config -> package names
@@ -1987,6 +2014,12 @@ function replace_requires(field,   pkg) {
                replace_pkgconfig(pkg);
        }
 
+       # pythonegg -> package names
+       if (match($2, /pythonegg\(([^)]+)\)/)) {
+               pkg = substr($2, RSTART + 10, RLENGTH - 11);
+               replace_pythonegg(pkg);
+       }
+
        sub(/^python-setuptools-devel$/, "python-distribute", $2);
        sub(/^gcc-g77/, "gcc-fortran", $2);
 
This page took 0.031107 seconds and 4 git commands to generate.