]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
rel 5
[packages/rpm-build-tools.git] / adapter.awk
index d2793bd86b3be5526838a545bf3e76f4b4f876d6..bb0828295ed0203a95b6017e3dcb91fbe263ff38 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-2016 PLD-Team <feedback@pld-linux.org>
 # Authors:
 #      MichaƂ Kuratczyk <kura@pld.org.pl>
 #      Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
@@ -431,12 +431,14 @@ 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}")
@@ -1157,9 +1159,15 @@ 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")
 
        gsub(infodir, "%{_infodir}")
 
@@ -1180,6 +1188,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}")
@@ -1329,6 +1339,8 @@ 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("%{php_extdir}", "%{php_extensiondir}")
 
        # change to %{_datadir}, with some exceptions
        for (c = 1; c <= NF; c++) {
@@ -1474,6 +1486,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}")
 
@@ -1530,6 +1545,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}")
@@ -1763,6 +1779,9 @@ 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)
@@ -1921,7 +1940,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
@@ -1999,8 +2018,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)$") {
@@ -2025,8 +2045,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") {
@@ -2053,6 +2074,10 @@ function replace_php_virtual_deps(field) {
                }
        }
 
+       if (pkg == "php(language)") {
+               $2 = "php(core)"
+       }
+
        if (pkg == "php4") {
                $2 = "webserver(php)"
                if ($4 ~ /^[0-9]:/) {
@@ -2060,6 +2085,7 @@ function replace_php_virtual_deps(field) {
                }
        }
 }
+# }}}
 
 # {{{ replace_groupnames(group)
 function replace_groupnames(group) {
@@ -2174,6 +2200,7 @@ function replace_perlmod(pkg, version,   cmd, line) {
                return
        }
 }
+# }}}
 
 # {{{ replace_pythonegg(pkg)
 function replace_pythonegg(pkg,    cmd, line) {
@@ -2191,6 +2218,7 @@ function replace_pythonegg(pkg,    cmd, line) {
 }
 # }}}
 
+# {{{ replace_requires
 function replace_requires(field,   pkg) {
        # strip %{?_isa}
        if ($2 ~ /_isa/) {
@@ -2308,6 +2336,7 @@ function replace_requires(field,   pkg) {
 
        # {{{ fedora / redhat
        sub(/^Django$/, "python-django", $2)
+       sub(/^qt5-qtwebkit-devel$/, "Qt5WebKit-devel", $2)
        sub(/^GitPython$/, "python-git", $2)
        sub(/^MySQL-python$/, "python-MySQLdb", $2)
        sub(/^NetworkManager-glib-devel$/, "NetworkManager-devel", $2)
@@ -2345,6 +2374,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)
@@ -2387,6 +2417,7 @@ 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(/^oxygen-icon-theme$/, "kde4-icons-oxygen", $2)
        sub(/^pcsc-lite-ccid$/, "pcsc-driver-ccid", $2)
        sub(/^pulseaudio-libs-devel$/, "pulseaudio-devel", $2)
        sub(/^pyOpenSSL$/, "python-pyOpenSSL", $2)
@@ -2411,9 +2442,11 @@ function replace_requires(field,   pkg) {
        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)
@@ -2427,7 +2460,10 @@ function replace_requires(field,   pkg) {
        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-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)
@@ -2509,6 +2545,9 @@ function replace_requires(field,   pkg) {
 
        # {{{ suse/opensuse
        sub(/^alsa-devel$/, "alsa-lib-devel", $2)
+       sub(/^python-djangorestframework$/, "python-django-rest-framework", $2)
+       sub(/^python-django_compressor$/, "python-django-compressor", $2)
+       sub(/^bitstream-vera$/, "fonts-TTF-bitstream-vera", $2)
        sub(/^gtk-sharp2$/, "dotnet-gtk-sharp2", $2)
        sub(/^gtkmm2-devel$/, "gtkmm-devel", $2)
        sub(/^libexpat-devel$/, "expat-devel", $2)
@@ -2518,6 +2557,9 @@ function replace_requires(field,   pkg) {
        sub(/^libpulse-devel$/, "pulseaudio-devel", $2)
        sub(/^libqt4-devel$/, "qt4-build, qt4-qmake, QtCore-devel", $2)
        sub(/^monodoc-core$/, "mono-monodoc", $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-gobject$/, "python-pygobject", $2)
        sub(/^python-gstreamer-0_10$/, "python-gstreamer", $2)
@@ -2529,5 +2571,6 @@ function replace_requires(field,   pkg) {
 
        replace_opam_deps(field)
 }
+# }}}
 
 # vim:ts=4:sw=4 fdm=marker
This page took 0.047251 seconds and 4 git commands to generate.