]> git.pld-linux.org Git - packages/adapter.git/blobdiff - adapter.awk
Replace Requires(triggerpostun) with Requires(post)
[packages/adapter.git] / adapter.awk
index e71edefd4dbb0a9c68ec67a42e6e8a8832e5bc22..e84d29ec6df1010f9597af5cf30499c770ee18a3 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Adapter adapts .spec files for PLD Linux.
 #
-# Copyright (C) 1999-2015 PLD-Team <feedback@pld-linux.org>
+# Copyright (C) 1999-2021 PLD-Team <feedback@pld-linux.org>
 # Authors:
 #      Michał Kuratczyk <kura@pld.org.pl>
 #      Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
@@ -33,8 +33,7 @@ BEGIN {
        RPM_SECTIONS = "package|build|changelog|clean|description|install|post|posttrans|postun|pre|prep|pretrans|preun|triggerin|triggerpostun|triggerun|verifyscript|check"
        SECTIONS = "^%(" RPM_SECTIONS ")"
 
-       rev = "1.514"
-       VERSION = "0.36/" rev
+       VERSION="1.515"
 
        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|Auto(Req|Prov))"
 
@@ -47,6 +46,9 @@ BEGIN {
        b_idx = 0               # index of BR/R arrays
        BR_count = 0    # number of additional BuildRequires
 
+       # %global defines
+       globals["nil"] = ""
+
        # If variable removed, then 1 (for removing it from export)
        removed["LDFLAGS"] = 0
        removed["CFLAGS"] = 0
@@ -143,6 +145,11 @@ function b_makekey(a, b,   s) {
        }
 }
 
