]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
- fix groups
[packages/rpm-build-tools.git] / adapter.awk
index b86a3f1a525c4849f1829611e0a4cb37fa814928..64ec6377ce9a86272d54ddb87b96ed9c10658f4c 100644 (file)
@@ -440,7 +440,12 @@ function b_makekey(a, b,   s) {
 
        preamble = 0
 
-       if (/^[ \t]*rm([ \t]+-[rf]+)*[ \t]+\${?RPM_BUILD_ROOT}?/ && did_rmroot==0) {
+       # foreign rpms
+       sub("^%{__rm} -rf %{buildroot}", "rm -rf $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
                print "rm -rf $RPM_BUILD_ROOT"
                next
@@ -481,10 +486,6 @@ function b_makekey(a, b,   s) {
        if ($1 ~ /chmod/ && $2 ~ /644/)
                next
 
-       # foreign rpms
-       $0 = fixedsub("%buildroot", "$RPM_BUILD_ROOT", $0)
-       $0 = fixedsub("%{buildroot}", "$RPM_BUILD_ROOT", $0)
-
        # atrpms
        $0 = fixedsub("%perl_makeinstall", "%{__make} pure_install \\\n\tDESTDIR=$RPM_BUILD_ROOT", $0);
 }
@@ -645,8 +646,10 @@ preamble == 1 {
                sub(/^X11\/GNOME/,"X11/Applications", group)
                sub(/^X11\/Utilities/,"X11/Applications", group)
                sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy", group)
+               sub(/^X11\/Library/,"X11/Libraries", group)
                sub(/^Shells/,"Applications/Shells", group)
                sub(/^System Environment\/Libraries$/, "Libraries", group)
+               sub(/^Library\/Development$/, "Development/Libraries", group)
                sub(/^System Environment\/Daemons$/, "Daemons", group)
                sub(/^Applications\/Internet$/, "Applications/Networking", group)
                sub(/^Applications\/Daemons$/, "Daemons", group)
@@ -665,6 +668,8 @@ preamble == 1 {
                sub(/^Development\/Testing$/, "Development", group)
                sub(/^Text Processing\/Markup\/HTML$/, "Applications/Text", group)
                sub(/^Text Processing\/Markup\/XML$/, "Applications/Text", group)
+               sub(/^Web\/Database$/, "Applications/WWW", group)
+               sub(/^System Environment\/Base$/, "Base", group)
 
                $0 = "Group:\t\t" group
 
@@ -727,7 +732,6 @@ preamble == 1 {
 
         # jpackages
                sub(/^java-devel$/, "jdk", $2);
-               sub(/^ant$/, "jakarta-ant", $2);
                sub(/^log4j$/, "jakarta-log4j", $2);
                sub(/^oro$/, "jakarta-oro", $2);
                sub(/^xerces-j2$/, "xerces-j", $2);
@@ -943,7 +947,7 @@ preamble == 1 {
        print
 
        if (name_seen == 0 && name) {
-               print "Name:\t" name
+               print "Name:\t\t" name
                name_seen = 1
        }
 
@@ -1047,6 +1051,7 @@ function use_macros()
        gsub(py_sitedir, "%{py_sitedir}")
        gsub(py_scriptdir, "%{py_scriptdir}")
        gsub("%{_libdir}/python2.4/site-packages", "%{py_sitedir}")
+       gsub("%{python_sitelib}", "%{py_sitedir}")
        gsub("%{_datadir}/applications", "%{_desktopdir}")
        gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}")
 
@@ -1083,6 +1088,10 @@ function use_macros()
                        continue;
                if ($c ~ sysconfdir "/{?env.d")
                        continue;
+               if ($c ~ sysconfdir "/{?modprobe.(d|conf)")
+                       continue;
+               if ($c ~ sysconfdir "/{?udev/rules.d")
+                       continue;
                if ($c ~ sysconfdir "/{?logrotate.d")
                        continue;
                if ($c ~ sysconfdir "/{?pam.d")
@@ -1111,6 +1120,8 @@ function use_macros()
                        continue;
                if ($c ~ sysconfdir "/{?samba")
                        continue;
+               if ($c ~ sysconfdir "/shells")
+                       continue;
                gsub(sysconfdir, "%{_sysconfdir}", $c)
        }
 
@@ -1282,6 +1293,8 @@ function use_files_macros(        i, n, t, a)
                return;
        }
 
+       sub("^%doc %{_mandir}", "%{_mandir}")
+
        gsub("^%{_sbindir}", "%attr(755,root,root) %{_sbindir}")
        gsub("^%{_bindir}", "%attr(755,root,root) %{_bindir}")
 
@@ -1356,6 +1369,12 @@ function use_files_macros(       i, n, t, a)
                gsub("%attr\\(0", "%attr(")
        }
 
+    # kill default attrs
+    gsub(/%dir %attr\(755,root,root\)/, "%dir");
+    if (!/%dir/) {
+        gsub(/%attr\(644,root,root\) /, "");
+    }
+
        # sort %verify attrs
        if (match($0, /%verify\(not([^)]+)\)/)) {
                t = substr($0, RSTART, RLENGTH)
This page took 0.047954 seconds and 4 git commands to generate.