]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- adapter up to rev. 1.43 auto/th/rpm-build-tools-4_4_36-1
authorpawelz <pawelz@pld-linux.org>
Tue, 16 Feb 2010 17:36:38 +0000 (17:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- adapter.awk up to rev. 1.438
- builder up to rev. 1.606
- pldnotify.awk up to rev. 1.78
- let it be version 4.4.36

Changed files:
    adapter_.awk -> 1.11
    adapter_.sh -> 1.7
    builder_.sh -> 1.27
    pldnotify_.awk -> 1.10
    rpm-build-tools.spec -> 1.19

adapter_.awk
adapter_.sh
builder_.sh
pldnotify_.awk
rpm-build-tools.spec

index c3bde7f6614f9d73579744a863ad586c272af557..2c5eebf88d8a6e63b4025d3a9c884361bb010652 100644 (file)
@@ -26,6 +26,8 @@
 # - desc wrapping is totally fucked up on global.spec,1.25, dosemu.spec,1.115-
 # - it should change: /%source([0-9]+)/i to %{SOURCE\1}
 # - extra quote on LDFLAGS line: https://bugs.launchpad.net/pld-linux/+bug/385836
+# - %{with_foo:%attr()...} gets converted to %attr() %{with_foo:...} [vlc.spec]
+# - 'R: foo ' (with traliling space) gets coverted to "R: foo\nR: " [vlc.spec @ 1.199 ]
 
 BEGIN {
        RPM_SECTIONS = "package|build|changelog|clean|description|install|post|posttrans|postun|pre|prep|pretrans|preun|triggerin|triggerpostun|triggerun|verifyscript|check"
@@ -57,7 +59,7 @@ BEGIN {
 
        import_rpm_macros()
 
-       packages_dir = topdir "/packages"
+       packages_dir = topdir
        groups_file = packages_dir "/rpm.groups"
 
        system("cd "packages_dir"; [ -f rpm.groups ] || cvs up rpm.groups > /dev/null")
@@ -708,7 +710,7 @@ preamble == 1 {
                replace_requires();
        }
 
-       if (field ~ /^requires:/) {
+       if (field ~ /^requires:/ || field ~ /^requires\(/) {
                replace_requires();
        }
 
@@ -728,6 +730,11 @@ preamble == 1 {
                $1 = "License:"
        }
 
+       # ease updating from debian .dsc
+       if (field ~ /homepage:/) {
+               $1 = "URL:"
+       }
+
        if (field ~ /license:/) {
                l = substr($0, index($0, $2));
                if (l == "Python Software Foundation License") {
@@ -751,6 +758,9 @@ preamble == 1 {
                if (l == "GPLv2+") {
                        l = "GPL v2+"
                }
+               if (l == "LGPLv2+") {
+                       l = "LGPL v2+"
+               }
                $0 = "License:\t" l;
        }
 
@@ -1403,6 +1413,11 @@ function use_files_macros(       i, n, t, a, l)
                $0 = "%attr(755,root,root) " $0
        }
 
+       # remove attrs from man pages
+       if (/%{_mandir}/ && /^%attr/) {
+               sub("^%attr\\(.*\\) *", "");
+       }
+
        # /etc/sysconfig files
        # %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/*
        # attr not required, allow default 644 attr
@@ -1572,20 +1587,26 @@ function unify_url(url)
 {
 
        # sourceforge urls
-       # Docs about sourceforge mirror system: http://sourceforge.net/docs/B05/
-       sub("[?&]big_mirror=.*$", "", url);
-       sub("[?&]modtime=.*$", "", url);
-       sub("[?]use_mirror=.*$", "", url);
-       sub("[?]download$", "", url);
-
-       sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
-       sub("^http://download\.sf\.net/", "http://dl.sourceforge.net/", url)
-       sub("^http://download\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
-       sub("^http://downloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
-
-       sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
-       sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", url)
-       sub("^http://dl\.sf\.net/", "http://dl.sourceforge.net/", url)
+       # Docs about sourceforge mirror system: http://sourceforge.net/apps/trac/sourceforge/wiki/Mirrors
+       sub("^http://prdownloads\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://download\.sf\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://download\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://dl\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://.*\.dl\.sourceforge\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://dl\.sf\.net/", "http://downloads.sourceforge.net/", url)
+       sub("^http://downloads\.sourceforge\.net/sourceforge/", "http://downloads.sourceforge.net/", url)
+       # new style urls, strip "files/" between and prepend dl.
+       if (match(url, "^http://sourceforge.net/projects/[^/]+/files/")) {
+               url = substr(url, 1, RLENGTH - length("files/")) substr(url, RSTART + RLENGTH);
+               sub("^http://sourceforge.net/projects/", "http://downloads.sourceforge.net/project/", url);
+       }
+       if (url ~ /sourceforge.net/) {
+               sub("[?&]big_mirror=.*$", "", url);
+               sub("[?&]modtime=.*$", "", url);
+               sub("[?]use_mirror=.*$", "", url);
+               sub("[?]download$", "", url);
+               sub("/download$", "", url);
+       }
 
        sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", url)
        sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", url)
@@ -1693,73 +1714,6 @@ function add_br(br)
        BR[BR_count++] = br
 }
 
-function replace_requires()
-{
-
-       # jpackages
-       sub(/^java-devel$/, "jdk", $2);
-       sub(/^log4j$/, "java-log4j", $2);
-       sub(/^logging-log4j$/, "java-log4j", $2);
-       sub(/^jakarta-log4j$/, "java-log4j", $2);
-       sub(/^oro$/, "java-oro", $2);
-       sub(/^jakarta-oro$/, "java-oro", $2);
-       sub(/^jakarta-ant$/, "ant", $2);
-       sub(/^xerces-j2$/, "java-xerces", $2);
-       sub(/^xerces-j$/, "java-xerces", $2);
-       sub(/^ldapjdk$/, "ldapsdk", $2);
-       sub(/^saxon-scripts$/, "saxon", $2);
-       sub(/^xalan-j2$/, "java-xalan", $2);
-       sub(/^xalan-j$/, "java-xalan", $2);
-       sub(/^gnu-regexp$/, "java-gnu-regexp", $2);
-       sub(/^gnu.regexp$/, "java-gnu-regexp", $2);
-       sub(/^jakarta-commons-httpclient$/, "java-commons-httpclient", $2);
-       sub(/^xml-commons-resolver$/, "java-xml-commons-resolver", $2);
-       sub(/^axis$/, "java-axis", $2);
-       sub(/^wsdl4j$/, "java-wsdl4j", $2);
-       sub(/^uddi4j$/, "java-uddi4j", $2);
-       sub(/^hamcrest$/, "java-hamcrest", $2);
-
-       # redhat virtual
-       sub(/^tftp-server$/, "tftpdaemon", $2);
-
-       sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
-       sub(/^chkconfig$/, "/sbin/chkconfig", $2);
-
-       # fedora
-       sub(/^iscsi-initiator-utils$/, "open-iscsi", $2);
-
-       replace_php_virtual_deps()
-}
-
-# php virtual deps as discussed in devel-en
-function replace_php_virtual_deps()
-{
-       pkg = $2
-#      if (pkg == "php-program") {
-#              $0 = $1 "\t/usr/bin/php"
-#              return
-#      }
-
-#      if (pkg ~ /^php-[a-z]/ && pkg !~ /^php-(pear|common|cli|devel|fcgi|cgi|dirs|program|pecl-)/) {
-#              sub(/^php-/, "php(", pkg);
-#              sub(/$/, ") # verify this correctness -- it may be wanted to use specific not virtual dep", pkg);
-#              $2 = pkg
-#      }
-
-       if (pkg ~/^php$/) {
-               $2 = "webserver(php)";
-               if ($4 ~ /^[0-9]:/) {
-                       $4 = substr($4, 3);
-               }
-       }
-
-       if (pkg ~/^php4$/) {
-               $2 = "webserver(php)";
-               if ($4 ~ /^[0-9]:/) {
-                       $4 = substr($4, 3);
-               }
-       }
-}
 
 # Load rpm macros
 # you should update the list also in adapter when making changes here
@@ -1819,7 +1773,110 @@ function import_rpm_macros() {
        tmpdir = ENVIRON["tmpdir"]
 }
 
+
+# php virtual deps as discussed in devel-en
+function replace_php_virtual_deps() {
+       pkg = $2
+#      if (pkg == "php-program") {
+#              $0 = $1 "\t/usr/bin/php"
+#              return
+#      }
+
+#      if (pkg ~ /^php-[a-z]/ && pkg !~ /^php-(pear|common|cli|devel|fcgi|cgi|dirs|program|pecl-)/) {
+#              sub(/^php-/, "php(", pkg);
+#              sub(/$/, ") # verify this correctness -- it may be wanted to use specific not virtual dep", pkg);
+#              $2 = pkg
+#      }
+
+       if (pkg ~/^php$/) {
+               $2 = "webserver(php)";
+               if ($4 ~ /^[0-9]:/) {
+                       $4 = substr($4, 3);
+               }
+       }
+
+       if (pkg ~/^php4$/) {
+               $2 = "webserver(php)";
+               if ($4 ~ /^[0-9]:/) {
+                       $4 = substr($4, 3);
+               }
+       }
+}
+
+function replace_requires() {
+
+       # jpackages
+       sub(/^java-devel$/, "jdk", $2);
+       sub(/^log4j$/, "java-log4j", $2);
+       sub(/^logging-log4j$/, "java-log4j", $2);
+       sub(/^jakarta-log4j$/, "java-log4j", $2);
+       sub(/^oro$/, "java-oro", $2);
+       sub(/^jakarta-oro$/, "java-oro", $2);
+       sub(/^jakarta-ant$/, "ant", $2);
+       sub(/^xerces-j2$/, "java-xerces", $2);
+       sub(/^xerces-j$/, "java-xerces", $2);
+       sub(/^ldapjdk$/, "ldapsdk", $2);
+       sub(/^saxon-scripts$/, "saxon", $2);
+       sub(/^xalan-j2$/, "java-xalan", $2);
+       sub(/^xalan-j$/, "java-xalan", $2);
+       sub(/^gnu-regexp$/, "java-gnu-regexp", $2);
+       sub(/^gnu.regexp$/, "java-gnu-regexp", $2);
+       sub(/^jakarta-commons-httpclient$/, "java-commons-httpclient", $2);
+       sub(/^xml-commons-resolver$/, "java-xml-commons-resolver", $2);
+       sub(/^axis$/, "java-axis", $2);
+       sub(/^wsdl4j$/, "java-wsdl4j", $2);
+       sub(/^uddi4j$/, "java-uddi4j", $2);
+       sub(/^hamcrest$/, "java-hamcrest", $2);
+
+       # redhat virtual
+       sub(/^tftp-server$/, "tftpdaemon", $2);
+
+       sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
+       sub(/^chkconfig$/, "/sbin/chkconfig", $2);
+
+       # fedora
+       sub(/^iscsi-initiator-utils$/, "open-iscsi", $2);
+       sub(/^gnome-python2-extras$/, "python-gnome-extras", $2);
+       sub(/^gtk2$/, "gtk+2", $2);
+       sub(/^gtk2-devel$/, "gtk+2-devel", $2);
+       sub(/^pygtk2-devel$/, "python-pygtk-devel", $2);
+       sub(/^pygtk2$/, "python-pygtk", $2);
+       sub(/^qt4-devel$/, "qt4-build", $2);
+       sub(/^file-devel$/, "libmagic-devel", $2);
+       sub(/^gamin-python$/, "python-gamin", $2);
+       sub(/^pygobject2$/, "python-pygobject", $2);
+       sub(/^tkinter$/, "python-tkinter", $2);
+       sub(/^python-imaging$/, "python-PIL", $2);
+       sub(/^python-imaging-tk$/, "python-PIL-tk", $2);
+       sub(/^initscripts$/, "rc-scripts", $2);
+
+       # debian
+       sub(/^libgconf2-dev$/, "GConf2-devel", $2);
+       sub(/^libglib2.0-dev$/, "glib2-devel", $2);
+       sub(/^libgtk2.0-dev$/, "gtk+2-devel", $2);
+       sub(/^libhunspell-dev$/, "hunspell-devel", $2);
+       sub(/^libpango1.0-dev$/, "pango-devel", $2);
+       sub(/^libxslt1-dev$/, "libxslt-devel", $2);
+       sub(/^libgl1-mesa-dev$/, "OpenGL-devel", $2);
+       sub(/^mesa-common-dev$/, "OpenGL-devel", $2);
+       sub(/^libgl1-mesa-dri$/, "OpenGL", $2);
+       sub(/^libglu1-mesa-dev$/, "OpenGL-GLU-devel", $2);
+       sub(/^libxss-dev$/, "xorg-lib-libXScrnSaver-devel", $2);
+       sub(/^libboost-filesystem[0-9.]+-dev$/, "boost-devel", $2);
+       sub(/^libboost-program-options[0-9.]+-dev$/, "boost-devel", $2);
+       sub(/^libboost-regex[0-9.]+-dev$/, "boost-devel", $2);
+       sub(/^libboost-thread[0-9.]+-dev$/, "boost-devel", $2);
+       sub(/^libmcrypt-dev$/, "libmcrypt-devel", $2);
+       sub(/^libcurl4-openssl-dev$/, "curl-devel", $2);
+       sub(/^libmhash-dev$/, "mhash-devel", $2);
+       sub(/^libqt4-dev$/, "qt4-build", $2);
+       sub(/^libssl-dev$/, "openssl-devel", $2);
+
+       replace_php_virtual_deps()
+}
+
 function replace_groupnames(group) {
+       group = replace(group, "Amusements/Games", "Applications/Games");
        group = replace(group, "Amusements/Games/Strategy/Real Time", "X11/Applications/Games/Strategy");
        group = replace(group, "Application/Multimedia", "Applications/Multimedia");
        group = replace(group, "Application/System", "Applications/System");
@@ -1854,6 +1911,7 @@ function replace_groupnames(group) {
        group = replace(group, "System Environment/Daemons", "Daemons");
        group = replace(group, "System Environment/Kernel", "Base/Kernel");
        group = replace(group, "System Environment/Libraries", "Libraries");
+       group = replace(group, "System Tools", "Applications/System");
        group = replace(group, "System", "Base");
        group = replace(group, "System/Base", "Base");
        group = replace(group, "System/Kernel and hardware", "Base/Kernel");
@@ -1861,6 +1919,8 @@ function replace_groupnames(group) {
        group = replace(group, "System/Servers", "Daemons");
        group = replace(group, "Text Processing/Markup/HTML", "Applications/Text");
        group = replace(group, "Text Processing/Markup/XML", "Applications/Text");
+       group = replace(group, "User Interface/Desktops", "X11/Applications");
+       group = replace(group, "Utilities/System", "Applications/System");
        group = replace(group, "Web/Database", "Applications/WWW");
        group = replace(group, "X11/GNOME", "X11/Applications");
        group = replace(group, "X11/GNOME/Applications", "X11/Applications");
index e497e65b93546de5b2285c3c6ceaef94e161ec90..f3b25054ec57fe2ff1d746fb355c3415d8cefae6 100644 (file)
@@ -47,13 +47,25 @@ if [ ! -x /usr/bin/patch ]; then
        exit 1
 fi
 
+[ -n "$PAGER" ] || PAGER="/usr/bin/less -r"
+
+if [ -n "$CONFIG_DIR" ]; then
+       USER_CFG="$CONFIG_DIR/.adapterrc"
+elif [ -n "$HOME_ETC" ]; then
+       USER_CFG="$HOME_ETC/.adapterrc"
+else
+       USER_CFG=~/.adapterrc
+fi
+
+[ -f $USER_CFG ] && . $USER_CFG
+
 t=$(getopt -o hsomdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$PROGRAM" -- "$@") || exit $?
 eval set -- "$t"
 
 while true; do
        case "$1" in
        -h|--help)
-               echo 2>&1 "$usage"
+               echo 2>&1 "$usage"
                exit 1
        ;;
        -s|--no-sort|--skip-sort)
@@ -89,25 +101,42 @@ done
 
 diffcol()
 {
-        # vim like diff colourization
-        sed -e '
-        s,\e,\e[44m^[\e[49m,g;
-        s,\a,\e[44m^G\e[49m,g;
-        s,^\(Index:\|diff\|---\|+++\) .*$,\e[32m&,;
-        s,^@@ ,\e[33m&,g;
-        s,^-,\e[35m&,;
-        s,^+,\e[36m&,;
-        s,\r,\e[44m^M\e[49m,g;
-        s,     ,    ,g;
-        s,\([^[:space:]]\)\([[:space:]]\+\)$,\1\e[41m\2\e[49m,g;
-        s,$,\e[0m,
-        ' "$@"
+       # vim like diff colourization
+LC_ALL=en_US.UTF-8 gawk ' {
+       split( $0, S, /\t/ );
+       $0 = S[ 1 ];
+       for ( i = 2; i in S; i++ ) {
+               spaces = 7 - ( (length( $0 ) - 1) % 8 );
+               $0 = $0 "\xE2\x9E\x94";
+               for ( y = 0; y < spaces; y++ )
+                       $0 = $0 "\xE2\x87\xBE";
+               $0 = $0 S[ i ];
+       }
+       gsub( /\033/, "\033[44m^[\033[49m" );
+       cmd = "";
+       if ( sub( /^ /, "" ) )
+               cmd = " ";
+       sub( /(\xE2\x9E\x94(\xE2\x87\xBE)*| )+$/, "\033[31;41m&\033[39;49m" );
+       gsub( /\xE2\x9E\x94(\xE2\x87\xBE)*/, "\033[7m&\033[27m" );
+       gsub( /\xE2\x87\xBE/, " " );
+       # uncomment if you do not like utf-8 arrow
+       # gsub( /\xE2\x9E\x94/, ">" );
+       $0 = cmd $0;
+       gsub( /\007/, "\033[44m^G\033[49m" );
+       gsub( /\r/, "\033[44m^M\033[49m" );
+}
+/^(Index:|diff|---|\+\+\+) / { $0 = "\033[32m" $0 }
+/^@@ / { $0 = "\033[33m" $0 }
+/^-/ { $0 = "\033[35m" $0 }
+/^+/ { $0 = "\033[36m" $0 }
+{ $0 = $0 "\033[0m"; print }
+' "$@"
 }
 
 diff2hunks()
 {
-        # diff2hunks orignally by dig
-        perl -e '
+       # diff2hunks orignally by dig
+       perl -e '
 #! /usr/bin/perl -w
 
 use strict;
@@ -222,7 +251,7 @@ adapterize() {
        elif [ "$(diff --brief $SPECFILE $tmp)" ]; then
                diff -u $SPECFILE $tmp > $tmp.diff
                if [ -t 1 ]; then
-                               diffcol $tmp.diff | less -r
+                               diffcol $tmp.diff | $PAGER
                                while : ; do
                                        echo -n "Accept? (Yes, No, Confirm each chunk)? "
                                        read ans
@@ -235,12 +264,12 @@ adapterize() {
                                        [cC]) # confirm each chunk
                                                diff2hunks $tmp.diff
                                                for t in $(ls $tmp-*.diff); do
-                                                               diffcol $t | less -r
+                                                               diffcol $t | $PAGER
                                                                echo -n "Accept? (Yes, [N]o, Quit)? "
                                                                read ans
                                                                case "$ans" in
                                                                [yYoO]) # y0 mama
-                                                                       patch < $t
+                                                                       patch -p0 < $t
                                                                        ;;
                                                                [Q]) # Abort
                                                                        break
@@ -274,3 +303,5 @@ if [ $# -ne 1 -o ! -f "$SPECFILE" ]; then
 fi
 
 adapterize
+
+# vim: ts=4:sw=4
index a7d401b892a5cfabaccd0e70dbdb55fe55043cc7..45dfc64e1cf88374ce5d25e95a792c0de3c81ebe 100644 (file)
@@ -22,6 +22,7 @@
 # - builder -u fetches current version first (well that's okay, how you compare versions if you have no old spec?)
 # - when Icon: field is present, -5 and -a5 doesn't work
 # - builder -R skips installing BR if spec is not present before builder invocation (need to run builder twice)
+# - does not respect NoSource: X, and tries to cvs up such files [ example: VirtualBox-bin.spec and its Source0 ]
 # TODO:
 # - ability to do ./builder -bb foo.spec foo2.spec foo3.spec
 
@@ -86,7 +87,7 @@ BCOND=""
 GROUP_BCONDS="no"
 
 # create symlinks for tools in PACKAGE_DIR, see get_spec()
-SYMLINK_TOOLS="yes"
+SYMLINK_TOOLS="no"
 
 PATCHES=""
 SOURCES=""
@@ -264,8 +265,8 @@ Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|
                       them into src.rpm,
 --short-circuit     - short-circuit build
 -B, --branch        - add branch
--c, --clean         - clean all temporarily created files (in BUILD, SOURCES,
-                      SPECS and \$RPM_BUILD_ROOT and CVS/Entries) after rpmbuild commands.
+-c, --clean         - clean all temporarily created files (in BUILD\$RPM_BUILD_ROOT) after rpmbuild commands.
+                      may be used with building process.
 -m, --mr-proper     - clean all temporarily created files (in BUILD, SOURCES,
                                          SPECS and \$RPM_BUILD_ROOT and CVS/Entries). Doesn't run
                                          any rpm building.
@@ -374,7 +375,7 @@ Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|
 depspecname() {
        local package="$1"
 
-       package=$(echo "$package" | sed -e '/perl(.*)/{s,perl(\(.*\)),perl-\1,;s,::,-,g}')
+       package=$(echo "$package" | sed -e '/perl(.*)/{s,perl(\(.*\)),perl-\1,;s,::,-,g};' -e 's/-\(devel\|static\)$//' )
        echo "$package"
 }
 
@@ -411,7 +412,7 @@ update_shell_title() {
 # set TARGET from BuildArch: from SPECFILE
 set_spec_target() {
        if [ -n "$SPECFILE" ] && [ -z "$TARGET" ]; then
-               tmp=$(awk '/^BuildArch:/ { print $NF}' $ASSUMED_NAME/$SPECFILE)
+               tmp=$(awk '/^BuildArch:/ { print $NF; exit }' $ASSUMED_NAME/$SPECFILE)
                if [ "$tmp" ]; then
                                target_platform=$(rpm -E '%{_target_vendor}-%{_target_os}%{?_gnu}')
                                TARGET="$tmp"
@@ -437,16 +438,16 @@ minirpm() {
 %x8664 x86_64 amd64 ia32e
 %alt_kernel %{nil}
 %_alt_kernel %{nil}
-%requires_releq_kernel_up %{nil}
-%requires_releq_kernel_smp %{nil}
-%requires_releq_kernel %{nil}
+%requires_releq_kernel_up(s:n:) %{nil}
+%requires_releq_kernel_smp(s:n:) %{nil}
+%requires_releq_kernel(s:n:) %{nil}
 %requires_releq() %{nil}
 %pyrequires_eq() %{nil}
 %requires_eq() %{nil}
 %requires_eq_to() %{nil}
-%releq_kernel_up ERROR
-%releq_kernel_smp ERROR
-%releq_kernel ERROR
+%releq_kernel_up(n:) ERROR
+%releq_kernel_smp(n:) ERROR
+%releq_kernel(n:) ERROR
 %kgcc_package ERROR
 %_fontsdir ERROR
 %ruby_version ERROR
@@ -661,8 +662,8 @@ init_builder() {
 
        if [ "$NOINIT" != "yes" ] ; then
                TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
-               REPO_DIR=$TOP_DIR/packages
-               PACKAGE_DIR=$TOP_DIR/packages/$ASSUMED_NAME
+               REPO_DIR=$TOP_DIR
+               PACKAGE_DIR=$REPO_DIR/$ASSUMED_NAME
        else
                REPO_DIR="."
                PACKAGE_DIR="."
@@ -682,7 +683,8 @@ get_spec() {
 
        cd "$REPO_DIR"
        if [ ! -f "$ASSUMED_NAME/$SPECFILE" ]; then
-               SPECFILE="$(basename $SPECFILE .spec).spec"
+               # XXX: still needed?
+               SPECFILE=$(basename $SPECFILE)
        fi
        if [ "$NOCVSSPEC" != "yes" ]; then
 
@@ -702,7 +704,7 @@ get_spec() {
 
                        # create symlinks for tools
                        if [ "$SYMLINK_TOOLS" != "no" ]; then
-                               for a in dropin md5 adapter builder {relup,compile,repackage,rsync}.sh; do
+                               for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh; do
                                        [ -f $a ] || continue
                                        ln -s ../$a $ASSUMED_NAME
                                        cvsignore_df $a
@@ -959,18 +961,27 @@ update_md5() {
 }
 
 check_md5() {
+       local bad
        [ "$NO5" = "yes" ] && return
 
        update_shell_title "check md5"
 
        for i in "$@"; do
-               if good_md5 "$i" && good_size "$i"; then
-                       continue
+               bad=0
+               if ! good_md5 "$i"; then
+                       echo -n "MD5 sum mismatch."
+                       bad=1
+               fi
+               if ! good_size "$i"; then
+                       echo -n "0 sized file."
+                       bad=1
                fi
 
-               echo "MD5 sum mismatch or 0 size.  Use -U to refetch sources,"
-               echo "or -5 to update md5 sums, if you're sure files are correct."
-               Exit_error err_no_source_in_repo $i
+               if [ $bad -eq 1 ]; then
+                       echo " Use -U to refetch sources,"
+                       echo "or -5 to update md5 sums, if you're sure files are correct."
+                       Exit_error err_no_source_in_repo $i
+               fi
        done
 }
 
@@ -1014,13 +1025,13 @@ get_files() {
                                if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
                                        echo "Warning: no URL given for $i"
                                fi
+                               target="$fp"
 
                                if [ -z "$NODIST" ] && [ -n "$srcmd5" ]; then
                                        if good_md5 "$i" && good_size "$i"; then
                                                echo "$fp having proper md5sum already exists"
                                                continue
                                        fi
-                                       target="$fp"
 
                                        # optionally prefer mirror over distfiles if there's mirror
                                        # TODO: build url list and then try each url from the list
@@ -1072,6 +1083,7 @@ get_files() {
                                                                update_shell_title "${GETURI2%% *}: $url_attic"
                                                                ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
                                                        fi
+                                                       test -s "$target" || rm -f "$target"
                                                fi
                                        fi
 
@@ -1098,11 +1110,12 @@ get_files() {
                                                im="$i"
                                        fi
                                        update_shell_title "${GETURI%% *}: $im"
-                                       ${GETURI} "$im" || \
+                                       ${GETURI} "$im" ${OUTFILEOPT} "$target" || \
                                        if [ "`echo $im | grep -E 'ftp://'`" ]; then
                                                update_shell_title "${GETURI2%% *}: $im"
-                                               ${GETURI2} "$im"
+                                               ${GETURI2} "$im" ${OUTFILEOPT} "$target"
                                        fi
+                                       test -s "$target" || rm -f "$target"
                                fi
 
                                if [ "$cvsup" = 1 ]; then
@@ -1897,7 +1910,7 @@ init_rpm_dir() {
        echo "- run cvs co SPECS"
 
        echo "To checkout *all* packages:"
-       echo "- run cvs up in $TOP_DIR/packages dir"
+       echo "- run cvs up -dP in $TOP_DIR/packages dir"
 
        echo ""
        echo "To commit with your developer account:"
@@ -1996,7 +2009,7 @@ while [ $# -gt 0 ]; do
                -B | --branch )
                        COMMAND="branch"; shift; TAG="${1}"; shift;;
                -c | --clean )
-                       CLEAN="--clean --rmspec --rmsource"; shift ;;
+                       CLEAN="--clean"; shift ;;
                -cf | --cvs-force )
                        CVS_FORCE="-F"; shift;;
                -d | --cvsroot )
@@ -2209,20 +2222,21 @@ while [ $# -gt 0 ]; do
                        Exit_error err_invalid_cmdline "$1"
                        ;;
                *)
-                       SPECFILE="${1}"
+                       SPECFILE=$1; shift
                        # check if specname was passed as specname:cvstag
                        if [ "${SPECFILE##*:}" != "${SPECFILE}" ]; then
                                CVSTAG="${SPECFILE##*:}"
                                SPECFILE="${SPECFILE%%:*}"
                        fi
+                       # always have SPECFILE ending with .spec extension
+                       SPECFILE=${SPECFILE%%.spec}.spec
                        ASSUMED_NAME=$(basename ${SPECFILE%%.spec})
-                       shift
        esac
 done
 
 [ -d "$ASSUMED_NAME" ] && CVS_ENTRIES="$ASSUMED_NAME/CVS/Entries" || CVS_ENTRIES="CVS/Entries"
 if [ -f "$CVS_ENTRIES" ] && [ -z "$CVSTAG" ]; then
-       CVSTAG=$(awk -vSPECFILE=$(basename ${SPECFILE%.spec}.spec) -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' ${CVS_ENTRIES})
+       CVSTAG=$(awk -vSPECFILE=$(basename $SPECFILE) -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' ${CVS_ENTRIES})
        if [ "$CVSTAG" ]; then
                echo >&2 "builder: Sticky tag $CVSTAG active. Use -r TAGNAME to override."
        fi
@@ -2282,7 +2296,7 @@ case "$COMMAND" in
                        # display SMP make flags if set
                        smp_mflags=$(rpm -E %{?_smp_mflags})
                        if [ "$smp_mflags" ]; then
-                               echo >&2 "builder: SMP make flags are set to $smp_mflags"
+                               echo "builder: SMP make flags are set to $smp_mflags"
                        fi
 
                        get_spec
index a727fd68cb03aa3cfb62cee6df14c6562fd211e5..4a548a45e0aad030ffe8351d37a9d366cbb8176c 100644 (file)
@@ -179,7 +179,8 @@ function get_links(url,filename,   errno,link,oneline,retval,odp,wholeodp,lowero
 
        if (url ~ /^http:\/\/(download|dl).(sf|sourceforge).net\//) {
                gsub("^http://(download|dl).(sf|sourceforge).net/", "", url)
-               url = "http://prdownloads.sourceforge.net/" substr(url, 1, 1) "/" substr(url, 1, 2) "/" url
+               gsub("/.*", "", url)
+               url = "http://sourceforge.net/projects/" url "/files/"
                if (DEBUG) print "sf url, mungled url to: " url
        }
 
@@ -201,9 +202,23 @@ function get_links(url,filename,   errno,link,oneline,retval,odp,wholeodp,lowero
                 if (DEBUG) print "mysql 5.1 url, mungled url to: " url
        }
 
+       if (url ~/^(http|https):\/\/launchpad\.net\/(.*)\//) {
+               gsub("^(http|https):\/\/launchpad\.net\/", "", url)
+               gsub("\/.*/", "", url)
+               url = "https://code.launchpad.net/" url "/+download"
+               if (DEBUG) print "main launchpad url, mungled url to: " url
+       }
+
+       if (url ~/^(http|https):\/\/edge\.launchpad\.net\/(.*)\//) {
+               gsub("^(http|https):\/\/edge\.launchpad\.net\/", "", url)
+               gsub("\/.*/", "", url)
+               url = "https://edge.launchpad.net/" url "/+download"
+               if (DEBUG) print "edge launchpad url, mungled url to: " url
+       }
+
 
        if (DEBUG) print "Retrieving: " url
-       cmd = "wget -nv -O - \"" url "\" -t 2 -T 45 --passive-ftp --no-check-certificate > " tmpfile " 2> " tmpfileerr
+       cmd = "wget --user-agent \"Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2) Gecko/20100129 PLD/3.0 (Th) Iceweasel/3.6\" -nv -O - \"" url "\" -t 2 -T 45 --passive-ftp --no-check-certificate > " tmpfile " 2> " tmpfileerr
        if (DEBUG) print "Execute: " cmd
        errno = system(cmd)
 
@@ -400,7 +415,7 @@ function process_source(number,lurl,name,version) {
                                newfilename=fixedsub(prever,"",newfilename)
                                newfilename=fixedsub(postver,"",newfilename)
                                if (DEBUG) print "Version: " newfilename
-                               if (newfilename ~ /\.(pkg|bin|binary|built)$/) continue
+                               if (newfilename ~ /\.(asc|sig|pkg|bin|binary|built)$/) continue
                                if (NUMERIC) {
                                        if ( compare_ver_dec(version, newfilename)==1 ) {
                                                if (DEBUG) print "Yes, there is new one"
index 6604f519de455f84b07df57e22c7b977eb2a0242..e55939317926b0b713678f5265fd7fb996ebc0bf 100644 (file)
@@ -5,7 +5,7 @@ Summary(pt_BR.UTF-8):   Scripts e programas executáveis usados para construir pac
 Summary(ru.UTF-8):     Скрипты и утилиты, необходимые для сборки пакетов
 Summary(uk.UTF-8):     Скрипти та утиліти, необхідні для побудови пакетів
 Name:          rpm-build-tools
-Version:       4.4.35
+Version:       4.4.36
 Release:       1
 License:       GPL
 Group:         Applications/File
This page took 0.114607 seconds and 4 git commands to generate.