+# load globals
+/^%global/ {
+       globals[$2] = $3;
+}
+
 /^%define/ {
        # FIXME: this section will likely never match after cvs->git migration
        if ($2 == "date") {
@@ -271,6 +278,8 @@ function b_makekey(a, b,    s) {
 /^%package/, (!/^%package/ && $0 ~ SECTIONS) {
        # FIXME: this breaks \t indenting in preamble?
        gsub(/\t/, " ")
+
+       sub(/%{python3_pkgversion}/, "3", $2)
 }
 
 ################
@@ -285,6 +294,10 @@ function b_makekey(a, b,   s) {
                format_indent = -1
        }
 
+       # try ASCII quotes and apostrophes
+       gsub(/’/, "'")
+       gsub(/—/, " - ")
+
        # Format description
        if (ENVIRON["SKIP_DESC"] != 1 && description == 1 && !/^%[a-z]+/ && !/^%description/) {
                if (/^[ \t]*$/) {
@@ -367,13 +380,13 @@ function b_makekey(a, b,  s) {
        }
 
        # invalid in %prep
-       sub("^rm -rf \$RPM_BUILD_ROOT.*", "")
+       sub("^rm -rf \\$RPM_BUILD_ROOT.*", "")
 }
 
 ##########
 # %build #
 ##########
-/^%build/, (!/^%build/ && $0 ~ SECTIONS) {
+/^%build([^A-Za-z0-9_]|$)/, (!/^%build/ && $0 ~ SECTIONS) {
        preamble = 0
 
        if (did_prep == 0) {
@@ -431,19 +444,21 @@ function b_makekey(a, b,  s) {
 
        # use PLD Linux macros
        $0 = fixedsub("glib-gettextize --copy --force","%{__glib_gettextize}", $0)
+       $0 = fixedsub("glib-gettextize --force --copy", "%{__glib_gettextize}", $0)
        $0 = fixedsub("intltoolize --copy --force", "%{__intltoolize}", $0)
        $0 = fixedsub("automake --add-missing --copy", "%{__automake}", $0)
        $0 = fixedsub("automake -a --foreign --copy", "%{__automake}", $0)
        $0 = fixedsub("automake -a -c --foreign", "%{__automake}", $0)
        $0 = fixedsub("automake -a -c", "%{__automake}", $0)
        $0 = fixedsub("libtoolize --force --automake --copy", "%{__libtoolize}", $0)
+       $0 = fixedsub("libtoolize --force --copy", "%{__libtoolize}", $0)
        $0 = fixedsub("libtoolize -c -f --automake", "%{__libtoolize}", $0)
 
-       sub(/^aclocal$/, "%{__aclocal}")
-       sub(/^autoheader$/, "%{__autoheader}")
-       sub(/^autoconf$/, "%{__autoconf}")
+       sub(/^aclocal( --force)?$/, "%{__aclocal}")
+       sub(/^(%{_bindir}\/)?autoheader( --force)?$/, "%{__autoheader}")
+       sub(/^(%{_bindir}\/)?autoconf( --force)?$/, "%{__autoconf}")
        sub(/^automake$/, "%{__automake}")
-       sub(/^libtoolize$/, "%{__libtoolize}")
+       sub(/^libtoolize( --copy --force)?$/, "%{__libtoolize}")
 
        # atrpms
        $0 = fixedsub("%perl_configure", "%{__perl} Makefile.PL \\\n\tINSTALLDIRS=vendor", $0)
@@ -473,7 +488,7 @@ function b_makekey(a, b,    s) {
        sub("^%{__rm} -rf %{buildroot}", "rm -rf $RPM_BUILD_ROOT")
        sub("%buildroot", "$RPM_BUILD_ROOT")
        sub("%{buildroot}", "$RPM_BUILD_ROOT")
-       sub("%{\?buildroot}", "$RPM_BUILD_ROOT")
+       sub("%{\\?buildroot}", "$RPM_BUILD_ROOT")
 
        if (/^[ \t]*rm([ \t]+-[rf]+)*[ \t]+(\${?RPM_BUILD_ROOT}?|%{?buildroot}?)/ && did_rmroot==0) {
                did_rmroot=1
@@ -492,7 +507,7 @@ function b_makekey(a, b,    s) {
        }
 
        if (!/%{_lib}/) {
-               sub("\$RPM_BUILD_ROOT/%", "$RPM_BUILD_ROOT%")
+               sub("\\$RPM_BUILD_ROOT/%", "$RPM_BUILD_ROOT%")
        }
 
        use_macros()
@@ -550,15 +565,15 @@ function b_makekey(a, b,  s) {
        preamble = 0
 
        if (gsub("/usr/sbin/useradd", "%useradd")) {
-               sub(" 2> /dev/null \|\| :", "")
-               sub(" >/dev/null 2>&1 \|\|:", "")
+               sub(" 2> /dev/null \\|\\| :", "")
+               sub(" >/dev/null 2>&1 \\|\\|:", "")
        }
 
        # fedora extras macros
        if (/%__fe_useradd/) {
                sub("%__fe_useradd", "%useradd -u ")
-               sub(" 2> /dev/null \|\| :", "")
-               sub(" >/dev/null 2>&1 \|\|:", "")
+               sub(" 2> /dev/null \\|\\| :", "")
+               sub(" >/dev/null 2>&1 \\|\\|:", "")
                sub(" &>/dev/null \\|\\| :", "")
        }
 
@@ -584,7 +599,7 @@ function b_makekey(a, b,    s) {
 
        sub("update-desktop-database &> /dev/null \\|\\| :", "%update_desktop_database")
        sub("touch --no-create %{_datadir}/icons/hicolor", "%update_icon_cache_post hicolor")
-       sub("if \\[ -x %{_bindir}/gtk-update-icon-cache \\]; then\n\t%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor \|\| :\nfi", "")
+       sub("if \\[ -x %{_bindir}/gtk-update-icon-cache \\]; then\n\t%{_bindir}/gtk-update-icon-cache -q %{_datadir}/icons/hicolor \\|\\| :\nfi", "")
 
        sub("export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`", "")
        if (/gconftool-2 --makefile-install-rule/) {
@@ -735,11 +750,16 @@ preamble == 1 {
                        next
                }
 
-               replace_requires(field)
+               replace_requires()
+       }
+
+       if (field ~ /triggerpostun/) {
+               # rpm 4.16 does not have Requires(triggerpostun):
+               sub(/triggerpostun/, "post", $1)
        }
 
        if (field == "requires:" || field ~ /^requires\(/ || field == "suggests:") {
-               replace_requires(field)
+               replace_requires()
        }
 
 
@@ -830,6 +850,9 @@ preamble == 1 {
                if (l == "MPLv1.1") {
                        l = "MPL v1.1"
                }
+               if (l == "Mozilla Public License, version 2.0") {
+                       l = "MPL v2.0"
+               }
                $0 = "License:\t" l
        }
 
@@ -1154,9 +1177,17 @@ function use_macros()
        common_macros()
 
        sub("%{_defaultdocdir}", "%{_docdir}")
+       sub("%{_pkgdocdir}", "%{_docdir}")
        sub("%{_datadir}/doc", "%{_docdir}")
        sub("%{_bindir}/perl", "%{__perl}")
        sub("%{_bindir}/python", "%{__python}")
+       sub("%{__python2}", "%{__python}")
+       sub("%{nodejs_sitelib}", "%{nodejs_libdir}")
+
+       sub("%py2_build", "%py_build")
+       sub("%py2_install", "%py_install")
+       sub("%{py2_build}", "%py_build")
+       sub("%{py2_install}", "%py_install")
 
        gsub(infodir, "%{_infodir}")
 
@@ -1177,6 +1208,8 @@ function use_macros()
        gsub(py3_scriptdir, "%{py3_scriptdir}")
        gsub("%{python3_sitelib}", "%{py3_sitescriptdir}")
        gsub("%{python3_version}", "%{py3_ver}")
+       gsub("%{python2_version}", "%{py_ver}")
+       gsub("%{python3_sitearch}", "%{py3_sitedir}")
 
        gsub(ruby_archdir, "%{ruby_archdir}")
        gsub(ruby_libdir, "%{ruby_libdir}")
@@ -1311,7 +1344,7 @@ function use_macros()
                        continue
                if ($c ~ sysconfdir "/apm")
                        continue
-               if ($c ~ sysconfdir "/modules-load\.d")
+               if ($c ~ sysconfdir "/modules-load\\.d")
                        continue
                gsub(sysconfdir, "%{_sysconfdir}", $c)
        }
@@ -1326,6 +1359,9 @@ function use_macros()
        gsub(php_pear_dir, "%{php_pear_dir}")
        gsub(php_data_dir, "%{php_data_dir}")
        gsub("%{_datadir}/php", "%{php_data_dir}")
+       gsub("%{php_home}", "%{php_data_dir}")
+       gsub("%{phpdir}", "%{php_data_dir}")
+       gsub("%{php_extdir}", "%{php_extensiondir}")
 
        # change to %{_datadir}, with some exceptions
        for (c = 1; c <= NF; c++) {
@@ -1338,8 +1374,10 @@ function use_macros()
                gsub(datadir, "%{_datadir}", $c)
        }
 
-       # bash completions dir, after datadir change
+       # completions dir, after datadir change
        gsub("%{_datadir}/bash-completion/completions", "%{bash_compdir}")
+       gsub("%{_datadir}/fish/vendor_completions.d", "%{fish_compdir}")
+       gsub("%{_datadir}/zsh/site-functions", "%{zsh_compdir}")
 
        gsub("%{prefix}/share", "%{_datadir}")
        if (prefix"/share" == datadir)
@@ -1442,7 +1480,7 @@ function use_macros()
        gsub("%optflags", "%{rpmcflags}")
        gsub("%{compat_perl_vendorarch}", "%{perl_vendorarch}")
 
-       gsub("^%{__make} install DESTDIR=\$RPM_BUILD_ROOT", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
+       gsub("^%{__make} install DESTDIR=\\$RPM_BUILD_ROOT", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT")
        gsub("^fix-info-dir$", "[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>\\&1")
        $0 = fixedsub("%buildroot", "$RPM_BUILD_ROOT", $0)
        $0 = fixedsub("%{buildroot}", "$RPM_BUILD_ROOT", $0)
@@ -1471,6 +1509,9 @@ function use_macros()
        gsub(/%__cat/, "cat")
        gsub(/%__chmod/, "chmod")
 
+       gsub(/%desktop_database_postun/, "%update_desktop_database")
+       gsub(/%desktop_database_post/, "%update_desktop_database")
+
        gsub("/usr/src/linux", "%{_kernelsrcdir}")
        gsub("%{_prefix}/src/linux", "%{_kernelsrcdir}")
 
@@ -1481,6 +1522,12 @@ function use_macros()
                add_br("BuildRequires:  rpmbuild(macros) >= 1.300")
        }
 
+       if (/^%meson / || /^%{meson}/) {
+               sub(/^meson/, "%meson")
+               sub(/^%{meson}/, "%meson")
+               add_br("BuildRequires:  rpmbuild(macros) >= 1.726")
+       }
+
        $0 = fixedsub("%(%{__cc} -dumpversion)", "%{cc_version}", $0)
        $0 = fixedsub("%(%{__cxx} -dumpversion)", "%{cxx_version}", $0)
 
@@ -1527,6 +1574,7 @@ function use_files_macros(        i, n, t, a, l)
        }
 
        sub("^%doc %{_mandir}", "%{_mandir}")
+       sub("^%license", "%doc")
 
        gsub("^%{_sbindir}", "%attr(755,root,root) %{_sbindir}")
        gsub("^%{_bindir}", "%attr(755,root,root) %{_bindir}")
@@ -1542,12 +1590,12 @@ function use_files_macros(      i, n, t, a, l)
        }
 
        # replace back
-       gsub("%{_sysconfdir}/cron\.d", "/etc/cron.d")
-       gsub("%{_sysconfdir}/crontab\.d", "/etc/crontab.d")
-       gsub("%{_sysconfdir}/logrotate\.d", "/etc/logrotate.d")
-       gsub("%{_sysconfdir}/pam\.d", "/etc/pam.d")
-       gsub("%{_sysconfdir}/profile\.d", "/etc/profile.d")
-       gsub("%{_sysconfdir}/rc\.d", "/etc/rc.d")
+       gsub("%{_sysconfdir}/cron\\.d", "/etc/cron.d")
+       gsub("%{_sysconfdir}/crontab\\.d", "/etc/crontab.d")
+       gsub("%{_sysconfdir}/logrotate\\.d", "/etc/logrotate.d")
+       gsub("%{_sysconfdir}/pam\\.d", "/etc/pam.d")
+       gsub("%{_sysconfdir}/profile\\.d", "/etc/profile.d")
+       gsub("%{_sysconfdir}/rc\\.d", "/etc/rc.d")
        gsub("%{_sysconfdir}/security", "/etc/security")
        gsub("%{_sysconfdir}/skel", "/etc/skel")
        gsub("%{_sysconfdir}/sysconfig", "/etc/sysconfig")
@@ -1640,7 +1688,7 @@ function use_files_macros(        i, n, t, a, l)
        }
 
        if (/%{_mandir}/) {
-               gsub("\.gz$", "*")
+               gsub("\\.gz$", "*")
                gsub("%ext_man$", "*")
        }
 
@@ -1693,8 +1741,8 @@ function use_files_macros(        i, n, t, a, l)
 function use_script_macros()
 {
        if (gsub("/sbin/service", "%service")) {
-               sub(" >/dev/null 2>&1 \|\|:", "")
-               sub(" 2> /dev/null \|\| :", "")
+               sub(" >/dev/null 2>&1 \\|\\|:", "")
+               sub(" 2> /dev/null \\|\\| :", "")
        }
 }
 
@@ -1743,7 +1791,7 @@ function cflags(var)
        }
 
        if (!/!\?debug/)
-               sub("\$RPM_OPT_FLAGS", "%{rpmcflags}")
+               sub("\\$RPM_OPT_FLAGS", "%{rpmcflags}")
        return 1
 }
 
@@ -1760,19 +1808,23 @@ function unify_url(url)
        # sourceforge urls
        # Docs about sourceforge mirror system: http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors
 
+       # 0. strip "#", rpm5 chops it off
+       sub("#.*", "", url)
+
        # 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)
-       sub("^http://dl\.sourceforge\.net/", "http://downloads.sourceforge.net/", 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)
+       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)
+       sub("^http://dl\\.sourceforge\\.net/", "http://downloads.sourceforge.net/", 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)
 
        # 3. unify urls
        if (url ~ /sourceforge.net/) {
                sub("[?&]big_mirror=.*$", "", url)
                sub("[?&]modtime=.*$", "", url)
+               sub("[?&]r=.*$", "", url)
                sub("[?]use_mirror=.*$", "", url)
                sub("[?]download$", "", url)
                sub("/download$", "", url)
@@ -1790,20 +1842,20 @@ function unify_url(url)
                url = sprintf("http://downloads.sourceforge.net/%s/%s", substr(url, 42, RLENGTH - 41), matchstr(url, "[^/]+$"))
        }
 
-       sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", url)
-       sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", url)
+       sub("^ftp://ftp\\.gnome\\.org/", "http://ftp.gnome.org/", url)
+       sub("^http://ftp\\.gnome\\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", url)
 
        # apache urls
        sub("^http://apache.zone-h.org/", "http://www.apache.org/dist/", url)
 
        # gnu.org
-       sub("^ftp://ftp\.gnu\.org/", "http://ftp.gnu.org/", url)
-       sub("^http://ftp\.gnu\.org/pub/gnu/", "http://ftp.gnu.org/gnu/", url)
+       sub("^ftp://ftp\\.gnu\\.org/", "http://ftp.gnu.org/", url)
+       sub("^http://ftp\\.gnu\\.org/pub/gnu/", "http://ftp.gnu.org/gnu/", url)
 
        # debian.org
-       sub("^ftp://ftp\.[^.]+\.debian\.org/", "ftp://ftp.debian.org/", url)
-       sub("^http://ftp\.[^.]+\.debian\.org/", "ftp://ftp.debian.org/", url)
-       sub("^ftp://ftp\.debian\.org/pub/debian/", "ftp://ftp.debian.org/debian/", url)
+       sub("^ftp://ftp\\.[^.]+\\.debian\\.org/", "ftp://ftp.debian.org/", url)
+       sub("^http://ftp\\.[^.]+\\.debian\\.org/", "ftp://ftp.debian.org/", url)
+       sub("^ftp://ftp\\.debian\\.org/pub/debian/", "ftp://ftp.debian.org/debian/", url)
 
        return url
 }
@@ -1840,6 +1892,13 @@ function demacroize(str)
        if (subver) {
                sub("%{subver}", subver, str)
        }
+
+       if (globals["gh_owner"]) {
+               sub("%{gh_owner}", globals["gh_owner"], str)
+       }
+       if (globals["gh_project"]) {
+               sub("%{gh_project}", globals["gh_project"], str)
+       }
        return str
 }
 
@@ -1873,7 +1932,7 @@ function get_epoch(pkg, ver,      epoch)
 #      freetype = 2.0.0 -> correct
 #      freetype = 2.1.9 -> with epoch 1, as epoch 1 was added in 2.1.7
 
-       shell = "grep -o '^" pkg ":[^:]\+' ../PLD-doc/BuildRequires.txt | awk '{print $NF}'"
+       shell = "grep -o '^" pkg ":[^:]\\+' ../PLD-doc/BuildRequires.txt | awk '{print $NF}'"
        shell | getline epoch
        return epoch
 }
@@ -1917,7 +1976,7 @@ function add_br(br)
        BR[BR_count++] = br
 }
 
-# Load rpm macros
+# {{{ Load rpm macros
 # you should update the list also in adapter when making changes here
 function import_rpm_macros(  v) {
        # File with rpm groups
@@ -1929,14 +1988,6 @@ function import_rpm_macros(  v) {
                exit(rc = 1)
        }
 
-       # update this version dep each time some new macro export is added
-       v = 1.52
-       if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < v) {
-               printf("adapter shell script is outdated: Need %s, got %s. Please update it.\n", v, ENVIRON["ADAPTER_REVISION"]) > "/dev/stderr"
-               do_not_touch_anything = 1
-               exit(rc = 1)
-       }
-
        prefix = ENVIRON["_prefix"]
        bindir = ENVIRON["_bindir"]
        sbindir = ENVIRON["_sbindir"]
@@ -1995,8 +2046,9 @@ function import_rpm_macros(  v) {
        systemduserunitdir = ENVIRON["systemduserunitdir"]
        systemdtmpfilesdir = ENVIRON["systemdtmpfilesdir"]
 }
+# }}}
 
-# replace opam names (caml)
+# {{{ replace opam names (caml)
 function replace_opam_deps(field,     name) {
        name = $2
        if (name ~ "^(cryptokit|extlib|xmlm)$") {
@@ -2021,8 +2073,9 @@ function replace_opam_deps(field,     name) {
                $2 = name
        }
 }
+# }}}
 
-# php virtual deps as discussed in devel-en
+# {{{ php virtual deps as discussed in devel-en
 function replace_php_virtual_deps(field) {
        pkg = $2
 #      if (pkg == "php-program") {
@@ -2049,6 +2102,10 @@ function replace_php_virtual_deps(field) {
                }
        }
 
+       if (pkg == "php(language)") {
+               $2 = "php(core)"
+       }
+
        if (pkg == "php4") {
                $2 = "webserver(php)"
                if ($4 ~ /^[0-9]:/) {
@@ -2056,6 +2113,7 @@ function replace_php_virtual_deps(field) {
                }
        }
 }
+# }}}
 
 # {{{ replace_groupnames(group)
 function replace_groupnames(group) {
@@ -2151,6 +2209,27 @@ function replace_pkgconfig(pkg,    cmd, path, n, i, line) {
 }
 # }}}
 
+# {{{ replace_perlmod(pkg)
+function replace_perlmod(pkg, version,   cmd, line) {
+       # do nothing if version is specified
+       if (version) {
+               return
+       }
+       cmd = "rpm -q --qf '%{N}\n' --whatprovides 'perl(" 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
+       }
+}
+# }}}
+
 # {{{ replace_pythonegg(pkg)
 function replace_pythonegg(pkg,    cmd, line) {
        cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" pkg ")'"
@@ -2167,7 +2246,13 @@ function replace_pythonegg(pkg,    cmd, line) {
 }
 # }}}
 
-function replace_requires(field,   pkg) {
+# {{{ replace_requires
+function replace_requires(pkg) { # "pkg' is local variable, not an argument
+       # strip %{?_isa}
+       if ($2 ~ /_isa/) {
+               $2 = fixedsub("%{?_isa}", "", $2);
+       }
+
        # pkg-config -> package names
        if (match($2, /pkgconfig\(([^)]+)\)/)) {
                pkg = substr($2, RSTART + 10, RLENGTH - 11)
@@ -2180,6 +2265,12 @@ function replace_requires(field,   pkg) {
                replace_pythonegg(pkg)
        }
 
+       # perl() -> package names
+       if (match($2, /perl\(([^)]+)\)/)) {
+               pkg = substr($2, RSTART + 5, RLENGTH - 6)
+               replace_perlmod(pkg, $3)
+       }
+
        sub(/^python-setuptools-devel$/, "python-distribute", $2)
        sub(/^gcc-g77/, "gcc-fortran", $2)
 
@@ -2299,6 +2390,7 @@ function replace_requires(field,   pkg) {
        sub(/^gnome-python2-gconf$/, "python-gnome-gconf", $2)
        sub(/^gnome-python2-gnomekeyring$/, "python-gnome-desktop-keyring", $2)
        sub(/^gnome-python2-gtkspell$/, "python-gnome-extras-gtkspell", $2)
+       sub(/^gstreamer-python$/, "python-gstreamer", $2)
        sub(/^gtk-sharp2-devel$/, "dotnet-gtk-sharp2-devel", $2)
        sub(/^gtk2$/, "gtk+2", $2)
        sub(/^gtk2-devel$/, "gtk+2-devel", $2)
@@ -2310,6 +2402,7 @@ function replace_requires(field,   pkg) {
        sub(/^iscsi-initiator-utils$/, "open-iscsi", $2)
        sub(/^kdelibs4-devel$/, "kde4-kdelibs-devel", $2)
        sub(/^keyutils-libs-devel$/, "keyutils-devel", $2)
+       sub(/^lasso-python$/, "python-lasso", $2)
        sub(/^libICE-devel$/, "xorg-lib-libICE-devel", $2)
        sub(/^libSM-devel$/, "xorg-lib-libSM-devel", $2)
        sub(/^libX11-devel$/, "xorg-lib-libX11-devel", $2)
@@ -2331,6 +2424,7 @@ function replace_requires(field,   pkg) {
        sub(/^libXxf86misc-devel$/, "xorg-lib-libXxf86misc-devel", $2)
        sub(/^libXxf86vm-devel$/, "xorg-lib-libXxf86vm-devel", $2)
        sub(/^libacl-devel$/, "acl-devel", $2)
+       sub(/^libappstream-glib$/, "appstream-glib", $2)
        sub(/^libattr-devel$/, "attr-devel", $2)
        sub(/^libcurl-devel$/, "curl-devel", $2)
        sub(/^libgudev1-devel$/, "udev-glib-devel", $2)
@@ -2351,11 +2445,16 @@ function replace_requires(field,   pkg) {
        sub(/^mod_wsgi$/, "apache-mod_wsgi", $2)
        sub(/^newt-python$/, "python-snack", $2)
        sub(/^notify-python$/, "python-pynotify", $2)
+       sub(/^numpy$/, "python-numpy", $2)
+       sub(/^opencv-python$/, "python-opencv", $2)
+       sub(/^oxygen-icon-theme$/, "kde4-icons-oxygen", $2)
        sub(/^pcsc-lite-ccid$/, "pcsc-driver-ccid", $2)
+       sub(/^protobuf-python$/, "python-protobuf", $2)
        sub(/^pulseaudio-libs-devel$/, "pulseaudio-devel", $2)
        sub(/^pyOpenSSL$/, "python-pyOpenSSL", $2)
        sub(/^pycairo$/, "python-pycairo", $2)
        sub(/^pyflakes$/, "python-pyflakes", $2)
+       sub(/^pygame$/, "python-pygame", $2)
        sub(/^pygobject2$/, "python-pygobject", $2)
        sub(/^pygobject3$/, "python-pygobject3", $2)
        sub(/^pygobject3-devel$/, "python-pygobject3-common-devel", $2)
@@ -2372,15 +2471,18 @@ function replace_requires(field,   pkg) {
        sub(/^pytalloc$/, "python-talloc", $2)
        sub(/^pytalloc-devel$/, "python-talloc-devel", $2)
        sub(/^pytest$/, "python-pytest", $2)
+       sub(/^python-PyQt4-devel$/, "sip-PyQt4", $2)
        sub(/^python-crypto$/, "python-Crypto", $2)
        sub(/^python-cups$/, "python-pycups", $2)
+       sub(/^python-docker-py$/, "python-docker", $2)
        sub(/^python-enchant$/, "python-pyenchant", $2)
        sub(/^python-imaging$/, "python-PIL", $2)
        sub(/^python-imaging-tk$/, "python-PIL-tk", $2)
+       sub(/^python-ndg_httpsclient$/, "python-ndg-httpsclient", $2)
        sub(/^python-newt$/, "python-snack", $2)
        sub(/^python-pygtk$/, "python-pygtk-gtk", $2)
        sub(/^python-recaptcha-client$/, "python-recaptcha", $2)
-       sub(/^python-sphinx$/, "python-Sphinx", $2)
+       sub(/^python-sphinx$/, "sphinx-pdg", $2)
        sub(/^python-sqlalchemy$/, "python-SQLAlchemy", $2)
        sub(/^python-twisted$/, "python-TwistedCore", $2)
        sub(/^python-twisted-core$/, "python-TwistedCore", $2)
@@ -2388,24 +2490,35 @@ function replace_requires(field,   pkg) {
        sub(/^python-twisted-web$/, "python-TwistedWeb", $2)
        sub(/^python-unittest2$/, "python-modules", $2)
        sub(/^python-uuid$/, "python-modules", $2)
+       sub(/^python-xlib$/, "python-Xlib", $2)
        sub(/^python-zope-interface$/, "Zope-Interface", $2)
+       sub(/^python-zope.component$/, "Zope-Component", $2)
+       sub(/^python-zope.interface$/, "Zope-Interface", $2)
+       sub(/^python2-certifi$/, "python-certifi", $2)
        sub(/^python2-devel$/, "python-devel", $2)
+       sub(/^python3-docker-py$/, "python3-docker", $2)
        sub(/^pytz$/, "python-pytz", $2)
        sub(/^pyxdg$/, "python-pyxdg", $2)
        sub(/^qt4-devel$/, "qt4-build", $2)
        sub(/^qt4-webkit-devel$/, "QtWebKit-devel", $2)
+       sub(/^qt5-qtgraphicaleffects$/, "Qt5Quick-graphicaleffects", $2)
+       sub(/^qt5-qtquickcontrols$/, "Qt5Quick-controls", $2)
+       sub(/^qt5-qtwebkit-devel$/, "Qt5WebKit-devel", $2)
        sub(/^qtiocompressor-devel$/, "QtIOCompressor-devel", $2)
        sub(/^qtlockedfile-devel$/, "QtLockedFile-devel", $2)
        sub(/^qtsingleapplication-devel$/, "QtSingleApplication-devel", $2)
        sub(/^rpm-python$/, "python-rpm", $2)
+       sub(/^scipy$/, "python-scipy", $2)
        sub(/^sip-devel$/, "python-sip-devel", $2)
        sub(/^tftp-server$/, "tftpdaemon", $2)
        sub(/^tkinter$/, "python-tkinter", $2)
        sub(/^urw-fonts$/, "fonts-Type1-urw", $2)
        sub(/^webkitgtk3-devel$/, "gtk-webkit3-devel", $2)
+       sub(/^webkitgtk4$/, "gtk-webkit4", $2)
        sub(/^xapian-bindings-python$/, "python-xapian", $2)
        sub(/^xorg-x11-proto-devel$/, "xorg-proto-xproto-devel", $2)
        sub(/^xorg-x11-server-sdk$/, "xorg-xserver-server-devel", $2)
+       sub(/^xorg-x11-server-utils$/, "xorg-app-iceauth xorg-app-rgb xorg-app-sessreg xorg-app-xgamma xorg-app-xhost xorg-app-xinput xorg-app-xkill xorg-app-xmodmap xorg-app-xrandr xorg-app-xrandr xorg-app-xrefresh xorg-app-xset xorg-app-xsetpointer xorg-app-xsetroot xorg-app-xstdcmap", $2)
        # }}}
 
        # {{{ mandriva
@@ -2422,10 +2535,12 @@ function replace_requires(field,   pkg) {
        sub(/^blkid-dev$/, "libblkid-devel", $2)
        sub(/^ext2fs-dev$/, "e2fsprogs-devel", $2)
        sub(/^libao-dev$/, "libao-devel", $2)
+       sub(/^libavahi-client-dev$/, "avahi-devel", $2)
        sub(/^libboost-filesystem[0-9.]+-dev$/, "boost-devel", $2)
        sub(/^libboost-program-options[0-9.]+-dev$/, "boost-devel", $2)
        sub(/^libboost-regex[0-9.]+-dev$/, "boost-devel", $2)
        sub(/^libboost-thread[0-9.]+-dev$/, "boost-devel", $2)
+       sub(/^libcups2-dev$/, "cups-devel", $2)
        sub(/^libcurl4-openssl-dev$/, "curl-devel", $2)
        sub(/^libdnet-dev$/, "libdnet-devel", $2)
        sub(/^libesd0-dev$/, "esound-devel", $2)
@@ -2471,6 +2586,10 @@ function replace_requires(field,   pkg) {
 
        # {{{ suse/opensuse
        sub(/^alsa-devel$/, "alsa-lib-devel", $2)
+       sub(/^binutils-gold$/, "binutils", $2)
+       sub(/^bitstream-vera$/, "fonts-TTF-bitstream-vera", $2)
+       sub(/^dbus-1-devel$/, "dbus-devel", $2)
+       sub(/^gconf2-devel$/, "GConf2-devel", $2)
        sub(/^gtk-sharp2$/, "dotnet-gtk-sharp2", $2)
        sub(/^gtkmm2-devel$/, "gtkmm-devel", $2)
        sub(/^libexpat-devel$/, "expat-devel", $2)
@@ -2479,8 +2598,15 @@ function replace_requires(field,   pkg) {
        sub(/^libopenssl-devel$/, "openssl-devel", $2)
        sub(/^libpulse-devel$/, "pulseaudio-devel", $2)
        sub(/^libqt4-devel$/, "qt4-build, qt4-qmake, QtCore-devel", $2)
+       sub(/^llvm-clang$/, "clang", $2)
        sub(/^monodoc-core$/, "mono-monodoc", $2)
+       sub(/^mozilla-nss-devel$/, "nss-devel", $2)
+       sub(/^python-Babel$/, "python-babel", $2)
+       sub(/^python-Django$/, "python-django", $2)
+       sub(/^python-Pillow$/, "python-pillow", $2)
        sub(/^python-cairo$/, "python-pycairo", $2)
+       sub(/^python-django_compressor$/, "python-django-compressor", $2)
+       sub(/^python-djangorestframework$/, "python-django-rest-framework", $2)
        sub(/^python-gobject$/, "python-pygobject", $2)
        sub(/^python-gstreamer-0_10$/, "python-gstreamer", $2)
        sub(/^python-gtk$/, "python-pygtk-gtk", $2)
@@ -2491,5 +2617,6 @@ function replace_requires(field,   pkg) {
 
        replace_opam_deps(field)
 }
+# }}}
 
 # vim:ts=4:sw=4 fdm=marker
This page took 0.071627 seconds and 4 git commands to generate.