]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
sf changed API but also made things simpler on files RSS side - use that for monitoring
[packages/rpm-build-tools.git] / adapter.awk
index 53aafec8d7f8b4549fadeb090fa0f3a7a279a396..b98a38f11a62427d8a8d764ddd374beffdf0a950 100644 (file)
@@ -252,6 +252,7 @@ function b_makekey(a, b,    s) {
 
 # %package part
 /^%package/, (!/^%package/ && $0 ~ SECTIONS) {
+       # FIXME: this breaks \t indenting in preamble?
        gsub(/\t/, " ")
 }
 
@@ -641,6 +642,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:"
@@ -690,7 +696,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" ||
@@ -961,6 +967,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
 
@@ -1053,6 +1060,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()
 {
@@ -1087,6 +1111,8 @@ function use_macros()
                return
        }
 
+       common_macros()
+
        sub("%{_defaultdocdir}", "%{_docdir}")
        sub("%{_datadir}/doc", "%{_docdir}")
        sub("%{_bindir}/perl", "%{__perl}")
@@ -1258,6 +1284,7 @@ function use_macros()
        gsub(php_pear_dir, "%{php_pear_dir}")
        gsub(php_data_dir, "%{php_data_dir}")
 
+       # change to %{_datadir}, with some exceptions
        for (c = 1; c <= NF; c++) {
                if ($c ~ datadir "/automake")
                        continue
@@ -1268,6 +1295,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}")
@@ -2031,6 +2061,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")
@@ -2112,6 +2143,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)
This page took 0.054975 seconds and 4 git commands to generate.