]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.awk
Install link to mirrors file
[packages/rpm-build-tools.git] / adapter.awk
index 19e8da90f44fb45dbf1b8b2ff165dbc3ddeb4590..414f4d7d2db42ae4ec50d71bee18d91a6a49622d 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Adapter adapts .spec files for PLD Linux.
 #
-# Copyright (C) 1999-2011 PLD-Team <feedback@pld-linux.org>
+# Copyright (C) 1999-2012 PLD-Team <feedback@pld-linux.org>
 # Authors:
 #      MichaƂ Kuratczyk <kura@pld.org.pl>
 #      Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
@@ -33,16 +33,14 @@ BEGIN {
        RPM_SECTIONS = "package|build|changelog|clean|description|install|post|posttrans|postun|pre|prep|pretrans|preun|triggerin|triggerpostun|triggerun|verifyscript|check"
        SECTIONS = "^%(" RPM_SECTIONS ")"
 
-       RCSID = "$Id$"
-       rev = RCSID # TODO: parse from RCSID
-       VERSION = "0.35/" rev
+       rev = "1.514"
+       VERSION = "0.36/" rev
 
        PREAMBLE_TAGS = "(R|BR|Summary|Name|Version|Release|Epoch|License|Group|URL|BuildArch|BuildRoot|Obsoletes|Conflicts|Provides|ExclusiveArch|ExcludeArch|Pre[Rr]eq|(Build)?Requires|Suggests|Auto(Req|Prov))"
 
        usedigest = 0   # Enable to switch to rpm 4.4.6+ md5 digests
 
        preamble = 1    # Is it part of preamble? Default - yes
-       boc = 4                 # Beginning of %changelog
        bod = 0                 # Beginning of %description
        tw = 70                 # Descriptions width
 
@@ -64,21 +62,6 @@ BEGIN {
 
        system("cd "packages_dir"; [ -f rpm.groups ] || cvs up rpm.groups > /dev/null")
        system("[ -d ../PLD-doc ] && cd ../PLD-doc && ([ -f BuildRequires.txt ] || cvs up BuildRequires.txt >/dev/null)");
-
-       # Temporary file for changelog section
-       changelog_file = mktemp("adapter.changelogXXXXXX")
-}
-
-# There should be a comment with CVS keywords on the first line of file.
-FNR == 1 {
-       if (!/^# \$[R]evision: .* \$, \$[D]ate: .* \$$/) {      # If this line is already OK?
-               print "# $" "Revision:$, " "$" "Date:$" # No
-               if ( /^#.*([rR]evision|[dD]ate)/ ) # There was something similar, but incorrect
-                        next
-       } else {
-               print $0                                # Yes
-               next            # It is enough for first line
-       }
 }
 
 # If the latest line matched /%files/
@@ -166,8 +149,9 @@ function b_makekey(a, b,    s) {
        if ($2 == "_applnkdir") {
                next
        }
+
+       # FIXME: this section will likely never match after cvs->git migration
        if ($2 == "date") {
-               date = 1
                if (did_files == 0) {
                        print "%files"
                        print ""
@@ -539,65 +523,6 @@ function b_makekey(a, b,   s) {
        }
 }
 
-##############
-# %changelog #
-##############
-/^%changelog/, (!/^%changelog/ && $0 ~ SECTIONS) {
-       preamble = 0
-       has_changelog = 1
-       skip = 0
-       # There should be some CVS keywords on the first line of %changelog.
-       if (boc == 3) {
-               if ($0 !~ _cvsmailfeedback) {
-                       print "* %{date} " _cvsmailfeedback > changelog_file
-               } else {
-                       skip = 1
-               }
-               boc = 2
-       }
-       if (boc == 2 && !skip) {
-               if (!/All persons listed below/) {
-                       printf "All persons listed below can be reached at " > changelog_file
-                       print "<cvs_login>" _cvsmaildomain "\n" > changelog_file
-               } else {
-                       skip = 1
-               }
-               boc = 1
-       }
-       if (boc == 1 && !skip) {
-               if (!/^$/) {
-                       if (!/\$.*Log:.*\$/) {
-                               print "$" "Log:$" > changelog_file
-                       }
-                       boc = 0
-               }
-       }
-       # Define date macro.
-       if (boc == 4) {
-               if (date == 0) {
-                       printf "%%define date\t%%(echo `LC_ALL=\"C\"" > changelog_file
-                       print " date +\"%a %b %d %Y\"`)" > changelog_file
-                       date = 1
-               }
-               boc = 3
-       }
-
-       sub(/[ \t]+$/, "");
-       if (!/^%[a-z]+$/ || /changelog/) {
-               # stop changelog if "real" changelog starts
-               if (boc == 0 && /^\* /) {
-                       boc = -1
-               }
-               if (boc == -1) {
-                       next;
-               }
-               print > changelog_file
-       } else {
-               print
-       }
-       next
-}
-
 ###########
 # SCRIPTS #
 ###########
@@ -1082,36 +1007,11 @@ END {
                }
        }
 
-       close(changelog_file)
-       while ((getline < changelog_file) > 0)
-               print
-       system("rm -f " changelog_file)
-
        if (did_clean == 0) {
                print ""
                print "%clean"
                print "rm -rf $RPM_BUILD_ROOT"
        }
-
-       if (date == 0) {
-               print ""
-               print "%define date\t%(echo `LC_ALL=\"C\" date +\"%a %b %d %Y\"`)"
-       }
-
-       if (has_changelog == 0) {
-               print "%changelog"
-       }
-
-       if (boc > 2) {
-               print "* %{date} PLD Team <feedback@pld-linux.org>"
-       }
-       if (boc > 1) {
-               printf "All persons listed below can be reached at "
-               print "<cvs_login>@pld-linux.org\n"
-       }
-       if (boc > 0) {
-               print "$" "Log:$"
-       }
 }
 
 # substitutes fixed strings (not regexps)
@@ -1187,6 +1087,9 @@ function use_macros()
        gsub(ruby_sitelibdir, "%{ruby_sitelibdir}")
        gsub(ruby_rdocdir, "%{ruby_rdocdir}")
 
+       gsub(systemdunitdir, "%{systemdunitdir}")
+       gsub(systemdtmpfilesdir, "%{systemdtmpfilesdir}")
+
        gsub("%{_datadir}/applications", "%{_desktopdir}")
        gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}")
        gsub("%{_datadir}/java", "%{_javadir}")
@@ -1197,6 +1100,9 @@ function use_macros()
        gsub("%{_datadir}/pkgconfig", "%{_npkgconfigdir}")
        gsub(npkgconfigdir, "%{_npkgconfigdir}")
 
+       gsub("%{_datadir}/locale", "%{_localedir}")
+       gsub(localedir, "%{_localedir}")
+
        gsub(libdir, "%{_libdir}")
        gsub(javadir, "%{_javadir}")
 
@@ -1458,9 +1364,6 @@ function use_macros()
        if (pear_subclass) {
                gsub("%{_subclass}", pear_subclass);
        }
-
-       gsub("/lib/systemd/system", "%{systemdunitdir}")
-
 }
 
 function format_configure(line,                n, a, s) {
@@ -1889,7 +1792,7 @@ function add_br(br)
 
 # Load rpm macros
 # you should update the list also in adapter when making changes here
-function import_rpm_macros() {
+function import_rpm_macros(  v) {
        # File with rpm groups
        topdir = ENVIRON["_topdir"]
 
@@ -1900,17 +1803,13 @@ function import_rpm_macros() {
        }
 
        # update this version dep each time some new macro export is added
-       if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < 1.47) {
-               print "adapter shell script is outdated, please cvs up it" > "/dev/stderr"
+       v = 1.49
+       if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < v) {
+               printf("adapter shell script is outdated: Need %s, got %s. Please update it.\n", v, ENVIRON["ADAPTER_REVISION"]) > "/dev/stderr"
                do_not_touch_anything = 1
                exit(rc = 1);
        }
 
-       # get cvsaddress for changelog section
-       # using rpm macros as too lazy to add ~/.adapterrc parsing support.
-       _cvsmaildomain = ENVIRON["_cvsmaildomain"]
-       _cvsmailfeedback = ENVIRON["_cvsmailfeedback"]
-
        prefix = ENVIRON["_prefix"]
        bindir = ENVIRON["_bindir"]
        sbindir = ENVIRON["_sbindir"]
@@ -1929,6 +1828,7 @@ function import_rpm_macros() {
        javadir = ENVIRON["_javadir"]
        pkgconfigdir = ENVIRON["_pkgconfigdir"]
        npkgconfigdir = ENVIRON["_npkgconfigdir"]
+       localedir = ENVIRON["_localedir"]
 
        perl_sitearch = ENVIRON["perl_sitearch"]
        perl_archlib = ENVIRON["perl_archlib"]
@@ -1957,6 +1857,9 @@ function import_rpm_macros() {
        php_pear_dir = ENVIRON["php_pear_dir"]
        php_data_dir = ENVIRON["php_data_dir"]
        tmpdir = ENVIRON["tmpdir"]
+
+       systemdunitdir = ENVIRON["systemdunitdir"]
+       systemdtmpfilesdir = ENVIRON["systemdtmpfilesdir"]
 }
 
 # php virtual deps as discussed in devel-en
@@ -2042,6 +1945,7 @@ function replace_groupnames(group) {
        group = replace(group, "Text Processing/Markup/XML", "Applications/Text");
        group = replace(group, "Text tools", "Applications/Text");
        group = replace(group, "User Interface/Desktops", "X11/Applications");
+       group = replace(group, "User Interface/X", "X11/Applications");
        group = replace(group, "Utilities/System", "Applications/System");
        group = replace(group, "Web/Database", "Applications/WWW");
        group = replace(group, "X11/GNOME", "X11/Applications");
@@ -2070,11 +1974,13 @@ function replace_requires() {
 
        # jpackages / fedora java packages
        sub(/^antlr3$/, "java-antlr3", $2);
+       sub(/^aqute-bnd$/, "java-bnd", $2);
        sub(/^avalon-framework$/, "java-avalon-framework", $2);
        sub(/^avalon-logkit$/, "java-avalon-logkit", $2);
        sub(/^axis$/, "java-axis", $2);
        sub(/^bouncycastle$/, "java-bcprov", $2);
        sub(/^bouncycastle-mail$/, "java-bcmail", $2);
+       sub(/^bouncycastle-pg$/, "java-bcpg", $2);
        sub(/^bouncycastle-tsp$/, "java-bctsp", $2);
        sub(/^bsf$/, "java-bsf", $2);
        sub(/^dom4j$/, "java-dom4j", $2);
@@ -2093,7 +1999,6 @@ function replace_requires() {
        sub(/^jakarta-oro$/, "java-oro", $2);
        sub(/^jakarta-servletapi$/, "java(servlet)", $2);
        sub(/^java-devel$/, "jdk", $2);
-       sub(/^java-xerces$/, "java(jaxp_parser_impl)", $2);
        sub(/^java\(JSP\)$/, "java(jsp)", $2);
        sub(/^java\(JavaServerFaces\)$/, "java(javaserverfaces)", $2);
        sub(/^java\(Portlet\)$/, "java(portlet)", $2);
@@ -2136,8 +2041,8 @@ function replace_requires() {
        sub(/^wsdl4j$/, "java-wsdl4j", $2);
        sub(/^xalan-j$/, "java-xalan", $2);
        sub(/^xalan-j2$/, "java-xalan", $2);
-       sub(/^xerces-j$/, "java(jaxp_parser_impl)", $2);
-       sub(/^xerces-j2$/, "java(jaxp_parser_impl)", $2);
+       sub(/^xerces-j$/, "java-xerces", $2);
+       sub(/^xerces-j2$/, "java-xerces", $2);
        sub(/^xml-commons-apis$/, "java-xml-commons", $2);
        sub(/^xml-commons-resolver$/, "java-xml-commons-resolver", $2);
        sub(/^xmldb-api$/, "java-xmldb", $2);
@@ -2152,11 +2057,13 @@ function replace_requires() {
        sub(/^chkconfig$/, "/sbin/chkconfig", $2);
        sub(/^db4-devel$/, "db-devel", $2);
        sub(/^dbus-python$/, "python-dbus", $2);
+       sub(/^desktop-notification-daemon$/, "dbus(org.freedesktop.Notifications)", $2);
        sub(/^file-devel$/, "libmagic-devel", $2);
        sub(/^freetype2-devel$/, "freetype-devel", $2);
        sub(/^fuse-devel$/, "libfuse-devel", $2);
        sub(/^gamin-python$/, "python-gamin", $2);
        sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
+       sub(/^gnome-desktop3-devel$/, "gnome-desktop-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);
@@ -2169,11 +2076,24 @@ function replace_requires() {
        sub(/^iproute$/, "iproute2", $2);
        sub(/^iscsi-initiator-utils$/, "open-iscsi", $2);
        sub(/^keyutils-libs-devel$/, "keyutils-devel", $2);
+       sub(/^libSM-devel$/, "xorg-lib-libSM-devel", $2);
+       sub(/^libX11-devel$/, "xorg-lib-libX11-devel", $2);
+       sub(/^libXScrnSaver-devel$/, "xorg-lib-libXScrnSaver-devel", $2);
+       sub(/^libXau-devel$/, "xorg-lib-libXau-devel", $2);
+       sub(/^libXcomposite-devel$/, "xorg-lib-libXcomposite-devel", $2);
+       sub(/^libXcursor-devel$/, "xorg-lib-libXcursor-devel", $2);
+       sub(/^libXdamage-devel$/, "xorg-lib-libXdamage-devel", $2);
+       sub(/^libXext-devel$/, "xorg-lib-libXext-devel", $2);
        sub(/^libXft-devel$/, "xorg-lib-libXft-devel", $2);
+       sub(/^libXinerama-devel$/, "xorg-lib-libXinerama-devel", $2);
        sub(/^libXrandr-devel$/, "xorg-lib-libXrandr-devel", $2);
+       sub(/^libXrender-devel$/, "xorg-lib-libXrender-devel", $2);
+       sub(/^libXxf86vm-devel$/, "xorg-lib-libXxf86vm-devel", $2);
        sub(/^libacl-devel$/, "acl-devel", $2);
        sub(/^libcurl-devel$/, "curl-devel", $2);
        sub(/^libgudev1-devel$/, "udev-glib-devel", $2);
+       sub(/^libmx-devel$/, "mx-devel", $2);
+       sub(/^libselinux-python$/, "python-selinux", $2);
        sub(/^libsrtp-devel$/, "srtp-devel", $2);
        sub(/^libtdb$/, "tdb", $2);
        sub(/^libtdb-devel$/, "tdb-devel", $2);
@@ -2181,21 +2101,26 @@ function replace_requires() {
        sub(/^libtevent-devel$/, "tevent-devel", $2);
        sub(/^libusb1-devel$/, "libusb-devel", $2);
        sub(/^mod_wsgi$/, "apache-mod_wsgi", $2);
+       sub(/^newt-python$/, "python-snack", $2);
        sub(/^notify-python$/, "python-pynotify", $2);
        sub(/^pcsc-lite-ccid$/, "pcsc-driver-ccid", $2);
        sub(/^pulseaudio-libs-devel$/, "pulseaudio-devel", $2);
        sub(/^pyOpenSSL$/, "python-pyOpenSSL", $2);
+       sub(/^pycairo$/, "python-pycairo", $2);
        sub(/^pyflakes$/, "python-pyflakes", $2);
        sub(/^pygobject2$/, "python-pygobject", $2);
+       sub(/^pygobject3-devel$/, "python-pygobject3-common-devel", $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(/^pytalloc$/, "python-talloc", $2);
        sub(/^pytalloc-devel$/, "python-talloc-devel", $2);
+       sub(/^python-cups$/, "python-pycups", $2);
        sub(/^python-enchant$/, "python-pyenchant", $2);
        sub(/^python-imaging$/, "python-PIL", $2);
        sub(/^python-imaging-tk$/, "python-PIL-tk", $2);
+       sub(/^python-newt$/, "python-snack", $2);
        sub(/^python-pygtk$/, "python-pygtk-gtk", $2);
        sub(/^python-recaptcha-client$/, "python-recaptcha", $2);
        sub(/^python-twisted-core$/, "python-TwistedCore", $2);
@@ -2212,6 +2137,7 @@ function replace_requires() {
        sub(/^tftp-server$/, "tftpdaemon", $2);
        sub(/^tkinter$/, "python-tkinter", $2);
        sub(/^urw-fonts$/, "fonts-Type1-urw", $2);
+       sub(/^webkitgtk3-devel$/, "gtk-webkit3-devel", $2);
        sub(/^xapian-bindings-python$/, "python-xapian", $2);
        sub(/^xorg-x11-server-sdk$/, "xorg-xserver-server-devel", $2);
 
This page took 0.056606 seconds and 4 git commands to generate.