]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
- let --mr-proper respect builddir
[packages/rpm-build-tools.git] / adapter.awk
index fdbd5098310214b14ca7c016704795ccbaf4da06..f6f0b16de258a66de42049af023e2565a9f4ade4 100644 (file)
@@ -360,6 +360,11 @@ function b_makekey(a, b,   s) {
        }
        sub("^%patch ", "%patch0 ");
 
+       # fedora extras
+       if (/^%apply/) {
+               sub("^%apply -n", "%patch");
+       }
+
        # invalid in %prep
        sub("^rm -rf \$RPM_BUILD_ROOT.*", "");
 }
@@ -604,6 +609,19 @@ function b_makekey(a, b,   s) {
                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(" &>/dev/null \\|\\| :", "");
+       }
+
+       if (/%__fe_groupadd/) {
+               sub("%__fe_groupadd", "%groupadd -g ");
+               sub(" &>/dev/null \\|\\| :", "");
+       }
+
        # %useradd and %groupadd may not be wrapped
        if (/%(useradd|groupadd).*\\$/) {
                a = $0; getline;
@@ -615,6 +633,20 @@ function b_makekey(a, b,   s) {
 
 /^%post/, (!/^%post/ && $0 ~ SECTIONS) {
        preamble = 0
+
+       # fedora extras macros
+       sub("%__chkconfig", "/sbin/chkconfig");
+
+       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("export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`", "")
+       if (/gconftool-2 --makefile-install-rule/) {
+               sub("gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/", "%gconf_schema_install ")
+               sub("> /dev/null", "");
+       }
+
        use_macros()
 }
 /^%preun/, (!/^%preun/ && $0 ~ SECTIONS) {
@@ -623,6 +655,14 @@ function b_makekey(a, b,   s) {
 }
 /^%postun/, (!/^%postun/ && $0 ~ SECTIONS) {
        preamble = 0
+
+       # fedora extras macros
+       if (/%__fe_userdel|%__fe_groupdel/) {
+               sub("%__fe_groupdel", "%groupremove");
+               sub("%__fe_userdel", "%userremove");
+               sub(" &>/dev/null \\|\\| :", "");
+       }
+
        use_script_macros()
 }
 /^%triggerin/, (!/^%triggerin/ && $0 ~ SECTIONS) {
@@ -1782,6 +1822,16 @@ function kill_preamble_macros()
                $2 = demacroize($2);
                $2 = unify_url($2)
        }
+
+       # fedora extras
+       if (/%{\?FE_USERADD_REQ}/) {
+               $0 = "";
+               print "BuildRequires:   rpmbuild(macros) >= 1.202"
+               print "Provides:        user(xxx)"
+               print "Requires(postun):        /usr/sbin/userdel"
+               print "Requires(pre):  /bin/id"
+               print "Requires(pre):  /usr/sbin/useradd"
+       }
 }
 
 function get_epoch(pkg, ver,   epoch)
@@ -2071,6 +2121,7 @@ function replace_requires() {
 
        # fedora / redhat
        sub(/^Django$/, "python-django", $2);
+       sub(/^Django$/, "python-django", $2);
        sub(/^GitPython$/, "python-git", $2);
        sub(/^PyQt4-devel$/, "python-PyQt4-devel", $2);
        sub(/^PyQwt-devel$/, "python-PyQwt-devel", $2);
@@ -2084,16 +2135,21 @@ function replace_requires() {
        sub(/^gamin-python$/, "python-gamin", $2);
        sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
        sub(/^gnome-python2-extras$/, "python-gnome-extras", $2);
+       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(/^gtk-sharp2-devel$/, "dotnet-gtk-sharp2-devel", $2);
        sub(/^gtk2$/, "gtk+2", $2);
        sub(/^gtk2-devel$/, "gtk+2-devel", $2);
+       sub(/^gtk3-devel$/, "gtk+3-devel", $2);
        sub(/^initscripts$/, "rc-scripts", $2);
        sub(/^iproute$/, "iproute2", $2);
        sub(/^iscsi-initiator-utils$/, "open-iscsi", $2);
        sub(/^libXft-devel$/, "xorg-lib-libXft-devel", $2);
        sub(/^libXrandr-devel$/, "xorg-lib-libXrandr-devel", $2);
+       sub(/^libacl-devel$/, "acl-devel", $2);
        sub(/^libcurl-devel$/, "curl-devel", $2);
+       sub(/^libgudev1-devel$/, "udev-glib-devel", $2);
        sub(/^libsrtp-devel$/, "srtp-devel", $2);
        sub(/^mod_wsgi$/, "apache-mod_wsgi", $2);
        sub(/^notify-python$/, "python-pynotify", $2);
@@ -2104,6 +2160,7 @@ function replace_requires() {
        sub(/^pygobject2$/, "python-pygobject", $2);
        sub(/^pygtk2$/, "python-pygtk", $2);
        sub(/^pygtk2-devel$/, "python-pygtk-devel", $2);
+       sub(/^pygtk2-libglade$/, "python-pygtk-glade", $2);
        sub(/^pysvn$/, "python-pysvn", $2);
        sub(/^python-enchant$/, "python-pyenchant", $2);
        sub(/^python-imaging$/, "python-PIL", $2);
This page took 0.059485 seconds and 4 git commands to generate.