]> git.pld-linux.org Git - packages/adapter.git/blobdiff - adapter.awk
adapter: python-uuid is part of Python 2.5 and newer
[packages/adapter.git] / adapter.awk
index abb0ddd3c1b16decd0785370f65451e52df51caa..2859041357425d5c79b059de512dcb9491f992b7 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Adapter adapts .spec files for PLD Linux.
 #
-# Copyright (C) 1999-2013 PLD-Team <feedback@pld-linux.org>
+# Copyright (C) 1999-2014 PLD-Team <feedback@pld-linux.org>
 # Authors:
 #      MichaƂ Kuratczyk <kura@pld.org.pl>
 #      Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
@@ -144,11 +144,6 @@ function b_makekey(a, b,   s) {
 }
 
 /^%define/ {
-       # Remove defining _applnkdir (this macro has been included in rpm-3.0.4)
-       if ($2 == "_applnkdir") {
-               next
-       }
-
        # FIXME: this section will likely never match after cvs->git migration
        if ($2 == "date") {
                if (did_files == 0) {
@@ -257,6 +252,7 @@ function b_makekey(a, b,    s) {
 
 # %package part
 /^%package/, (!/^%package/ && $0 ~ SECTIONS) {
+       # FIXME: this breaks \t indenting in preamble?
        gsub(/\t/, " ")
 }
 
@@ -509,11 +505,9 @@ function b_makekey(a, b,   s) {
        if ($1 ~ /chmod/ && $2 ~ /644/)
                next
 
-       # atrpms
        $0 = fixedsub("%perl_makeinstall", "%{__make} pure_install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
-
-       # alt linux
        $0 = fixedsub("%make_install DESTDIR=$RPM_BUILD_ROOT install", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
+       $0 = fixedsub("%make_install", "%{__make} install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0)
 }
 
 ##########
@@ -646,6 +640,11 @@ preamble == 1 {
                $1 = "Requires:"
        }
 
+       # deprecated. such deps are autogenerated in rpm5
+       if ($0 == "%{?ruby_mod_ver_requires_eq}") {
+               next
+       }
+
        # F<16 had requires(hint)
        if (/^Requires\(hint\):/) {
                $1 = "Suggests:"
@@ -695,7 +694,7 @@ preamble == 1 {
                $0 = format_requires($1, value)
        }
 
-       # BR: tar (and others) is to common (rpm-build requires it)
+       # BR: tar (and others) are too common (rpm-build requires it)
        if (field == "buildrequires:") {
                l = substr($0, index($0, $2))
                if (l == "awk" ||
@@ -741,6 +740,11 @@ preamble == 1 {
                $1 = "License:"
        }
 
+       if (field == "buildarch:") {
+               $1 = "BuildArch:"
+       }
+
+
        # ease updating from debian .dsc
        if (field ~ /homepage:/) {
                $1 = "URL:"
@@ -763,6 +767,7 @@ preamble == 1 {
                if (l == "Apache License 2.0" || \
                           l == "Apache 2.0" || \
                           l == "Apache 2" || \
+                          l == "Apache-2.0" || \
                           l == "Apache License (2.0)" ||
                           l == "Apache License Version 2.0" || \
                           l == "Apache License, Version 2.0" || \
@@ -966,6 +971,7 @@ ENVIRON["SKIP_SORTBR"] != 1 && preamble == 1 && $0 ~ PREAMBLE_TAGS ":", $0 ~ PRE
        if ($1 == "R:" ) {
                $1 = "Requires:"
        }
+       common_macros()
        format_preamble()
 #      kill_preamble_macros(); # breaks tabbing
 
@@ -1058,6 +1064,23 @@ function replace(s, s1, s2) {
        }
 }
 
+# replace common macros
+function common_macros() {
+       gsub(/%name/, "%{name}")
+       gsub(/%version/, "%{version}")
+       gsub(/%release/, "%{release}")
+       gsub(/%epoch/, "%{epoch}")
+       gsub(/%_sysconfdir/, "%{_sysconfdir}")
+       gsub(/%_unitdir/, "%{systemdunitdir}")
+       gsub(/%_initdir/, "/etc/rc.d/init.d")
+       gsub(/%_man1dir/, "%{_mandir}/man1")
+       gsub(/%_man2dir/, "%{_mandir}/man2")
+       gsub(/%_man3dir/, "%{_mandir}/man3")
+       gsub(/%_man5dir/, "%{_mandir}/man5")
+       gsub(/%_man8dir/, "%{_mandir}/man8")
+
+}
+
 # There should be one or two tabs after the colon.
 function format_preamble()
 {
@@ -1092,6 +1115,8 @@ function use_macros()
                return
        }
 
+       common_macros()
+
        sub("%{_defaultdocdir}", "%{_docdir}")
        sub("%{_datadir}/doc", "%{_docdir}")
        sub("%{_bindir}/perl", "%{__perl}")
@@ -1136,6 +1161,7 @@ function use_macros()
        gsub(systemduserunitdir, "%{systemduserunitdir}")
        gsub(systemdtmpfilesdir, "%{systemdtmpfilesdir}")
        gsub("%{_tmpfilesdir}", "%{systemdtmpfilesdir}")
+       gsub("%{_prefix}/lib/tmpfiles.d", "%{systemdtmpfilesdir}")
 
        gsub("%{_datadir}/applications", "%{_desktopdir}")
        gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}")
@@ -1262,7 +1288,9 @@ function use_macros()
 
        gsub(php_pear_dir, "%{php_pear_dir}")
        gsub(php_data_dir, "%{php_data_dir}")
+       gsub("%{_datadir}/php", "%{php_data_dir}")
 
+       # change to %{_datadir}, with some exceptions
        for (c = 1; c <= NF; c++) {
                if ($c ~ datadir "/automake")
                        continue
@@ -1273,6 +1301,9 @@ function use_macros()
                gsub(datadir, "%{_datadir}", $c)
        }
 
+       # bash completions dir, after datadir change
+       gsub("%{_datadir}/bash-completion/completions", "%{bash_compdir}")
+
        gsub("%{prefix}/share", "%{_datadir}")
        if (prefix"/share" == datadir)
                gsub("%{_prefix}/share", "%{_datadir}")
@@ -2036,6 +2067,7 @@ function replace_groupnames(group) {
        group = replace(group, "System Tools", "Applications/System")
        group = replace(group, "System", "Base")
        group = replace(group, "System/Base", "Base")
+       group = replace(group, "System/Configuration/Networking", "Applications/Networking")
        group = replace(group, "System/Kernel and hardware", "Base/Kernel")
        group = replace(group, "System/Libraries", "Libraries")
        group = replace(group, "System/Servers", "Daemons")
@@ -2117,6 +2149,8 @@ function replace_requires(field,   pkg) {
        # bad package.xml, see http://pear.php.net/bugs/bug.php?id=17779
        sub(/^php-php-gtk/, "php-gtk2", $2)
 
+       sub(/^rake/, "ruby-rake", $2)
+
        # {{{ jpackages / fedora java packages
        sub(/^antlr3$/, "java-antlr3", $2)
        sub(/^aqute-bnd$/, "java-bnd", $2)
@@ -2263,7 +2297,9 @@ function replace_requires(field,   pkg) {
        sub(/^libtevent-devel$/, "tevent-devel", $2)
        sub(/^libusb1-devel$/, "libusb-devel", $2)
        sub(/^libuser-python$/, "python-libuser", $2)
+       sub(/^libvirt-python$/, "python-libvirt", $2)
        sub(/^libxkbfile-devel$/, "xorg-lib-libxkbfile", $2)
+       sub(/^libxml2-python$/, "python-libxml2", $2)
        sub(/^mod_wsgi$/, "apache-mod_wsgi", $2)
        sub(/^newt-python$/, "python-snack", $2)
        sub(/^notify-python$/, "python-pynotify", $2)
@@ -2297,6 +2333,8 @@ function replace_requires(field,   pkg) {
        sub(/^python-twisted$/, "python-TwistedCore", $2)
        sub(/^python-twisted-core$/, "python-TwistedCore", $2)
        sub(/^python-twisted-names$/, "python-TwistedNames", $2)
+       sub(/^python-unittest2$/, "python-modules", $2)
+       sub(/^python-uuid$/, "python-modules", $2)
        sub(/^python2-devel$/, "python-devel", $2)
        sub(/^pytz$/, "python-pytz", $2)
        sub(/^pyxdg$/, "python-pyxdg", $2)
@@ -2377,10 +2415,12 @@ function replace_requires(field,   pkg) {
 
        # {{{ suse/opensuse
        sub(/^alsa-devel$/, "alsa-lib-devel", $2)
+       sub(/^libqt4-devel$/, "qt4-build, qt4-qmake, QtCore-devel", $2)
        sub(/^gtk-sharp2$/, "dotnet-gtk-sharp2", $2)
        sub(/^gtkmm2-devel$/, "gtkmm-devel", $2)
        sub(/^libexpat-devel$/, "expat-devel", $2)
        sub(/^libffmpeg-devel$/, "ffmpeg-devel", $2)
+       sub(/^libffms2-devel$/, "ffms2-devel", $2)
        sub(/^libopenssl-devel$/, "openssl-devel", $2)
        sub(/^libpulse-devel$/, "pulseaudio-devel", $2)
        sub(/^monodoc-core$/, "mono-monodoc", $2)
This page took 0.036315 seconds and 4 git commands to generate.