]> git.pld-linux.org Git - packages/rpm.git/commitdiff
This commit was manufactured by cvs2git to create tag 'auto-ac-rpm-4_4_2-4'. auto/ac/rpm-4_4_2-4
authorcvs2git <feedback@pld-linux.org>
Tue, 27 Nov 2007 21:54:43 +0000 (21:54 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Sprout from rpm-4_4_2 2007-11-27 21:54:43 UTC cvs2git <feedback@pld-linux.org> 'This commit was manufactured by cvs2git to create branch 'rpm-4_4_2'.'
Cherrypick from master 2005-08-23 19:39:34 UTC Elan Ruusamäe <glen@pld-linux.org> '- up from SPECS HEAD, rev 1.324':
    adapter.awk -> 1.3
    builder -> 1.12
    pldnotify.awk -> 1.6
    rpm-find-lang -> 1.11
    rpm-mono.patch -> 1.1
    rpm.platform -> 1.5
Cherrypick from unlabeled-1.1.2 2005-07-06 22:41:03 UTC Elan Ruusamäe <glen@pld-linux.org> '- add RPM_SKIP_AUTO_RESTART':
    banner.sh -> 1.1.2.1
    rpm-user_group.sh -> 1.1.2.3
    rpm.sysconfig -> 1.1.2.4
Cherrypick from unlabeled-1.10.2 2005-08-15 18:29:46 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> '- up for 4.4.2':
    rpm-debuginfo.patch -> 1.10.2.1
Cherrypick from unlabeled-1.158.4 2005-09-02 10:31:32 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> '- add missing mono part from head':
    rpm.macros -> 1.158.4.57
Cherrypick from unlabeled-1.20.2 2005-08-29 16:49:37 UTC Jan Rękorajski <baggins@pld-linux.org> '- add ~/etc/.rpmmacros to macrofiles':
    rpm-rpmrc.patch -> 1.20.2.4
Cherrypick from unlabeled-1.555.2 2005-09-03 18:10:22 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> '- rel 4; use patched system libmagic':
    rpm.spec -> 1.555.2.107
Delete:
    RPM-GPG-KEY
    find-java-prov.sh
    find-java-req.sh
    rpm-4.4.2-suggests.patch
    rpm-CVE-2006-5466.patch
    rpm-as_needed-fix.patch
    rpm-bug-146549.patch
    rpm-cleanlibdirs.patch
    rpm-cpuinfo.patch
    rpm-dep_whiteout.patch
    rpm-doxygen_no_file.patch
    rpm-error-fatal.patch
    rpm-javadeps.patch
    rpm-kill-prereq.patch
    rpm-locale.patch
    rpm-lzma.patch
    rpm-lzma2.patch
    rpm-macros.java
    rpm-macros.patch
    rpm-man_pl.patch
    rpm-p4.patch
    rpm-requireseq.patch
    rpm-skip-backups.patch
    rpm-truncate-cvslog.patch

37 files changed:
RPM-GPG-KEY [deleted file]
adapter.awk [new file with mode: 0644]
banner.sh
builder [new file with mode: 0644]
find-java-prov.sh [deleted file]
find-java-req.sh [deleted file]
pldnotify.awk [new file with mode: 0644]
rpm-4.4.2-suggests.patch [deleted file]
rpm-CVE-2006-5466.patch [deleted file]
rpm-as_needed-fix.patch [deleted file]
rpm-bug-146549.patch [deleted file]
rpm-cleanlibdirs.patch [deleted file]
rpm-cpuinfo.patch [deleted file]
rpm-debuginfo.patch
rpm-dep_whiteout.patch [deleted file]
rpm-doxygen_no_file.patch [deleted file]
rpm-error-fatal.patch [deleted file]
rpm-find-lang
rpm-javadeps.patch [deleted file]
rpm-kill-prereq.patch [deleted file]
rpm-locale.patch [deleted file]
rpm-lzma.patch [deleted file]
rpm-lzma2.patch [deleted file]
rpm-macros.java [deleted file]
rpm-macros.patch [deleted file]
rpm-man_pl.patch [deleted file]
rpm-mono.patch
rpm-p4.patch [deleted file]
rpm-requireseq.patch [deleted file]
rpm-rpmrc.patch
rpm-skip-backups.patch [deleted file]
rpm-truncate-cvslog.patch [deleted file]
rpm-user_group.sh
rpm.macros [new file with mode: 0644]
rpm.platform
rpm.spec
rpm.sysconfig

diff --git a/RPM-GPG-KEY b/RPM-GPG-KEY
deleted file mode 100644 (file)
index 01871a5..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Below is public GPG key used for signing all PLD 2.0 (Ac) packages. It is also available on our FTP. 
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-mQGiBEYeXR4RBADzXva/pQ3Cb7W5u0ogtvi3ooo26kXKYUFhnZJndq4iCCTIyUYC
-twMasZvDz7RXO36V9x/uXCCj8POc11wfQaRV+H92zQBAnAwZRUCkfOJ4u2cv+4Dd
-KyCq4KwPC0K+eyz9hEXHg6qlXaOCBxnGuOWaN8qdVc1ZzA0KvofqRJGCQwCgy8+V
-97aqXYbPgkKsVLy/C2o9xXED/3DYkfVzgBpfpnnfe8VhrKXh3Ko0vQs5r67Lhi9o
-QZOHYD7Ub+ahMzGbW/F2Dq5jF9Mam57z93FoROw3Y/mJ0Cu3Ua43Ii5fVEKmqH24
-1Zow4c78D/GJfh1EUqmqOx2zkTO2KIbvNJqoRjQ22JzbJLjEYlnBhPvWWKlfQZss
-xKFuBACfxuaNJ2gSYCqkScAwUx4nvFpJlfAdWt/7eaaAMzFmnFEakYliZ12UrdO1
-U0xT5UkvP7yAvxdXC3HhI03sRGKBtqCQn7jA4DznCL3Jz5+XGG5tE/RpR0WBlzaW
-uS4Kuyf9/Imas7Fyxfv/ZPrsjEe1LcD0yr1zg0G2nvOlEgAgXrQ4UExEIExpbnV4
-IERpc3RyaWJ1dGlvbiAyLjAgKEFjKSA8YWMtYWRtaW5AcGxkLWxpbnV4Lm9yZz6I
-YAQTEQIAIAUCRh5dHgIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEHx1HFwb
-vVRZx/EAn1pN8ykFoMUd9ap/orPWuiK/HC7IAJwI0a/Vg4d5O/XseXHifKiizmvG
-frkBDQRGHl0eEAQAsXIeTPUCfMER3FjOnVsFpG3AzjTnHCGZa1F9ri7/AoOoi0ZT
-bzvzUDa+e6mVKGCgZssxSfuLc841fylSg9Fh6FIKdOm4i7xMHR4lGJ0OAfSdyT7R
-h6xeM6Kv+6r6cTTmt60vul+/SYSi5Tsd7zdKhmw9Sz2sR4xmQz4IGM4Pve8AAwUD
-/0d95Q3kff3QzXxMrpnVmQN1mRZL2x+aDpzRe6oLn6clWis2Fj/LNx71Mb87Frw5
-Tz5RY6WuU/fyZGsPX/ngCmf8S9pM53VPtW2PWoyJpu5ENO5iEY2RLFCsKXCOS2j4
-p0IEKULPAIZ/12+wKks2uZG+tNMzIvXzmWtTPzKazSPmiEkEGBECAAkFAkYeXR4C
-GwwACgkQfHUcXBu9VFkZogCgjPi/pyQ4Wqs20kZXIP/QbVC7kjUAoLw5INvpciE2
-GKFQV2VUl29FqBmJ
-=K14g
------END PGP PUBLIC KEY BLOCK-----
-
diff --git a/adapter.awk b/adapter.awk
new file mode 100644 (file)
index 0000000..edcbed8
--- /dev/null
@@ -0,0 +1,690 @@
+#!/bin/awk -f
+#
+# This is adapter v0.27. Adapter adapts .spec files for PLD.
+#
+# Copyright (C) 1999-2003 PLD-Team <feedback@pld-linux.org>
+# Authors:
+#      Micha³ Kuratczyk <kura@pld.org.pl>
+#      Sebastian Zagrodzki <s.zagrodzki@mimuw.edu.pl>
+#      Tomasz K³oczko <kloczek@rudy.mif.pg.gda.pl>
+#      Artur Frysiak <wiget@pld.org.pl>
+#      Michal Kochanowicz <mkochano@pld.org.pl>
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+BEGIN {
+       preamble = 1            # Is it part of preamble? Default - yes
+       boc = 4                 # Beggining of %changelog
+       bod = 0                 # Beggining of %description
+       tw = 70                 # Descriptions width
+       
+       # If variable removed, then 1 (for removing it from export)
+       removed["LDFLAGS"] = 0
+       removed["CFLAGS"] = 0
+       removed["CXXFLAGS"] = 0
+
+       # If 1, we are inside of comment block (started with /^#%/)
+       comment_block = 0
+       
+       # File with rpm groups
+       "rpm --eval %_sourcedir" | getline groups_file
+       groups_file = groups_file "/rpm.groups"
+       system("cd `rpm --eval %_sourcedir`; cvs up rpm.groups >/dev/null")
+
+       # Temporary file for changelog section
+       changelog_file = ENVIRON["HOME"] "/tmp/adapter.changelog"
+
+       # Load rpm macros
+       "rpm --eval %_prefix"   | getline prefix
+       "rpm --eval %_bindir"   | getline bindir
+       "rpm --eval %_sbindir"  | getline sbindir
+       "rpm --eval %_libdir"   | getline libdir
+       "rpm --eval %_sysconfdir" | getline sysconfdir
+       "rpm --eval %_datadir"  | getline datadir
+       "rpm --eval %_includedir" | getline includedir
+       "rpm --eval %_mandir"   | getline mandir
+       "rpm --eval %_infodir"  | getline infodir
+}
+
+# There should be a comment with CVS keywords on the first line of file.
+FNR == 1 {
+       if (!/# \$Revision:/)   # If this line is already OK?
+               print "# $" "Revision:$, " "$" "Date:$" # No
+       else {
+               print $0                                # Yes
+               next            # It is enough for first line
+       }
+}
+
+# If the latest line matched /%files/
+defattr == 1 {
+       if ($0 !~ /defattr/)    # If no %defattr
+               print "%defattr(644,root,root,755)"     # Add it
+       else
+               $0 = "%defattr(644,root,root,755)"      # Correct mistakes (if any)
+       defattr = 0
+}
+
+# Comments
+/^#/ && (description == 0) {
+       if (/This file does not like to be adapterized!/) {
+               print                   # print this message
+               while (getline)         # print the rest of spec as it is
+                       print
+               do_not_touch_anything = 1 # do not touch anything in END()
+               exit 0
+       }
+
+       # Generally, comments are printed without touching
+       sub(/[ \t]+$/, "")
+       print $0
+       next
+}
+
+# Remove defining _applnkdir (this macro has been included in rpm-3.0.4)
+/^%define/ {
+       if ($2 == "_applnkdir")
+               next
+       if ($2 == "date")
+               date = 1
+}
+
+################
+# %description #
+################
+/^%description/, (/^%[a-z]+/ && !/^%description/) {
+       preamble = 0
+
+       if (/^%description/) {
+               bod++
+               format_line = ""
+               format_indent = -1
+       }
+
+       # Define _prefix and _mandir if it is X11 application
+#      if (/^%description$/ && x11 == 1) {
+#              print "%define\t\t_prefix\t\t/usr/X11R6"
+#              print "%define\t\t_mandir\t\t%{_prefix}/man\n"
+#              prefix = "/usr/X11R6"
+#              x11 = 2
+#      }
+       
+       # Format description
+       if (description == 1 && !/^%[a-z]+/ && !/^%description/) {
+               if (/^[ \t]*$/) {
+                       format_flush(format_line, format_indent)
+                       print ""
+                       format_line = ""
+                       format_indent = -1
+               } else if (/^[ \t]*[-\*][ \t]*/) {
+                       format_flush(format_line, format_indent)
+                       match($0, /^[ \t]*/)    
+                       format_indent = RLENGTH
+                       match($0, /^[ \t]*[-\*][ \t]/)
+                       format_line = substr($0, RLENGTH)
+               } else 
+                       format_line = format_line " " $0
+               next
+       }
+       if (/^%[a-z]+/ && (!/^%description/ || bod == 2)) {
+               if (NF > 3 && $2 == "-l") {
+                       ll = $1
+                       for (i = 4; i <= NF; i++)
+                               ll = ll " " $i
+                       $0 = ll " -l " $3
+               }
+               format_flush(format_line, format_indent)
+               if (bod == 2) {
+                       bod = 1
+                       description = 1
+               } else {
+                       bod = 0
+                       description = 0
+               }
+       } else
+               description = 1
+}
+
+#########
+# %prep #
+#########
+/^%prep/, (/^%[a-z]+$/ && !/^%prep/) {
+       preamble = 0
+       
+       # Add '-q' to %setup
+       if (/^%setup/ && !/-q/)
+               sub(/^%setup/, "%setup -q")
+}
+
+##########
+# %build #
+##########
+/^%build/, (/^%[a-z]+$/ && !/^%build/) {
+       preamble = 0
+
+       use_macros()
+       
+       if (/^automake$/)
+               sub(/$/, " -a -c")
+
+       if (/LDFLAGS/) {
+               if (/LDFLAGS="-s"/) {
+                       removed["LDFLAGS"] = 1
+                       next
+               } else {
+                       split($0, tmp, "LDFLAGS=")
+                       count = split(tmp[2], flags, "\"")
+                       if (flags[1] != "" && flags[1] !~ "!?debug") {
+                               sub(/-s[" ]?/, "%{rpmldflags} ", flags[1])
+                               $0 = tmp[1] line[1] "LDFLAGS=" flags[1] "\""
+                               for (i = 2; i < count; i++)
+                                       $0 = $0 flags[i] "\""
+                       }
+               }
+       }
+
+       if (/CFLAGS=/)
+               if (cflags("CFLAGS") == 0)
+                       next
+
+       if (/CXXFLAGS=/)
+               if (cflags("CXXFLAGS") == 0)
+                       next
+       
+       if (/^export /) {
+               if (removed["LDFLAGS"])
+                       sub(" LDFLAGS", "")
+               if (removed["CFLAGS"])
+                       sub(" CFLAGS", "")
+               if (removed["CXXFLAGS"])
+                       sub(" CXXFLAGS", "")
+               # Is there still something?
+               if (/^export[ ]*$/)
+                       next
+       }
+                       
+}
+
+##########
+# %clean #
+##########
+/^%clean/, (/^%[a-z]+$/ && !/^%clean/) {
+       did_clean = 1
+}
+
+############
+# %install #
+############
+/^%install/, (/^%[a-z]+$/ && !/^%install/) {
+       
+       preamble = 0
+       
+       if (/^[ \t]*rm([ \t]+-[rf]+)*[ \t]+\${?RPM_BUILD_ROOT}?/ && did_rmroot==0) {
+               did_rmroot=1
+               print "rm -rf $RPM_BUILD_ROOT"
+               next
+       }
+
+       if (!/^(#?[ \t]*)$/ && !/^%install/ && did_rmroot==0) {
+               print "rm -rf $RPM_BUILD_ROOT"
+               did_rmroot=1
+       }
+       
+       use_macros()
+       
+       # 'install -d' instead 'mkdir -p'
+       if (/mkdir -p/)
+               sub(/mkdir -p/, "install -d")
+               
+       # No '-u root' or '-g root' for 'install'
+       if (/^install/ && /-[ug][ \t]*root/)
+               gsub(/-[ug][ \t]*root /, "")
+       
+       if (/^install/ && /-m[ \t]*644/)
+               gsub(/-m[ \t]*644 /, "")
+       
+       # No lines contain 'chown' or 'chgrp' if owner/group is 'root'
+       if (($1 ~ /chown/ && $2 ~ /root\.root/) || ($1 ~ /chgrp/ && $2 ~ /root/))
+               next
+       
+       # No lines contain 'chmod' if it sets the modes to '644'
+       if ($1 ~ /chmod/ && $2 ~ /644/)
+               next
+}
+
+##########
+# %files #
+##########
+/^%files/, (/^%[a-z \-]+$/ && !/^%files/) {
+       preamble = 0
+       
+       if ($0 ~ /^%files/)
+               defattr = 1
+       
+       use_macros()
+       use_files_macros()
+}
+
+##############
+# %changelog #
+##############
+/^%changelog/, (/^%[a-z]+$/ && !/^%changelog/) {
+       preamble = 0
+       has_changelog = 1
+       skip = 0
+       # There should be some CVS keywords on the first line of %changelog.
+       if (boc == 3) {
+               if (!/PLD Team/)
+                       print "* %{date} PLD Team <feedback@pld-linux.org>" > 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>@pld-linux.org\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/)
+               print > changelog_file
+       else
+               print
+       next
+}
+
+###########
+# SCRIPTS #
+###########
+/^%pre/, (/^%[a-z]+$/ && !/^%pre/) {
+       preamble = 0
+}
+/^%post/, (/^%[a-z]+$/ && !/^%post/) {
+       preamble = 0
+}
+/^%preun/, (/^%[a-z]+$/ && !/^%preun/) {
+       preamble = 0
+}
+/^%postun/, (/^%[a-z]+$/ && !/^%postun/) {
+       preamble = 0
+}
+
+#############
+# PREAMBLES #
+#############
+preamble == 1 {
+       # There should not be a space after the name of field
+       # and before the colon.
+       sub(/[ \t]*:/, ":")
+       
+       field = tolower($1)
+       fieldnlower = $1
+       if (field ~ /group(\([^)]+\)):/)
+               next
+       if (field ~ /group:/) {
+               format_preamble()
+               sub(/^Utilities\//,"Applications/",$2)
+               sub(/^Games/,"Applications/Games",$2)
+               sub(/^X11\/Games/,"X11/Applications/Games",$2)
+               sub(/^X11\/GNOME\/Development\/Libraries/,"X11/Development/Libraries",$2)
+               sub(/^X11\/GNOME\/Applications/,"X11/Applications",$2)
+               sub(/^X11\/GNOME/,"X11/Applications",$2)
+               sub(/^X11\/Utilities/,"X11/Applications",$2)
+               sub(/^X11\/Games\/Strategy/,"X11/Applications/Games/Strategy",$2)
+               sub(/^Shells/,"Applications/Shells",$2)
+
+               sub(/^[^ \t]*[ \t]*/,"")
+               Grupa = $0
+
+               print "Group:\t\t" Grupa
+               if (Grupa ~ /^X11/ && x11 == 0) # Is it X11 application?
+                      x11 = 1
+
+               byl_plik_z_grupami = 0
+               byl_opis_grupy = 0
+               while ((getline linia_grup < groups_file) > 0) {
+                       byl_plik_z_grupami = 1
+                       if (linia_grup == Grupa) {
+                               byl_opis_grupy = 1
+                               break
+                       }
+               }
+
+               if (!byl_plik_z_grupami)
+                       print "######\t\t" groups_file ": no such file"
+               else if (!byl_opis_grupy)
+                       print "######\t\t" "Unknown group!"
+               
+               close(groups_file)
+               next
+       }
+       
+       if (field ~ /packager:|distribution:|docdir:|prefix:/)
+               next
+       
+       if (field ~ /buildroot:/)
+               $0 = $1 "%{tmpdir}/%{name}-%{version}-root-%(id -u -n)"
+
+       # Use "License" instead of "Copyright" if it is (L)GPL or BSD
+       if (field ~ /copyright:/ && $2 ~ /GPL|BSD/)
+               $1 = "License:"
+       
+       if (field ~ /name:/)
+               name = $2
+
+       if (field ~ /version:/)
+               version = $2
+
+       if (field ~ /serial:/)
+               $1 = "Epoch:"
+
+       # Use %{name} and %{version} in the filenames in "Source:"
+       if (field ~ /^source/ || field ~ /patch/) {
+               n = split($2, url, /\//)
+               if (url[n] ~ /\.gz$/) {
+                       url[n+1] = ".gz" url[n+1]
+                       sub(/\.gz$/,"",url[n])
+               }
+               if (url[n] ~ /\.zip$/) {
+                       url[n+1] = ".zip" url[n+1]
+                       sub(/\.zip$/,"",url[n])
+               }
+               if (url[n] ~ /\.tar$/) {
+                       url[n+1] = ".tar" url[n+1]
+                       sub(/\.tar$/,"",url[n])
+               }
+               if (url[n] ~ /\.patch$/) {
+                       url[n+1] = ".patch" url[n+1]
+                       sub(/\.patch$/,"",url[n])
+               }
+               if (url[n] ~ /\.bz2$/) {
+                       url[n+1] = ".bz2" url[n+1]
+                       sub(/\.bz2$/,"",url[n])
+               }
+               if (url[n] ~ /\.logrotate$/) {
+                       url[n+1] = ".logrotate" url[n+1]
+                       sub(/\.logrotate$/,"",url[n])
+               }
+               if (url[n] ~ /\.pamd$/) {
+                       url[n+1] = ".pamd" url[n+1]
+                       sub(/\.pamd$/,"",url[n])
+               }
+
+               filename = url[n]
+               url[n] = fixedsub(name, "%{name}", url[n])
+               if (field ~ /source/) 
+                       url[n] = fixedsub(version, "%{version}", url[n])
+               $2 = fixedsub(filename, url[n], $2)
+       }
+
+       if (field ~ /^source:/)
+               $1 = "Source0:" 
+
+       if (field ~ /patch:/)
+               $1 = "Patch0:"
+       
+       format_preamble()
+       
+       if ($1 ~ /%define/) {
+               # Do not add %define of _prefix if it already is.
+               if ($2 ~ /^_prefix/) {
+                       sub("^"prefix, $3, bindir)
+                       sub("^"prefix, $3, sbindir)
+                       sub("^"prefix, $3, libdir)
+                       sub("^"prefix, $3, datadir)
+                       sub("^"prefix, $3, includedir)
+                       prefix = $3
+                       x11 = 2
+               }
+               if ($2 ~ /_bindir/ && !/_sbindir/)
+                       bindir = $3
+               if ($2 ~ /_sbindir/)
+                       sbindir = $3
+               if ($2 ~ /_libdir/)
+                       libdir = $3
+               if ($2 ~ /_sysconfdir/)
+                       sysconfdir = $3
+               if ($2 ~ /_datadir/)
+                       datadir = $3
+               if ($2 ~ /_includedir/)
+                       includedir = $3
+               if ($2 ~ /_mandir/)
+                       mandir = $3
+               if ($2 ~ /_infodir/)
+                       infodir = $3
+       }
+}
+
+
+# main()  ;-)
+{
+       preamble = 1
+       
+       sub(/[ \t]+$/, "")
+       print
+}
+
+
+END {
+       if (do_not_touch_anything)
+               exit 0
+       
+       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:$"
+}
+
+function fixedsub(s1,s2,t,      ind) {
+# substitutes fixed strings (not regexps)
+        if (ind = index(t,s1))
+                t = substr(t, 1, ind-1) s2 substr(t, ind+length(s1))
+        return t
+}
+
+# There should be one or two tabs after the colon.
+function format_preamble()
+{
+       sub(/:[ \t]*/, ":")
+       if (match($0, /[A-Za-z0-9(),#_ \t]+[ \t]*:[ \t]*/) == 1) {
+               if (RLENGTH < 8)
+                       sub(/:/, ":\t\t")
+               else
+                       sub(/:/, ":\t")
+       }
+}
+
+# Replace directly specified directories with macros
+function use_macros()
+{
+       gsub(bindir, "%{_bindir}")
+       gsub("%{prefix}/bin", "%{_bindir}")
+       if(prefix"/bin" == bindir)
+               gsub("%{_prefix}/bin", "%{_bindir}")
+
+       for (c = 1; c <= NF; c++) {
+               if ($c ~ sbindir "/fix-info-dir")
+                       continue;
+               gsub(sbindir, "%{_sbindir}", $c)
+       }
+
+       gsub("%{prefix}/sbin", "%{_sbindir}")
+       if(prefix"/sbin" == sbindir)
+               gsub("%{_prefix}/sbin", "%{_sbindir}")
+
+#      gsub(libdir, "%{_libdir}")
+#      gsub("%{prefix}/lib", "%{_libdir}")
+#      if(prefix"/lib" == libdir)
+#              gsub("%{_prefix}/lib", "%{_libdir}")
+
+       for (c = 1; c <= NF; c++) {
+               if ($c ~ sysconfdir "/{?cron.")
+                       continue;
+               if ($c ~ sysconfdir "/{?crontab.d")
+                       continue;
+               if ($c ~ sysconfdir "/{?logrotate.d")
+                       continue;
+               if ($c ~ sysconfdir "/{?pam.d")
+                       continue;
+               if ($c ~ sysconfdir "/{?profile.d")
+                       continue;
+               if ($c ~ sysconfdir "/{?rc.d")
+                       continue;
+               if ($c ~ sysconfdir "/{?security")
+                       continue;
+               if ($c ~ sysconfdir "/{?skel")
+                       continue;
+               if ($c ~ sysconfdir "/{?sysconfig")
+                       continue;
+               gsub(sysconfdir, "%{_sysconfdir}", $c)
+       }
+
+       gsub(datadir, "%{_datadir}")
+       gsub("%{prefix}/share", "%{_datadir}")
+       if(prefix"/share" == datadir)
+               gsub("%{_prefix}/share", "%{_datadir}")
+
+       gsub(includedir, "%{_includedir}")
+       gsub("%{prefix}/include", "%{_includedir}")
+       if(prefix"/include" == includedir)
+               gsub("%{_prefix}/include", "%{_includedir}")
+
+       gsub(mandir, "%{_mandir}")
+       if ($0 !~ "%{_datadir}/manual")
+               gsub("%{_datadir}/man", "%{_mandir}")
+       gsub("%{_prefix}/share/man", "%{_mandir}")
+       gsub("%{prefix}/share/man", "%{_mandir}")
+       gsub("%{prefix}/man", "%{_mandir}")
+       gsub("%{_prefix}/man", "%{_mandir}")
+
+       gsub(infodir, "%{_infodir}")
+       gsub("%{prefix}/info", "%{_infodir}")
+       gsub("%{_prefix}/info", "%{_infodir}")
+
+       if (prefix !~ "/X11R6") {
+               gsub("%{_datadir}/aclocal", "%{_aclocaldir}")
+       }
+
+       if (prefix != "/") {
+               for (c = 1; c <= NF; c++) {
+                       if ($c ~ prefix "/sbin/fix-info-dir")
+                               continue;
+                       gsub(prefix, "%{_prefix}", $c)
+               }
+               gsub("%{prefix}", "%{_prefix}")
+       }
+
+       gsub("%{PACKAGE_VERSION}", "%{version}")
+       gsub("%{PACKAGE_NAME}", "%{name}")
+
+       # we can move files between tge dirs below
+       if ($0 !~ "%{_applnkdir}") {
+               gsub("%{_datadir}/gnome/apps", "%{_applnkdir}")
+               gsub("%{_datadir}/applnk", "%{_applnkdir}")
+       }
+
+       gsub("^make$", "%{__make}")
+       gsub("^make ", "%{__make} ")
+
+       gsub("/usr/src/linux", "%{_kernelsrcdir}")
+       gsub("%{_prefix}/src/linux", "%{_kernelsrcdir}")
+}
+       
+function use_files_macros()
+{
+       gsub("^%{_sbindir}", "%attr(755,root,root) %{_sbindir}")
+       gsub("^%{_bindir}", "%attr(755,root,root) %{_bindir}")
+}
+
+function fill(ch, n, i) {
+       for (i = 0; i < n; i++)
+               printf("%c", ch)
+}
+
+function format_flush(line, indent, newline, word, first_word) {
+       first_word = 1
+       if (format_indent == -1) 
+               newline = ""
+       else
+               newline = fill(" ", format_indent) "- "
+
+       while (match(line, /[^\t ]+/)) {
+               word = substr(line, RSTART, RLENGTH)
+               if (length(newline) + length(word) + 1 > tw) {
+                       print newline
+                       
+                       if (format_indent == -1)
+                               newline = ""
+                       else
+                               newline = fill(" ", format_indent + 2)
+                       first_word = 1
+               }
+
+               if (first_word) {
+                       newline = newline word
+                       first_word = 0
+               } else
+                       newline = newline " " word
+                       
+               line = substr(line, RSTART + RLENGTH)
+       }
+       if (newline ~ /[^\t ]/) {
+               print newline
+       }
+}
+
+function cflags(var)
+{
+       if ($0 == var "=\"$RPM_OPT_FLAGS\"") {
+               removed[var] = 1
+               return 0
+       }
+               
+       if (!/!\?debug/)
+               sub("\$RPM_OPT_FLAGS", "%{rpmcflags}")
+       return 1
+}
+
index 5c92c5c48d4ca7ecd30cb7cd93da94a0454ff049..0b30b2a55147f8bb9d4c082d8a423dfd2e62aee8 100644 (file)
--- a/banner.sh
+++ b/banner.sh
@@ -64,24 +64,24 @@ Help()
 --all       - all banners
 --delete    - delete wanted banners
 -e
---exclude   - exclude following banners (useful with -a)
+--exclude   - exclude following banners (usefull with -a)
 -h
---help      - show this help
+--help      - shows this help
 -i
---include   - cancel effect of -e (EXCLUDED banners will remain excluded)
+--include   - cancels effect of -e (EXCLUDED banners will remain excluded)
 -m
---make      - make a brand-new banner named as following parameter [1] (from stdin)
+--make      - makes a brand-new banner named as following para [1] (from stdin)
 -M          - same as above, but append if file exists
 -n
---names     - show names of the banners
---newer     - all choosen banners should be newer than following parameter in seconds
---older     - all choosen banners should be older than following parameter in seconds
+--names     - shows names of the banners
+--newer     - all choosen banners should be newer than following para in seconds
+--older     - all choosen banners should be older than following para in seconds
 -s
---show      - show wanted banners
+--show      - shows wanted banners
 --stderr    - send banner to stderr instead of stdout (or other)
 --stdout    - send banner to stdout instead of stderr (or other)
 -u
---usage     - show short help
+--usage     - shows short help
 
 [1] - if there will be no slash ('/') in name then config dir will be used,
       else -- specified.
@@ -94,7 +94,10 @@ Unknown parameter $1
 EOF
        Help
 }
-
+check_banner_name()
+{
+       echo "$1"|sed 's,.*/,,'
+}
 check_banners_mtime()
 {
        BANNERS="$1"
@@ -142,17 +145,14 @@ make_banner()
 {
        BANNER="$1"
        SHOW="$2"
-       if [ ! -d "${BANNER%/*}" ]; then
-               mkdir -p "${BANNER%/*}"
-       fi
-       data=$(cat)
+       mkdir -p $(echo $BANNER|sed 's,/[^/]*$,,')
        if [ $NEW_APPEND -eq 0 ]; then
-               echo "$data" > $BANNER
+               cat > $BANNER
        else
-               echo "$data" >> $BANNER
+               cat >> $BANNER
        fi
        if [ $SHOW -eq 1 ];then
-               echo "$data"
+               cat $BANNER
        fi
 }
 show_banner()
@@ -187,8 +187,8 @@ while [ ! -z $1 ]; do
                        ;;
                -m|--make|-M)
                        NEED_BANNER_LIST=0
-                       if [[ $2 != */* ]]; then
-                               NEW_BANNER="$BANNERDIR/${2##*/}"
+                       if [ "$(check_banner_name $2)" == "$2" ]; then
+                               NEW_BANNER=$BANNERDIR/$(check_banner_name "$2")
                        else
                                NEW_BANNER="$2"
                        fi
@@ -247,9 +247,9 @@ while [ ! -z $1 ]; do
                        ;;
                *)
                        if [ $EXCLUDE_FLAG -eq 0 ];then
-                               BANNERS="$BANNERS ${1##*/}"
+                               BANNERS="$BANNERS $(check_banner_name $1)"
                        else
-                               NOBANNERS="$NOBANNERS ${1##*/}"
+                               NOBANNERS="$NOBANNERS $(check_banner_name $1)"
                        fi
                        ;;
        esac
diff --git a/builder b/builder
new file mode 100644 (file)
index 0000000..811ad5a
--- /dev/null
+++ b/builder
@@ -0,0 +1,1785 @@
+#!/bin/sh
+# -----------
+# $Id$
+# Exit codes:
+#        0 - succesful
+#        1 - help displayed
+#        2 - no spec file name in cmdl parameters
+#        3 - spec file not stored in repo
+#        4 - some source, patch or icon files not stored in repo
+#        5 - package build failed
+#        6 - spec file with errors
+#        7 - wrong source in /etc/poldek.conf
+#        8 - Failed installing buildrequirements and subrequirements
+#        9 - Requested tag already exist
+#       10 - Refused to build fractional release
+#      100 - Unknown error (should not happen)
+
+# Notes (todo):
+#      - builder -u fetches current version first
+#      - tries to get new version from distfiles without new md5
+#      - after fetching new version doesn't update md5
+#      - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
+#        when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
+#      - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
+#      - when Icon: field is present, -5 and -a5 doesn't work
+
+VERSION="\
+Build package utility from PLD CVS repository
+V 0.12 (C) 1999-2005 Free Penguins".
+PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
+
+COMMAND="build"
+TARGET=""
+
+SPECFILE=""
+BE_VERBOSE=""
+QUIET=""
+CLEAN=""
+DEBUG=""
+NOURLS=""
+NOCVS=""
+NOCVSSPEC=""
+NODIST=""
+UPDATE=""
+UPDATE5=""
+ADD5=""
+NO5=""
+ADAPTERIZE=""
+ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
+CVSROOT=""
+
+# It can be used i.e. in log file naming.
+# See LOGFILE example.
+DATE=`date +%Y-%m-%d_%H-%M-%S`
+
+# Example: LOGFILE='../log.$PACKAGE_NAME'
+# Example: LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
+# Yes, you can use variable name! Note _single_ quotes!
+LOGFILE=''
+
+LOGDIR=""
+LOGDIROK=""
+LOGDIRFAIL=""
+LASTLOG_FILE=""
+
+CHMOD="no"
+CHMOD_MODE="0444"
+RPMOPTS=""
+BCOND=""
+GROUP_BCONDS="no"
+CVSIGNORE_DF="no"
+
+PATCHES=""
+SOURCES=""
+ICONS=""
+PACKAGE_RELEASE=""
+PACKAGE_VERSION=""
+PACKAGE_NAME=""
+PROTOCOL="ftp"
+WGET_RETRIES=${MAX_WGET_RETRIES:-0}
+CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
+
+CVSTAG=""
+RES_FILE=""
+
+CVS_SERVER="cvs.pld-linux.org"
+DISTFILES_SERVER="://distfiles.pld-linux.org"
+ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org"
+
+DEF_NICE_LEVEL=19
+
+FAIL_IF_NO_SOURCES="yes"
+
+if [ -x /usr/bin/rpm-getdeps ]; then
+        FETCH_BUILD_REQUIRES_RPMGETDEPS="yes"
+else
+        FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
+fi
+
+# Here we load saved user environment used to
+# predefine options set above, or passed to builder
+# in command line.
+# This one reads global system environment settings:
+if [ -f ~/etc/builderrc ]; then
+       . ~/etc/builderrc
+fi
+# And this one cascades settings using user personal
+# builder settings.
+# Example of ~/.builderrc:
+#
+#UPDATE_POLDEK_INDEXES="yes"
+#FETCH_BUILD_REQUIRES="yes"
+#REMOVE_BUILD_REQUIRES="force"
+#GROUP_BCONDS="yes"
+#LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
+#
+SU_SUDO=""
+if [ -n "$HOME_ETC" ]; then
+       USER_CFG="$HOME_ETC/.builderrc"
+else
+       USER_CFG=~/.builderrc
+fi
+
+[ -f "$USER_CFG" ] && . "$USER_CFG"
+
+if [ -n "$USE_PROZILLA" ]; then
+       GETURI="proz --no-getch -r -P ./ -t$WGET_RETRIES $PROZILLA_OPTS"
+       GETURI2="$GETURI"
+       OUTFILEOPT="-O"
+elif [ -n "$USE_AXEL" ]; then
+       GETURI="axel -a $AXEL_OPTS"
+       GETURI2="$GETURI"
+       OUTFILEOPT="-o"
+else
+       wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
+       wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
+        
+       GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
+       GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
+       OUTFILEOPT="-O"
+fi
+
+GETLOCAL="cp -a"
+
+if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
+       RPM="rpm"
+       RPMBUILD="rpm"
+else
+       RPM="rpm"
+       RPMBUILD="rpmbuild"
+fi
+
+POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
+POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
+
+run_poldek()
+{
+       RES_FILE=~/tmp/poldek-exit-status.$RANDOM
+       if [ -n "$LOGFILE" ]; then
+               LOG=`eval echo $LOGFILE`
+               if [ -n "$LASTLOG_FILE" ]; then
+                       echo "LASTLOG=$LOG" > $LASTLOG_FILE
+               fi
+               (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee -a $LOG
+               return $exit_pldk
+       else
+               (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
+               return `cat ${RES_FILE}`
+               rm -rf ${RES_FILE}
+       fi
+}
+
+#---------------------------------------------
+# functions
+
+usage()
+{
+       if [ -n "$DEBUG" ]; then set -xv; fi
+       echo "\
+Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
+
+[-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
+[{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
+[-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
+[-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
+[-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
+[-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
+[{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
+[-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
+[--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
+
+-5, --update-md5    - update md5 comments in spec, implies -nd -ncs
+--adapter[ize]      - run adapter.awk on SPECFILE
+-a5, --add-md5      - add md5 comments to URL sources, implies -nc -nd -ncs
+-n5, --no-md5       - ignore md5 comments in spec
+-D, --debug         - enable builder script debugging mode,
+-debug              - produce rpm debug package (same as --opts -debug)
+-V, --version       - output builder version
+-a, --as_anon       - get files via pserver as cvs@$CVS_SERVER,
+-b, -ba, --build    - get all files from CVS repo or HTTP/FTP and build package
+                      from <package>.spec,
+-bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
+                      only package from <package>.spec,
+-bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
+                      them into src.rpm,
+-bp, --build-prep   - execute the %prep phase of <package>.spec,
+-B, --branch        - add branch
+-c, --clean         - clean all temporarily created files (in BUILD, SOURCES,
+                      SPECS and \$RPM_BUILD_ROOT),
+-d <cvsroot>, --cvsroot <cvsroot>
+                    - setup \$CVSROOT,
+--define <macro> <value>
+                    - define a macro <macro> with value <value>,
+--nodeps            - rpm won't check any dependences
+-g, --get           - get <package>.spec and all related files from CVS repo
+                      or HTTP/FTP,
+-h, --help          - this message,
+--http              - use http instead of ftp,
+-l <logfile>, --logtofile <logfile>
+                    - log all to file,
+-m, --mr-proper     - only remove all files related to spec file and all work
+                      resources,
+-nc, --no-cvs       - don't download sources from CVS, if source URL is given,
+-ncs, --no-cvs-specs
+                    - don't check specs in CVS
+-nd, --no-distfiles - don't download from distfiles
+-nm, --no-mirrors   - don't download from mirror, if source URL is given,
+-nu, --no-urls      - don't try to download from FTP/HTTP location,
+-ns, --no-srcs      - don't download Sources
+-ns0, --no-source0  - don't download Source0
+-nn, --no-net       - don't download anything from the net
+--opts <rpm opts>   - additional options for rpm
+-q, --quiet         - be quiet,
+--date yyyy-mm-dd   - build package using resources from specified CVS date,
+-r <cvstag>, --cvstag <cvstag>
+                    - build package using resources from specified CVS tag,
+-R, --fetch-build-requires
+                    - fetch what is BuildRequired,
+-RB, --remove-build-requires
+                    - remove all you fetched with -R or --fetch-build-requires
+                      remember, this option requires confirmation,
+-FRB, --force-remove-build-requires
+                    - remove all you fetched with -R or --fetch-build-requires
+                      remember, this option works without confirmation,
+-sf, --source-files - list sources - bare filenames (intended for offline
+                      operations; does not work when Icon field is present
+                                                        but icon file is absent),
+-sp, --source-paths - list sources - filenames with full local paths (intended for
+                      offline operations; does not work when Icon field is present
+                                                        but icon file is absent),
+-T <cvstag> , --tag <cvstag>
+                    - add cvs tag <cvstag> for files,
+-Tvs, --tag-version-stable
+                    - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
+-Tvn, --tag-version-nest
+                    - add cvs tags NEST and NAME-VERSION-RELEASE for files,
+-Ts, --tag-stable
+                    - add cvs tag STABLE for files,
+-Tn, --tag-nest
+                    - add cvs tag NEST for files,
+-Tv, --tag-version
+                    - add cvs tag NAME-VERSION-RELEASE for files,
+-Tp, --tag-prefix <prefix>
+                    - add <prefix> to NAME-VERSION-RELEASE tags,
+-tt, --test-tag <prefix>
+                    - fail if tag is already present,
+-ir, --integer-release-only
+                    - allow only integer and snapshot releases
+-v, --verbose       - be verbose,
+-u, --try-upgrade   - check version, and try to upgrade package
+-un, --try-upgrade-with-float-version
+                    - as above, but allow float version
+-U, --update        - refetch sources, don't use distfiles, and update md5 comments
+-Upi, --update-poldek-indexes
+                    - refresh or make poldek package index files.
+--with/--without <feature>
+                    - conditional build package depending on %_with_<feature>/
+                      %_without_<feature> macro switch.  You may now use
+                      --with feat1 feat2 feat3 --without feat4 feat5 --with feat6
+                      constructions. Set GROUP_BCONDS to yes to make use of it.
+--target <platform>, --target=<platform>
+                   - build for platform <platform>.
+"
+}
+
+cache_rpm_dump () {
+        if [ -n "$DEBUG" ]; then
+                 set -x;
+                 set -v;
+        fi
+rpm_dump_cache=`
+       case "$RPMBUILD" in
+               rpm )
+                       rpm -bp --nodeps --define 'prep %dump' $BCOND $TARGET_SWITCH $SPECFILE 2>&1
+                       ;;
+               rpmbuild )
+                       rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
+                       ;;
+       esac`
+}
+
+rpm_dump () {
+       if [ -z "$rpm_dump_cache" ] ; then
+               echo "internal error: cache_rpm_dump not called!" 1>&2
+       fi
+       echo "$rpm_dump_cache"
+}
+
+parse_spec()
+{
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       cd $SPECS_DIR
+
+       cache_rpm_dump
+
+       if [ "$NOSRCS" != "yes" ]; then
+               SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
+       fi
+       if (rpm_dump | grep -qEi ":.*nosource.*1"); then
+               FAIL_IF_NO_SOURCES="no"
+       fi
+
+       PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
+       ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
+       PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
+       PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -n 1`"
+       PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
+
+# These variables may be unset after first cache_rpm_dump call
+# (because of not-yet-retrieved icon file)
+#
+#      if [ -z "$PACKAGE_NAME" -o -z "$PACKAGE_VERSION" -o -z "$PACKAGE_RELEASE" ]; then
+#               Exit_error err_no_package_data;
+#      fi
+
+       if [ -n "$BE_VERBOSE" ]; then
+               echo "- Sources :  `nourl $SOURCES`"
+               if [ -n "$PATCHES" ]; then
+                       echo "- Patches :  `nourl $PATCHES`"
+               else
+                       echo "- Patches :  *no patches needed*"
+               fi
+               if [ -n "$ICONS" ]; then
+                       echo "- Icon    :  `nourl $ICONS`"
+               else
+                       echo "- Icon    :  *no package icon*"
+               fi
+               echo "- Name    : $PACKAGE_NAME"
+               echo "- Version : $PACKAGE_VERSION"
+               echo "- Release : $PACKAGE_RELEASE"
+       fi
+}
+
+Exit_error()
+{
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       cd "$__PWD"
+
+       case "$1" in
+               "err_no_spec_in_cmdl" )
+                       remove_build_requires
+                       echo "ERROR: spec file name not specified.";
+                       exit 2 ;;
+               "err_no_spec_in_repo" )
+                       remove_build_requires
+                       echo "Error: spec file not stored in CVS repo.";
+                       exit 3 ;;
+               "err_no_source_in_repo" )
+                       remove_build_requires
+                       echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
+                       exit 4 ;;
+               "err_build_fail" )
+                       remove_build_requires
+                       echo "Error: package build failed. (${2:-no more info})";
+                       exit 5 ;;
+               "err_no_package_data" )
+                       remove_build_requires
+                       echo "Error: couldn't get out package name/version/release from spec file."
+                       exit 6 ;;
+          "err_tag_exists" )
+                       remove_build_requires
+                       echo "Tag ${2} already exists (spec release: ${3}).";
+                       exit 9 ;;
+          "err_fract_rel" )
+                       remove_build_requires
+                       echo "Release ${2} not integer and not a snapshot.";
+                       exit 10 ;;
+
+       esac
+   echo "Unknown error."
+   exit 100
+}
+
+init_builder()
+{
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
+       SPECS_DIR="`$RPM --eval '%{_specdir}'`"
+
+       __PWD="`pwd`"
+}
+
+get_spec()
+{
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       cd "$SPECS_DIR"
+       if [ \! -f "$SPECFILE" ]; then
+               SPECFILE="`basename $SPECFILE .spec`.spec";
+       fi
+       if [ "$NOCVSSPEC" != "yes" ]; then
+               OPTIONS="up "
+
+               if [ -n "$CVSROOT" ]; then
+                       OPTIONS="-d $CVSROOT $OPTIONS"
+               else
+                       if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
+                               echo "warning: No cvs access defined - using local .spec file"
+                               NOCVSSPEC="yes"
+                       fi
+               fi
+
+               if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
+                       OPTIONS="$OPTIONS -A"
+               else
+                       if [ -n "$CVSDATE" ]; then
+                               OPTIONS="$OPTIONS -D $CVSDATE"
+                       fi
+                       if [ -n "$CVSTAG" ]; then
+                               OPTIONS="$OPTIONS -r $CVSTAG"
+                       fi
+               fi
+
+               result=1
+               retries_counter=0
+               while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
+               do
+                       retries_counter=$(( $retries_counter + 1 ))
+                       output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
+                       result=$?
+                       [ -n "$output" ] && echo "$output"
+                       if [ "$result" -ne "0" ]; then
+                               if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then
+                                       echo "Trying again [$SPECFILE]... ($retries_counter)"
+                                       sleep 2
+                                       continue
+                               fi
+                               Exit_error err_no_spec_in_repo;
+                       fi
+               done
+       fi
+       if [ ! -f "$SPECFILE" ]; then
+               Exit_error err_no_spec_in_repo;
+       fi
+
+       if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
+               chmod $CHMOD_MODE $SPECFILE
+       fi
+       unset OPTIONS
+       [ -n "$DONT_PRINT_REVISION" ] || grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
+}
+
+find_mirror()
+{
+       cd "$SPECS_DIR"
+       url="$1"
+       if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
+               cvs update mirrors >&2
+       fi
+
+       IFS="|"
+       while read origin mirror name rest
+       do
+               ol=`echo -n "$origin"|wc -c`
+               prefix="`echo -n "$url" | head -c $ol`"
+               if [ "$prefix" = "$origin" ] ; then
+                       suffix="`echo "$url"|cut -b $ol-`"
+                       echo -n "$mirror$suffix"
+                       return 0
+               fi
+       done < mirrors
+       echo "$url"
+}
+
+src_no ()
+{
+       cd $SPECS_DIR
+       rpm_dump | \
+       grep "SOURCEURL[0-9]*[  ]*$1""[         ]*$" | \
+       sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
+       head -n 1 | xargs
+}
+
+src_md5 ()
+{
+       [ X"$NO5" = X"yes" ] && return
+       no=$(src_no "$1")
+       [ -z "$no" ] && return
+       cd $SPECS_DIR
+       spec_rev=$(grep $SPECFILE CVS/Entries 2>/dev/null | sed -e s:/$SPECFILE/:: -e s:/.*::)
+       if [ -z "$spec_rev" ]; then
+               spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
+       fi
+       spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
+       md5=$(grep -s -v '^#' additional-md5sums | \
+       grep -E "[      ]$(basename "$1")[      ]+${spec}([     ,]|\$)" | \
+       sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
+       grep -E '^[0-9a-f]{32}$')
+       if [ X"$md5" = X"" ] ; then
+               source_md5=`grep -i "#[         ]*Source$no-md5[        ]*:" $SPECFILE | sed -e 's/.*://'`
+               if [ ! -z "$source_md5" ] ; then
+                       echo $source_md5;
+               else
+                       # we have empty SourceX-md5, but it is still possible
+                       # that we have NoSourceX-md5 AND NoSource: X
+                       nosource_md5=`grep -i "#[        ]*NoSource$no-md5[      ]*:" $SPECFILE | sed -e 's/.*://'`
+                       if [ ! -z "$nosource_md5" -a ! X"`grep -i "^NoSource:[   ]*$no$" $SPECFILE`" = X"" ] ; then
+                               echo $nosource_md5;
+                       fi;
+               fi;
+       else
+               if [ $(echo "$md5" | wc -l) != 1 ] ; then
+                       echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
+               fi
+               echo "$md5" | tail -n 1
+       fi
+}
+
+distfiles_url ()
+{
+       echo "$PROTOCOL$DISTFILES_SERVER/distfiles/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
+}
+
+distfiles_attic_url ()
+{
+       echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
+}
+
+good_md5 ()
+{
+       md5=$(src_md5 "$1")
+       [ "$md5" = "" ] || \
+       [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
+}
+
+good_size ()
+{
+        size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
+        [ -n "$size" -a "$size" -gt 0 ]
+}
+
+cvsignore_df ()
+{
+       if [ "$CVSIGNORE_DF" != "yes" ]; then
+               return
+       fi
+       cvsignore=${SOURCE_DIR}/.cvsignore
+       if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
+               echo "$1" >> $cvsignore
+       fi
+}
+
+get_files()
+{
+       GET_FILES="$@"
+
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
+               cd "$SOURCE_DIR"
+
+               OPTIONS="up "
+               if [ -n "$CVSROOT" ]; then
+                       OPTIONS="-d $CVSROOT $OPTIONS"
+               else
+                       if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
+                               echo "warning: No cvs access defined for SOURCES"
+                               NOCVS="yes"
+                       fi
+               fi
+               if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
+                       OPTIONS="$OPTIONS -A"
+               else
+                       if [ -n "$CVSDATE" ]; then
+                               OPTIONS="$OPTIONS -D $CVSDATE"
+                       fi
+                       if [ -n "$CVSTAG" ]; then
+                               OPTIONS="$OPTIONS -r $CVSTAG"
+                       fi
+               fi
+               for i in $GET_FILES
+               do
+                       if [ -n "$UPDATE5" ]; then
+                               if [ -n "$ADD5" ]; then
+                                       [ `nourl $i` = "$i" ] && continue
+                                       grep -qiE '^#[  ]*Source'$(src_no $i)'-md5[     ]*:' $SPECS_DIR/$SPECFILE && continue
+                               else
+                                       grep -qiE '^#[  ]*Source'$(src_no $i)'-md5[     ]*:' $SPECS_DIR/$SPECFILE || continue
+                               fi
+                       fi
+                       FROM_DISTFILES=0
+                       if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
+                               if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
+                                       echo "Warning: no URL given for $i"
+                               fi
+
+                               if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
+                                       if good_md5 "$i" && good_size "$i"; then
+                                               echo "$(nourl "$i") having proper md5sum already exists"
+                                               continue
+                                       fi
+                                       target=$(nourl "$i")
+                                       url=$(distfiles_url "$i")
+                                       url_attic=$(distfiles_attic_url "$i")
+                                       FROM_DISTFILES=1
+                                       if [ `echo $url | grep -E '^(\.|/)'` ]; then
+                                               ${GETLOCAL} $url $target
+                                       else
+                                               if [ -z "$NOMIRRORS" ]; then
+                                                       url="`find_mirror "$url"`"
+                                               fi
+                                               ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
+                                               if [ `echo $url | grep -E 'ftp://'` ]; then
+                                                       ${GETURI2} ${OUTFILEOPT} "$target" "$url"
+                                               fi
+                                       fi
+                                       if ! test -s "$target"; then
+                                               rm -f "$target"
+                                               if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
+                                                       ${GETLOCAL} $url_attic $target
+                                               else
+                                                       if [ -z "$NOMIRRORS" ]; then
+                                                               url_attic="`find_mirror "$url_attic"`"
+                                                       fi
+                                                       ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
+                                                       if [ `echo $url_attic | grep -E 'ftp://'` ]; then
+                                                               ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
+                                                       fi
+                                               fi
+                                       fi
+                                       if test -s "$target"; then
+                                               cvsignore_df $target
+                                       else
+                                               rm -f "$target"
+                                               FROM_DISTFILES=0
+                                       fi
+                               elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
+                                       # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
+                                       result=1
+                                       retries_counter=0
+                                       while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
+                                       do
+                                               retries_counter=$(( $retries_counter + 1 ))
+                                               output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
+                                               result=$?
+                                               [ -n "$output" ] && echo "$output"
+                                               if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$result" -ne "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; then
+                                                       echo "Trying again [`nourl $i`]... ($retries_counter)"
+                                                       sleep 2
+                                                       continue
+                                               else
+                                                       break
+                                               fi
+                                       done
+                               fi
+
+                               if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
+                                       if [ -z "$NOMIRRORS" ]; then
+                                               im="`find_mirror "$i"`"
+                                       else
+                                               im="$i"
+                                       fi
+                                       ${GETURI} "$im" || \
+                                       if [ `echo $im | grep -E 'ftp://'` ]; then
+                                               ${GETURI2} "$im"
+                                       fi
+                               fi
+
+                       fi
+                       srcno=$(src_no $i)
+                       if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
+                               Exit_error err_no_source_in_repo $i;
+                       elif [ -n "$UPDATE5" ] && \
+                               ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
+                               [ -z "$(grep -E -i '^NoSource[  ]*:[    ]*'$i'([        ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
+                               grep -q -i -E '^#[      ]*source'$(src_no $i)'-md5[     ]*:' $SPECS_DIR/$SPECFILE )
+                       then
+                               echo "Updating source-$srcno md5."
+                               md5=$(md5sum `nourl $i` | cut -f1 -d' ')
+                               perl -i -ne '
+                               print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
+                               print "# Source'$srcno'-md5:\t'$md5'\n"
+                               if /^Source'$srcno'\s*:\s+/;
+                               ' \
+                               $SPECS_DIR/$SPECFILE
+                       fi
+
+                       if good_md5 "$i" && good_size "$i"; then
+                               :
+                       elif [ "$FROM_DISTFILES" = 1 ]; then
+                               # wrong md5 from distfiles: remove the file and try again
+                               # but only once ...
+                               echo "MD5 sum mismatch. Trying full fetch."
+                               FROM_DISTFILES=2
+                               rm -f $target
+                               ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
+                               if [ `echo $url | grep -E 'ftp://'` ]; then
+                                       ${GETURI2} ${OUTFILEOPT} "$target" "$url"
+                               fi
+                               if ! test -s "$target"; then
+                                       rm -f "$target"
+                                       ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
+                                       if [ `echo $url_attic | grep -E 'ftp://'` ]; then
+                                               ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
+                                       fi
+                               fi
+                               test -s "$target" || rm -f "$target"
+                       fi
+
+                       if good_md5 "$i" && good_size "$i" ; then
+                               :
+                       else
+                               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
+                       fi
+               done
+
+               if [ "$CHMOD" = "yes" ]; then
+                       CHMOD_FILES="`nourl $GET_FILES`"
+                       if [ -n "$CHMOD_FILES" ]; then
+                               chmod $CHMOD_MODE $CHMOD_FILES
+                       fi
+               fi
+               unset OPTIONS
+       fi
+}
+
+make_tagver() {
+
+               if [ -n "$DEBUG" ]; then
+                        set -x;
+                        set -v;
+               fi
+
+               # Check whether first character of PACKAGE_NAME is legal for tag name
+               if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
+                       TAG_PREFIX=tag_
+               fi
+               TAGVER=$TAG_PREFIX$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
+               # Remove #kernel.version_release from TAGVER because tagging sources
+               # could occur with different kernel-headers than kernel-headers used at build time.
+               TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
+               echo -n "$TAGVER"
+}
+
+tag_files()
+{
+       TAG_FILES="$@"
+
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
+               echo "Version: $PACKAGE_VERSION"
+               echo "Release: $PACKAGE_RELEASE"
+
+               TAGVER=`make_tagver`
+
+               if [ "$TAG_VERSION" = "yes" ]; then
+                       echo "CVS tag: $TAGVER"
+               fi
+               if [ -n "$TAG" ]; then
+                       echo "CVS tag: $TAG"
+               fi
+
+               OPTIONS="tag -F"
+               if [ -n "$CVSROOT" ]; then
+                       OPTIONS="-d $CVSROOT $OPTIONS"
+               fi
+
+               cd "$SOURCE_DIR"
+               for i in $TAG_FILES
+               do
+                       # don't tag files stored on distfiles
+                       [ -n "`src_md5 $i`" ] && continue
+                       if [ -f "`nourl $i`" ]; then
+                               if [ "$TAG_VERSION" = "yes" ]; then
+                                       cvs $OPTIONS $TAGVER `nourl $i`
+                               fi
+                               if [ -n "$TAG" ]; then
+                                       cvs $OPTIONS $TAG `nourl $i`
+                               fi
+                       else
+                               Exit_error err_no_source_in_repo $i
+                       fi
+               done
+
+               cd "$SPECS_DIR"
+               if [ "$TAG_VERSION" = "yes" ]; then
+                       cvs $OPTIONS $TAGVER $SPECFILE
+               fi
+               if [ -n "$TAG" ]; then
+                       cvs $OPTIONS $TAG $SPECFILE
+               fi
+
+               unset OPTIONS
+       fi
+}
+
+branch_files()
+{
+       TAG=$1
+       echo "CVS branch tag: $TAG"
+       shift;
+
+       TAG_FILES="$@"
+
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
+
+               OPTIONS="tag -b"
+               if [ -n "$CVSROOT" ]; then
+                       OPTIONS="-d $CVSROOT $OPTIONS"
+               fi
+               cd "$SOURCE_DIR"
+               for i in $TAG_FILES
+               do
+                       if [ -f `nourl $i` ]; then
+                               cvs $OPTIONS $TAG `nourl $i`
+                       else
+                               Exit_error err_no_source_in_repo $i
+                       fi
+               done
+               cd "$SPECS_DIR"
+               cvs $OPTIONS $TAG $SPECFILE
+
+               unset OPTIONS
+       fi
+}
+
+
+
+build_package()
+{
+       if [ -n "$DEBUG" ]; then
+               set -x;
+               set -v;
+       fi
+
+       cd "$SPECS_DIR"
+
+       if [ -n "$TRY_UPGRADE" ]; then
+               if [ -n "$FLOAT_VERSION" ]; then
+                       TNOTIFY=`./pldnotify.awk $SPECFILE -n`
+               else
+                       TNOTIFY=`./pldnotify.awk $SPECFILE`
+               fi
+
+               TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
+
+               if [ -n "$TNEWVER" ]; then
+                       TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
+                       echo "New version found, updating spec file to version " $TNEWVER
+                       cp -f $SPECFILE $SPECFILE.bak
+                       chmod +w $SPECFILE
+                       eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
+                       eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
+                       parse_spec;
+                       if [ -n "$ICONS" ]; then
+                               get_files $ICONS;
+                               parse_spec;
+                       fi
+                       get_files "$SOURCES $PATCHES";
+                       unset TOLDVER TNEWVER TNOTIFY
+               fi
+       fi
+       cd "$SPECS_DIR"
+
+       case "$COMMAND" in
+               build )
+                       BUILD_SWITCH="-ba" ;;
+               build-binary )
+                       BUILD_SWITCH="-bb" ;;
+               build-source )
+                       BUILD_SWITCH="-bs --nodeps" ;;
+               build-prep )
+                       BUILD_SWITCH="-bp --nodeps" ;;
+       esac
+       if [ -n "$LOGFILE" ]; then
+               LOG=`eval echo $LOGFILE`
+               if [ -d "$LOG" ]; then
+                       echo "Log file $LOG is a directory."
+                       echo "Parse error in the spec?"
+                       Exit_error err_build_fail;
+               fi
+               if [ -n "$LASTLOG_FILE" ]; then
+                       echo "LASTLOG=$LOG" > $LASTLOG_FILE
+               fi
+               RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
+               (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
+               RETVAL=`cat $RES_FILE`
+               rm $RES_FILE
+               if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
+                       if [ "$RETVAL" -eq "0" ]; then
+                               mv $LOG $LOGDIROK
+                       else
+                               mv $LOG $LOGDIRFAIL
+                       fi
+               fi
+       else
+               eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE
+               RETVAL=$?
+       fi
+       if [ "$RETVAL" -ne "0" ]; then
+               if [ -n "$TRY_UPGRADE" ]; then
+                       echo "\n!!! Package with new version cannot be build automagically\n"
+                       mv -f $SPECFILE.bak $SPECFILE
+               fi
+               Exit_error err_build_fail;
+       fi
+       unset BUILD_SWITCH
+}
+
+nourl()
+{
+       echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
+}
+
+install_required_packages()
+{
+       run_poldek -vi $1
+       return $?
+}
+
+set_bconds_values()
+{
+       AVAIL_BCONDS_WITHOUT=""
+       AVAIL_BCONDS_WITH=""
+       if `grep -q ^%bcond ${SPECFILE}`; then
+               BCOND_VERSION="NEW"
+       elif `egrep -q ^#\ *_with ${SPECFILE}`; then
+               BCOND_VERSION="OLD"
+       else
+               BCOND_VERSION="NONE"
+       fi
+
+       # expand bconds from ~/.bcondrc
+       # The file structure is like gentoo's package.use:
+       # ---
+       # * -selinux
+       # samba -mysql -pgsql
+       # w32codec-installer license_agreement
+       # php +mysqli
+       # ---
+       if [ "${BCOND_VERSION}" != "NONE" ] && ( [ -f $HOME/.bcondrc ] || ( [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] ) ) ; then
+               # This takes package name, first defined in spec.
+               # so consider that when defining flags for package.
+               PN=`$RPM -q --qf '%{NAME}\n' --specfile $SPECFILE | head -n 1`
+               AVAIL=`$RPMBUILD --bcond $SPECFILE`
+
+               BCONDRC=$HOME/.bcondrc
+               [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && BCONDRC=$HOME_ETC/.bcondrc
+
+               while read pkg flags; do
+                       # ignore comments
+                       [[ "$pkg" == \#* ]] && continue
+
+                       # any package or current package?
+                       if [ "$pkg" = "*" ] || [ "$pkg" = "$PN" ]; then
+                               for flag in $flags; do
+                                       opt=${flag#[+-]}
+
+                                       # use only flags which are in this package.
+                                       if [[ $AVAIL = *${opt}* ]]; then
+                                               if [[ $flag = -* ]]; then
+                                                       BCOND="$BCOND --without $opt"
+                                               else
+                                                       BCOND="$BCOND --with $opt"
+                                               fi
+                                       fi
+                               done
+                       fi
+               done < $BCONDRC
+       fi
+
+       case "${BCOND_VERSION}" in
+                NONE)
+                       :
+                       ;;
+               OLD)
+                       echo "Warning: This spec has old style bconds. Fix it || die."
+                       for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_without_`
+                       do
+                               AVAIL_BCOND_WITHOUT=`echo $opt|sed -e "s/^_without_//g"`
+                               if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
+                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
+                               else
+                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
+                               fi
+                       done
+
+                       for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_with_`
+                       do
+                               AVAIL_BCOND_WITH=`echo $opt|sed -e "s/^_with_//g"`
+                               if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
+                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
+                               else
+                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
+                               fi
+                       done
+                       ;;
+               NEW)
+                       cond_type="" # with || without
+                       for opt in `$RPMBUILD --bcond $SPECFILE`
+                       do
+                               case "$opt" in
+                                       _without)
+                                               cond_type="without"
+                                               ;;
+                                       _with)
+                                               cond_type="with"
+                                               ;;
+                                       _without_*)
+                                               AVAIL_BCOND_WITHOUT="`echo $opt | sed 's/^_without_//g'`"
+                                               if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
+                                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
+                                               else
+                                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
+                                               fi
+                                               ;;
+                                       _with_*)
+                                               AVAIL_BCOND_WITH="`echo $opt | sed 's/^_with_//g'`"
+                                               if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
+                                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
+                                               else
+                                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
+                                               fi
+                                               ;;
+                                       *)
+                                               case "$cond_type" in
+                                                       with)
+                                                               cond_type=''
+                                                               AVAIL_BCOND_WITH="$opt"
+                                                               if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
+                                                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
+                                                               else
+                                                                       AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
+                                                               fi
+                                                               ;;
+                                                       without)
+                                                               cond_type=''
+                                                               AVAIL_BCOND_WITHOUT="$opt"
+                                                               if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
+                                                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
+                                                               else
+                                                                       AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
+                                                               fi
+                                                               ;;
+                                               esac
+                                               ;;
+                               esac
+                       done
+                       ;;
+       esac
+}
+
+run_sub_builder()
+{
+       package_name="${1}"
+       echo -ne "Package installation failed:\t$package_name\n"
+       #
+       # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
+       # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
+       # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
+       # jakby nie bylo tego kawalka kodu.
+       #
+       # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
+       #         Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
+       #
+       #
+       # y0shi.
+
+       parent_spec_name=''
+
+       # Istnieje taki spec? ${package}.spec
+       if [ -f "${SPECS_DIR}${package}.spec" ]; then
+               parent_spec_name=${package}.spec
+       elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
+               parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
+       else
+               for provides_line in `grep ^Provides:.*$package  ${SPECS_DIR} -R`
+               do
+                       echo $provides_line
+               done
+       fi
+
+       if [ "${parent_spec_name}" != "" ]; then
+               sub_builder_opts=''
+               if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
+                       sub_builder_opts="${sub_builder_opts} -R"
+               fi
+               if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
+                       sub_builder_opts="${sub_builder_opts} -RB"
+               elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
+                       sub_builder_opts="${sub_builder_opts} -FRB"
+               fi
+               if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
+                       sub_builder_opts="${sub_builder_opts} -Upi"
+               fi
+               cd "${SPECS_DIR}"
+               ./builder ${sub_builder_opts} ${parent_spec_name}
+       fi
+       NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
+}
+
+remove_build_requires()
+{
+       if [ "$INSTALLED_PACKAGES" != "" ]; then
+               case "$REMOVE_BUILD_REQUIRES" in
+                       "force")
+                               run_poldek --noask -ve $INSTALLED_PACKAGES
+                               ;;
+                       "nice")
+                               run_poldek --ask -ve $INSTALLED_PACKAGES
+                               ;;
+                       *)
+                               echo You may want to manually remove following BuildRequires fetched:
+                               echo $INSTALLED_PACKAGES
+                               echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
+                               ;;
+               esac
+       fi
+}
+
+display_bconds()
+{
+       if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
+               if [ "$BCOND" != "" ]; then
+                       echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
+                       echo -ne "$BCOND"
+               else
+                       echo -ne "\nNo conditional flags passed"
+               fi
+               echo -ne "\n\nfrom available:\n"
+               echo -ne "--with   :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
+       fi
+}
+
+# checks a given list of packages/files/provides agains current rpmdb.
+# outputs all dependencies whcih current rpmdb doesn't satisfy.
+# input can be either STDIN or parameters
+_rpm_prov_check()
+{
+        local DEPS
+
+        if [ "$#" -gt 0 ]; then
+                 DEPS="$@"
+        else
+                 DEPS=$(cat)
+        fi
+
+        DEPS=$(rpm -q --whatprovides $DEPS 2>&1 | awk '/^(error:|no package provides)/ { print }')
+
+        # packages
+        echo "$DEPS" | awk '/^no package provides/ { print "@" $NF }'
+
+        # other deps (files)
+        echo "$DEPS" | awk -F: '/^error:.*No such file/{o=$2; gsub("^ file ", "", o); print "@" o}'
+}
+
+# checks if given package/files/provides exists in rpmdb.
+# inout can be either stdin or parameters
+# returns packages wchi hare present in the rpmdb
+_rpm_cnfl_check()
+{
+        local DEPS
+
+        if [ "$#" -gt 0 ]; then
+                 DEPS="$@"
+        else
+                 DEPS=$(cat)
+        fi
+
+        rpm -q --whatprovides $DEPS 2>/dev/null | awk '!/no package provides/ { print }'
+}
+
+fetch_build_requires()
+{
+       if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
+               if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
+                       CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
+                       DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
+
+                       if [ -n "$CONF" ] || [ -n "$DEPS" ]; then
+                               $SU_SUDO /usr/bin/poldek --update || $SU_SUDO /usr/bin/poldek --upa
+                       fi
+                       if [ -n "$CONF" ]; then
+                               echo "Trying to uninstall conflicting packages ($CONF):"
+                               $SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CONF
+                       fi
+                       if [ -n "$DEPS" ]; then
+                               echo "Trying to install dependencies ($DEPS):"
+                               $SU_SUDO /usr/bin/poldek --caplookup -uGv $DEPS
+                       fi
+                       return
+               fi
+
+               echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
+               echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
+               echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
+               echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
+               echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
+               for package_item in `cat $SPECFILE|grep -B100000 ^%changelog|grep -v ^#|grep BuildRequires|grep -v ^-|sed -e "s/^.*BuildRequires://g"|awk '{print $1}'|sed -e s,perl\(,perl-,g -e s,::,-,g -e s,\(.*\),,g -e s,%{,,g -e s,},,g|grep -v OpenGL-devel|sed -e s,sh-utils,coreutils,g -e s,fileutils,coreutils,g -e s,textutils,coreutils,g -e s,kgcc_package,gcc,g -e s,\),,g`
+               do
+                       package_item="`echo $package_item|sed -e s,rpmbuild,rpm-build,g |sed -e s,__perl,perl,g |sed -e s,gasp,binutils-gasp,g -e s,binutils-binutils,binutils,g -e s,apxs,apache,g|sed -e s,apache\(EAPI\)-devel,apache-devel,g -e s,kernel-headers\(netfilter\),kernel-headers,g -e s,awk,mawk,g -e s,mmawk,mawk,g -e s,motif,openmotif,g -e s,openopenmotif,openmotif,g`"
+                       GO="yes"
+                       package=`basename "$package_item"|sed -e "s/}$//g"`
+                       COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
+                       mach=`uname -m`
+
+                       COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
+                       if `echo $COND_TST|grep -q '^BuildRequires:'`; then
+                               if [ "$COND_ARCH_TST" != "" ] && [ "`echo $COND_ARCH_TST|sed -e "s/i.86/ix86/g"`" != "`echo $mach|sed -e "s/i.86/ix86/g"`" ]; then
+                                       GO="yes"
+                               fi
+                       # bcond:
+                       else
+                               COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
+                               GO=""
+                               # %{without}
+                               if `echo $COND_TST|grep -q 'without_'`; then
+                                       COND_NAME=`echo $COND_NAME|sed -e s,^.*without_,,g`
+                                       if `echo $COND_TST|grep -q !`; then
+                                               COND_STATE="with"
+                                       else
+                                               COND_STATE="wout"
+                                       fi
+                                       COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
+                                       COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
+                                       if [ -n "$COND_WITHOUT" ] || [ -z "$COND_WITH" ]; then
+                                               COND_ARGV="wout"
+                                       else
+                                               COND_ARGV="with"
+                                       fi
+                               # %{with}
+                               elif `echo $COND_TST|grep -q 'with_'`; then
+                                       COND_NAME=`echo $COND_NAME|sed -e s,^.*with_,,g`
+                                       if `echo $COND_TST|grep -q !`; then
+                                               COND_STATE="wout"
+                                       else
+                                               COND_STATE="with"
+                                       fi
+                                       COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
+                                       COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
+                                       if [ -n "$COND_WITH" ] || [ -z "$COND_WITHOUT" ]; then
+                                               COND_ARGV="with"
+                                       else
+                                               COND_ARGV="wout"
+                                       fi
+                               fi
+                               RESULT="${COND_STATE}-${COND_ARGV}"
+                               case "$RESULT" in
+                                       "with-wout" | "wout-with" )
+                                               GO=""
+                                               ;;
+                                       "wout-wout" | "with-with" )
+                                               GO="yes"
+                                               ;;
+                                       * )
+                                               echo "Action '$RESULT' was not defined for package '$package_item'"
+                                               GO="yes"
+                                               ;;
+                               esac
+                       fi
+
+                       if [ "$GO" = "yes" ]; then
+                               if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
+                                       echo "Testing if $package has subrequirements..."
+                                       run_poldek -t -i $package --dumpn=".$package-req.txt"
+                                       if [ -f ".$package-req.txt" ]; then
+                                               for package_name in `cat ".$package-req.txt"|grep -v ^#`
+                                               do
+                                                       if [ "$package_name" = "$package" ]; then
+                                                               echo -ne "Installing BuildRequired package:\t$package_name\n"
+                                                               export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing BuildRequired package: ${package_name}\007"`
+                                                               install_required_packages $package;
+                                                       else
+                                                               echo -ne "Installing (sub)Required package:\t$package_name\n"
+                                                               export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing (sub)Required package: ${package_name}\007"`
+                                                               install_required_packages $package_name;
+                                                       fi
+                                                       case $? in
+                                                               0)
+                                                                       INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
+                                                                       echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
+                                                                       ;;
+                                                               *)
+                                                                       echo "Attempting to run spawn sub - builder..."
+                                                                       run_sub_builder $package_name
+                                                                       if [ $? -eq 0 ]; then
+                                                                               install_required_packages $package_name;
+                                                                               case $? in
+                                                                                       0)
+                                                                                               INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
+                                                                                               echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
+                                                                                               ;;
+                                                                                       *)
+                                                                                               NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
+                                                                                               ;;
+                                                                               esac
+                                                                       fi
+                                                                       ;;
+                                                       esac
+                                               done
+                                               rm -f ".$package-req.txt"
+                                       else
+                                               echo "Attempting to run spawn sub - builder..."
+                                               run_sub_builder $package
+                                               if [ $? -eq 0 ]; then
+                                                       install_required_packages $package;
+                                                       case $? in
+                                                               0)
+                                                                       INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
+                                                                       echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
+                                                                       ;;
+                                                               *)
+                                                                       NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
+                                                                       ;;
+                                                       esac
+                                               fi
+                                       fi
+                               else
+                                       echo "Package $package is already installed. BuildRequirement satisfied."
+                               fi
+                       fi
+               done
+               export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
+               if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
+                       echo "Unable to install following packages and their dependencies:"
+                       for pkg in "$NOT_INSTALLED_PACKAGES"
+                       do
+                               echo $pkg
+                       done
+                       remove_build_requires
+                       exit 8
+               fi
+       fi
+}
+
+diffcol()
+{
+        # vim like diff colourization, glen@pld-linux.org
+        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,
+        ' "$@"
+}
+
+adapterize()
+{
+        cd "$SPECS_DIR"
+        local tmpdir
+        tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/adapter-XXXXXX) || exit
+        awk -f adapter.awk $SPECFILE > $tmpdir/$SPECFILE
+
+        if [ "`diff --brief $SPECFILE $tmpdir/$SPECFILE`" ] ; then
+                 diff -u $SPECFILE $tmpdir/$SPECFILE > $tmpdir/$SPECFILE.diff
+                 diffcol $tmpdir/$SPECFILE.diff | less -r
+                 (
+                               while : ; do
+                                        echo -n "Accept? [yn] "
+                                        read ans
+                                        case "$ans" in
+                                        [yYoO]) # y0 mama
+                                                 mv -f $tmpdir/$SPECFILE $SPECFILE
+                                                 echo "Ok, adapterized."
+                                                 break
+                                        ;;
+                                        [nNsS])
+                                                 echo "Ok, exiting."
+                                                 break
+                                        ;;
+                                        esac
+                               done
+                 )
+        else
+                 echo "The SPEC is perfect ;)"
+        fi
+
+        rm -rf $tmpdir
+}
+
+#---------------------------------------------
+# main()
+
+if [ "$#" = 0 ]; then
+       usage;
+       exit 1
+fi
+
+while test $# -gt 0
+do
+       case "${1}" in
+               -5 | --update-md5 )
+                       COMMAND="get";
+                       NODIST="yes"
+                       NOCVSSPEC="yes"
+                       UPDATE5="yes"
+                       shift ;;
+               --adapter | --adapterize )
+                       COMMAND="adapterize";
+                       NODIST="yes"
+                       NOCVSSPEC="yes"
+                       ADAPTERIZE="yes"
+                       shift ;;
+               -a5 | --add-md5 )
+                       COMMAND="get";
+                       NODIST="yes"
+                       NOCVS="yes"
+                       NOCVSSPEC="yes"
+                       UPDATE5="yes"
+                       ADD5="yes"
+                       shift ;;
+               -n5 | --no-md5 )
+                       NO5="yes"
+                       shift ;;
+               -D | --debug )
+                       DEBUG="yes"; shift ;;
+               -V | --version )
+                       COMMAND="version"; shift ;;
+               -a | --as_anon )
+                       CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
+               -b | -ba | --build )
+                       COMMAND="build"; shift ;;
+               -bb | --build-binary )
+                       COMMAND="build-binary"; shift ;;
+               -bs | --build-source )
+                       COMMAND="build-source"; shift ;;
+               -bp | --build-prep )
+                       COMMAND="build-prep"; shift ;;
+               -B | --branch )
+                       COMMAND="branch"; shift; TAG="${1}"; shift;;
+               -c | --clean )
+                       CLEAN="--clean --rmspec --rmsource"; shift ;;
+               -d | --cvsroot )
+                       shift; CVSROOT="${1}"; shift ;;
+               -g | --get )
+                       COMMAND="get"; shift ;;
+               -h | --help )
+                       COMMAND="usage"; shift ;;
+               --http )
+                       PROTOCOL="http"; shift ;;
+               -l | --logtofile )
+                       shift; LOGFILE="${1}"; shift ;;
+               -ni| --nice )
+                       shift; DEF_NICE_LEVEL=${1}; shift ;;
+               -m | --mr-proper )
+                       COMMAND="mr-proper"; shift ;;
+               -nc | --no-cvs )
+                       NOCVS="yes"; shift ;;
+               -ncs | --no-cvs-specs )
+                       NOCVSSPEC="yes"; shift ;;
+               -nd | --no-distfiles )
+                       NODIST="yes"; shift ;;
+               -nm | --no-mirrors )
+                       NOMIRRORS="yes"; shift ;;
+               -nu | --no-urls )
+                       NOURLS="yes"; shift ;;
+               -ns | --no-srcs )
+                       NOSRCS="yes"; shift ;;
+               -ns0 | --no-source0 )
+                       NOSOURCE0="yes"; shift ;;
+               -nn | --no-net )
+                       NOCVS="yes"
+                       NOCVSSPEC="yes"
+                       NODIST="yes"
+                       NOMIRRORS="yes"
+                       NOURLS="yes"
+                       NOSRCS="yes"
+                       shift;;
+               --opts )
+                       shift; RPMOPTS="$RPM_OPTS ${1}"; shift ;;
+               --with | --without )
+                       case $GROUP_BCONDS in
+                               "yes")
+                                       COND=${1}
+                                       shift
+                                       while ! `echo ${1}|grep -qE '(^-|spec)'`
+                                       do
+                                               BCOND="$BCOND $COND $1"
+                                               shift
+                                       done;;
+                               "no")
+                                       BCOND="$BCOND $1 $2" ; shift 2 ;;
+                       esac
+                       ;;
+               --target )
+                       shift; TARGET="${1}"; shift ;;
+               --target=* )
+                       TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
+               -q | --quiet )
+                       QUIET="--quiet"; shift ;;
+               --date )
+                       CVSDATE="${2}"; shift 2 ;;
+               -r | --cvstag )
+                       shift; CVSTAG="${1}"; shift ;;
+               -R | --fetch-build-requires)
+                       FETCH_BUILD_REQUIRES="yes"
+                       NOT_INSTALLED_PACKAGES=
+                       shift ;;
+               -RB | --remove-build-requires)
+                       REMOVE_BUILD_REQUIRES="nice"
+                       shift ;;
+               -FRB | --force-remove-build-requires)
+                       REMOVE_BUILD_REQUIRES="force"
+                       shift ;;
+               -sf | --sources-files)
+                       COMMAND="list-sources-files"
+                       shift ;;        
+               -sp | --sources-paths)
+                       COMMAND="list-sources-local-paths"
+                       shift ;;        
+               -Tvs | --tag-version-stable )
+                       COMMAND="tag";
+                       TAG="STABLE"
+                       TAG_VERSION="yes"
+                       shift;;
+               -Tvn | --tag-version-nest )
+                       COMMAND="tag";
+                       TAG="NEST"
+                       TAG_VERSION="yes"
+                       shift;;
+               -Ts | --tag-stable )
+                       COMMAND="tag";
+                       TAG="STABLE"
+                       TAG_VERSION="no"
+                       shift;;
+               -Tn | --tag-nest )
+                       COMMAND="tag";
+                       TAG="NEST"
+                       TAG_VERSION="no"
+                       shift;;
+               -Tv | --tag-version )
+                       COMMAND="tag";
+                       TAG=""
+                       TAG_VERSION="yes"
+                       shift;;
+               -Tp | --tag-prefix )
+                       TAG_PREFIX="$2"
+                       shift 2;;
+               -tt | --test-tag )
+                       TEST_TAG="yes"
+                       shift;;
+               -T | --tag )
+                       COMMAND="tag";
+                       shift
+                       TAG="$1"
+                       TAG_VERSION="no"
+                       shift;;
+               -ir | --integer-release-only )
+                       INTEGER_RELEASE="yes"
+                       shift;;
+               -U | --update )
+                       COMMAND="get"
+                       UPDATE="yes"
+                       NOCVSSPEC="yes"
+                       NODIST="yes"
+                       UPDATE5="yes"
+                       shift ;;
+               -Upi | --update-poldek-indexes )
+                       UPDATE_POLDEK_INDEXES="yes"
+                       shift ;;
+               -u | --try-upgrade )
+                       TRY_UPGRADE="1"; shift ;;
+               -un | --try-upgrade-with-float-version )
+                       TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
+               -v | --verbose )
+                       BE_VERBOSE="1"; shift ;;
+               --define)
+                       shift
+                       MACRO="${1}"
+                       VALUE="${2}"
+                       shift 2
+                       RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
+                       ;;
+               --nodeps)
+                       shift
+                       RPMOPTS="${RPMOPTS} --nodeps"
+                       ;;
+               -debug)
+                       RPMOPTS="${RPMOPTS} -debug"; shift ;;
+               * )
+                       SPECFILE="${1}"
+                       export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
+                       shift ;;
+       esac
+done
+
+if [ -n "$DEBUG" ]; then
+       set -x;
+       set -v;
+fi
+
+if [ -n "$TARGET" ]; then
+       case "$RPMBUILD" in
+               "rpmbuild")
+                       TARGET_SWITCH="--target $TARGET" ;;
+               "rpm")
+                       TARGET_SWITCH="--target=$TARGET" ;;
+       esac
+fi
+
+case "$COMMAND" in
+       "build" | "build-binary" | "build-source" | "build-prep" )
+               init_builder;
+               if [ -n "$SPECFILE" ]; then
+                       get_spec;
+                       set_bconds_values;
+                       display_bconds;
+                       fetch_build_requires;
+                       parse_spec;
+                       if [ "$INTEGER_RELEASE" = "yes" ]; then
+                               echo "Checking release $PACKAGE_RELEASE..."
+                               if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
+                                       Exit_error err_fract_rel "$PACKAGE_RELEASE"
+                               fi
+                       fi
+
+                       if [ -n "$TEST_TAG" ]; then
+                               TAGVER=`make_tagver`
+                               echo "Searching for tag $TAGVER..."
+                               TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
+                               if [ -n "$TAGREL" ]; then
+                                       Exit_error err_tag_exists "$TAGVER" "$TAGREL"
+                               fi
+                       fi
+
+                       if [ -n "$ICONS" ]; then
+                               get_files $ICONS;
+                               parse_spec;
+                       fi
+                       if [ -n "$NOSOURCE0" ] ; then
+                               SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
+                       fi
+                       get_files "$SOURCES $PATCHES";
+                       build_package;
+                       if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
+                               run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
+                       fi
+                       remove_build_requires;
+               else
+                       Exit_error err_no_spec_in_cmdl;
+               fi
+               ;;
+       "branch" )
+               init_builder;
+               if [ -n "$SPECFILE" ]; then
+                       get_spec;
+                       parse_spec;
+                       if [ -n "$ICONS" ]; then
+                               get_files $ICONS
+                               parse_spec;
+                       fi
+                       get_files $SOURCES $PATCHES;
+                       branch_files $TAG "$SOURCES $PATCHES $ICONS";
+               else
+                       Exit_error err_no_spec_in_cmdl;
+               fi
+               ;;
+       "get" )
+               init_builder;
+               if [ -n "$SPECFILE" ]; then
+                       get_spec;
+                       parse_spec;
+                       if [ -n "$ICONS" ]; then
+                               OLD_UPDATE5=$UPDATE5
+                               UPDATE5= get_files $ICONS
+                               UPDATE5=$OLD_UPDATE5
+                               parse_spec;
+                       fi
+                       if [ -n "$NOSOURCE0" ] ; then
+                               SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
+                       fi
+                       get_files $SOURCES $PATCHES
+               else
+                       Exit_error err_no_spec_in_cmdl;
+               fi
+               ;;
+       "tag" )
+               NOURLS=1
+               NODIST=1
+               init_builder;
+               if [ -n "$SPECFILE" ]; then
+                       get_spec;
+                       parse_spec;
+                       if [ -n "$ICONS" ]; then
+                               get_files $ICONS
+                               parse_spec;
+                       fi
+                       # don't fetch sources from remote locations
+                       new_SOURCES=""
+                       for file in $SOURCES
+                       do
+                               [ -n "`src_md5 $file`" ] && continue
+                               new_SOURCES="$new_SOURCES $file"
+                       done
+                       SOURCES="$new_SOURCES"
+                       get_files $SOURCES $PATCHES;
+                       tag_files "$SOURCES $PATCHES $ICONS";
+               else
+                       Exit_error err_no_spec_in_cmdl;
+               fi
+               ;;
+       "mr-proper" )
+               $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
+               ;;
+       "list-sources-files" )
+               init_builder
+               NOCVSSPEC="yes"
+               DONT_PRINT_REVISION="yes"
+               get_spec
+               parse_spec
+               SAPS="$SOURCES $PATCHES"
+               for SAP in $SAPS ; do
+                        echo $SAP | awk '{gsub(/.*\//,"") ; print}'
+               done
+               ;;
+       "list-sources-local-paths" )
+               init_builder
+               NOCVSSPEC="yes"
+               DONT_PRINT_REVISION="yes"
+               get_spec
+               parse_spec
+               SAPS="$SOURCES $PATCHES"
+               for SAP in $SAPS ; do
+                        echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
+               done
+               ;;
+       "adapterize" )
+               adapterize
+               ;;
+       "usage" )
+               usage;;
+       "version" )
+               echo "$VERSION";;
+esac
+if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
+       rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES"
+fi
+cd "$__PWD"
+
+# vi:syntax=sh:ts=3:sw=4
diff --git a/find-java-prov.sh b/find-java-prov.sh
deleted file mode 100755 (executable)
index b13a73b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# This script reads filenames from STDIN and outputs any relevant provides
-# information that needs to be included in the package.
-#
-# Based on rpm-4.4.2/scripts/find-req.pl
-# Authors: Elan Ruusamäe <glen@pld-linux.org>
-
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
-
-cat > /dev/null
diff --git a/find-java-req.sh b/find-java-req.sh
deleted file mode 100755 (executable)
index 6d6106f..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-# This script reads filenames from STDIN and outputs any relevant requires
-# information that needs to be included in the package.
-#
-# Based on rpm-4.4.2/scripts/find-req.pl
-# Authors: Elan Ruusamäe <glen@pld-linux.org>
-
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
-
-javaclassversion() {
-       [ $# -gt 0 ] || return
-
-       local ver
-       classver=$(echo "$@" | xargs -r file | grep -o 'compiled Java class data, version [0-9.]*' | awk '{print $NF}' | sort -u)
-       [ "$classver" ] || return
-       for v in $classver; do
-               echo "java(ClassDataVersion) >= $v"
-       done
-}
-
-javajarversion() {
-       local jar="$1"
-
-       # check only files, symlinks could point outside buildroot
-       [ -f "$jar" -a ! -L "$jar" ] || return
-
-#      echo >&2 "find java requires: ${jar#$RPM_BUILD_ROOT}"
-
-       tmp=$(mktemp -d)
-       unzip -q -d $tmp $jar >&2
-       javaclassversion $(find $tmp -type f -name '*.class')
-       rm -rf $tmp
-}
-
-FILES=$(cat -)
-
-find_requires() {
-       for file in $FILES; do
-               case $file in
-               *.jar)
-                       javajarversion "$file"
-               ;;
-               *.class)
-                       javaclassversion "$file"
-               ;;
-               esac
-       done
-}
-
-find_requires | sort -u
diff --git a/pldnotify.awk b/pldnotify.awk
new file mode 100644 (file)
index 0000000..c0da0a1
--- /dev/null
@@ -0,0 +1,368 @@
+#!/bin/awk -f
+# $Revision$, $Date$
+function fixedsub(s1,s2,t,     ind) {
+# substitutes fixed strings (not regexps)
+       if (ind = index(t,s1)) {
+               t = substr(t, 1, ind-1) s2 substr(t, ind+length(s1))
+       }
+       return t
+}
+
+function ispre(s) {
+       if ((s~"pre")||(s~"PRE")||(s~"beta")||(s~"BETA")||(s~"alpha")||(s~"ALPHA")||(s~"rc")||(s~"RC")) {
+               if (DEBUG) print "pre-version"
+               return 1
+       } else {
+               return 0
+       }
+}
+       
+function compare_ver(v1,v2) {
+# compares version numbers
+       while (match(v1,/[a-zA-Z][0-9]|[0-9][a-zA-Z]/))
+               v1=(substr(v1,1,RSTART) "." substr(v1,RSTART+RLENGTH-1))
+       while (match(v2,/[a-zA-Z][0-9]|[0-9][a-zA-Z]/))
+               v2=(substr(v2,1,RSTART) "." substr(v2,RSTART+RLENGTH-1))
+       sub("^0*","",v1)
+       sub("^0*","",v2)
+       gsub("\.0*",".",v1)
+       gsub("\.0*",".",v2)
+       if (DEBUG) print "v1 == " v1
+       if (DEBUG) print "v2 == " v2
+       count=split(v1,v1a,"\.")
+       count2=split(v2,v2a,"\.")
+       
+       if (count<count2) mincount=count 
+       else mincount=count2
+       
+       for (i=1; i<=mincount; i++) {
+               if (v1a[i]=="") v1a[i]=0
+               if (v2a[i]=="") v2a[i]=0
+               if (DEBUG) print "i == " i
+               if (DEBUG) print "v1[i] == " v1a[i]
+               if (DEBUG) print "v2[i] == " v2a[i]
+               if ((v1a[i]~/[0-9]/)&&(v2a[i]~/[0-9]/)) {
+                       if (length(v2a[i])>length(v1a[i]))
+                               return 1
+                       else if (v2a[i]>v1a[i])
+                               return 1
+                       else if (length(v1a[i])>length(v2a[i]))
+                               return 0
+                       else if (v1a[i]>v2a[i])
+                               return 0
+               } else if ((v1a[i]~/[A-Za-z]/)&&(v2a[i]~/[A-Za-z]/)) {
+                       if (v2a[i]>v1a[i])
+                               return 1
+                       else if (v1a[i]>v2a[i])
+                               return 0
+               } else if (ispre(v1a[i]) == 1)
+                       return 1
+               else
+                       return 0
+       }
+       if ((count2==mincount)&&(count!=count2)) {
+               for (i=count2+1; i<=count; i++)
+                       if (ispre(v1a[i]) == 1)
+                               return 1
+               return 0
+       } else if (count!=count2) {
+               for (i=count+1; i<=count2; i++)
+                       if (ispre(v2a[i]) == 1)
+                               return 0
+               return 1
+       }
+       return 0
+}
+
+function compare_ver_dec(v1,v2) {
+# compares version numbers as decimal floats
+       while (match(v1,/[0-9][a-zA-Z]/))
+               v1=(substr(v1,1,RSTART) "." substr(v1,RSTART+RLENGTH-1))
+       while (match(v2,/[0-9][a-zA-Z]/))
+               v2=(substr(v2,1,RSTART) "." substr(v2,RSTART+RLENGTH-1))
+       sub("^0*","",v1)
+       sub("^0*","",v2)
+       if (DEBUG) print "v1 == " v1
+       if (DEBUG) print "v2 == " v2
+       count=split(v1,v1a,"\.")
+       count2=split(v2,v2a,"\.")
+       
+       if (count<count2) mincount=count 
+       else mincount=count2
+       
+       for (i=1; i<=mincount; i++) {
+               if (v1a[i]=="") v1a[i]=0
+               if (v2a[i]=="") v2a[i]=0
+               if (DEBUG) print "i == " i
+               if (DEBUG) print "v1[i] == " v1a[i]
+               if (DEBUG) print "v2[i] == " v2a[i]
+               if ((v1a[i]~/[0-9]/)&&(v2a[i]~/[0-9]/)) {
+                       if (i==2) {
+                               if (0+("." v2a[i])>0+("." v1a[i]))
+                                       return 1
+                               else if (0+("." v1a[i])>0+("." v2a[i]))
+                                       return 0
+                       } else {
+                               if (length(v2a[i])>length(v1a[i]))
+                                       return 1
+                               else if (v2a[i]>v1a[i])
+                                       return 1
+                               else if (length(v1a[i])>length(v2a[i]))
+                                       return 0
+                               else if (v1a[i]>v2a[i])
+                                       return 0
+                       }
+               } else if ((v1a[i]~/[A-Za-z]/)&&(v2a[i]~/[A-Za-z]/)) {
+                       if (v2a[i]>v1a[i])
+                               return 1
+                       else if (v1a[i]>v2a[i])
+                               return 0
+               } else if (ispre(v1a[i]) == 1)
+                       return 1
+               else
+                       return 0
+       }
+       if ((count2==mincount)&&(count!=count2)) {
+               for (i=count2+1; i<=count; i++)
+                       if (ispre(v1a[i]) == 1)
+                               return 1
+               return 0
+       } else if (count!=count2) {
+               for (i=count+1; i<=count2; i++)
+                       if (ispre(v2a[i]) == 1)
+                               return 0
+               return 1
+       }
+       return 0
+}
+
+function get_links(url,        errno,link,oneline,retval,odp,tmpfile) {
+# get all <A HREF=..> tags from specified URL
+       "mktemp /tmp/XXXXXX" | getline tmpfile
+       close("mktemp /tmp/XXXXXX")
+       
+       if (DEBUG) print "Retrieving: " url
+       errno=system("wget -O - \"" url "\" -t 3 -T 300 --passive-ftp > " tmpfile " 2>/dev/null" )
+       
+       if (errno==0) {
+               while (getline oneline < tmpfile)
+                       odp=(odp " " oneline)
+               if ( DEBUG ) print "Odpowiedz: " odp
+       }
+       
+       close(tmpfile)
+       system("rm -f " tmpfile)
+       urldir=url;
+       sub(/[^\/]+$/,"",urldir)
+       if ( errno==0) {
+               while ((tolower(odp) ~ /<frame[ \t]/)||(tolower(odp) ~ /href=/)) {
+                       if (tolower(odp) ~ /<frame[ \t]/) {
+                               match(tolower(odp),/<frame[ \t][^>]*>/)
+                               ramka=substr(odp,RSTART,RLENGTH)
+                               odp=substr(odp,RSTART+RLENGTH)
+                               sub(/[sS][rR][cC]=[ \t]+/,"src=",ramka);
+                               match(tolower(ramka),/src="[^"]+"/)
+                               newurl=substr(ramka,RSTART+5,RLENGTH-6)
+                               if (DEBUG) print "Ramka: " newurl
+                               if (newurl !~ /\//) {
+                                       newurl=(urldir newurl)
+                                       if (DEBUG) print "Ramka->: " newurl
+                               }
+                               retval=(retval " " get_links(newurl))
+                       } else if (tolower(odp) ~ /href=[ \t]*"[^"]+"/) {
+                               sub(/[hH][rR][eE][fF]=[ \t]+/,"href=",odp)
+                               match(tolower(odp),/href="[^"]+"/)
+                               link=substr(odp,RSTART,RLENGTH)
+                               odp=substr(odp,RSTART+RLENGTH)
+                               link=substr(link,7,length(link)-7)
+                               retval=(retval " " link)
+                       } else if (tolower(odp) ~ /href=[ \t]*[^ \t>]+/) {
+                               sub(/[hH][rR][eE][fF]=[ \t]+/,"href=",odp)
+                               match(tolower(odp),/href=[^ \t>]+/)
+                               link=substr(odp,RSTART,RLENGTH)
+                               odp=substr(odp,RSTART+RLENGTH)
+                               link=substr(link,6,length(link)-5)
+                               retval=(retval " " link)
+                       } else {
+                               retval=(retval " INTERNAL_ERROR")
+                               break
+                       }
+               }
+       } else {
+               retval=("WGET ERROR: " errno)
+       }
+       
+       
+       if (DEBUG) print "Zwracane: " retval
+       return retval
+}
+
+function subst_defines(var,defs) {
+# substitute all possible RPM macros
+       while ((var ~ /%{.*}/) || (var ~ /%[A-Za-z0-9_]+/)) {
+               oldvar=var
+               for (j in defs) {
+                       gsub("%{" j "}", defs[j], var)
+                       gsub("%" j , defs[j], var)
+               }
+               if (var==oldvar) {
+                       if ( DEBUG ) for (i in defs) print i " == " defs[i]
+                       return var
+               }
+       }
+       return var
+}
+
+function find_mirror(url) {
+
+       while (succ = (getline line < "mirrors")) {
+           if (succ==-1) { return url }
+               nf=split(line,fields,"|")
+               if (nf>1){
+                       origin=fields[1]
+                       mirror=fields[2]
+                       mname=fields[3]
+                       prefix=substr(url,1,length(origin))
+                       if (prefix==origin){
+                               if ( DEBUG ) print "Mirror znaleziony na " mname
+                               close("mirrors")
+                               return mirror substr(url,length(origin))
+                       }
+               }
+       }
+
+       return url
+}
+
+function process_source(number,lurl,name,version) {
+# fetches file list, and compares version numbers
+       if ( DEBUG ) print "Przetwarzam " lurl
+
+       if ( index(lurl,version)==0 ) {
+               if (DEBUG) print "Nie ma numeru wersji."
+               return 0
+       }
+
+       sub("://",":",lurl)
+       sub("/",":/",lurl)
+       gsub("[^/]*$",":&",lurl)
+       split(lurl,url,":")
+       acc=url[1]
+       host=url[2]
+       dir=url[3]
+       filename=url[4]
+
+       if (index(dir,version)) {
+               dir=substr(dir,1,index(dir,version)-1)
+               sub("[^/]*$","",dir)
+               sub("(\.tar\.(bz|bz2|gz)|zip)$","",filename)
+               if ( DEBUG ) print "Sprawdze katalog: " dir
+               if ( DEBUG ) print "i plik: " filename
+       }
+
+       filenameexp=filename
+       gsub("\+","\\+",filenameexp)
+       sub(version,"[A-Za-z0-9.]+",filenameexp)
+       gsub("\.","\\.",filenameexp)
+       if ( DEBUG ) print "Wzorzec: " filenameexp
+       match(filename,version)
+       prever=substr(filename,1,RSTART-1)
+       postver=substr(filename,RSTART+RLENGTH)
+       if ( DEBUG ) print "Przed numerkiem: " prever
+       if ( DEBUG ) print "i po: " postver
+       newurl=find_mirror(acc "://" host dir)  
+       #print acc "://" host dir
+       #newurl=url[1]"://"url[2]url[3]url[4]
+       #newurl=acc "://" host dir filename
+       if ( DEBUG ) print "Zagl±dam na " newurl 
+       
+       references=0
+       finished=0
+       oldversion=version
+       odp=get_links(newurl)
+       if( odp ~ "ERROR: ") {
+               print name "(" number ") " odp
+       } else {
+               if (DEBUG) print "Sciagnieta strona"
+               c=split(odp,linki)
+               for (nr=1; nr<=c; nr++) {
+                       addr=linki[nr]
+                       if (DEBUG) print "Znaleziony link: " addr
+                       if ((addr ~ filenameexp) && !(addr ~ "[-_.0-9A-Za-z~]" filenameexp)) {
+                               match(addr,filenameexp)
+                               newfilename=substr(addr,RSTART,RLENGTH)
+                               if (DEBUG) print "Hipotetyczny nowy: " newfilename
+                               newfilename=fixedsub(prever,"",newfilename)
+                               newfilename=fixedsub(postver,"",newfilename)
+                               if (DEBUG) print "Wersja: " newfilename
+                               if (newfilename ~ /\.(pkg|bin|binary)$/) continue
+                               if (NUMERIC) {
+                                       if ( compare_ver_dec(version, newfilename)==1 ) {
+                                               if (DEBUG) print "Tak, jest nowa"
+                                               version=newfilename
+                                               finished=1
+                                       }
+                               } else if ( compare_ver(version, newfilename)==1 ) {
+                                       if (DEBUG) print "Tak, jest nowa"
+                                       version=newfilename
+                                       finished=1
+                               }
+                       }
+               }
+               if (finished==0)
+                       print name "(" number ") seems ok: " oldversion
+               else
+                       print name "(" number ") [OLD] " oldversion " [NEW] " version
+       }
+}
+       
+function process_data(name,ver,rel,src) {
+# this function checks if substitutions were valid, and if true:
+# processes each URL and tries to get current file list
+       for (i in src) {
+               if ( src[i] !~ /%{.*}/ && src[i] !~ /%[A-Za-z0-9_]/ )  {
+                       if ( DEBUG ) print "Zrodlo: " src[i]
+                       process_source(i,src[i],name,ver)
+               } else {
+                       print FNAME ":" i ": niemozliwe podstawienie: " src[i]
+               }
+       }
+}
+
+BEGIN {
+       # if U want to use DEBUG, run script with "-v DEBUG=1"
+       # or uncomment the line below
+       # DEBUG = 1
+
+       errno=system("wget --help > /dev/null 2>&1")
+       if (errno) {
+               print "No wget installed!"
+               exit 1
+       }
+       if (ARGC>=3 && ARGV[2]=="-n") {
+               NUMERIC=1
+               for (i=3; i<ARGC; i++) ARGV[i-1]=ARGV[i] 
+               ARGC=ARGC-1
+       }
+}
+
+FNR==1 {
+       if ( ARGIND != 1 ) {
+               process_data(NAME,VER,REL,SRC)
+               NAME="" ; VER="" ; REL=""
+               for (i in DEFS) delete DEFS[i]
+               for (i in SRC) delete SRC[i]
+       }
+       FNAME=FILENAME
+}
+
+/^[Uu][Rr][Ll]:/&&(URL=="") { URL=subst_defines($2,DEFS) ; DEFS["url"]=URL }
+/^[Nn]ame:/&&(NAME=="") { NAME=subst_defines($2,DEFS) ; DEFS["name"]=NAME }
+/^[Vv]ersion:/&&(VER=="") { VER=subst_defines($2,DEFS) ; DEFS["version"]=VER }
+/^[Rr]elease:/&&(REL=="") { REL=subst_defines($2,DEFS) ; DEFS["release"]=REL }
+/^[Ss]ource[0-9]*:/ { if (/(ftp|http):\/\//) SRC[FNR]=subst_defines($2,DEFS) }
+/%define/ { DEFS[$2]=subst_defines($3,DEFS) }
+
+END {
+       process_data(NAME,VER,REL,SRC)
+}
diff --git a/rpm-4.4.2-suggests.patch b/rpm-4.4.2-suggests.patch
deleted file mode 100644 (file)
index dde6e2d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
---- rpm-4.4.2/lib/rpmlib.h.suggests    2007-06-14 16:26:47.000000000 -0400
-+++ rpm-4.4.2/lib/rpmlib.h     2007-06-14 16:28:19.000000000 -0400
-@@ -447,6 +447,16 @@ typedef enum rpmTag_e {
-     RPMTAG_PRIORITY           = 1162, /* i   extension placeholder */
-     RPMTAG_CVSID              = 1163, /* s */
- #define       RPMTAG_SVNID    RPMTAG_CVSID    /* s */
-+    RPMTAG_BLINKPKGID         = 1164, /* s[] */
-+    RPMTAG_BLINKHDRID         = 1165, /* s[] */
-+    RPMTAG_BLINKNEVRA         = 1166, /* s[] */
-+    RPMTAG_FLINKPKGID         = 1167, /* s[] */
-+    RPMTAG_FLINKHDRID         = 1168, /* s[] */
-+    RPMTAG_FLINKNEVRA         = 1169, /* s[] */
-+    RPMTAG_PACKAGEORIGIN      = 1170, /* s */
-+    RPMTAG_TRIGGERPREIN               = 1171, /* internal */
-+    RPMTAG_BUILDSUGGESTS      = 1172, /* internal */
-+    RPMTAG_BUILDENHANCES      = 1173, /* internal */
- /*@-enummemuse@*/
-     RPMTAG_FIRSTFREE_TAG      /*!< internal */
---- rpm-4.4.2/build/parsePreamble.c.suggests   2007-06-14 15:54:21.000000000 -0400
-+++ rpm-4.4.2/build/parsePreamble.c    2007-06-14 16:26:05.000000000 -0400
-@@ -684,6 +684,12 @@ static int handlePreambleTag(Spec spec, 
-       if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
-           return rc;
-       break;
-+    case RPMTAG_BUILDSUGGESTS:
-+    case RPMTAG_BUILDENHANCES:
-+      break;
-+    case RPMTAG_SUGGESTSFLAGS:
-+    case RPMTAG_ENHANCESFLAGS:
-+      break;
-     case RPMTAG_BUILDCONFLICTS:
-     case RPMTAG_CONFLICTFLAGS:
-     case RPMTAG_OBSOLETEFLAGS:
-@@ -783,6 +789,10 @@ static struct PreambleRec_s preambleList
-     {RPMTAG_DISTTAG,          0, 0, 0, "disttag"},
-     {RPMTAG_CVSID,            0, 0, 0, "cvsid"},
-     {RPMTAG_SVNID,            0, 0, 0, "svnid"},
-+    {RPMTAG_SUGGESTSFLAGS,    0, 0, 0, "suggests"},
-+    {RPMTAG_ENHANCESFLAGS,    0, 0, 0, "enhances"},
-+    {RPMTAG_BUILDSUGGESTS,    0, 0, 0, "buildsuggests"},
-+    {RPMTAG_BUILDENHANCES,    0, 0, 0, "buildenhances"},
-     /*@-nullassign@*/ /* LCL: can't add null annotation */
-     {0, 0, 0, 0, 0}
-     /*@=nullassign@*/
diff --git a/rpm-CVE-2006-5466.patch b/rpm-CVE-2006-5466.patch
deleted file mode 100644 (file)
index d543958..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-Index: lib/query.c
-===================================================================
-RCS file: /cvs/devel/rpm/lib/query.c,v
-retrieving revision 2.173.2.15
-retrieving revision 2.173.2.16
-diff -a -u -r2.173.2.15 -r2.173.2.16
---- lib/query.c        8 Oct 2006 21:41:45 -0000       2.173.2.15
-+++ lib/query.c        30 Oct 2006 02:50:53 -0000      2.173.2.16
-@@ -124,6 +124,28 @@
-     return str;
- }
-+/**
-+ */
-+static void flushBuffer(char ** tp, char ** tep, int nonewline)
-+      /*@ modifies *tp, *tep @*/
-+{
-+    char *t, *te;
-+
-+    t = *tp;
-+    te = *tep;
-+    if (te > t) {
-+      if (!nonewline) {
-+          *te++ = '\n';
-+          *te = '\0';
-+      }
-+      rpmMessage(RPMMESS_NORMAL, "%s", t);
-+      te = t;
-+      *t = '\0';
-+    }
-+    *tp = t;
-+    *tep = te;
-+}
-+
- int showQueryPackage(QVA_t qva, rpmts ts, Header h)
- {
-     int scareMem = 0;
-@@ -131,7 +153,6 @@
-     char * t, * te;
-     char * prefix = NULL;
-     int rc = 0;               /* XXX FIXME: need real return code */
--    int nonewline = 0;
-     int i;
-     te = t = xmalloc(BUFSIZ);
-@@ -141,7 +162,6 @@
-     if (qva->qva_queryFormat != NULL) {
-       const char * str = queryHeader(h, qva->qva_queryFormat);
--      nonewline = 1;
-       /*@-branchstate@*/
-       if (str) {
-           size_t tb = (te - t);
-@@ -157,6 +177,7 @@
-           /*@=usereleased@*/
- /*@=boundswrite@*/
-           str = _free(str);
-+          flushBuffer(&t, &te, 1);
-       }
-       /*@=branchstate@*/
-     }
-@@ -312,31 +333,13 @@
-                       _("package has neither file owner or id lists\n"));
-           }
-       }
--/*@-branchstate@*/
--      if (te > t) {
--/*@-boundswrite@*/
--          *te++ = '\n';
--          *te = '\0';
--          rpmMessage(RPMMESS_NORMAL, "%s", t);
--          te = t;
--          *t = '\0';
--/*@=boundswrite@*/
--      }
--/*@=branchstate@*/
-+      flushBuffer(&t, &te, 0);
-     }
-           
-     rc = 0;
- exit:
--    if (te > t) {
--      if (!nonewline) {
--/*@-boundswrite@*/
--          *te++ = '\n';
--          *te = '\0';
--/*@=boundswrite@*/
--      }
--      rpmMessage(RPMMESS_NORMAL, "%s", t);
--    }
-+    flushBuffer(&t, &te, 0);
-     t = _free(t);
-     fi = rpmfiFree(fi);
diff --git a/rpm-as_needed-fix.patch b/rpm-as_needed-fix.patch
deleted file mode 100644 (file)
index 12a01cd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Nur rpm-4.4.2.orig/build/Makefile.am rpm-4.4.2.as_needed-fix/build/Makefile.am
---- rpm-4.4.2.orig/build/Makefile.am   2006-08-04 22:17:16.000000000 +0200
-+++ rpm-4.4.2.as_needed-fix/build/Makefile.am  2006-08-04 22:17:43.000000000 +0200
-@@ -33,6 +33,7 @@
-       $(top_builddir)/lib/librpm.la \
-       $(top_builddir)/rpmdb/librpmdb.la \
-       $(top_builddir)/rpmio/librpmio.la \
-+      @WITH_MAGIC_LIB@ \
-       @WITH_LIBELF_LIB@
- rpmfile.h:
diff --git a/rpm-bug-146549.patch b/rpm-bug-146549.patch
deleted file mode 100644 (file)
index 7461ca1..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146549
-
---- rpm-4.4.2/rpmio/rpmsq.c.deadlock   2005-07-13 12:47:03.000000000 +0200
-+++ rpm-4.4.2/rpmio/rpmsq.c    2005-08-19 14:47:53.000000000 +0200
-@@ -218,7 +218,6 @@
-           sq->id = ME();
-           ret = pthread_mutex_init(&sq->mutex, NULL);
--          ret = pthread_cond_init(&sq->cond, NULL);
-           insque(elem, (prev != NULL ? prev : rpmsqQueue));
-           ret = sigrelse(SIGCHLD);
-       }
-@@ -240,8 +239,11 @@
-       ret = sighold (SIGCHLD);
-       if (ret == 0) {
-           remque(elem);
--          ret = pthread_cond_destroy(&sq->cond);
--          ret = pthread_mutex_destroy(&sq->mutex);
-+         
-+          /* Unlock the mutex and then destroy it */ 
-+          if((ret = pthread_mutex_unlock(&sq->mutex)) == 0)
-+              ret = pthread_mutex_destroy(&sq->mutex);
-+
-           sq->id = NULL;
- /*@-bounds@*/
-           if (sq->pipes[1])   ret = close(sq->pipes[1]);
-@@ -315,11 +317,20 @@
-                    sq != NULL && sq != rpmsqQueue;
-                    sq = sq->q_forw)
-               {
-+                  int ret;
-+
-                   if (sq->child != reaped)
-                       /*@innercontinue@*/ continue;
-                   sq->reaped = reaped;
-                   sq->status = status;
--                  (void) pthread_cond_signal(&sq->cond);
-+
-+                  /* Unlock the mutex.  The waiter will then be able to 
-+                   * aquire the lock.  
-+                   *
-+                   * XXX: jbj, wtd, if this fails? 
-+                   */
-+                  ret = pthread_mutex_unlock(&sq->mutex); 
-+
-                   /*@innerbreak@*/ break;
-               }
-           }
-@@ -391,6 +402,7 @@
- {
-     pid_t pid;
-     int xx;
-+    int nothreads = 0;   /* XXX: Shouldn't this be a global? */
-     if (sq->reaper) {
-       xx = rpmsqInsert(sq, NULL);
-@@ -405,6 +417,24 @@
-     xx = sighold(SIGCHLD);
-+    /* 
-+     * Initialize the cond var mutex.   We have to aquire the lock we 
-+     * use for the condition before we fork.  Otherwise it is possible for
-+     * the child to exit, we get sigchild and the sig handler to send 
-+     * the condition signal before we are waiting on the condition.
-+     */
-+    if (!nothreads) {
-+      if(pthread_mutex_lock(&sq->mutex)) {
-+          /* Yack we did not get the lock, lets just give up */
-+/*@-bounds@*/
-+          xx = close(sq->pipes[0]);
-+          xx = close(sq->pipes[1]);
-+          sq->pipes[0] = sq->pipes[1] = -1;
-+/*@=bounds@*/
-+          goto out;
-+      }
-+    }
-+
-     pid = fork();
-     if (pid < (pid_t) 0) {            /* fork failed.  */
- /*@-bounds@*/
-@@ -462,10 +492,6 @@
-     /* Protect sq->reaped from handler changes. */
-     ret = sighold(SIGCHLD);
--    /* Initialize the cond var mutex. */
--    if (!nothreads)
--      ret = pthread_mutex_lock(&sq->mutex);
--
-     /* Start the child, linux often runs child before parent. */
- /*@-bounds@*/
-     if (sq->pipes[0] >= 0)
-@@ -486,7 +512,13 @@
-           ret = sigpause(SIGCHLD);
-       else {
-           xx = sigrelse(SIGCHLD);
--          ret = pthread_cond_wait(&sq->cond, &sq->mutex);
-+          
-+          /* 
-+           * We start before the fork with this mutex locked;
-+           * The only one that unlocks this the signal handler.
-+           * So if we get the lock the child has been reaped.
-+           */
-+          ret = pthread_mutex_lock(&sq->mutex);
-           xx = sighold(SIGCHLD);
-       }
-     }
-@@ -495,9 +527,6 @@
-     /* Accumulate stopwatch time spent waiting, potential performance gain. */
-     sq->ms_scriptlets += rpmswExit(&sq->op, -1)/1000;
--    /* Tear down cond var mutex, our child has been reaped. */
--    if (!nothreads)
--      xx = pthread_mutex_unlock(&sq->mutex);
-     xx = sigrelse(SIGCHLD);
- #ifdef _RPMSQ_DEBUG
diff --git a/rpm-cleanlibdirs.patch b/rpm-cleanlibdirs.patch
deleted file mode 100644 (file)
index 344dca7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
---- rpm-4.4.2/rpmio/Makefile.am.orig   2005-10-07 13:52:53.000000000 +0200
-+++ rpm-4.4.2/rpmio/Makefile.am        2005-11-08 15:56:58.000000000 +0100
-@@ -26,8 +26,6 @@
- BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs)
--LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
--
- usrlibdir = $(libdir)@MARK64@
- usrlib_LTLIBRARIES = librpmio.la
- librpmio_la_SOURCES = \
---- rpm-4.4.2/rpmdb/Makefile.am.orig   2005-10-07 13:52:53.000000000 +0200
-+++ rpm-4.4.2/rpmdb/Makefile.am        2005-11-08 15:56:49.000000000 +0100
-@@ -37,9 +37,6 @@
- # XXX watchout, ../db3/libdb.la created by this Makefile may surprise
- libdb_la = 
--# XXX grrr, RPM_BUILD_ROOT prevents build pollution if/when -lrpm different
--LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
--
- usrlibdir = $(libdir)@MARK64@
- usrlib_LTLIBRARIES = librpmdb.la
- librpmdb_la_SOURCES = \
---- rpm-4.4.2/lib/Makefile.am.orig     2005-10-07 13:52:53.000000000 +0200
-+++ rpm-4.4.2/lib/Makefile.am  2005-11-08 15:56:22.000000000 +0100
-@@ -29,8 +29,6 @@
- mylibs = librpm.la
- LIBS =
--LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
--
- usrlibdir = $(libdir)@MARK64@
- usrlib_LTLIBRARIES = librpm.la
- librpm_la_SOURCES = \
---- rpm-4.4.2/build/Makefile.am.orig   2005-03-14 11:03:48.000000000 +0100
-+++ rpm-4.4.2/build/Makefile.am        2005-11-08 15:56:12.000000000 +0100
-@@ -22,8 +22,6 @@
- pkginc_HEADERS = rpmbuild.h rpmfc.h rpmfile.h rpmspec.h
- noinst_HEADERS = buildio.h
--LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
--
- usrlibdir = $(libdir)@MARK64@
- usrlib_LTLIBRARIES = librpmbuild.la
- librpmbuild_la_SOURCES = \
---- rpm-4.4.2/configure.ac.orig        2005-10-07 13:52:54.000000000 +0200
-+++ rpm-4.4.2/configure.ac     2005-11-08 15:55:31.000000000 +0100
-@@ -350,9 +350,6 @@
- localdone=
- dirs=$prefix
--if test "$cross_compiling" != "yes"; then
--  dirs="$dirs /usr/local"
--fi
- for dir in $dirs
- do
-       case $dir in
diff --git a/rpm-cpuinfo.patch b/rpm-cpuinfo.patch
deleted file mode 100644 (file)
index 2f675d0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- rpm/lib/depends.c  2007-02-13 20:39:00.386623000 +0100
-+++ rpm/lib/depends.c  2007-02-19 19:48:40.490623000 +0100
-@@ -507,6 +507,10 @@
-       goto unsatisfied;
-     }
-+    /* Ignore cpuinfo() and uname() deps */
-+    if (!strncmp(Name, "cpuinfo(", sizeof("cpuinfo(")-1) || !strncmp(Name, "uname(", sizeof("uname(")-1))
-+          goto exit;
-+
-     /* Search added packages for the dependency. */
-     if (rpmalSatisfiesDepend(ts->addedPackages, dep, NULL) != NULL) {
-       /*
index c6dab82c5b9e71c2cf86595029260cc450fbe337..43d6a8cc68d63ba0b057c120f347c679fbd2392a 100644 (file)
@@ -34,6 +34,27 @@ diff -urN rpm-4.3.org/macros.in rpm-4.3/macros.in
  %{__arch_install_post}\
  %{__os_install_post}\
  %{nil}
+@@ -1250,7 +1250,10 @@
+ unset DISPLAY ||:\
+ %{nil}
+-%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
++%install \
++%if 0%{?_enable_debug_packages}\
++%{?buildsubdir:%{debug_package}}\
++%endif\
+ %%install\
+ LANG=C\
+ export LANG\
+@@ -1407,7 +1410,7 @@
+     %{?verbose:set -x;} \
+     if [ -d "$RPM_BUILD_ROOT" ]; then \
+       echo "Strip executable binaries, archives and shared object files."; \
+-      filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
++      filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
+       elfexelist=`echo $filelist | xargs -r file | \
+               awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
+       elfsharedlist=`echo $filelist | xargs -r file | \
 --- rpm-4.4.2/scripts/find-debuginfo.sh.orig   2005-07-14 17:52:31.000000000 +0200
 +++ rpm-4.4.2/scripts/find-debuginfo.sh        2005-07-23 13:57:04.542906944 +0200
 @@ -25,7 +25,7 @@
diff --git a/rpm-dep_whiteout.patch b/rpm-dep_whiteout.patch
deleted file mode 100644 (file)
index 0f477d0..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
---- rpm-4.4.2/macros.in~       2005-12-25 03:50:21.000000000 +0200
-+++ rpm-4.4.2/macros.in        2006-01-08 17:17:24.000000000 +0200
-@@ -776,78 +776,7 @@
- # XXX Note: that there cannot be any whitespace within the string "p>q",
- #     and that both p and q are package names (i.e. no version/release).
- #
--#%_dependency_whiteout_5_2            \
--#     pam>pamconfig
--#%_dependency_whiteout_6_1            \
--#     pilot-link-devel>pilot-link
--#%_dependency_whiteout_6_2            \
--#     egcs-c++>libstdc++
--%_dependency_whiteout_7_0             \
--      pango-gtkbeta-devel>pango-gtkbeta\
--      XFree86>Mesa                    \
--      compat-glibc>db2                \
--      compat-glibc>db1                \
--      pam>initscripts                 \
--      initscripts>sysklogd
--%_dependency_whiteout_7_1             \
--      arts>kdelibs-sound
--%_dependency_whiteout_7_2             \
--      libgnomeprint15>gnome-print     \
--      nautilus>nautilus-mozilla       \
--      tcl>postgresql-tcl
--#%_dependency_whiteout_8_0            \
--#     perl>perl-Parse-RecDescent      \
--#     XFree86-libs>XFree86-Mesa-libGL \
--#     perl>perl-Filter                \
--#     perl>mrtg                       \
--#     perl>mod_perl                   \
--#     mysql>perl-DBD-MySQL            \
--#     ghostscript>gimp-print          \
--#     arts>kde2-compat                \
--#     perl-Date-Calc>perl-Bit-Vector  \
--#     glibc-debug>glibc-devel
--
--%_dependency_whiteout_8_0             \
--      mysql>perl-DBD-MySQL            \
--      perl>perl-Filter                \
--      perl>mrtg                       \
--      perl>mod_perl                   \
--      perl-Date-Calc>perl-Bit-Vector  \
--
--%_dependency_whiteout_fc3             \
--      coreutils>pam                   \
--      nautilus>nautilus-cd-burner     \
--      aspell>aspell-en                \
--      kernel>initscripts              \
--      kernel-smp>initscripts          \
--      xorg-x11-libs>xorg-x11-Mesa-libGL \
--      openldap>cyrus-sasl-md5         \
--      openldap>cyrus-sasl             \
--      openjade>docbook-dtds           \
--      gtk+>gdk-pixbuf                 \
--      xorg-x11>xinitrc                \
--      gnome-python2>gnome-python2-bonobo \
--      httpd-suexec>httpd              \
--      xemacs-sumo>apel-xemacs         \
--      php>php-pear                    \
--      openoffice.org-libs>openoffice.org
--
- %_dependency_whiteout                 \
--      libtermcap>bash                 \
--      modutils>vixie-cron             \
--      ypbind>yp-tools                 \
--      ghostscript-fonts>ghostscript   \
--      %{?_dependency_whiteout_fc3}    \
--      %{?_dependency_whiteout_fc2}    \
--      %{?_dependency_whiteout_fc1}    \
--      %{?_dependency_whiteout_9}      \
--      %{?_dependency_whiteout_8_0}    \
--      %{?_dependency_whiteout_7_2}    \
--      %{?_dependency_whiteout_7_1}    \
--      %{?_dependency_whiteout_7_0}    \
--      %{?_dependency_whiteout_6_2}    \
--      %{?_dependency_whiteout_6_1}    \
--      %{?_dependency_whiteout_5_2}    \
-       %{nil}
- #
diff --git a/rpm-doxygen_no_file.patch b/rpm-doxygen_no_file.patch
deleted file mode 100644 (file)
index 50979a8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- rpm-4.4.2/Doxyfile.in~     2006-03-07 01:59:42.000000000 +0100
-+++ rpm-4.4.2/Doxyfile.in      2006-03-07 02:00:00.000000000 +0100
-@@ -398,7 +398,6 @@
-                          @top_srcdir@/doc/manual/spec \
-                          @top_srcdir@/doc/manual/triggers \
-                          @top_srcdir@/doc/manual/tsort \
--                         @top_srcdir@/file/src/ \
-                          @top_srcdir@/lib/ \
-                        @top_srcdir@/lua/ \
-                          @top_srcdir@/rpmdb/ \
diff --git a/rpm-error-fatal.patch b/rpm-error-fatal.patch
deleted file mode 100644 (file)
index ec0792f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-+---------------------------------------------------------------------------
-| Make sure that an %{error:<msg>} macro really stops further
-| processing. Else it would be nothing more than a %{warn:<msg>}.
-+---------------------------------------------------------------------------
---- rpm-4.4.2/rpmio/macro.c~   2007-03-07 18:50:42.754005171 +0200
-+++ rpm-4.4.2/rpmio/macro.c    2007-03-07 18:55:51.040958707 +0200
-@@ -1380,7 +1380,7 @@
-           STREQ("error", f, fn)) {
-               int waserror = 0;
-               if (STREQ("error", f, fn))
--                      waserror = 1;
-+                      waserror = 1, rc = 1;
-               if (g != NULL && g < ge)
-                       doOutput(mb, waserror, g, gn);
-               else
index 9c586ed58d9073ada3de4d432fa46b647a5d4072..e1293fbadd5194796794c9003a1c83f27b76d9ad 100644 (file)
 
 #changes:
 # $Id$
-# 2006-08-28 Elan Ruusamäe <glen@pld-linux.org>
-#   * fixed --all-name which got broken with last change.
-# 2006-08-09 Elan Ruusamäe <glen@pld-linux.org>
-#   * huge performance boost for packages calling %find_lang multiple times (kde*i18n)
 # 2001-01-08 Micha³ Kochanowicz <mkochano@pld.org.pl>
 #   * --all-name support for KDE.
 # 2000-11-28 Rafa³ Cygnarowski <pascalek@pld.org.pl>
 #   * added support for GNOME help files
 #   * start support for KDE help files
 
-PROG=${0##*/}
-
 usage () {
 cat <<EOF
 
-Usage: $PROG TOP_DIR PACKAGE_NAME [prefix]
+Usage: $0 TOP_DIR PACKAGE_NAME [prefix]
 
 where TOP_DIR is
 the top of the tree containing the files to be processed--should be
@@ -49,70 +43,53 @@ to \$3.
 Additional options:
   --with-gnome         find GNOME help files
   --with-kde           find KDE help files
-  --with-omf           find OMF files
   --all-name           match all package/domain names
   --without-mo         skip *.mo locale files
 EOF
 exit 1
 }
 
-if [ -z "$1" ]; then
-       usage
-elif [ $1 = / ]; then
-       echo >&2 "$PROG: expects non-/ argument for '$1'"
-       exit 1
-elif [ ! -d $1 ]; then
-       echo >&2 "$PROG: $1: No such directory"
-       exit 1
-else
-       TOP_DIR="${1%/}"
+if [ -z "$1" ] ; then usage
+elif [ $1 = / ] ; then echo $0: expects non-/ argument for '$1' 1>&2
+elif [ ! -d $1 ] ; then
+ echo $0: $1: no such directory
+ exit 1
+else TOP_DIR="`echo $1|sed -e 's:/$::'`"
 fi
 shift
 
-if [ -z "$1" ]; then
-       usage
-else
-       NAME=$1
+if [ -z "$1" ] ; then usage
+else NAME=$1
 fi
 shift
 
-GNOME='#'
-KDE='#'
-OMF='#'
-MO=''
+GNOME=#
+KDE=#
+MO=
 MO_NAME=$NAME.lang
-ALL_NAME='#'
-NO_ALL_NAME=''
+ALL_NAME=#
+NO_ALL_NAME=
 while test $# -gt 0 ; do
-    case "$1" in
-       --with-gnome)
-               GNOME=''
-               echo "$PROG: Enabling with GNOME"
-               shift
-               ;;
-       --with-kde)
-               echo "$PROG: Enabling with KDE"
-               KDE=''
+    case "${1}" in
+       --with-gnome )
+               GNOME=
                shift
                ;;
-       --with-omf)
-               echo "$PROG: Enabling with OMF"
-               OMF=''
+       --with-kde )
+               KDE=
                shift
                ;;
-       --without-mo)
-               echo "$PROG: Disabling .mo files"
-               MO='#'
+       --without-mo )
+               MO=#
                shift
                ;;
-       --all-name)
-               echo "$PROG: Enabling with all names"
-               ALL_NAME=''
-               NO_ALL_NAME='#'
+       --all-name )
+               ALL_NAME=
+               NO_ALL_NAME=#
                shift
                ;;
        * )
-               MO_NAME=$1
+               MO_NAME=${1}
                shift
                ;;
     esac
@@ -120,62 +97,18 @@ done
 
 echo '%defattr(644,root,root,755)' > $MO_NAME
 
-if [ ! -f __find.files ] || [ "$TOP_DIR" -nt __find.files ]; then
-       find $TOP_DIR -type f -name '*.mo' | xargs -r file | egrep -v ', 1 messages$' | \
-       sed -e '
-               s/:.*//
-               s:'"$TOP_DIR"'::' > __find.files
-else
-       echo "$PROG: Using cached __find.files"
-fi
-
-if [ ! -f __omf.files ] || [ "$TOP_DIR" -nt __omf.files ]; then
-       find $TOP_DIR -type f -name '*.omf' | \
-       sed -e '
-               s:'"$TOP_DIR"'::' > __omf.files
-else
-       echo "$PROG: Using cached __omf.files"
-fi
-
-(
-       if [ "$ALL_NAME" ]; then
-               fgrep $NAME __find.files
-       else
-               cat __find.files
-       fi
-) | sed '
+find $TOP_DIR -type f -name \*.mo | xargs -r file | egrep -v ', 1 messages$' |\
+sed '
+s/:.*//
+s:'"$TOP_DIR"'::
 '"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
 '"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
 s:^\([^%].*\)::
 s:%lang(C) ::
 s:^\$::' | egrep -v '^$' >> $MO_NAME
 
-(
-       if [ "$ALL_NAME" ]; then
-               fgrep $NAME __omf.files
-       else
-               cat __omf.files
-       fi
-) | sed '
-'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
-'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
-s:^\([^%].*\)::
-s:%lang(C) ::
-s:^\$::' | egrep -v '^$' >> $MO_NAME
-
-if [ ! -f __find.dirs ] || [ "$TOP_DIR" -nt __find.dirs ]; then
-       find $TOP_DIR -type d | sed 's:'"$TOP_DIR"'::' > __find.dirs
-else
-       echo "$PROG: Using cached __find.dirs"
-fi
-
-(
-       if [ "$ALL_NAME" ]; then
-               fgrep $NAME __find.dirs
-       else
-               cat __find.dirs
-       fi
-) | sed '
+find $TOP_DIR -type d|sed '
+s:'"$TOP_DIR"'::
 '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
 '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
 '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/]\+\):%lang(\2) \1\2:
@@ -186,13 +119,8 @@ s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
 s:^\([^%].*\)::
 s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
 
-(
-       if [ "$ALL_NAME" ]; then
-               fgrep $NAME __find.dirs
-       else
-               cat __find.dirs
-       fi
-) | sed '
+find $TOP_DIR -type d|sed '
+s:'"$TOP_DIR"'::
 '"$NO_ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
 '"$NO_ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:
 '"$ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
@@ -200,19 +128,8 @@ s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
 s:^\([^%].*\)::
 s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
 
-(
-       if [ "$ALL_NAME" ]; then
-               fgrep $NAME __find.dirs
-       else
-               cat __find.dirs
-       fi
-) | sed '
-'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
-'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
-s:^\([^%].*\)::
-s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
-
-if [ "$(egrep -v '(^%defattr|^$)' $MO_NAME | wc -l)" -le 0 ]; then
-       echo >&2 "Error: international files not found for $NAME!"
-       exit 1
+if [ "$(cat $MO_NAME | egrep -v '(^%defattr|^$)' | wc -l)" -le 0  ]; then
+        echo 'Error: international files not found !'
+        exit 1
 fi
+
diff --git a/rpm-javadeps.patch b/rpm-javadeps.patch
deleted file mode 100644 (file)
index f84fd99..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
---- rpm-4.4.2/build/rpmfc.c    2007-04-10 23:47:48.198925787 +0300
-+++ rpm-4.4.2/build/rpmfc.c    2007-04-10 23:51:46.054233914 +0300
-@@ -534,6 +534,8 @@
-   /* XXX "python 2.3 byte-compiled" */
-   { "python ",                        RPMFC_PYTHON|RPMFC_INCLUDE },
-+  { "Java ",                  RPMFC_JAVA|RPMFC_INCLUDE },
-+
-   /* .NET executables and libraries. file(1) cannot differ it from native win32 executables unfortunatelly */
-   { "PE executable",          RPMFC_MONO|RPMFC_INCLUDE },
-   { "executable PE",          RPMFC_MONO|RPMFC_INCLUDE },
-@@ -825,7 +827,13 @@
-               xx = rpmfcHelper(fc, 'P', "php", noautoprov, noautoprov_c);
-             if (findreq)
-                 xx = rpmfcHelper(fc, 'R', "php", noautoreq, noautoreq_c);
--      }
-+    }
-+    if (fc->fcolor->vals[fc->ix] & RPMFC_JAVA) {
-+            if (findprov)
-+                xx = rpmfcHelper(fc, 'P', "java", noautoprov, noautoprov_c);
-+            if (findreq)
-+                xx = rpmfcHelper(fc, 'R', "java", noautoreq, noautoreq_c);
-+    }
-     return 0;
- }
-@@ -1219,6 +1227,7 @@
-     { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PERL) },
-     { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PYTHON) },
-     { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PHP) },
-+    { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_JAVA) },
-     { rpmfcMONO,      RPMFC_MONO },
-     { NULL, 0 }
- };
-@@ -1552,6 +1561,15 @@
-           /* XXX all files with extension ".php" are PHP modules for now. */
-           else if (slen >= sizeof(".php") && !strcmp(s+slen-(sizeof(".php")-1), ".php"))
-               ftype = "PHP script text";
-+
-+          /* XXX all files with extension ".jar" are java archives for now. */
-+          else if (slen >= sizeof(".jar") && !strcmp(s+slen-(sizeof(".jar")-1), ".jar"))
-+              ftype = "Java archive file";
-+
-+          /* XXX all files with extension ".class" are java class files for now. */
-+          else if (slen >= sizeof(".class") && !strcmp(s+slen-(sizeof(".class")-1), ".class"))
-+              ftype = "Java class file";
-+
-           /* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
-           else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
-               ftype = "";
---- rpm-4.4.2/macros.in~       2007-04-10 23:56:47.370958264 +0300
-+++ rpm-4.4.2/macros.in        2007-04-11 01:07:01.215359339 +0300
-@@ -446,6 +446,9 @@
- %__mono_provides      @RPMCONFIGDIR@/monodeps.sh --provides
- %__mono_requires      @RPMCONFIGDIR@/monodeps.sh --requires
-+%__java_provides      %{nil}
-+%__java_requires      %{nil}
-+
- #
- # fixowner, fixgroup, and fixperms are run at the end of hardcoded setup
- # These macros are necessary only for legacy compatibility, and have moved
diff --git a/rpm-kill-prereq.patch b/rpm-kill-prereq.patch
deleted file mode 100644 (file)
index b23b80b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
---- rpm-4.4.2/lib/depends.c.orig       2005-10-07 13:39:39.000000000 +0200
-+++ rpm-4.4.2/lib/depends.c    2005-10-07 13:45:07.000000000 +0200
-@@ -966,8 +966,6 @@
- static inline /*@observer@*/ const char * const identifyDepend(int_32 f)
-       /*@*/
- {
--    if (isLegacyPreReq(f))
--      return "PreReq:";
-     f = _notpre(f);
-     if (f & RPMSENSE_SCRIPT_PRE)
-       return "Requires(pre):";
-@@ -1035,7 +1033,7 @@
-        * Attempt to unravel a dependency loop by eliminating Requires's.
-        */
-       /*@-branchstate@*/
--      if (zap && !(Flags & RPMSENSE_PREREQ)) {
-+      if (zap) {
-           rpmMessage(msglvl,
-                       _("removing %s \"%s\" from tsort relations.\n"),
-                       (rpmteNEVRA(p) ?  rpmteNEVRA(p) : "???"), dp);
-@@ -1297,15 +1295,15 @@
-           switch (rpmteType(p)) {
-           case TR_REMOVED:
--              /* Skip if not %preun/%postun requires or legacy prereq. */
-+              /* Skip if not %preun/%postun requires */
-               if (isInstallPreReq(Flags)
--               || !( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
-+               || !( isErasePreReq(Flags) ) )
-                   /*@innercontinue@*/ continue;
-               /*@switchbreak@*/ break;
-           case TR_ADDED:
--              /* Skip if not %pre/%post requires or legacy prereq. */
-+              /* Skip if not %pre/%post requires */
-               if (isErasePreReq(Flags)
--               || !( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
-+               || !( isInstallPreReq(Flags) ) )
-                   /*@innercontinue@*/ continue;
-               /*@switchbreak@*/ break;
-           }
-@@ -1324,15 +1322,15 @@
-           switch (rpmteType(p)) {
-           case TR_REMOVED:
--              /* Skip if %preun/%postun requires or legacy prereq. */
-+              /* Skip if %preun/%postun requires */
-               if (isInstallPreReq(Flags)
--               ||  ( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
-+               ||  ( isErasePreReq(Flags) ) )
-                   /*@innercontinue@*/ continue;
-               /*@switchbreak@*/ break;
-           case TR_ADDED:
--              /* Skip if %pre/%post requires or legacy prereq. */
-+              /* Skip if %pre/%post requires */
-               if (isErasePreReq(Flags)
--               ||  ( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
-+               ||  ( isInstallPreReq(Flags) ) )
-                   /*@innercontinue@*/ continue;
-               /*@switchbreak@*/ break;
-           }
---- rpm-4.4.2/lib/rpmlib.h.orig        2005-07-12 12:38:54.000000000 +0200
-+++ rpm-4.4.2/lib/rpmlib.h     2005-10-07 13:47:23.000000000 +0200
-@@ -505,13 +505,13 @@
-     RPMSENSE_PROVIDES = (1 << 4), /* only used internally by builds */
-     RPMSENSE_CONFLICTS        = (1 << 5), /* only used internally by builds */
-       /* bit 6 used to be RPMSENSE_PREREQ */
--#define       RPMSENSE_PREREQ RPMSENSE_ANY
-+    RPMSENSE_PREREQ   = (1 << 6), /* phased out. */
-     RPMSENSE_OBSOLETES        = (1 << 7), /* only used internally by builds */
-     RPMSENSE_INTERP   = (1 << 8),     /*!< Interpreter used by scriptlet. */
--    RPMSENSE_SCRIPT_PRE       = ((1 << 9)|RPMSENSE_PREREQ), /*!< %pre dependency. */
--    RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ), /*!< %post dependency. */
--    RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ), /*!< %preun dependency. */
--    RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ), /*!< %postun dependency. */
-+    RPMSENSE_SCRIPT_PRE       = (1 << 9), /*!< %pre dependency. */
-+    RPMSENSE_SCRIPT_POST = (1 << 10), /*!< %post dependency. */
-+    RPMSENSE_SCRIPT_PREUN = (1 << 11), /*!< %preun dependency. */
-+    RPMSENSE_SCRIPT_POSTUN = (1 << 12), /*!< %postun dependency. */
-     RPMSENSE_SCRIPT_VERIFY = (1 << 13),       /*!< %verify dependency. */
-     RPMSENSE_FIND_REQUIRES = (1 << 14), /*!< find-requires generated dependency. */
-     RPMSENSE_FIND_PROVIDES = (1 << 15), /*!< find-provides generated dependency. */
-@@ -524,7 +524,7 @@
-     RPMSENSE_SCRIPT_BUILD = (1 << 21),        /*!< %build build dependency. */
-     RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */
-     RPMSENSE_SCRIPT_CLEAN = (1 << 23),        /*!< %clean build dependency. */
--    RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ), /*!< rpmlib(feature) dependency. */
-+    RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
- /*@-enummemuse@*/
-     RPMSENSE_TRIGGERPREIN = (1 << 25),        /*!< @todo Implement %triggerprein. */
- /*@=enummemuse@*/
-@@ -560,7 +560,7 @@
- #define       _ERASE_ONLY_MASK  \
-     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
--#define       isLegacyPreReq(_x)  (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
-+#define       isLegacyPreReq(_x)  (0)
- #define       isInstallPreReq(_x)     ((_x) & _INSTALL_ONLY_MASK)
- #define       isErasePreReq(_x)       ((_x) & _ERASE_ONLY_MASK)
---- rpm-4.4.2/build/parseReqs.c.orig   2004-10-17 20:44:15.000000000 +0200
-+++ rpm-4.4.2/build/parseReqs.c        2005-10-07 13:40:50.000000000 +0200
-@@ -58,11 +58,11 @@
-       h = spec->buildRestrictions;
-       break;
-     case RPMTAG_PREREQ:
--      tagflags |= RPMSENSE_PREREQ;
-+      tagflags |= RPMSENSE_ANY;
-       h = pkg->header;
-       break;
-     case RPMTAG_BUILDPREREQ:
--      tagflags |= RPMSENSE_PREREQ;
-+      tagflags |= RPMSENSE_ANY;
-       h = spec->buildRestrictions;
-       break;
-     case RPMTAG_TRIGGERIN:
---- rpm-4.4.2/build/reqprov.c.orig     2004-10-09 20:23:00.000000000 +0200
-+++ rpm-4.4.2/build/reqprov.c  2005-10-07 13:42:01.000000000 +0200
-@@ -37,11 +37,6 @@
-       nametag = RPMTAG_CONFLICTNAME;
-       versiontag = RPMTAG_CONFLICTVERSION;
-       flagtag = RPMTAG_CONFLICTFLAGS;
--    } else if (Flags & RPMSENSE_PREREQ) {
--      nametag = RPMTAG_REQUIRENAME;
--      versiontag = RPMTAG_REQUIREVERSION;
--      flagtag = RPMTAG_REQUIREFLAGS;
--      extra = Flags & _ALL_REQUIRES_MASK;
-     } else if (Flags & RPMSENSE_TRIGGER) {
-       nametag = RPMTAG_TRIGGERNAME;
-       versiontag = RPMTAG_TRIGGERVERSION;
---- rpm-4.4.2/build/rpmfc.c.orig       2005-10-07 13:39:40.000000000 +0200
-+++ rpm-4.4.2/build/rpmfc.c    2005-10-07 13:42:14.000000000 +0200
-@@ -1634,18 +1634,9 @@
-   { "Provides",               { "%{?__find_provides}", NULL, NULL, NULL },
-       RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PROVIDEFLAGS,
-       0, -1 },
--#ifdef        DYING
--  { "PreReq",         { NULL, NULL, NULL, NULL },
--      RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS,
--      RPMSENSE_PREREQ, 0 },
--  { "Requires(interp)",       { NULL, "interp", NULL, NULL },
--      -1, -1, RPMTAG_REQUIREFLAGS,
--      _notpre(RPMSENSE_INTERP), 0 },
--#else
-   { "Requires(interp)",       { NULL, "interp", NULL, NULL },
-       RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS,
-       _notpre(RPMSENSE_INTERP), 0 },
--#endif
-   { "Requires(rpmlib)",       { NULL, "rpmlib", NULL, NULL },
-       -1, -1, RPMTAG_REQUIREFLAGS,
-       _notpre(RPMSENSE_RPMLIB), 0 },
diff --git a/rpm-locale.patch b/rpm-locale.patch
deleted file mode 100644 (file)
index 9e84259..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-diff -ur -x Makefile -x Makefile.in -x configure -x po rpm-4.4.2.org/rpmio/Makefile.am rpm-4.4.2/rpmio/Makefile.am
---- rpm-4.4.2.org/rpmio/Makefile.am    2007-02-13 20:51:36.290623000 +0100
-+++ rpm-4.4.2/rpmio/Makefile.am        2007-02-13 20:42:52.362623000 +0100
-@@ -31,7 +31,7 @@
- librpmio_la_SOURCES = \
-       LzmaDecode.c argv.c digest.c fts.c macro.c rpmdav.c \
-       rpmhook.c rpmio.c rpmlog.c rpmlua.c rpmmalloc.c \
--      rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c stubs.c url.c ugid.c
-+      rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c strtolocale.c stubs.c url.c ugid.c
- librpmio_la_LDFLAGS = -release 4.4 $(LDFLAGS) \
-       @WITH_BEECRYPT_LIB@ \
-       @WITH_NEON_LIB@ \
-diff -ur -x Makefile -x Makefile.in -x configure -x po rpm-4.4.2.org/rpmio/rpmio.h rpm-4.4.2/rpmio/rpmio.h
---- rpm-4.4.2.org/rpmio/rpmio.h        2007-02-13 20:51:36.290623000 +0100
-+++ rpm-4.4.2/rpmio/rpmio.h    2007-02-13 20:43:52.742623000 +0100
-@@ -709,6 +709,13 @@
-  */
- int xstrncasecmp(const char *s1, const char * s2, size_t n)   /*@*/;
-+/** \ingroup rpmio
-+ * Force encoding of string.
-+ */
-+/*@only@*/ /*@null@*/
-+const char * xstrtolocale(/*@only@*/ const char *str)
-+        /*@modifies *str @*/;
-+
- #ifdef __cplusplus
- }
- #endif
-
---- /dev/null  2007-02-07 08:10:39.238623000 +0100
-+++ rpm-4.4.2/rpmio/strtolocale.c      2007-02-13 20:42:06.650623000 +0100
-@@ -0,0 +1,65 @@
-+/** \ingroup rpmio
-+ * \file rpmio/strtolocale.c
-+ */
-+
-+#include "system.h"
-+#include <langinfo.h>
-+#include <iconv.h>
-+#include "debug.h"
-+
-+static char *locale_encoding = NULL;
-+static int locale_encoding_is_utf8;
-+
-+const char * xstrtolocale(const char *str)
-+{
-+    iconv_t cd;
-+    size_t src_size, dest_size;
-+    char *result, *src, *dest;
-+
-+    if (locale_encoding == NULL) {
-+        const char *encoding = nl_langinfo(CODESET);
-+        locale_encoding = xmalloc(strlen(encoding) + 11);
-+        sprintf(locale_encoding, "%s//TRANSLIT", encoding);
-+        locale_encoding_is_utf8 = strcasecmp(encoding, "UTF-8") == 0;
-+    }
-+
-+    if (!str || !*str || locale_encoding_is_utf8)
-+      return str;
-+
-+    cd = iconv_open(locale_encoding, "UTF-8");
-+    if (cd == (iconv_t)-1)
-+        return str;
-+
-+    src_size = strlen(str);
-+    dest_size = src_size + 1;
-+    result = xmalloc(dest_size);
-+    src = (char *)str;
-+    dest = result;
-+    for(;;) {
-+        size_t status = iconv(cd, &src, &src_size, &dest, &dest_size);
-+        if (status == (size_t)-1) {
-+            size_t dest_offset;
-+            if (errno != E2BIG) {
-+                free(result);
-+                iconv_close(cd);
-+                return str;
-+            }
-+            dest_offset = dest - result;
-+            dest_size += 16;
-+            result = xrealloc(result, dest_offset + dest_size);
-+            dest = result + dest_offset;
-+        } else if (src_size == 0) {
-+            if (src == NULL) break;
-+            src = NULL;
-+        }
-+    }
-+    iconv_close(cd);
-+    free((void *)str);
-+    if (dest_size == 0) {
-+        size_t dest_offset = dest - result;
-+        result = xrealloc(result, dest_offset + 1);
-+        dest = result + dest_offset;
-+    }
-+    *dest = '\0';
-+    return result;
-+}
---- rpm-4.4.2.org/lib/formats.c        2005-01-26 05:46:54.000000000 +0100
-+++ rpm-4.4.2/lib/formats.c    2007-02-13 20:50:01.082623000 +0100
-@@ -301,6 +301,7 @@
-     char * t, * te;
-     unsigned long anint = 0;
-     int xx;
-+    int freeit = 0;
- /*@-branchstate@*/
-     switch (type) {
-@@ -308,6 +309,10 @@
-     case RPM_STRING_TYPE:
-       s = data;
-       xtag = "string";
-+      /* XXX Force utf8 strings. */
-+      s = xstrdup(s);
-+      s = xstrtolocale(s);
-+      freeit = 1;
-       break;
-     case RPM_BIN_TYPE:
-     { int cpl = b64encode_chars_per_line;
-@@ -321,6 +326,7 @@
-       b64encode_chars_per_line = cpl;
- /*@=mods@*/
-       xtag = "base64";
-+      freeit = 1;
-     } break;
-     case RPM_CHAR_TYPE:
-     case RPM_INT8_TYPE:
-@@ -367,7 +373,7 @@
-     /* XXX s was malloc'd */
- /*@-branchstate@*/
--    if (!strcmp(xtag, "base64"))
-+    if (freeit)
-       s = _free(s);
- /*@=branchstate@*/
-@@ -1077,6 +1083,7 @@
-     if (rc && (*data) != NULL) {
-       *data = xstrdup(*data);
-+      *data = xstrtolocale(*data);
-       *freeData = 1;
-       return 0;
-     }
-diff -ur rpm-4.4.2.org/configure.ac rpm-4.4.2/configure.ac
---- rpm-4.4.2.org/configure.ac 2005-03-14 03:58:34.000000000 +0100
-+++ rpm-4.4.2/configure.ac     2007-06-14 23:46:45.004895140 +0200
-@@ -416,6 +416,8 @@
-     AC_CHECK_LIB(socket, socket)
- ])
-+AC_CHECK_HEADERS(locale.h)
-+
- AC_CHECK_HEADERS(error.h)
- AC_CHECK_FUNCS(error)
diff --git a/rpm-lzma.patch b/rpm-lzma.patch
deleted file mode 100644 (file)
index 9e3cf72..0000000
+++ /dev/null
@@ -1,725 +0,0 @@
---- /dev/null  2005-12-16 15:50:59.000000000 +0100
-+++ rpm-4.4.5/rpmio/LzmaDecode.c       2006-04-23 13:07:24.000000000 +0200
-@@ -0,0 +1,588 @@
-+/*
-+  LzmaDecode.c
-+  LZMA Decoder (optimized for Speed version)
-+  
-+  LZMA SDK 4.22 Copyright (c) 1999-2005 Igor Pavlov (2005-06-10)
-+  http://www.7-zip.org/
-+
-+  LZMA SDK is licensed under two licenses:
-+  1) GNU Lesser General Public License (GNU LGPL)
-+  2) Common Public License (CPL)
-+  It means that you can select one of these two licenses and 
-+  follow rules of that license.
-+
-+  SPECIAL EXCEPTION:
-+  Igor Pavlov, as the author of this Code, expressly permits you to 
-+  statically or dynamically link your Code (or bind by name) to the 
-+  interfaces of this file without subjecting your linked Code to the 
-+  terms of the CPL or GNU LGPL. Any modifications or additions 
-+  to this file, however, are subject to the LGPL or CPL terms.
-+*/
-+
-+#include "LzmaDecode.h"
-+
-+#ifndef Byte
-+#define Byte unsigned char
-+#endif
-+
-+#define kNumTopBits 24
-+#define kTopValue ((UInt32)1 << kNumTopBits)
-+
-+#define kNumBitModelTotalBits 11
-+#define kBitModelTotal (1 << kNumBitModelTotalBits)
-+#define kNumMoveBits 5
-+
-+#define RC_READ_BYTE (*Buffer++)
-+
-+#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \
-+  { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
-+
-+#ifdef _LZMA_IN_CB
-+
-+#define RC_TEST { if (Buffer == BufferLim) \
-+  { SizeT size; int result = InCallback->Read(InCallback, &Buffer, &size); if (result != LZMA_RESULT_OK) return result; \
-+  BufferLim = Buffer + size; if (size == 0) return LZMA_RESULT_DATA_ERROR; }}
-+
-+#define RC_INIT Buffer = BufferLim = 0; RC_INIT2
-+
-+#else
-+
-+#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
-+
-+#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
-+ 
-+#endif
-+
-+#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
-+
-+#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound)
-+#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits;
-+#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits;
-+
-+#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
-+  { UpdateBit0(p); mi <<= 1; A0; } else \
-+  { UpdateBit1(p); mi = (mi + mi) + 1; A1; } 
-+  
-+#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)               
-+
-+#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
-+  { int i = numLevels; res = 1; \
-+  do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \
-+  res -= (1 << numLevels); }
-+
-+
-+#define kNumPosBitsMax 4
-+#define kNumPosStatesMax (1 << kNumPosBitsMax)
-+
-+#define kLenNumLowBits 3
-+#define kLenNumLowSymbols (1 << kLenNumLowBits)
-+#define kLenNumMidBits 3
-+#define kLenNumMidSymbols (1 << kLenNumMidBits)
-+#define kLenNumHighBits 8
-+#define kLenNumHighSymbols (1 << kLenNumHighBits)
-+
-+#define LenChoice 0
-+#define LenChoice2 (LenChoice + 1)
-+#define LenLow (LenChoice2 + 1)
-+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
-+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
-+#define kNumLenProbs (LenHigh + kLenNumHighSymbols) 
-+
-+
-+#define kNumStates 12
-+#define kNumLitStates 7
-+
-+#define kStartPosModelIndex 4
-+#define kEndPosModelIndex 14
-+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
-+
-+#define kNumPosSlotBits 6
-+#define kNumLenToPosStates 4
-+
-+#define kNumAlignBits 4
-+#define kAlignTableSize (1 << kNumAlignBits)
-+
-+#define kMatchMinLen 2
-+
-+#define IsMatch 0
-+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
-+#define IsRepG0 (IsRep + kNumStates)
-+#define IsRepG1 (IsRepG0 + kNumStates)
-+#define IsRepG2 (IsRepG1 + kNumStates)
-+#define IsRep0Long (IsRepG2 + kNumStates)
-+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
-+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
-+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
-+#define LenCoder (Align + kAlignTableSize)
-+#define RepLenCoder (LenCoder + kNumLenProbs)
-+#define Literal (RepLenCoder + kNumLenProbs)
-+
-+#if Literal != LZMA_BASE_SIZE
-+StopCompilingDueBUG
-+#endif
-+
-+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
-+{
-+  unsigned char prop0;
-+  if (size < LZMA_PROPERTIES_SIZE)
-+    return LZMA_RESULT_DATA_ERROR;
-+  prop0 = propsData[0];
-+  if (prop0 >= (9 * 5 * 5))
-+    return LZMA_RESULT_DATA_ERROR;
-+  {
-+    for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
-+    for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
-+    propsRes->lc = prop0;
-+    /*
-+    unsigned char remainder = (unsigned char)(prop0 / 9);
-+    propsRes->lc = prop0 % 9;
-+    propsRes->pb = remainder / 5;
-+    propsRes->lp = remainder % 5;
-+    */
-+  }
-+
-+  #ifdef _LZMA_OUT_READ
-+  {
-+    int i;
-+    propsRes->DictionarySize = 0;
-+    for (i = 0; i < 4; i++)
-+      propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
-+    if (propsRes->DictionarySize == 0)
-+      propsRes->DictionarySize = 1;
-+  }
-+  #endif
-+  return LZMA_RESULT_OK;
-+}
-+
-+#define kLzmaStreamWasFinishedId (-1)
-+
-+int LzmaDecode(CLzmaDecoderState *vs,
-+    #ifdef _LZMA_IN_CB
-+    ILzmaInCallback *InCallback,
-+    #else
-+    const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
-+    #endif
-+    unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed)
-+{
-+  CProb *p = vs->Probs;
-+  SizeT nowPos = 0;
-+  Byte previousByte = 0;
-+  UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
-+  UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
-+  int lc = vs->Properties.lc;
-+
-+  #ifdef _LZMA_OUT_READ
-+  
-+  UInt32 Range = vs->Range;
-+  UInt32 Code = vs->Code;
-+  #ifdef _LZMA_IN_CB
-+  const Byte *Buffer = vs->Buffer;
-+  const Byte *BufferLim = vs->BufferLim;
-+  #else
-+  const Byte *Buffer = inStream;
-+  const Byte *BufferLim = inStream + inSize;
-+  #endif
-+  int state = vs->State;
-+  UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
-+  int len = vs->RemainLen;
-+  UInt32 globalPos = vs->GlobalPos;
-+  UInt32 distanceLimit = vs->DistanceLimit;
-+
-+  Byte *dictionary = vs->Dictionary;
-+  UInt32 dictionarySize = vs->Properties.DictionarySize;
-+  UInt32 dictionaryPos = vs->DictionaryPos;
-+
-+  Byte tempDictionary[4];
-+
-+  #ifndef _LZMA_IN_CB
-+  *inSizeProcessed = 0;
-+  #endif
-+  *outSizeProcessed = 0;
-+  if (len == kLzmaStreamWasFinishedId)
-+    return LZMA_RESULT_OK;
-+
-+  if (dictionarySize == 0)
-+  {
-+    dictionary = tempDictionary;
-+    dictionarySize = 1;
-+    tempDictionary[0] = vs->TempDictionary[0];
-+  }
-+
-+  if (len == kLzmaNeedInitId)
-+  {
-+    {
-+      UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
-+      UInt32 i;
-+      for (i = 0; i < numProbs; i++)
-+        p[i] = kBitModelTotal >> 1; 
-+      rep0 = rep1 = rep2 = rep3 = 1;
-+      state = 0;
-+      globalPos = 0;
-+      distanceLimit = 0;
-+      dictionaryPos = 0;
-+      dictionary[dictionarySize - 1] = 0;
-+      #ifdef _LZMA_IN_CB
-+      RC_INIT;
-+      #else
-+      RC_INIT(inStream, inSize);
-+      #endif
-+    }
-+    len = 0;
-+  }
-+  while(len != 0 && nowPos < outSize)
-+  {
-+    UInt32 pos = dictionaryPos - rep0;
-+    if (pos >= dictionarySize)
-+      pos += dictionarySize;
-+    outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
-+    if (++dictionaryPos == dictionarySize)
-+      dictionaryPos = 0;
-+    len--;
-+  }
-+  if (dictionaryPos == 0)
-+    previousByte = dictionary[dictionarySize - 1];
-+  else
-+    previousByte = dictionary[dictionaryPos - 1];
-+
-+  #else /* if !_LZMA_OUT_READ */
-+
-+  int state = 0;
-+  UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
-+  int len = 0;
-+  const Byte *Buffer;
-+  const Byte *BufferLim;
-+  UInt32 Range;
-+  UInt32 Code;
-+
-+  #ifndef _LZMA_IN_CB
-+  *inSizeProcessed = 0;
-+  #endif
-+  *outSizeProcessed = 0;
-+
-+  {
-+    UInt32 i;
-+    UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
-+    for (i = 0; i < numProbs; i++)
-+      p[i] = kBitModelTotal >> 1;
-+  }
-+  
-+  #ifdef _LZMA_IN_CB
-+  RC_INIT;
-+  #else
-+  RC_INIT(inStream, inSize);
-+  #endif
-+
-+  #endif /* _LZMA_OUT_READ */
-+
-+  while(nowPos < outSize)
-+  {
-+    CProb *prob;
-+    UInt32 bound;
-+    int posState = (int)(
-+        (nowPos 
-+        #ifdef _LZMA_OUT_READ
-+        + globalPos
-+        #endif
-+        )
-+        & posStateMask);
-+
-+    prob = p + IsMatch + (state << kNumPosBitsMax) + posState;
-+    IfBit0(prob)
-+    {
-+      int symbol = 1;
-+      UpdateBit0(prob)
-+      prob = p + Literal + (LZMA_LIT_SIZE * 
-+        (((
-+        (nowPos 
-+        #ifdef _LZMA_OUT_READ
-+        + globalPos
-+        #endif
-+        )
-+        & literalPosMask) << lc) + (previousByte >> (8 - lc))));
-+
-+      if (state >= kNumLitStates)
-+      {
-+        int matchByte;
-+        #ifdef _LZMA_OUT_READ
-+        UInt32 pos = dictionaryPos - rep0;
-+        if (pos >= dictionarySize)
-+          pos += dictionarySize;
-+        matchByte = dictionary[pos];
-+        #else
-+        matchByte = outStream[nowPos - rep0];
-+        #endif
-+        do
-+        {
-+          int bit;
-+          CProb *probLit;
-+          matchByte <<= 1;
-+          bit = (matchByte & 0x100);
-+          probLit = prob + 0x100 + bit + symbol;
-+          RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break)
-+        }
-+        while (symbol < 0x100);
-+      }
-+      while (symbol < 0x100)
-+      {
-+        CProb *probLit = prob + symbol;
-+        RC_GET_BIT(probLit, symbol)
-+      }
-+      previousByte = (Byte)symbol;
-+
-+      outStream[nowPos++] = previousByte;
-+      #ifdef _LZMA_OUT_READ
-+      if (distanceLimit < dictionarySize)
-+        distanceLimit++;
-+
-+      dictionary[dictionaryPos] = previousByte;
-+      if (++dictionaryPos == dictionarySize)
-+        dictionaryPos = 0;
-+      #endif
-+      if (state < 4) state = 0;
-+      else if (state < 10) state -= 3;
-+      else state -= 6;
-+    }
-+    else             
-+    {
-+      UpdateBit1(prob);
-+      prob = p + IsRep + state;
-+      IfBit0(prob)
-+      {
-+        UpdateBit0(prob);
-+        rep3 = rep2;
-+        rep2 = rep1;
-+        rep1 = rep0;
-+        state = state < kNumLitStates ? 0 : 3;
-+        prob = p + LenCoder;
-+      }
-+      else
-+      {
-+        UpdateBit1(prob);
-+        prob = p + IsRepG0 + state;
-+        IfBit0(prob)
-+        {
-+          UpdateBit0(prob);
-+          prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState;
-+          IfBit0(prob)
-+          {
-+            #ifdef _LZMA_OUT_READ
-+            UInt32 pos;
-+            #endif
-+            UpdateBit0(prob);
-+            
-+            #ifdef _LZMA_OUT_READ
-+            if (distanceLimit == 0)
-+            #else
-+            if (nowPos == 0)
-+            #endif
-+              return LZMA_RESULT_DATA_ERROR;
-+            
-+            state = state < kNumLitStates ? 9 : 11;
-+            #ifdef _LZMA_OUT_READ
-+            pos = dictionaryPos - rep0;
-+            if (pos >= dictionarySize)
-+              pos += dictionarySize;
-+            previousByte = dictionary[pos];
-+            dictionary[dictionaryPos] = previousByte;
-+            if (++dictionaryPos == dictionarySize)
-+              dictionaryPos = 0;
-+            #else
-+            previousByte = outStream[nowPos - rep0];
-+            #endif
-+            outStream[nowPos++] = previousByte;
-+            #ifdef _LZMA_OUT_READ
-+            if (distanceLimit < dictionarySize)
-+              distanceLimit++;
-+            #endif
-+
-+            continue;
-+          }
-+          else
-+          {
-+            UpdateBit1(prob);
-+          }
-+        }
-+        else
-+        {
-+          UInt32 distance;
-+          UpdateBit1(prob);
-+          prob = p + IsRepG1 + state;
-+          IfBit0(prob)
-+          {
-+            UpdateBit0(prob);
-+            distance = rep1;
-+          }
-+          else 
-+          {
-+            UpdateBit1(prob);
-+            prob = p + IsRepG2 + state;
-+            IfBit0(prob)
-+            {
-+              UpdateBit0(prob);
-+              distance = rep2;
-+            }
-+            else
-+            {
-+              UpdateBit1(prob);
-+              distance = rep3;
-+              rep3 = rep2;
-+            }
-+            rep2 = rep1;
-+          }
-+          rep1 = rep0;
-+          rep0 = distance;
-+        }
-+        state = state < kNumLitStates ? 8 : 11;
-+        prob = p + RepLenCoder;
-+      }
-+      {
-+        int numBits, offset;
-+        CProb *probLen = prob + LenChoice;
-+        IfBit0(probLen)
-+        {
-+          UpdateBit0(probLen);
-+          probLen = prob + LenLow + (posState << kLenNumLowBits);
-+          offset = 0;
-+          numBits = kLenNumLowBits;
-+        }
-+        else
-+        {
-+          UpdateBit1(probLen);
-+          probLen = prob + LenChoice2;
-+          IfBit0(probLen)
-+          {
-+            UpdateBit0(probLen);
-+            probLen = prob + LenMid + (posState << kLenNumMidBits);
-+            offset = kLenNumLowSymbols;
-+            numBits = kLenNumMidBits;
-+          }
-+          else
-+          {
-+            UpdateBit1(probLen);
-+            probLen = prob + LenHigh;
-+            offset = kLenNumLowSymbols + kLenNumMidSymbols;
-+            numBits = kLenNumHighBits;
-+          }
-+        }
-+        RangeDecoderBitTreeDecode(probLen, numBits, len);
-+        len += offset;
-+      }
-+
-+      if (state < 4)
-+      {
-+        int posSlot;
-+        state += kNumLitStates;
-+        prob = p + PosSlot +
-+            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << 
-+            kNumPosSlotBits);
-+        RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
-+        if (posSlot >= kStartPosModelIndex)
-+        {
-+          int numDirectBits = ((posSlot >> 1) - 1);
-+          rep0 = (2 | ((UInt32)posSlot & 1));
-+          if (posSlot < kEndPosModelIndex)
-+          {
-+            rep0 <<= numDirectBits;
-+            prob = p + SpecPos + rep0 - posSlot - 1;
-+          }
-+          else
-+          {
-+            numDirectBits -= kNumAlignBits;
-+            do
-+            {
-+              RC_NORMALIZE
-+              Range >>= 1;
-+              rep0 <<= 1;
-+              if (Code >= Range)
-+              {
-+                Code -= Range;
-+                rep0 |= 1;
-+              }
-+            }
-+            while (--numDirectBits != 0);
-+            prob = p + Align;
-+            rep0 <<= kNumAlignBits;
-+            numDirectBits = kNumAlignBits;
-+          }
-+          {
-+            int i = 1;
-+            int mi = 1;
-+            do
-+            {
-+              CProb *prob3 = prob + mi;
-+              RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
-+              i <<= 1;
-+            }
-+            while(--numDirectBits != 0);
-+          }
-+        }
-+        else
-+          rep0 = posSlot;
-+        if (++rep0 == (UInt32)(0))
-+        {
-+          /* it's for stream version */
-+          len = kLzmaStreamWasFinishedId;
-+          break;
-+        }
-+      }
-+
-+      len += kMatchMinLen;
-+      #ifdef _LZMA_OUT_READ
-+      if (rep0 > distanceLimit) 
-+      #else
-+      if (rep0 > nowPos)
-+      #endif
-+        return LZMA_RESULT_DATA_ERROR;
-+
-+      #ifdef _LZMA_OUT_READ
-+      if (dictionarySize - distanceLimit > (UInt32)len)
-+        distanceLimit += len;
-+      else
-+        distanceLimit = dictionarySize;
-+      #endif
-+
-+      do
-+      {
-+        #ifdef _LZMA_OUT_READ
-+        UInt32 pos = dictionaryPos - rep0;
-+        if (pos >= dictionarySize)
-+          pos += dictionarySize;
-+        previousByte = dictionary[pos];
-+        dictionary[dictionaryPos] = previousByte;
-+        if (++dictionaryPos == dictionarySize)
-+          dictionaryPos = 0;
-+        #else
-+        previousByte = outStream[nowPos - rep0];
-+        #endif
-+        len--;
-+        outStream[nowPos++] = previousByte;
-+      }
-+      while(len != 0 && nowPos < outSize);
-+    }
-+  }
-+  RC_NORMALIZE;
-+
-+  #ifdef _LZMA_OUT_READ
-+  vs->Range = Range;
-+  vs->Code = Code;
-+  vs->DictionaryPos = dictionaryPos;
-+  vs->GlobalPos = globalPos + (UInt32)nowPos;
-+  vs->DistanceLimit = distanceLimit;
-+  vs->Reps[0] = rep0;
-+  vs->Reps[1] = rep1;
-+  vs->Reps[2] = rep2;
-+  vs->Reps[3] = rep3;
-+  vs->State = state;
-+  vs->RemainLen = len;
-+  vs->TempDictionary[0] = tempDictionary[0];
-+  #endif
-+
-+  #ifdef _LZMA_IN_CB
-+  vs->Buffer = Buffer;
-+  vs->BufferLim = BufferLim;
-+  #else
-+  *inSizeProcessed = (SizeT)(Buffer - inStream);
-+  #endif
-+  *outSizeProcessed = nowPos;
-+  return LZMA_RESULT_OK;
-+}
---- /dev/null  2005-12-16 15:50:59.000000000 +0100
-+++ rpm-4.4.5/rpmio/LzmaDecode.h       2006-04-23 13:25:41.000000000 +0200
-@@ -0,0 +1,131 @@
-+/* 
-+  LzmaDecode.h
-+  LZMA Decoder interface
-+
-+  LZMA SDK 4.21 Copyright (c) 1999-2005 Igor Pavlov (2005-06-08)
-+  http://www.7-zip.org/
-+
-+  LZMA SDK is licensed under two licenses:
-+  1) GNU Lesser General Public License (GNU LGPL)
-+  2) Common Public License (CPL)
-+  It means that you can select one of these two licenses and 
-+  follow rules of that license.
-+
-+  SPECIAL EXCEPTION:
-+  Igor Pavlov, as the author of this code, expressly permits you to 
-+  statically or dynamically link your code (or bind by name) to the 
-+  interfaces of this file without subjecting your linked code to the 
-+  terms of the CPL or GNU LGPL. Any modifications or additions 
-+  to this file, however, are subject to the LGPL or CPL terms.
-+*/
-+
-+#ifndef __LZMADECODE_H
-+#define __LZMADECODE_H
-+
-+#define _LZMA_IN_CB
-+/* Use callback for input data */
-+
-+#define _LZMA_OUT_READ
-+/* Use read function for output data */
-+
-+/* #define _LZMA_PROB32 */
-+/* It can increase speed on some 32-bit CPUs, 
-+   but memory usage will be doubled in that case */
-+
-+/* #define _LZMA_LOC_OPT */
-+/* Enable local speed optimizations inside code */
-+
-+/* #define _LZMA_SYSTEM_SIZE_T */
-+/* Use system's size_t. You can use it to enable 64-bit sizes supporting*/
-+
-+#ifndef UInt32
-+#ifdef _LZMA_UINT32_IS_ULONG
-+#define UInt32 unsigned long
-+#else
-+#define UInt32 unsigned int
-+#endif
-+#endif
-+
-+#ifndef SizeT
-+#ifdef _LZMA_SYSTEM_SIZE_T
-+#include <stddef.h>
-+#define SizeT size_t
-+#else
-+#define SizeT UInt32
-+#endif
-+#endif
-+
-+#ifdef _LZMA_PROB32
-+#define CProb UInt32
-+#else
-+#define CProb unsigned short
-+#endif
-+
-+#define LZMA_RESULT_OK 0
-+#define LZMA_RESULT_DATA_ERROR 1
-+
-+#ifdef _LZMA_IN_CB
-+typedef struct _ILzmaInCallback
-+{
-+  int (*Read)(void *object, const unsigned char **buffer, SizeT *bufferSize);
-+} ILzmaInCallback;
-+#endif
-+
-+#define LZMA_BASE_SIZE 1846
-+#define LZMA_LIT_SIZE 768
-+
-+#define LZMA_PROPERTIES_SIZE 5
-+
-+typedef struct _CLzmaProperties
-+{
-+  int lc;
-+  int lp;
-+  int pb;
-+  #ifdef _LZMA_OUT_READ
-+  UInt32 DictionarySize;
-+  #endif
-+}CLzmaProperties;
-+
-+int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
-+
-+#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp)))
-+
-+#define kLzmaNeedInitId (-2)
-+
-+typedef struct _CLzmaDecoderState
-+{
-+  CLzmaProperties Properties;
-+  CProb *Probs;
-+
-+  #ifdef _LZMA_IN_CB
-+  const unsigned char *Buffer;
-+  const unsigned char *BufferLim;
-+  #endif
-+
-+  #ifdef _LZMA_OUT_READ
-+  unsigned char *Dictionary;
-+  UInt32 Range;
-+  UInt32 Code;
-+  UInt32 DictionaryPos;
-+  UInt32 GlobalPos;
-+  UInt32 DistanceLimit;
-+  UInt32 Reps[4];
-+  int State;
-+  int RemainLen;
-+  unsigned char TempDictionary[4];
-+  #endif
-+} CLzmaDecoderState;
-+
-+#ifdef _LZMA_OUT_READ
-+#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; }
-+#endif
-+
-+int LzmaDecode(CLzmaDecoderState *vs,
-+    #ifdef _LZMA_IN_CB
-+    ILzmaInCallback *inCallback,
-+    #else
-+    const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
-+    #endif
-+    unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
-+
-+#endif
diff --git a/rpm-lzma2.patch b/rpm-lzma2.patch
deleted file mode 100644 (file)
index 7803bbd..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-diff -ruN rpm-4.4.2./build/pack.c rpm-4.4.2/build/pack.c
---- rpm-4.4.2./build/pack.c    2005-07-15 17:06:57.000000000 +0200
-+++ rpm-4.4.2/build/pack.c     2006-05-23 18:15:38.359083760 +0200
-@@ -479,6 +479,12 @@
-           /* Add prereq on rpm version that understands bzip2 payloads */
-           (void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1");
-       }
-+      if (s[1] == 'l' && s[2] == 'z') {
-+          (void) headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE,
-+              "lzma", 1);
-+        (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.6-1");
-+    }
-+      
-       strcpy(buf, rpmio_flags);
-       buf[s - rpmio_flags] = '\0';
-       (void) headerAddEntry(h, RPMTAG_PAYLOADFLAGS, RPM_STRING_TYPE, buf+1, 1);
-diff -ruN rpm-4.4.2./lib/psm.c rpm-4.4.2/lib/psm.c
---- rpm-4.4.2./lib/psm.c       2006-05-23 16:58:47.000000000 +0200
-+++ rpm-4.4.2/lib/psm.c        2006-05-23 18:16:44.419041120 +0200
-@@ -2059,6 +2059,9 @@
-           t = stpcpy(t, ".gzdio");
-       if (!strcmp(payload_compressor, "bzip2"))
-           t = stpcpy(t, ".bzdio");
-+      if (!strcmp(payload_compressor, "lzma"))
-+          t = strcpy(t, ".lzdio");
-+
-       rc = RPMRC_OK;
-     } break;
-diff -ruN rpm-4.4.2./lib/rpmlibprov.c rpm-4.4.2/lib/rpmlibprov.c
---- rpm-4.4.2./lib/rpmlibprov.c        2004-03-16 22:58:29.000000000 +0100
-+++ rpm-4.4.2/lib/rpmlibprov.c 2006-05-23 18:21:13.235174856 +0200
-@@ -54,6 +54,9 @@
-     { "rpmlib(BuiltinLuaScripts)",    "4.2.2-1",
-       (                RPMSENSE_EQUAL),
-     N_("internal support for lua scripts.") },
-+    { "rpmlib(PayloadIsLzma)",                "4.4.6-1",
-+      (                RPMSENSE_EQUAL),
-+    N_("package payload can be compressed using lzma.") },
-     { NULL,                           NULL, 0,        NULL }
- };
-diff -ruN rpm-4.4.2./rpm2cpio.c rpm-4.4.2/rpm2cpio.c
---- rpm-4.4.2./rpm2cpio.c      2005-01-17 19:46:16.000000000 +0100
-+++ rpm-4.4.2/rpm2cpio.c       2006-05-23 18:15:38.364083000 +0200
-@@ -76,6 +76,8 @@
-           t = stpcpy(t, ".gzdio");
-       if (!strcmp(payload_compressor, "bzip2"))
-           t = stpcpy(t, ".bzdio");
-+      if (!strcmp(payload_compressor, "lzma"))
-+          t = stpcpy(t, ".lzdio");
-     }
-     gzdi = Fdopen(fdi, rpmio_flags);  /* XXX gzdi == fdi */
-diff -ruN rpm-4.4.2./rpmio/Makefile.am rpm-4.4.2/rpmio/Makefile.am
---- rpm-4.4.2./rpmio/Makefile.am       2006-05-23 16:58:47.000000000 +0200
-+++ rpm-4.4.2/rpmio/Makefile.am        2006-05-23 18:22:45.116206816 +0200
-@@ -22,14 +22,14 @@
-       argv.h fts.h rpmdav.h \
-       rpmio.h rpmurl.h rpmmacro.h rpmlog.h rpmmessages.h rpmerr.h rpmpgp.h \
-       rpmsq.h rpmsw.h ugid.h
--noinst_HEADERS = rpmio_internal.h rpmlua.h rpmhook.h
-+noinst_HEADERS = LzmaDecode.h rpmio_internal.h rpmlua.h rpmhook.h
- BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs)
- usrlibdir = $(libdir)@MARK64@
- usrlib_LTLIBRARIES = librpmio.la
- librpmio_la_SOURCES = \
--      argv.c digest.c fts.c macro.c rpmdav.c \
-+      LzmaDecode.c argv.c digest.c fts.c macro.c rpmdav.c \
-       rpmhook.c rpmio.c rpmlog.c rpmlua.c rpmmalloc.c \
-       rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c strcasecmp.c stubs.c url.c ugid.c
- librpmio_la_LDFLAGS = -release 4.4 $(LDFLAGS) \
-diff -ruN rpm-4.4.2./rpmio/rpmio.c rpm-4.4.2/rpmio/rpmio.c
---- rpm-4.4.2./rpmio/rpmio.c   2006-05-23 16:58:47.000000000 +0200
-+++ rpm-4.4.2/rpmio/rpmio.c    2006-05-23 18:15:38.367082544 +0200
-@@ -80,6 +80,7 @@
- #define       FDONLY(fd)      assert(fdGetIo(fd) == fdio)
- #define       GZDONLY(fd)     assert(fdGetIo(fd) == gzdio)
- #define       BZDONLY(fd)     assert(fdGetIo(fd) == bzdio)
-+#define       LZDONLY(fd)     assert(fdGetIo(fd) == lzdio)
- #define       UFDONLY(fd)     /* assert(fdGetIo(fd) == ufdio) */
-@@ -180,6 +181,8 @@
-       } else if (fps->io == bzdio) {
-           sprintf(be, "BZD %p fdno %d", fps->fp, fps->fdno);
- #endif
-+      } else if (fps->io == lzdio) {
-+          sprintf(be, "LZD %p fdno %d", fps->fp, fps->fdno);
-       } else if (fps->io == fpio) {
-           /*@+voidabstract@*/
-           sprintf(be, "%s %p(%d) fdno %d",
-@@ -2361,6 +2364,327 @@
- /*@=moduncon@*/
- #endif        /* HAVE_BZLIB_H */
-+#include "LzmaDecode.h"
-+
-+#define kInBufferSize (1 << 15)
-+typedef struct _CBuffer
-+{
-+  ILzmaInCallback InCallback;
-+  FILE *File;
-+  unsigned char Buffer[kInBufferSize];
-+} CBuffer;
-+
-+typedef struct lzfile {
-+    CBuffer g_InBuffer;
-+    CLzmaDecoderState state;  /* it's about 24-80 bytes structure, if int is 32-bit */
-+    unsigned char properties[LZMA_PROPERTIES_SIZE];
-+
-+//    FILE *file;
-+    int pid;
-+} LZFILE;
-+
-+static size_t MyReadFile(FILE *file, void *data, size_t size)
-+{ 
-+    if (size == 0) return 0;
-+    return fread(data, 1, size, file); 
-+}
-+
-+static int MyReadFileAndCheck(FILE *file, void *data, size_t size)
-+{
-+    return (MyReadFile(file, data, size) == size);
-+}
-+
-+static int LzmaReadCompressed(void *object, const unsigned char **buffer, SizeT *size)
-+{
-+    CBuffer *b = (CBuffer *)object;
-+    *buffer = b->Buffer;
-+    *size = (SizeT)MyReadFile(b->File, b->Buffer, kInBufferSize);
-+    return LZMA_RESULT_OK;
-+}
-+
-+static inline /*@dependent@*/ void * lzdFileno(FD_t fd)
-+      /*@*/
-+{
-+    void * rc = NULL;
-+    int i;
-+
-+    FDSANE(fd);
-+    for (i = fd->nfps; i >= 0; i--) {
-+/*@-boundsread@*/
-+          FDSTACK_t * fps = &fd->fps[i];
-+/*@=boundsread@*/
-+          if (fps->io != lzdio)
-+              continue;
-+          rc = fps->fp;
-+      break;
-+    }
-+    
-+    return rc;
-+}
-+
-+static FD_t lzdWriteOpen(int fdno, int fopen)
-+{
-+    int pid;
-+    int p[2];
-+
-+    if (fdno < 0) return NULL;
-+    if (pipe(p) < 0) {
-+        close(fdno);
-+        return NULL;
-+    }
-+    pid = fork();
-+    if (pid < 0) {
-+        close(fdno);
-+        return NULL;
-+    }
-+    if (pid) {
-+        FD_t fd;
-+        LZFILE *lzfile;
-+
-+        close(fdno);
-+        close(p[0]);
-+        lzfile = calloc(1, sizeof(*lzfile));
-+        if (lzfile == NULL) return NULL;
-+        lzfile->g_InBuffer.File = fdopen(p[1], "wb");
-+        lzfile->pid = pid;
-+        if (lzfile->g_InBuffer.File == NULL) {
-+            close(p[1]);
-+            free(lzfile);
-+            return NULL;
-+        }
-+        fd = fdNew("open (lzdOpen write)");
-+        if (fopen) fdPop(fd);
-+        fdPush(fd, lzdio, lzfile, -1);
-+        return fdLink(fd, "lzdOpen");
-+    } else {
-+        int i;
-+        /* lzma */
-+        close(p[1]);
-+        dup2(p[0], 0);
-+        dup2(fdno, 1);
-+        for (i = 3; i < 1024; i++) close(i);
-+        if (execlp("lzma", "lzma", "e", "-si", "-so", NULL)) {
-+            _exit(1);
-+          }
-+    }
-+    return NULL; /* warning */
-+}
-+
-+static FD_t lzdReadOpen(int fdno, int fopen)
-+{
-+    LZFILE *lzfile;
-+    unsigned char ff[8];
-+    FD_t fd;
-+
-+    if (fdno < 0) return NULL;
-+    lzfile = calloc(1, sizeof(*lzfile));
-+    if (lzfile == NULL) return NULL;
-+    lzfile->g_InBuffer.File = fdopen(fdno, "rb");
-+    if (lzfile->g_InBuffer.File == NULL) goto error2;
-+
-+    if (!MyReadFileAndCheck(lzfile->g_InBuffer.File, lzfile->properties, sizeof(lzfile->properties))) {
-+error:
-+        fclose(lzfile->g_InBuffer.File);
-+error2:
-+        free(lzfile);
-+        return NULL;
-+    }
-+    if (!MyReadFileAndCheck(lzfile->g_InBuffer.File, ff, 8)) goto error;
-+    if (LzmaDecodeProperties(&lzfile->state.Properties, lzfile->properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK)
-+        goto error;
-+    lzfile->state.Probs = (CProb *)malloc(LzmaGetNumProbs(&lzfile->state.Properties) * sizeof(CProb));
-+    if (lzfile->state.Probs == NULL) goto error;
-+
-+    if (lzfile->state.Properties.DictionarySize == 0)
-+        lzfile->state.Dictionary = 0;
-+    else {
-+        lzfile->state.Dictionary = (unsigned char *)malloc(lzfile->state.Properties.DictionarySize);
-+        if (lzfile->state.Dictionary == NULL) {
-+            free(lzfile->state.Probs);
-+            goto error;
-+        }
-+    }
-+    lzfile->g_InBuffer.InCallback.Read = LzmaReadCompressed;
-+    LzmaDecoderInit(&lzfile->state);
-+
-+    fd = fdNew("open (lzdOpen read)");
-+    if (fopen) fdPop(fd);
-+    fdPush(fd, lzdio, lzfile, -1);
-+    return fdLink(fd, "lzdOpen");
-+}
-+
-+/*@-globuse@*/
-+static /*@null@*/ FD_t lzdOpen(const char * path, const char * mode)
-+      /*@globals fileSystem @*/
-+      /*@modifies fileSystem @*/
-+{
-+    if (mode == NULL)
-+        return NULL;
-+    if (mode[0] == 'w') {
-+        int fdno = open(path, O_WRONLY);
-+
-+        if (fdno < 0) return NULL;
-+        return lzdWriteOpen(fdno, 1);
-+    } else {
-+        int fdno = open(path, O_RDONLY);
-+
-+        if (fdno < 0) return NULL;
-+        return lzdReadOpen(fdno, 1);
-+    }
-+}
-+/*@=globuse@*/
-+
-+/*@-globuse@*/
-+static /*@null@*/ FD_t lzdFdopen(void * cookie, const char * fmode)
-+      /*@globals fileSystem, internalState @*/
-+      /*@modifies fileSystem, internalState @*/
-+{
-+    FD_t fd = c2f(cookie);
-+    int fdno;
-+
-+    if (fmode == NULL) return NULL;
-+    fdno = fdFileno(fd);
-+    fdSetFdno(fd, -1);                /* XXX skip the fdio close */
-+    if (fdno < 0) return NULL;
-+    if (fmode[0] == 'w') {
-+        return lzdWriteOpen(fdno, 0);
-+    } else {
-+        return lzdReadOpen(fdno, 0);
-+    }
-+}
-+/*@=globuse@*/
-+
-+/*@-globuse@*/
-+static int lzdFlush(FD_t fd)
-+      /*@globals fileSystem @*/
-+      /*@modifies fileSystem @*/
-+{
-+    LZFILE *lzfile = lzdFileno(fd);
-+
-+    if (lzfile == NULL || lzfile->g_InBuffer.File == NULL) return -2;
-+    return fflush(lzfile->g_InBuffer.File);
-+}
-+/*@=globuse@*/
-+
-+/* =============================================================== */
-+/*@-globuse@*/
-+/*@-mustmod@*/                /* LCL: *buf is modified */
-+static ssize_t lzdRead(void * cookie, /*@out@*/ char * buf, size_t count)
-+      /*@globals fileSystem, internalState @*/
-+      /*@modifies *buf, fileSystem, internalState @*/
-+{
-+    FD_t fd = c2f(cookie);
-+    LZFILE *lzfile;
-+    ssize_t rc = 0;
-+    int res = 0;
-+
-+    if (fd->bytesRemain == 0) return 0;       /* XXX simulate EOF */
-+    lzfile = lzdFileno(fd);
-+    fdstat_enter(fd, FDSTAT_READ);
-+    if (lzfile->g_InBuffer.File)
-+      /*@-compdef@*/
-+      res = LzmaDecode(&lzfile->state, &lzfile->g_InBuffer.InCallback, buf, count, &rc);
-+      /*@=compdef@*/
-+    if (res) {
-+      if (lzfile)
-+          fd->errcookie = "Lzma: decoding error";
-+    } else if (rc >= 0) {
-+      fdstat_exit(fd, FDSTAT_READ, rc);
-+      /*@-compdef@*/
-+      if (fd->ndigests && rc > 0) fdUpdateDigests(fd, (void *)buf, rc);
-+      /*@=compdef@*/
-+    }
-+    return rc;
-+}
-+/*@=mustmod@*/
-+/*@=globuse@*/
-+
-+/*@-globuse@*/
-+static ssize_t lzdWrite(void * cookie, const char * buf, size_t count)
-+      /*@globals fileSystem, internalState @*/
-+      /*@modifies fileSystem, internalState @*/
-+{
-+    FD_t fd = c2f(cookie);
-+    LZFILE *lzfile;
-+    ssize_t rc;
-+
-+    if (fd->bytesRemain == 0) return 0;       /* XXX simulate EOF */
-+
-+    if (fd->ndigests && count > 0) fdUpdateDigests(fd, (void *)buf, count);
-+
-+    lzfile = lzdFileno(fd);
-+    fdstat_enter(fd, FDSTAT_WRITE);
-+    rc = fwrite((void *)buf, 1, count, lzfile->g_InBuffer.File);
-+    if (rc == -1) {
-+      fd->errcookie = strerror(ferror(lzfile->g_InBuffer.File));
-+    } else if (rc > 0) {
-+      fdstat_exit(fd, FDSTAT_WRITE, rc);
-+    }
-+    return rc;
-+}
-+/*@=globuse@*/
-+
-+static inline int lzdSeek(void * cookie, /*@unused@*/ _libio_pos_t pos,
-+                      /*@unused@*/ int whence)
-+      /*@*/
-+{
-+    FD_t fd = c2f(cookie);
-+
-+    LZDONLY(fd);
-+    return -2;
-+}
-+
-+static int lzdClose( /*@only@*/ void * cookie)
-+      /*@globals fileSystem, internalState @*/
-+      /*@modifies fileSystem, internalState @*/
-+{
-+    FD_t fd = c2f(cookie);
-+    LZFILE *lzfile;
-+    int rc;
-+
-+    lzfile = lzdFileno(fd);
-+
-+    if (lzfile == NULL) return -2;
-+    fdstat_enter(fd, FDSTAT_CLOSE);
-+    /*@-noeffectuncon@*/ /* FIX: check rc */
-+    fclose(lzfile->g_InBuffer.File);
-+    if (lzfile->pid) wait4(lzfile->pid, NULL, 0, NULL);
-+    else { /* reading */
-+        free(lzfile->state.Probs);
-+        if (lzfile->state.Dictionary) free(lzfile->state.Dictionary);
-+    }
-+    free(lzfile);
-+    /*@=noeffectuncon@*/
-+    rc = 0;   /* XXX FIXME */
-+
-+    /* XXX TODO: preserve fd if errors */
-+
-+    if (fd) {
-+      if (rc == -1) {
-+          fd->errcookie = strerror(ferror(lzfile->g_InBuffer.File));
-+      } else if (rc >= 0) {
-+          fdstat_exit(fd, FDSTAT_CLOSE, rc);
-+      }
-+    }
-+
-+DBGIO(fd, (stderr, "==>\tlzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd)));
-+
-+    if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "LZDIO", stderr);
-+    /*@-branchstate@*/
-+    if (rc == 0)
-+      fd = fdFree(fd, "open (lzdClose)");
-+    /*@=branchstate@*/
-+    return rc;
-+}
-+
-+/*@-type@*/ /* LCL: function typedefs */
-+static struct FDIO_s lzdio_s = {
-+  lzdRead, lzdWrite, lzdSeek, lzdClose, XfdLink, XfdFree, XfdNew, fdFileno,
-+  NULL, lzdOpen, lzdFileno, lzdFlush, NULL, NULL, NULL, NULL, NULL
-+};
-+/*@=type@*/
-+FDIO_t lzdio = /*@-compmempass@*/ &lzdio_s /*@=compmempass@*/ ;
-+
- /* =============================================================== */
- /*@observer@*/
- static const char * getFdErrstr (FD_t fd)
-@@ -2379,7 +2703,9 @@
-       errstr = fd->errcookie;
-     } else
- #endif        /* HAVE_BZLIB_H */
--
-+    if (fdGetIo(fd) == lzdio) {
-+    errstr = fd->errcookie;
-+    } else 
-     {
-       errstr = (fd->syserrno ? strerror(fd->syserrno) : "");
-     }
-@@ -2674,6 +3000,9 @@
-           fd = bzdFdopen(fd, zstdio);
-           /*@=internalglobs@*/
- #endif
-+    } else if (!strcmp(end, "lzdio")) {
-+        iof = lzdio;
-+        fd = lzdFdopen(fd, zstdio);
-       } else if (!strcmp(end, "ufdio")) {
-           iof = ufdio;
-       } else if (!strcmp(end, "fpio")) {
-@@ -2839,6 +3168,9 @@
-           ec = (fd->syserrno  || fd->errcookie != NULL) ? -1 : 0;
-           i--;        /* XXX fdio under bzdio always has fdno == -1 */
- #endif
-+    } else if (fps->io == lzdio) {
-+          ec = (fd->syserrno  || fd->errcookie != NULL) ? -1 : 0;
-+          i--;        /* XXX fdio under lzdio always has fdno == -1 */
-       } else {
-       /* XXX need to check ufdio/gzdio/bzdio/fdio errors correctly. */
-           ec = (fdFileno(fd) < 0 ? -1 : 0);
-diff -ruN rpm-4.4.2./rpmio/rpmio.h rpm-4.4.2/rpmio/rpmio.h
---- rpm-4.4.2./rpmio/rpmio.h   2005-06-11 22:03:14.000000000 +0200
-+++ rpm-4.4.2/rpmio/rpmio.h    2006-05-23 18:15:38.373081632 +0200
-@@ -662,6 +662,10 @@
- /**
-  */
-+/*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
-+
-+/**
-+ */
- /*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio;
- /*@=exportlocal@*/
- /*@}*/
-diff -ruN rpm-4.4.2./tools/rpmtool.c rpm-4.4.2/tools/rpmtool.c
---- rpm-4.4.2./tools/rpmtool.c 2005-01-17 19:46:27.000000000 +0100
-+++ rpm-4.4.2/tools/rpmtool.c  2006-05-23 18:15:38.374081480 +0200
-@@ -87,7 +87,8 @@
-     RPMIOBITS_UNCOMPRESS= (1 <<  8),
-     RPMIOBITS_BINARY  = (1 <<  9),
-     RPMIOBITS_DUMP    = (1 << 10),
--    RPMIOBITS_XML     = (1 << 11)
-+    RPMIOBITS_XML     = (1 << 11),
-+    RPMIOBITS_LZDIO   = (1 << 16),
- } rpmtoolIOBits;
- static const char * iav[] = { "-", NULL };
-@@ -118,12 +119,13 @@
-     { "gzdio",                RPMIOBITS_GZDIO },
-     { "bzdio",                RPMIOBITS_BZDIO },
- #define       _RPMIOBITS_MODEMASK \
--    (RPMIOBITS_FDIO|RPMIOBITS_UFDIO|RPMIOBITS_GZDIO|RPMIOBITS_BZDIO)
-+    (RPMIOBITS_FDIO|RPMIOBITS_UFDIO|RPMIOBITS_GZDIO|RPMIOBITS_BZDIO|RPMIOBITS_LZDIO)
-     { "uncompress",   RPMIOBITS_UNCOMPRESS },
-     { "binary",               RPMIOBITS_BINARY },
-     { "dump",         RPMIOBITS_DUMP },
-     { "xml",          RPMIOBITS_XML },
-+    { "lzdio",      RPMIOBITS_LZDIO },
-     { NULL,   0 },
- };
-@@ -450,6 +452,8 @@
-                   t = stpcpy(t, ".gzdio");
-               if (!strcmp(payload_compressor, "bzip2"))
-                   t = stpcpy(t, ".bzdio");
-+        if (!strcmp(payload_compressor, "lzma"))
-+            t = stpcpy(t, ".lzdio");
-               gzdi = Fdopen(fdi, rpmio_flags);        /* XXX gzdi == fdi */
-               if (gzdi == NULL) {
diff --git a/rpm-macros.java b/rpm-macros.java
deleted file mode 100644 (file)
index 5b15d26..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-%define        __java_provides env RPM_BUILD_ROOT=%{buildroot} /usr/lib/rpm/java-find-provides
-%define        __java_requires env RPM_BUILD_ROOT=%{buildroot} /usr/lib/rpm/java-find-requires
diff --git a/rpm-macros.patch b/rpm-macros.patch
deleted file mode 100644 (file)
index 6cc1acd..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
---- rpm-4.4.2/macros.in~       2006-01-17 20:55:45.000000000 +0200
-+++ rpm-4.4.2/macros.in        2006-01-17 20:57:51.000000000 +0200
-@@ -223,7 +223,7 @@
- %_tmppath             %{_var}/tmp
- #     Path to top of build area.
--%_topdir              %{_usrsrc}/redhat
-+%_topdir         %(echo $HOME)/rpm
- #     The path to the unzip executable (legacy, use %{__unzip} instead).
- %_unzipbin            %{__unzip}
-@@ -327,8 +327,8 @@
- #             "w9.gzdio"      gzip level 9 (default).
- #             "w9.bzdio"      bzip2 level 9.
- #
--#%_source_payload     w9.gzdio
--#%_binary_payload     w9.gzdio
-+%_source_payload      w9.gzdio
-+%_binary_payload      w9.bzdio
- #     The signature to use and the location of configuration files for
- #     signing packages with PGP.
-@@ -1019,6 +1019,7 @@
- %_oldincludedir               /usr/include
- %_infodir             %{_prefix}/info
- %_mandir              %{_prefix}/man
-+%_x_libraries /usr/X11R6/%{_lib}
- #==============================================================================
- # ---- config.guess platform macros.
-@@ -1157,36 +1157,6 @@
-   %{-C:cd ${_mydir}; unset _mydir}
- #------------------------------------------------------------------------------
--# Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
--#
--# For example, these can be used as (from ImageMagick.spec from PLD site)
--#     [...]
--#     BuildPrereq: perl
--#     [...]
--#     %package perl
--#     Summary: libraries and modules for access to ImageMagick from perl
--#     Group: Development/Languages/Perl
--#     Requires: %{name} = %{version}
--#     %requires_eq    perl
--#     [...]
--#     %install
--#     rm -fr $RPM_BUILD_ROOT
--#     install -d $RPM_BUILD_ROOT/%{perl_sitearch}
--#     [...]
--#     %files perl
--#     %defattr(644,root,root,755)
--#     %{perl_sitearch}/Image
--#     %dir %{perl_sitearch}/auto/Image
--#
--%requires_eq()        %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
--%perl_sitearch        %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
--%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
--%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
--%perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
--%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
--%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
--
--#------------------------------------------------------------------------------
- # arch macro for all Intel i?86 compatibile processors
- #  (Note: This macro (and it's analogues) will probably be obsoleted when
- #   rpm can use regular expressions against target platforms in macro
-@@ -1277,4 +1277,17 @@
- %find_lang    @RPMCONFIGDIR@/find-lang.sh %{buildroot}
-+# PLD rpm macros
-+%_enable_debug_packages 0
-+
-+#-----------------------------------------------------------------
-+# CFLAGS and LDFLAGS used to build
-+
-+%debuginfocflags      %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
-+
-+%debugcflags  -O0 -g -Wall
-+%rpmcflags    %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
-+%rpmcxxflags  %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
-+%rpmldflags   %{nil}
-+
- # \endverbatim
- #*/
diff --git a/rpm-man_pl.patch b/rpm-man_pl.patch
deleted file mode 100644 (file)
index db61324..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- rpm/doc/pl/rpm.8~  2007-11-24 23:21:26.000000000 +0100
-+++ rpm/doc/pl/rpm.8   2007-11-24 23:21:26.000000000 +0100
-@@ -325,6 +325,7 @@
- Instaluje pakiety nawet je¶li niektóre z nich s± ju¿ zainstalowane na tym
- systemie.
- .TP
-+\fB--test\fR
- Nie instaluje pakietu, po prostu sprawdza i raportuje potencjalne
- konflikty.
- .SS "OPCJE USUWANIA"
index e54eab07720a05f6b073a06e8366365c217697b4..b6b771df49fb9cbb02bd7ae916ff54a8bb120362 100644 (file)
@@ -1,18 +1,17 @@
 diff -ruN rpm-4.4.2./build/rpmfc.c rpm-4.4.2/build/rpmfc.c
 --- rpm-4.4.2./build/rpmfc.c   2005-08-11 13:11:54.000000000 +0200
 +++ rpm-4.4.2/build/rpmfc.c    2005-08-11 15:33:47.000000000 +0200
-@@ -534,6 +534,10 @@
+@@ -534,6 +534,9 @@
    /* XXX "python 2.3 byte-compiled" */
    { "python ",                        RPMFC_PYTHON|RPMFC_INCLUDE },
  
 +  /* .NET executables and libraries. file(1) cannot differ it from native win32 executables unfortunatelly */
 +  { "PE executable",          RPMFC_MONO|RPMFC_INCLUDE },
-+  { "executable PE",          RPMFC_MONO|RPMFC_INCLUDE },
 +
    { "current ar archive",     RPMFC_STATIC|RPMFC_LIBRARY|RPMFC_ARCHIVE|RPMFC_INCLUDE },
  
    { "Zip archive data",               RPMFC_COMPRESSED|RPMFC_ARCHIVE|RPMFC_INCLUDE },
-@@ -827,6 +831,42 @@
+@@ -827,6 +830,42 @@
  }
  
  /**
@@ -55,7 +54,7 @@ diff -ruN rpm-4.4.2./build/rpmfc.c rpm-4.4.2/build/rpmfc.c
   * Extract Elf dependencies.
   * @param fc          file classifier
   * @param findprov    1 to enable provides
-@@ -1179,6 +1219,7 @@
+@@ -1179,6 +1218,7 @@
      { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PERL) },
      { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PYTHON) },
      { rpmfcSCRIPT,    (RPMFC_SCRIPT|RPMFC_PHP) },
diff --git a/rpm-p4.patch b/rpm-p4.patch
deleted file mode 100644 (file)
index 3b29c69..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- rpm-4.4.1/lib/rpmrc.c.orig 2005-08-02 21:33:34.000000000 +0200
-+++ rpm-4.4.1/lib/rpmrc.c      2005-10-11 07:51:45.000000000 +0200
-@@ -1076,6 +1076,7 @@
-                       // Pentium 4 Xeon, Pentium 4 Xeon MP,
-                       // Celeron, Mobile Celron                    (0.13um)
-           case 3:     // Pentium 4, Celeron                        (0.09um)
-+          case 4:     // Pentium 4 540J
-               return 1;
-       }
-     return 0;
diff --git a/rpm-requireseq.patch b/rpm-requireseq.patch
deleted file mode 100644 (file)
index e30cf2d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urBb rpm-4.4.2.org/macros.in rpm-4.4.2/macros.in
---- rpm-4.4.2.org/macros.in    2005-10-08 13:38:33.470982000 +0200
-+++ rpm-4.4.2/macros.in        2005-10-08 13:39:51.327848250 +0200
-@@ -1249,7 +1249,7 @@
- #     %{perl_sitearch}/Image
- #     %dir %{perl_sitearch}/auto/Image
- #
--%requires_eq()        %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
-+%requires_eq()        %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
- %perl_sitearch        %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
- %perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
- %perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
index 8c7d3a31ee589507b4986fd6769167ba5b46d6bb..b3ae580cb46252cede9937814e8d5599da061b74 100644 (file)
  buildarch_compat: ia32e: x86_64
  
 -macrofiles:   @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros
-+macrofiles:   @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/macros.build:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/etc/.rpmmacros:~/.rpmmacros
++macrofiles:   @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/etc/.rpmmacros:~/.rpmmacros
  
  # \endverbatim
  #*/
diff --git a/rpm-skip-backups.patch b/rpm-skip-backups.patch
deleted file mode 100644 (file)
index a5c126d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- rpm-4.4.2/rpmio/macro.c~   2006-04-27 00:49:59.000000000 +0300
-+++ rpm-4.4.2/rpmio/macro.c    2006-04-27 00:50:04.000000000 +0300
-@@ -2000,8 +2000,15 @@
-           continue;
-       /* Read macros from each file. */
--      for (i = 0; i < ac; i++)
--          (void) rpmLoadMacroFile(mc, av[i]);
-+      for (i = 0; i < ac; i++) {
-+          size_t slen = strlen(av[i]);
-+          if ((av[i])[slen-1] != '~' &&
-+              (slen < 8 || strcmp((av[i] + slen - 7), ".rpmnew")) &&
-+              (slen < 9 || (strcmp((av[i] + slen - 8), ".rpmorig") &&
-+                            strcmp((av[i] + slen - 8), ".rpmsave")))) {
-+              (void) rpmLoadMacroFile(mc, av[i]);
-+          }
-+      }
-       av = _free(av);
-     }
-     mfiles = _free(mfiles);
diff --git a/rpm-truncate-cvslog.patch b/rpm-truncate-cvslog.patch
deleted file mode 100644 (file)
index f03d71d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# vim:ts=8:sw=4
---- rpm-4.4.2/build/parseChangelog.c   2006-04-26 22:34:05.263994598 +0300
-+++ rpm-4.4.2-truncate-changelog/build/parseChangelog.c        2006-04-26 22:32:50.622329157 +0300
-@@ -8,6 +8,9 @@
- #include "rpmbuild.h"
- #include "debug.h"
-+#define CVS_RCSID "$""Log: "
-+#define CVS_REVISION "Revision "
-+
- void addChangelogEntry(Header h, time_t time, const char *name, const char *text)
- {
-     int_32 mytime = time;     /* XXX convert to header representation */
-@@ -116,6 +119,7 @@
-     time_t time;
-     time_t lastTime = 0;
-     char *date, *name, *text, *next;
-+    int numchangelog = rpmExpandNumeric("%{?_buildchangelogtruncate}");
-     s = getStringBuf(sb);
-@@ -197,6 +202,42 @@
-       while ((s > text) && xisspace(*s)) {
-           *s-- = '\0';
-       }
-+
-+      if (numchangelog && (s = strstr(text, CVS_RCSID))) {
-+          /* find end of line */
-+          while(*s && *s != '\n') s++;
-+          if (!*s) {
-+              goto out;
-+          }
-+          s++;
-+          if (!*s) {
-+              goto out;
-+          }
-+
-+          /* we reached place where first Revisions should be */
-+          i = 0;
-+          while (1) {
-+              if (strncmp(s, CVS_REVISION, sizeof(CVS_REVISION) - 1) == 0) {
-+                  if (i++ == numchangelog) {
-+                      break;
-+                  }
-+              }
-+              while(*s && *s != '\n') s++;
-+              if (!*s) {
-+                  break;
-+              }
-+              s++;
-+          }
-+
-+          if (*s) {
-+              s--;
-+              /* backup to the beginning of line */
-+              while ((s > text) && (*s == '\n' || xisspace(*s))) {
-+                  *s-- = '\0';
-+              }
-+          }
-+      }
-+out:
-       
-       addChangelogEntry(h, time, name, text);
-       s = next;
index ee662e2153360dced797a5a51348aee562a0dd83..677c8b8cb417ec223f13022227609d5d69bcb3b4 100644 (file)
@@ -14,14 +14,14 @@ fi
 if [ "$1" = user -o "$1" = group ]; then
        MODE=$1
 else
-       echo ERROR
+       echo ERROR | $BANNERCMD $BANNERPARA
        exit 2
 fi
 shift
 
 bannercmd()
 {
-       if [ "$BANNERCMD" = cat ]; then
+       if [ "$BANNERCMD" == cat ]; then
                echo cat
        else
                if [ "$RPM_SCRIPTVERBOSITY" -lt 2 ]; then
@@ -34,7 +34,7 @@ bannercmd()
 
 testrm()
 {
-       [ "$RPM_USERDEL" != yes ] || [ ! -x /bin/rpm ] && return 1
+       [ "$RPM_USERDEL" != yes ] && return 1
        [ -z "$1" ] && return 2
        rpm -q --whatprovides "${MODE}($1)" >/dev/null 2>&1
        # no package Provides it (strange)
@@ -51,27 +51,14 @@ elif [ "$1" = del ]; then
        if testrm $2; then
                echo "Removing $MODE $2" | `bannercmd "${MODE}del-$2"`
                /usr/sbin/${MODE}del $2 || :
-               if [ -x /usr/sbin/nscd ]; then
-               case "${MODE}" in
-               user)
-                       /usr/sbin/nscd -i passwd
-                       ;;
-               group)
-                       /usr/sbin/nscd -i group
-                       ;;
-               esac
-               fi
        fi
 elif [ "$MODE" = "user" -a "$1" = "addtogroup" ]; then
-       user="$2"
-       group="$3"
-       groups=$(id -n -G $user)
-       if [[ " $groups " != *\ $group\ * ]]; then
-           echo "Adding user $user to group $group" | `bannercmd "${MODE}mod-$user"`
-               for grp in $groups $group; do
-                       new="$new${new:+,}$grp"
-               done
-           usermod -G "$new" $user
+       USER=$2
+       GROUP=$3
+       GROUPS=`id -n -G $USER | sed -e's/^[^ ]* //;s/ /,/g'`
+       if ! echo ",$GROUPS," | grep -q ",$GROUP," ; then
+           echo "Adding user $USER to group $GROUP" | `bannercmd "${MODE}mod-$USER"`
+           usermod -G "$GROUPS,$GROUP" $USER
        fi
 else
        echo ERROR
diff --git a/rpm.macros b/rpm.macros
new file mode 100644 (file)
index 0000000..0ae145f
--- /dev/null
@@ -0,0 +1,777 @@
+# PLD rpm macros
+
+# other macros
+%epoch         0
+%_enable_debug_packages 0
+
+%__id          @__ID@
+%__id_u                %{__id} -u 
+%__chown_Rhf           @__CHOWN_RHF@
+%__chgrp_Rhf           @__CHGRP_RHF@
+
+%_fixowner       [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@
+%_fixgroup       true
+%_fixperms       %{__chmod} -Rf @FIXPERMS@
+%_topdir         %(echo $HOME)/rpm
+#-----------------------------------------------------------------
+# CFLAGS and LDFLAGS used to build
+
+%debuginfocflags       %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
+
+%debugcflags   -O0 -g -Wall
+%rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
+%rpmcxxflags   %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
+%rpmldflags    %{nil}
+
+# kernel compiler
+%kgcc          gcc
+%kgcc_package  gcc
+
+# Build system path macros.
+#
+%__autoconf            autoconf %{?debug:-Wall}
+%__automake            automake -a -c -f --foreign
+%__autopoint           autopoint --force
+
+%__gettextize { \
+    if ! gettextize --version | grep -q '0\.10\.' ; then \
+       if grep -qs 'AM_GNU_GETTEXT.*external' configure.{ac,in} ; then \
+           gettextize --copy --force --no-changelog; \
+       else \
+           gettextize --copy --force --no-changelog --intl; \
+       fi; \
+       if [ ! -f po/Makevars ]; then \
+           cp -f po/Makevars{.template,}; \
+       fi; \
+    else \
+       gettextize --copy --force; \
+    fi; \
+}
+
+%__glib_gettextize     glib-gettextize --copy --force
+%__gnome_doc_common    gnome-doc-common --copy
+%__gtkdocize           gtkdocize --copy
+%__intltoolize         intltoolize --copy --force
+%__libtoolize          libtoolize --copy --force
+
+%dependencytracking    %{nil}
+#-----------------------------------------------------------------
+%configure2_13 { \
+ if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
+ LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \
+ CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \
+ CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \
+ FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
+ CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
+ %{?__cc:CC="%{__cc}" ; export CC ; } \
+ %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \
+ %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
+       --host=%{_target_platform} \
+       --prefix=%{_prefix} \
+       --exec-prefix=%{_exec_prefix} \
+       --bindir=%{_bindir} \
+       --sbindir=%{_sbindir} \
+       --sysconfdir=%{_sysconfdir} \
+       --datadir=%{_datadir} \
+       --includedir=%{_includedir} \
+       --libdir=%{_libdir} \
+       --libexecdir=%{_libexecdir} \
+       --localstatedir=%{_localstatedir} \
+       --sharedstatedir=%{_sharedstatedir} \
+       --mandir=%{_mandir} \
+       --infodir=%{_infodir} \
+       --x-libraries=/usr/X11R6/%{_lib} \
+       %{dependencytracking} \
+}
+
+#----------------------------------------------------------------
+%global configure_cache 0
+%configure_cache_file   %{buildroot}.configure.cache
+
+%configure {./configure \
+       LDFLAGS="${LDFLAGS:-%rpmldflags}" \
+       CFLAGS="${CFLAGS:-%rpmcflags}" \
+       CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \
+       FFLAGS="${FFLAGS:-%rpmcflags}" \
+       CPPFLAGS="${CPPFLAGS:-}" \
+       %{?__cc:CC="%{__cc}"} \
+       %{?__cxx:CXX="%{__cxx}"} \
+       --build=%{_target_platform} \
+       --prefix=%{_prefix} \
+       --exec-prefix=%{_exec_prefix} \
+       --bindir=%{_bindir} \
+       --sbindir=%{_sbindir} \
+       --sysconfdir=%{_sysconfdir} \
+       --datadir=%{_datadir} \
+       --includedir=%{_includedir} \
+       --libdir=%{_libdir} \
+       --libexecdir=%{_libexecdir} \
+       --localstatedir=%{_localstatedir} \
+       --sharedstatedir=%{_sharedstatedir} \
+       --mandir=%{_mandir} \
+       --infodir=%{_infodir} \
+       --x-libraries=/usr/X11R6/%{_lib} \
+       %{dependencytracking} \
+       %{?configure_cache:--cache-file=%{configure_cache_file:-%{buildroot}.configure.cache}} \
+}
+
+# ------------------------------------------------------------------------
+# Overloading of some basic macros
+%prep \
+%%prep\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+unset LINGUAS ||:\
+%{nil}
+
+%build %%build\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+unset LINGUAS ||:\
+%{nil}
+
+%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
+%%install\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+unset LINGUAS ||:\
+%{nil}
+
+# ------------------------------------------------------------------------
+# Conditional build stuff.
+
+# Check if symbol is defined.
+# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
+%defined()     %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
+%undefined()   %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
+
+# Shorthand for %{defined with_...}
+%with()                %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
+%without()     %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
+
+# Handle conditional builds. %bcond_with is for case when feature is
+# default off and needs to be activated with --with ... command line 
+# switch. %bcond_without is for the dual case.
+#
+# %bcond_with foo defines symbol with_foo if --with foo was specified on
+# command line.
+# %bcond_without foo defines symbol with_foo if --without foo was *not* 
+# specified on command line.
+#
+# For example:
+#
+# %bcond_with extra_fonts
+# %bcond_without static
+# %if %{with extra_fonts}
+# ...
+# %endif
+# %ifdef %{with static}
+# ...
+# %endif
+# %{?with_static: ... }
+# %{!?with_static: ... }
+# %{?with_extra_fonts: ... }
+# %{!?with_extra_fonts: ... }
+# 
+# The bottom line: never use without_foo, _with_foo nor _without_foo, only
+# with_foo. This way changing default set of bconds for given spec is just
+# a matter of changing single line in it and syntax is more readable.
+%bcond_with()          %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
+%bcond_without()       %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
+# ------------------------------------------------------------------------
+
+# Location of autoconf macros
+%_aclocaldir   %(aclocal --print-ac-dir)
+
+# Location of omf files
+%_omf_dest_dir %(scrollkeeper-config --omfdir)
+
+# Location of pkgconfig files
+%_pkgconfigdir /usr/%{_lib}/pkgconfig
+
+# Location of desktop files
+%_desktopdir   /usr/share/applications
+%_applnkdir    ERROR:_applnkdir_is_obsolete_use_desktopdir_instead
+
+# Location of pixmaps for applnk/desktop files
+%_pixmapsdir   /usr/share/pixmaps
+
+# Location of themable icons for applnk/desktop files
+%_iconsdir     /usr/share/icons
+
+# Location of fonts directories
+%_fontsdir     /usr/share/fonts
+
+# Location of Gtk and associated libraries documentation
+%_gtkdocdir  %{_defaultdocdir}/gtk-doc/html
+
+# Location of KDE documentation
+%_kdedocdir  %{_defaultdocdir}/kde/HTML
+
+# unsermake script
+%__unsermake /usr/share/unsermake/unsermake
+
+# Current date
+%date          %(LC_ALL="C" date +"%a %b %d %Y")
+
+# tmp directory
+%tmpdir                %(echo "${TMPDIR:-/tmp}")
+
+# Example files, programs, scripts...
+%_examplesdir  /usr/src/examples
+
+# The directory holding Linux kernel sources
+%_kernelsrcdir /usr/src/linux
+
+# If non-empty "debug" macro defined, add "dbg" suffix to release number
+%_rpmfilename          %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
+
+# Requires name = version-release
+%requires_releq()              %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' | grep -v "is not")
+
+%releq_kernel_up()             %(LC_ALL="C" rpm -qf --qf '%%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%releq_kernel_smp()            %(LC_ALL="C" rpm -qf --qf '%%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%requires_releq_kernel_up()    %(LC_ALL="C" rpm -qf --qf 'PreReq: %%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%requires_releq_kernel_smp()   %(LC_ALL="C" rpm -qf --qf 'PreReq: %%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+
+%requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' | grep -v "is not")
+
+%apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
+
+# kernel version-release handling
+%__kernel_ver    %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | head -n 1 | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } /^EXTRAVERSION/ { ever = $0; gsub(/EXTRAVERSION.*=/, NIL, ever); gsub(/ /, NIL, ever); } END { printf("%d.%d.%d%s", ver, plev, slev, ever); }' %{_kernelsrcdir}/Makefile 2> /dev/null))
+%__kernel_rel    %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{RELEASE}" | grep -v "is not")
+%__kernel_rpmvr  %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{VERSION}-%{RELEASE}" | grep -v "is not")
+%_kernel_ver     %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}
+%_kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g')
+
+# sgml macros
+%xmlcat_add()            /usr/bin/xmlcatalog --noout --add nextCatalog \"\" %1 /etc/xml/catalog ;
+%xmlcat_del()            /usr/bin/xmlcatalog --noout --del %1 /etc/xml/catalog ;
+%xmlcat_add_rewrite      /usr/bin/xmlcatalog --noout --add rewriteSystem
+%xmlcat_create()          /usr/bin/xmlcatalog --noout --create %1 ;
+%sgmlcat_add()           /usr/bin/install-catalog --add %1 %2 > /dev/null ;
+%sgmlcat_del()           /usr/bin/install-catalog --remove %1 %2 > /dev/null ;
+%docbook_sgmlcat_fix() { for l in \
+'' \
+'  -- default decl --' \
+'DTDDECL "-//OASIS//DTD DocBook XML V%2//EN" "../../xml.dcl"' \
+'  -- hacks for opensp --' \
+'SYSTEM "file://%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd" "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
+'SYSTEM "http://www.oasis-open.org/docbook/xml/%2/docbookx.dtd"                  "%{_datadir}/sgml/docbook/xml-dtd-%2/docbookx.dtd"' \
+'' \
+; do echo $l; done >> %1 \
+}
+
+#-----------------------------------------------------------------
+# find and gzip all files in %{_mandir} and %{infodir}
+#
+# Requires: xargs, find
+#
+#%no_install_post_compress_docs        1
+%__spec_install_post_compress_docs { \
+%{!?no_install_post_compress_docs: \
+       echo "Compress man and info pages."; \
+       %{?verbose:set -x;} \
+       for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
+               if [ -d "$RPM_BUILD_ROOT$i" ]; then \
+                       find "$RPM_BUILD_ROOT$i" -name \*.bz2 -print | xargs -r %{__bzip2} -df; \
+                       find "$RPM_BUILD_ROOT$i" -name \*.gz -print | xargs -r %{__gzip} -dnf; \
+                       find "$RPM_BUILD_ROOT$i" -type f -print | xargs -r %{__gzip} -9nf; \
+               fi; \
+       done; \
+} }
+
+#-----------------------------------------------------------------
+# Strip executable binaries and shared object files
+#
+# Requires: find, awk, strip, cut, xargs
+#
+#%no_install_post_strip        1
+%__spec_install_post_strip {%{!?debug: \
+%{!?no_install_post_strip: \
+    %{?verbose:set -x;} \
+    if [ -d "$RPM_BUILD_ROOT" ]; then \
+       echo "Strip executable binaries, archives and shared object files."; \
+       filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
+       elfexelist=`echo $filelist | xargs -r file | \
+               awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
+       elfsharedlist=`echo $filelist | xargs -r file | \
+               awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
+       elfarchiveslist=`echo $filelist | xargs -r file | \
+               awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
+       if [ -n "$elfexelist" ]; then \
+               %{__strip} --remove-section=.note  --remove-section=.comment $elfexelist; \
+       fi; \
+       if [ -n "$elfsharedlist" ]; then \
+               %{__strip} --strip-unneeded --remove-section=.note  --remove-section=.comment $elfsharedlist; \
+       fi; \
+       if [ -n "$elfarchiveslist" ]; then \
+               %{__strip} --strip-debug --remove-section=.note  --remove-section=.comment $elfarchiveslist; \
+       fi; \
+    fi; } \
+} }
+#-----------------------------------------------------------------
+# remove all RPATH from executable binaries and shared object files
+#
+# Requires: find, awk, cut, xargs, chrpath, uname
+#
+#%no_install_post_chrpath      1
+%__spec_install_post_chrpath {%{!?debug: \
+%{!?no_install_post_chrpath: \
+       %{?verbose:set -x;} \
+if [ -d "$RPM_BUILD_ROOT" ]; then \
+echo "Remove RPATH from executable binaries and shared object files."; \
+find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"} | xargs -r file | \
+       awk '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}' | cut -d: -f1 | \
+while read file ; do \
+       rpath= ; \
+       chmod u+w "$file"; \
+       for dir in `chrpath -l "$file" | \
+                   awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \
+                       case $dir in \
+                       /home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \
+                               echo "remove-rpath: $dir in $file"; \
+                               ;; \
+                       * ) \
+                               if [ "$rpath" = "" ] ; then rpath="$dir" ; \
+                               else rpath="$rpath:$dir" ; fi ; \
+                               ;; \
+                       esac ; \
+       done ; \
+       if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \
+       else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \
+done; \
+fi; } \
+} }
+#-----------------------------------------------------------------
+# Find and gzip all kernel modules
+#
+# Requires: find
+#
+#%no_install_post_compress_modules  1
+%__spec_install_post_compress_modules { \
+%{!?no_install_post_compress_modules: \
+    %{?verbose:set -x;} \
+    if [ -d "$RPM_BUILD_ROOT" ]; then \
+echo "Compress kernel modules if any."; \
+    if test -d $RPM_BUILD_ROOT/lib/modules ; then \
+       find $RPM_BUILD_ROOT/lib/modules -name \*o -type f -print | \
+       xargs -r %{__gzip} -9nf; \
+          find $RPM_BUILD_ROOT/lib/modules -name \*o -type l -printf "%p %l\n" | \
+          while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
+    fi; \
+    fi; \
+} }
+
+%_source_payload        w9.gzdio
+%_binary_payload        w9.bzdio
+
+#-----------------------------------------------------------------
+# Update GConf2 schemas
+#
+# Requires: GConf2
+#
+%gconf_schema_install() \
+    umask 022; \
+    GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" /usr/bin/gconftool-2 --makefile-install-rule /etc/gconf/schemas/%{?1}%{!?1:*.schemas} > /dev/null \
+    %{nil}
+
+%gconf_schema_uninstall() \
+if [ $1 = 0 ]; then \
+    umask 022; \
+    GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" /usr/bin/gconftool-2 --makefile-uninstall-rule /etc/gconf/schemas/%{?1} > /dev/null \
+fi \
+%{nil}
+
+#-----------------------------------------------------------------
+# Update desktop MIME database
+# requires: desktop-file-utils
+#
+%update_desktop_database_post() {{ \
+       umask 022; \
+       /usr/bin/update-desktop-database; \
+}}
+
+%update_desktop_database_postun() {{ \
+if [ $1 = 0 ]; then \
+       umask 022; \
+       /usr/bin/update-desktop-database; \
+fi \
+}}
+
+#-----------------------------------------------------------------
+# Update scrollkeeper database
+# requires: scrollkeeper
+#
+%scrollkeeper_update_post() \
+       /usr/bin/scrollkeeper-update -q; \
+       %{nil}
+
+%scrollkeeper_update_postun() \
+if [ $1 = 0 ]; then \
+       /usr/bin/scrollkeeper-update -q; \
+fi \
+%{nil}
+
+#-----------------------------------------------------------------
+# Run ldconfig after installing/deinstalling libraries
+#
+%ldconfig_post() \
+       /sbin/ldconfig; \
+       %{nil}
+
+%ldconfig_postun() \
+       /sbin/ldconfig; \
+       %{nil}
+
+#-----------------------------------------------------------------
+# post %install sequence:
+# - autodeps exceptions
+# - compress all man and info pages,
+# - strip all ELF executables and ELF shared objects if not %debug.
+# - compress kernel modules if any
+
+###################################################################
+# Requires/Provides automation
+# exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
+#
+%__noautoreqfiles      %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
+%__noautoprovfiles     %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
+%__noautoreq           %(sed -e s'/#.*//' /etc/rpm/noautoreq)%{?_noautoreq: %{_noautoreq}}
+%__noautoreqdep                %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
+%__noautoprov          %(sed -e s'/#.*//' /etc/rpm/noautoprov)%{?_noautoprov: %{_noautoprov}}
+#%_noautocompressdoc   %{nil}
+#
+%_missing_doc_files_terminate_build    1%{nil}
+%_unpackaged_files_terminate_build     %{nil}
+# (X)emacs support
+%___emacs_lispdir_helper  -batch -q -eval '(while load-path (princ (concat (car load-path) "\\n")) (setq load-path (cdr load-path)))' 2> /dev/null|sed -n '/\\(.*\\/x\\?emacs\\/site-lisp\\)\\/\\?$/{s,,\\1,p;q;}'
+%_emacs_lispdir %(emacs %___emacs_lispdir_helper)
+%_xemacs_lispdir %(xemacs %___emacs_lispdir_helper)
+
+%__php_provides        %{nil}
+%__php_requires %{nil}
+%__perl_provides %{nil}
+%__perl_requires %{nil}
+%__mono_provides %{nil}
+%__mono_requires %{nil}
+
+# Perl specific macro definitions.
+%perl_privlib  %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
+%perl_archlib  %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
+%perl_vendorlib        %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
+%perl_vendorarch       %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
+%perl_sitelib  %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
+%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
+
+%php_pear_dir  %{_datadir}/pear
+
+# Python specific macro definitions.
+# python main version
+%py_ver         %(echo `python -c "import sys; print sys.version[:3]"`)
+
+# directories
+%py_prefix      %(echo `python -c "import sys; print sys.prefix"`)
+%py_libdir      %{py_prefix}/%{_lib}/python%{py_ver}
+%py_scriptdir  %{py_prefix}/share/python%{py_ver}
+%py_incdir      /usr/include/python%{py_ver}
+%py_sitedir    %{py_libdir}/site-packages
+%py_sitescriptdir %{py_scriptdir}/site-packages
+%py_dyndir      %{py_libdir}/lib-dynload
+
+# pure python modules compilation
+%py_comp        python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+%py_ocomp       python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
+
+# Software written in Python language require Python with main version
+%pyrequires_eq() Requires:     %1
+
+
+# Hardlink binary identical .pyc and .pyo files
+# (idea by glen <at> pld-linux <dot> org)
+%__spec_install_post_py_hardlink {\
+%{!?no_install_post_py_hardlink: \
+[ ! -d "$RPM_BUILD_ROOT" ] || find "$RPM_BUILD_ROOT" -name '*.pyc' | while read a; do \
+       b="$(echo $a|sed -e 's/.pyc$/.pyo/')"; \
+       if cmp -s "$a" "$b"; then \
+               ln -f "$a" "$b"; \
+       fi; \
+done \
+} }
+
+# remove python sources, so that check-files won't complain
+# (idea by glen <at> pld-linux <dot> org)
+%py_postclean() \
+for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
+ [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 | xargs -0r -l512 rm;\
+done \
+%{nil}
+
+# depmod macro
+%depmod() { \
+umask 022; \
+if [ -e /boot/System.map-%1 ]; then \
+        /sbin/depmod -a -F /boot/System.map-%1 %1; \
+else \
+        if [ -e /boot/System.map ]; then \
+                /sbin/depmod -a -F /boot/System.map %1; \
+        else \
+                /sbin/depmod -a %1; \
+        fi \
+fi; \
+}
+
+# XMMS specific macros
+%xmms_prefix                  %(xmms-config --prefix)
+%xmms_exec_prefix             %(xmms-config --exec-prefix)
+%xmms_version                 %(xmms-config --version)
+%xmms_datadir                 %(xmms-config --data-dir)
+%xmms_plugindir               %(xmms-config --plugin-dir)
+%xmms_visualization_plugindir %(xmms-config --visualization-plugin-dir)
+%xmms_input_plugindir         %(xmms-config --input-plugin-dir)
+%xmms_output_plugindir        %(xmms-config --output-plugin-dir)
+%xmms_effect_plugindir        %(xmms-config --effect-plugin-dir)
+%xmms_general_plugindir       %(xmms-config --general-plugin-dir)
+
+%_target_base_arch     %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/')
+
+%x8664                 x86_64 amd64 ia32e
+
+# user/group checking macros
+#
+# Usage:
+#      %userremove myuser
+#
+%userremove    /usr/lib/rpm/user_group.sh user del
+%groupremove   /usr/lib/rpm/user_group.sh group del
+#
+# Usage:
+#      if %usertestrm myuser; then
+#              /usr/sbin/userdel -r myuser
+# Note:
+#      use these macros only if you need to call userdel/groupdel with
+#      a non-standard option or take an extra action; otherwise use the
+#      %userremove/%groupremove macros
+#
+%usertestrm    /usr/lib/rpm/user_group.sh user testrm
+%grouptestrm   /usr/lib/rpm/user_group.sh group testrm
+# user group membership management macros
+#
+# Usage:
+#      %addusertogroup myuser agroup
+#
+%addusertogroup        /usr/lib/rpm/user_group.sh user addtogroup
+
+# banner support (useful in {pre,post}{,un} and triggers)
+#
+# Usage:
+#      %banner name [-a] [-e] [-n] [-tn] <<EOF
+# the banner text, the banner text
+# the banner text, and following line
+#EOF
+# You can use any form of here-document, <<'EOF' <<-EOT will do.
+# NOTE: if your use "<<-EOF", then You can actually indent inside here-document.
+#
+# -a   - append to the banner
+# -e   - send to stderr instead of stdout
+# -n   - no show banner (overrides -t)
+# -t   - show only, if RPM_SCRIPTVERBOSITY >= n; default n=5
+%banner(aent:) \
+RPM_SCRIPTVERBOSITY=5 \
+[ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
+if [ -x /usr/bin/banner.sh ]; then \
+       CMD="/usr/bin/banner.sh %{-e:--stderr} %{!-n:$([ $RPM_SCRIPTVERBOSITY -ge %{-t:%{-t*}}%{!-t:5} ] && echo -s)} %{!-a:-m}%{-a:-M} %1" \
+else \
+       CMD="cat%{-e: >&2}" \
+fi \
+$CMD %2%{?3: %3} \
+%nil
+
+# useradd/groupadd macros written by glen@pld-linux.org.
+# All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
+#
+# Usage:
+#   %useradd [-P package] [-u uid] [-d home_dir] [-s shell] [-c comment]
+#   [-g initial_group] [-G group[,...]] login
+#
+#  -u uid. REQUIRED
+#  -g gid/group. REQUIRED
+#  -s defaults to /bin/false
+#  -d defaults to /usr/share/empty
+#  -c No default
+#  -r is accepted but ignored (it's always set)
+# rpm specific flags
+#  -P package name. defaults to %{name}
+#
+%useradd(c:d:e:f:g:G:Mmk:op:s:u:rP:) \
+%{!-u:%{error:useradd: Required argument -u missing}} \
+%{!-g:%{error:useradd: Required argument -g missing}} \
+%{!?1:%{error:useradd: Required parameter login missing}} \
+if [ -n "`/bin/id -u %{expand:%{%{#}}} 2>/dev/null`" ]; then \
+       if [ "`/bin/id -u %{expand:%{%{#}}}`" != "%{-u*}" ]; then \
+               echo "Error: user %{expand:%{%{#}}} doesn't have uid=%{-u*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \
+               exit 1 \
+       fi \
+else \
+       echo "Adding user %{expand:%{%{#}}} UID=%{-u*}." \
+       /usr/sbin/useradd \\\
+               -u %{-u*} \\\
+               -r \\\
+               -d %{-d*}%{!-d:/usr/share/empty} \\\
+               -s %{-s*}%{!-s:/bin/false} \\\
+               %{-c:-c "%(set -- %{-c*} %{*}; echo $1)"}\\\
+               -g %{-g*} \\\
+               %{-M} \\\
+               %{-G:-G %{-G*}} \\\
+               %{expand:%{%{#}}} 1>&2 \
+fi;
+
+# Usage:
+#   %groupadd [-P package] [-g gid] group
+#
+# -g gid. REQUIRED
+#
+# Sample:
+#   %groupadd -P %{name}-base -g %{gid} %{name}
+
+%groupadd(g:P:rfo)     \
+%{!-g:%{error:groupadd: Required argument -g missing}} \
+%{!?1:%{error:groupadd: Required parameter group missing}} \
+if [ -n "`/usr/bin/getgid %{1}`" ]; then \
+       if [ "`/usr/bin/getgid %{1}`" != "%{-g*}" ]; then \
+               echo "Error: group %{1} doesn't have gid=%{-g*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \
+               exit 1 \
+       fi \
+else \
+       echo "Adding group %{1} GID=%{-g*}." \
+       /usr/sbin/groupadd -g %{-g*} -r %{1} 1>&2 \
+fi;
+
+# apache_config_{install/uninstall} macros written by glen@pld-linux.org.
+# All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
+#
+# The config is installed/removed inside trigger, this means that you can any
+# time install apache1 or apache package and the configuration file is updated.
+# if you don't need the config for various reason for specific apache, just
+# remove the symlink from apache config directory. the trigger will not put the
+# config again to that version of apache. In other words the config is linked
+# to apache config directory on first install of PACKAGE or apache.
+#
+# should be called in trigger body:
+#  %triggerin -- apache1 >= 1.3.33-2
+#  %apache_config_install -v 1
+#
+# Add package's apache config to apache config.
+#
+# Usage:
+#   %apache_config_install -v {1|2} -c %{_sysconfdir}/apache-%{name}.conf -n 99
+#
+#  -v REQUIRED: specify apache version. can be 1 or 2.
+#  -c OPTIONAL: specify full path to PACKAGE's config. Defaults to %{_sysconfdir}/apache-%{name}.conf.
+#  -n OPTIONAL: specify config "slot". defaults to 99
+#
+# Internal macros. don't use ;).
+# expands apache config dir by apache version at build time.
+%__apache_confdir() %(if [ %{1} = 1 ]; then echo /etc/apache/conf.d; elif [ %{1} = 2 ]; then echo /etc/httpd/httpd.conf; else echo >&2 Unknown apache version specified; fi)
+# expands apache service name by apache version at build time.
+%__apache_svcname() %(if [ %{1} = 1 ]; then echo apache; elif [ %{1} = 2 ]; then echo httpd; else echo >&2 Unknown apache version specified; fi)
+
+%apache_config_install(v:c:n:) \
+%{!-v:%{error:apache_config_install: Required argument -v missing}} \
+%{?debug:set -x; echo "apache_config_install:%{-v*} %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
+if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{__apache_confdir %{-v*}} ]; then\
+       ln -sf %{-c*}%{!-c:%{_sysconfdir}/apache-%{name}.conf} %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf\
+fi\
+# reload apache if the config symlink is there\
+if [ -L %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf ]; then\
+       # additionally don't reload if target package (the webserver) is upgraded, as webserver is restarted anyway in %post \
+       if [ "$2" != "2" ] && [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then\
+               /etc/rc.d/init.d/%{__apache_svcname %{-v*}} reload 1>&2\
+       fi\
+fi\
+%{nil}
+
+# Remove package's apache config from apache config.
+#
+# Usage:
+#   %apache_config_uninstall -v {1|2} -n 99
+#
+#  -v REQUIRED: specify apache version. can be 1 or 2.
+#  -n OPTIONAL: specify config "slot". defaults to 99
+%apache_config_uninstall(v:n:) \
+%{!-v:%{error:apache_config_uninstall: Required argument -v missing}} \
+%{?debug:set -x; echo "apache_config_uninstall:%{-v*} %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
+# remove link if either of the packages are gone \
+if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
+       if [ -L %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf ]; then \
+               rm -f %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf \
+               if [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then \
+                       /etc/rc.d/init.d/%{__apache_svcname %{-v*}} reload 1>&2 \
+               fi \
+       fi \
+fi \
+%{nil}
+
+# see browser-plugins.spec / template-browser-plugin.spec
+# written by glen@pld-linux.org.
+%nsplugin_install(d:) { \
+# create link if it's first install of either of the packages \
+if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{-d*} ]; then \
+( \
+%( \
+       for file in %{*}; do \
+               echo echo Installing $file to %{-d*}; \
+               echo "ln -sf %{_libdir}/browser-plugins/$file %{-d*};"; \
+       done ) \
+) | ( %banner -t 5 -e %{name}-in ); fi; \
+}
+
+%nsplugin_uninstall(d:) { \
+# remove link if either of the packages are gone \
+if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
+( \
+%( \
+       for file in %{*}; do \
+               echo echo Removing $file from %{-d*}; \
+               echo "rm -f %{-d*}/$file;"; \
+       done ) \
+) | ( %banner -t 5 -e %{name}-un ); fi; \
+}
+
+# service macro.
+#
+# calls usual service restart on package %post, but skips the restart if
+# administrator has disabled automatic service restarts in either global
+# /etc/sysconfig/rpm or per service /etc/sysconfig/SERVICE file.
+#
+# written by glen@pld-linux.org.
+# All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
+#
+# Usage:
+#   %service [-q] SERVICE ACTION
+#
+#  -q be silent when service isn't started (for postun scriplets)
+#
+%service(q) {{ \
+# we use function, not to globber namespace with useless variables \
+skip_auto_restart() { \
+       . /etc/sysconfig/rpm; # global setting \
+       [ -f /etc/sysconfig/%1 ] && . /etc/sysconfig/%1; # per service setting \
+       echo ${RPM_SKIP_AUTO_RESTART:-no}; \
+}; \
+if [ -f /var/lock/subsys/%1 ]; then \
+       if [ $(skip_auto_restart) = no ]; then \
+               /etc/rc.d/init.d/%1 %2 1>&2; \
+       else \
+               echo 'Run "/etc/rc.d/init.d/%1 %2" to %2 %1 service.'; \
+       fi \
+else \
+       %{!-q:echo 'Run "/etc/rc.d/init.d/%1 start" to start %1 service.';} \
+       %{-q::;} \
+fi }; }
+
index 36d574a4e1be3ccdd10f800b7a93f9745afbc19c..cdfe1b21acd16c8504a082f5c69637ed006c1821 100644 (file)
@@ -1,14 +1,4 @@
 # PLD rpm macros
-
-%__id          @__ID@
-%__id_u                %{__id} -u
-%__chown_Rhf           @__CHOWN_RHF@
-%__chgrp_Rhf           @__CHGRP_RHF@
-
-%_fixowner       [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@
-%_fixgroup       true
-%_fixperms       %{__chmod} -Rf @FIXPERMS@
-
 %_exec_prefix    %{_prefix}
 %_bindir         %{_exec_prefix}/bin
 %_sbindir        %{_exec_prefix}/sbin
@@ -31,7 +21,6 @@
 %{__spec_install_post_compress_docs}\
 %{__spec_install_post_compress_modules}\
 %{__spec_install_post_py_hardlink}\
-%{__spec_install_post_perl_clean}\
 %{__arch_install_post}\
 %{nil}
 
index ff1f5e851061b037a00ee121206f672714d98267..4898a00a50188112ebfa8f79ce051559afd717ec 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -2,7 +2,7 @@
 # TODO:
 # - python(abi) cap is not provided automatically (because /usr/bin/python matches
 #   ELF first; it should be provided by python-libs not binary anyway)
-#
+# 
 # Conditional build:
 %bcond_with    static          # build static rpmi (not supported at the moment)
 %bcond_without apidocs         # don't generate documentation with doxygen
 %define        reqdb_ver       4.2.52-10
 %define        reqpopt_ver     1.10.2
 %define        beecrypt_ver    2:4.1.2-4
-%define        sover   4.4
-%define        find_lang_rev   1.23
+%define        rpm_macros_rev  1.235
 Summary:       RPM Package Manager
-Summary(de.UTF-8):     RPM Packet-Manager
-Summary(es.UTF-8):     Gestor de paquetes RPM
-Summary(pl.UTF-8):     Aplikacja do zarządzania pakietami RPM
-Summary(pt_BR.UTF-8):  Gerenciador de pacotes RPM
-Summary(ru.UTF-8):     Менеджер пакетов от RPM
-Summary(uk.UTF-8):     Менеджер пакетів від RPM
+Summary(de):   RPM Packet-Manager
+Summary(es):   Gestor de paquetes RPM
+Summary(pl):   Aplikacja do zarz±dzania pakietami RPM
+Summary(pt_BR):        Gerenciador de pacotes RPM
+Summary(ru):   íÅÎÅÄÖÅÒ ÐÁËÅÔÏ× ÏÔ RPM
+Summary(uk):   íÅÎÅÄÖÅÒ ÐÁËÅԦנצĠRPM
 Name:          rpm
+%define        sover   4.4
 Version:       4.4.2
-Release:       48
+Release:       4
 License:       GPL
 Group:         Base
 Source0:       ftp://jbj.org/pub/rpm-4.4.x/%{name}-%{version}.tar.gz
@@ -46,15 +46,15 @@ Source7:    %{name}-compress-doc
 Source8:       %{name}-check-files
 Source9:       %{name}-php-provides
 Source10:      %{name}-php-requires
-Source11:      find-java-req.sh
+Source11:      %{name}.macros
 Source12:      perl.prov
 Source13:      %{name}-user_group.sh
 Source14:      %{name}.sysconfig
-Source15:      %{name}-macros.java
-Source16:      find-java-prov.sh
-Source17:      RPM-GPG-KEY
+Source30:      builder
+Source31:      adapter.awk
+Source32:      pldnotify.awk
 # http://svn.pld-linux.org/banner.sh/
-Source18:      banner.sh
+Source33:      banner.sh
 Patch0:                %{name}-pl.po.patch
 Patch1:                %{name}-rpmrc.patch
 Patch2:                %{name}-arch.patch
@@ -74,7 +74,6 @@ Patch15:      %{name}-system_libs-more.patch
 Patch16:       %{name}-php-deps.patch
 Patch17:       %{name}-ldconfig-always.patch
 Patch18:       %{name}-perl_req.patch
-Patch19:       %{name}-error-fatal.patch
 Patch20:       %{name}-magic-usesystem.patch
 Patch21:       %{name}-dontneedutils.patch
 Patch22:       %{name}-provides-dont-obsolete.patch
@@ -93,7 +92,7 @@ Patch34:      %{name}-epoch0.patch
 Patch35:       %{name}-perl_req-INC_dirs.patch
 Patch36:       %{name}-debuginfo.patch
 Patch37:       %{name}-doxygen_hack.patch
-Patch38:       %{name}-kill-prereq.patch
+
 Patch39:       %{name}-pythondeps.patch
 Patch40:       %{name}-print-requires.patch
 Patch41:       %{name}-reduce-stack-usage.patch
@@ -103,25 +102,8 @@ Patch44:   %{name}-no-neon.patch
 Patch45:       %{name}-no-sqlite.patch
 Patch46:       %{name}-mono.patch
 Patch47:       %{name}-posttrans.patch
-Patch48:       %{name}-requireseq.patch
-Patch49:       %{name}-p4.patch
-Patch50:       %{name}-macros.patch
-Patch51:       %{name}-cleanlibdirs.patch
-Patch52:       %{name}-dep_whiteout.patch
-Patch53:       %{name}-doxygen_no_file.patch
-Patch54:       %{name}-truncate-cvslog.patch
-Patch55:       %{name}-bug-146549.patch
-Patch56:       %{name}-skip-backups.patch
-Patch57:       %{name}-lzma.patch
-Patch58:       %{name}-lzma2.patch
-Patch59:       %{name}-CVE-2006-5466.patch
-Patch60:       %{name}-as_needed-fix.patch
-Patch61:       %{name}-locale.patch
-Patch62:       %{name}-cpuinfo.patch
-Patch63:       %{name}-javadeps.patch
-Patch64:       http://wraptastic.org/pub/jbj/%{name}-4.4.2-suggests.patch
-Patch65:       %{name}-man_pl.patch
 URL:           http://wraptastic.org/
+Icon:          rpm.gif
 BuildRequires: autoconf >= 2.52
 BuildRequires: automake
 BuildRequires: beecrypt-devel >= %{beecrypt_ver}
@@ -129,6 +111,7 @@ BuildRequires:      bzip2-devel >= 1.0.2-17
 BuildRequires: db-devel >= %{reqdb_ver}
 %{?with_apidocs:BuildRequires: doxygen}
 BuildRequires: elfutils-devel >= 0.108
+BuildRequires: findutils
 BuildRequires: gettext-devel >= 0.11.4-2
 %{?with_system_libmagic:BuildRequires: libmagic-devel}
 %{?with_selinux:BuildRequires: libselinux-devel >= 1.18}
@@ -145,24 +128,23 @@ BuildRequires:    popt-devel >= %{reqpopt_ver}
 BuildRequires: python-modules >= 1:2.3
 BuildRequires: readline-devel
 BuildRequires: rpm-perlprov
-%{?with_python:BuildRequires:  rpm-pythonprov}
+BuildRequires: rpm-pythonprov
 BuildRequires: zlib-devel
 %if %{with static}
 # Require static library only for static build
 BuildRequires: beecrypt-static >= %{beecrypt_ver}
 BuildRequires: bzip2-static >= 1.0.2-17
 BuildRequires: db-static >= %{reqdb_ver}
-BuildRequires: elfutils-static
 BuildRequires: glibc-static >= 2.2.94
-%{?with_system_libmagic:BuildRequires: libmagic-static}
+BuildRequires: elfutils-static
+%{with_system_libmagic:BuildRequires:  libmagic-static}
 %{?with_selinux:BuildRequires: libselinux-static >= 1.18}
 BuildRequires: popt-static >= %{reqpopt_ver}
 BuildRequires: zlib-static
 %endif
-Requires:      %{name}-base = %{version}-%{release}
-Requires:      %{name}-lib = %{version}-%{release}
 Requires:      beecrypt >= %{beecrypt_ver}
 Requires:      popt >= %{reqpopt_ver}
+Requires:      %{name}-lib = %{version}-%{release}
 %{!?with_static:Obsoletes:     rpm-utils-static}
 Conflicts:     glibc < 2.2.92
 # avoid SEGV caused by mixed db versions
@@ -183,7 +165,6 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                __cpp %{?force_cpp}%{!?force_cpp:%{_target_cpu}-pld-linux-gcc -E}
 
 %define                _rpmlibdir /usr/lib/rpm
-%define                _noautocompressdoc      RPM-GPG-KEY
 
 %description
 RPM is a powerful package manager, which can be used to build,
@@ -191,75 +172,55 @@ install, query, verify, update, and uninstall individual software
 packages. A package consists of an archive of files, and package
 information, including name, version, and description.
 
-%description -l de.UTF-8
-RPM ist ein kräftiger Packet-Manager, der verwendet sein kann zur
+%description -l de
+RPM ist ein kräftiger Packet-Manager, der verwendet sein kann zur
 Installation, Anfrage, Verifizierung, Aktualisierung und
 Uninstallation individueller Softwarepakete. Ein Paket besteht aus
 einem Archiv Dateien und Paketinformation, inklusive Name, Version und
 Beschreibung.
 
-%description -l es.UTF-8
+%description -l es
 RPM es un poderoso administrador de paquetes, que puede ser usado para
 construir, instalar, pesquisar, verificar, actualizar y desinstalar
 paquetes individuales de software. Un paquete consiste en un
-almacenaje de archivos, y información sobre el paquete, incluyendo
-nombre, versión y descripción.
-
-%description -l pl.UTF-8
-RPM jest doskonałym programem zarządzającym pakietami. Umożliwia on
-przebudowanie, instalację czy weryfikację dowolnego pakietu.
-Informacje dotyczące każdego pakietu, takie jak jego opis, lista
-plików wchodzących w skład pakietu, zależności od innych pakietów, są
-przechowywane w bazie danych i można je uzyskać za pomocą opcji
+almacenaje de archivos, y información sobre el paquete, incluyendo
+nombre, versión y descripción.
+
+%description -l pl
+RPM jest doskona³ym programem zarz±dzaj±cym pakietami. Umo¿liwia on
+przebudowanie, instalacjê czy weryfikacjê dowolnego pakietu.
+Informacje dotycz±ce ka¿dego pakietu, takie jak jego opis, lista
+plików wchodz±cych w sk³ad pakietu, zale¿no¶ci od innych pakietów, s±
+przechowywane w bazie danych i mo¿na je uzyskaæ za pomoc± opcji
 odpytywania programu rpm.
 
-%description -l pt_BR.UTF-8
-RPM é um poderoso gerenciador de pacotes, que pode ser usado para
+%description -l pt_BR
+RPM é um poderoso gerenciador de pacotes, que pode ser usado para
 construir, instalar, pesquisar, verificar, atualizar e desinstalar
 pacotes individuais de software. Um pacote consiste de um conjunto de
-arquivos e informações adicionais, incluindo nome, versão e descrição
-do pacote, permissões dos arquivos, etc.
-
-%description -l ru.UTF-8
-RPM - это мощный менеджер пакетов, который может быть использован для
-создания, инсталляции, запросов (query), проверки, обновления и
-удаления программных пакетов. Пакет состоит из файлового архива и
-служебной информации, включающей название, версию, описание и другие
-данные о пакете.
-
-%description -l uk.UTF-8
-RPM - це потужний менеджер пакетів, що може бути використаний для
-створення, інсталяції, запитів (query), перевірки, поновлення та
-видалення програмних пакетів. Пакет складається з файлового архіву та
-службової інформації, що містить назву, версію, опис та іншу
-інформацію про пакет.
-
-%package base
-Summary:       RPM base package - scripts used by rpm packages themselves
-Summary(pl.UTF-8):     Podstawowy pakiet RPM - skrypty używane przez same pakiety rpm
-Group:         Base
-Obsoletes:     vserver-rpm
-
-%description base
-The RPM base package contains scripts used by rpm packages themselves.
-These include:
-- scripts for adding/removing groups and users needed for rpm
-  packages,
-- banner.sh to display %%banner messages from rpm scriptlets.
-
-%description base -l pl.UTF-8
-Pakiet podstawowy RPM zwiera skrypty używane przez same pakiety rpm.
-Zawiera on:
-- skrypty dodające/usuwające grupy i użytkowników dla pakietów rpm,
-- banner.sh do pokazywania komunikatów %%banner dla skryptletów rpm.
+arquivos e informações adicionais, incluindo nome, versão e descrição
+do pacote, permissões dos arquivos, etc.
+
+%description -l ru
+RPM - ÜÔÏ ÍÏÝÎÙÊ ÍÅÎÅÄÖÅÒ ÐÁËÅÔÏ×, ËÏÔÏÒÙÊ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁΠÄÌÑ
+ÓÏÚÄÁÎÉÑ, ÉÎÓÔÁÌÌÑÃÉÉ, ÚÁÐÒÏÓÏ× (query), ÐÒÏ×ÅÒËÉ, ÏÂÎÏ×ÌÅÎÉÑ É
+ÕÄÁÌÅÎÉÑ ÐÒÏÇÒÁÍÍÎÙÈ ÐÁËÅÔÏ×. ðÁËÅÔ ÓÏÓÔÏÉÔ ÉÚ ÆÁÊÌÏ×ÏÇÏ ÁÒÈÉ×Á É
+ÓÌÕÖÅÂÎÏÊ ÉÎÆÏÒÍÁÃÉÉ, ×ËÌÀÞÁÀÝÅÊ ÎÁÚ×ÁÎÉÅ, ×ÅÒÓÉÀ, ÏÐÉÓÁÎÉÅ É ÄÒÕÇÉÅ
+ÄÁÎÎÙÅ Ï ÐÁËÅÔÅ.
+
+%description -l uk
+RPM - ÃÅ ÐÏÔÕÖÎÉÊ ÍÅÎÅÄÖÅÒ ÐÁËÅÔ¦×, ÝÏ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÉÊ ÄÌÑ
+ÓÔ×ÏÒÅÎÎÑ, ¦ÎÓÔÁÌÑæ§, ÚÁÐÉԦנ(query), ÐÅÒÅצÒËÉ, ÐÏÎÏ×ÌÅÎÎÑ ÔÁ
+×ÉÄÁÌÅÎÎÑ ÐÒÏÇÒÁÍÎÉÈ ÐÁËÅÔ¦×. ðÁËÅÔ ÓËÌÁÄÁ¤ÔØÓÑ Ú ÆÁÊÌÏ×ÏÇÏ ÁÒȦ×Õ ÔÁ
+ÓÌÕÖÂÏ×ϧ ¦ÎÆÏÒÍÁæ§, ÝϠͦÓÔÉÔØ ÎÁÚ×Õ, ×ÅÒÓ¦À, ÏÐÉÓ ÔÁ ¦ÎÛÕ
+¦ÎÆÏÒÍÁæÀ ÐÒÏ ÐÁËÅÔ.
 
 %package lib
 Summary:       RPMs library
-Summary(pl.UTF-8):     Biblioteki RPM-a
+Summary(pl):   Biblioteki RPM-a
 Group:         Libraries
 Requires:      beecrypt >= %{beecrypt_ver}
 Requires:      db >= %{reqdb_ver}
-%{?with_system_libmagic:Requires:      libmagic >= 1.15-2}
 %{?with_selinux:Requires:      libselinux >= 1.18}
 Requires:      popt >= %{reqpopt_ver}
 Obsoletes:     rpm-libs
@@ -269,24 +230,23 @@ Conflicts:        poldek < 0.18.1-16
 %description lib
 RPMs library.
 
-%description lib -l pl.UTF-8
+%description lib -l pl
 Biblioteki RPM-a.
 
 %package devel
 Summary:       Header files for rpm libraries
-Summary(de.UTF-8):     Header-Dateien für rpm Libraries
-Summary(es.UTF-8):     Archivos de inclusión y bibliotecas para programas de manipulación de paquetes rpm
-Summary(pl.UTF-8):     Pliki nagłówkowe bibliotek rpm
-Summary(pt_BR.UTF-8):  Arquivos de inclusão e bibliotecas para programas de manipulação de pacotes RPM
-Summary(ru.UTF-8):     Хедеры и библиотеки для программ, работающих с rpm-пакетами
-Summary(uk.UTF-8):     Хедери та бібліотеки для програм, що працюють з пакетами rpm
+Summary(de):   Header-Dateien für rpm Libraries
+Summary(es):   Archivos de inclusión y bibliotecas para programas de manipulación de paquetes rpm
+Summary(pl):   Pliki nag³ówkowe bibliotek rpm
+Summary(pt_BR):        Arquivos de inclusão e bibliotecas para programas de manipulação de pacotes RPM
+Summary(ru):   èÅÄÅÒÙ É ÂÉÂÌÉÏÔÅËÉ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÒÁÂÏÔÁÀÝÉÈ Ó rpm-ÐÁËÅÔÁÍÉ
+Summary(uk):   èÅÄÅÒÉ ÔÁ Â¦Â̦ÏÔÅËÉ ÄÌÑ ÐÒÏÇÒÁÍ, ÝÏ ÐÒÁÃÀÀÔØ Ú ÐÁËÅÔÁÍÉ rpm
 Group:         Development/Libraries
 Requires:      %{name}-lib = %{version}-%{release}
 Requires:      beecrypt-devel >= %{beecrypt_ver}
 Requires:      bzip2-devel
 Requires:      db-devel >= %{reqdb_ver}
 Requires:      elfutils-devel
-%{?with_system_libmagic:Requires:      libmagic-devel}
 %{?with_selinux:Requires:      libselinux-devel}
 Requires:      popt-devel >= %{reqpopt_ver}
 Requires:      zlib-devel
@@ -298,87 +258,86 @@ creation of graphical package managers and other tools that need
 intimate knowledge of RPM packages. This package contains header files
 for these libraries.
 
-%description devel -l de.UTF-8
-Der RPM-Packensystem enthält eine C-Library, die macht es einfach
-RPM-Pakete und Dateibanken zu manipulieren. Er eignet sich für
+%description devel -l de
+Der RPM-Packensystem enthält eine C-Library, die macht es einfach
+RPM-Pakete und Dateibanken zu manipulieren. Er eignet sich für
 Vereinfachung des Schaffens grafischer Paket-Manager und anderer
 Werkzeuge, die intime Kenntnis von RPM-Paketen brauchen.
 
-%description devel -l es.UTF-8
+%description devel -l es
 El sistema de empaquetado RPM incluye una biblioteca C que vuelve
-fácil la manipulación de paquetes y bases de datos RPM. Su objetivo es
-facilitar la creación de administradores gráficos de paquetes y otras
+fácil la manipulación de paquetes y bases de datos RPM. Su objetivo es
+facilitar la creación de administradores gráficos de paquetes y otras
 herramientas que necesiten un conocimiento profundo de paquetes RPM.
 
-%description devel -l pl.UTF-8
-System RPM zawiera biblioteki C, które ułatwiają manipulowanie
-pakietami RPM oraz bazami danych. W zamiarze ma to uprościć tworzenie
-graficznych programów zarządzających pakietami oraz innych narzędzi,
-które wymagają szczegółowej wiedzy na temat pakietów RPM. Ten pakiet
-zawiera pliki nagłówkowe wspomnianych bibliotek.
-
-%description devel -l pt_BR.UTF-8
-O sistema de empacotamento RPM inclui uma biblioteca C que torna fácil
-a manipulação de pacotes e bases de dados RPM. Seu objetivo é
-facilitar a criação de gerenciadores gráficos de pacotes e outras
+%description devel -l pl
+System RPM zawiera biblioteki C, które u³atwiaj± manipulowanie
+pakietami RPM oraz bazami danych. W zamiarze ma to upro¶ciæ tworzenie
+graficznych programów zarz±dzaj±cych pakietami oraz innych narzêdzi,
+które wymagaj± szczegó³owej wiedzy na temat pakietów RPM. Ten pakiet
+zawiera pliki nag³ówkowe wspomnianych bibliotek.
+
+%description devel -l pt_BR
+O sistema de empacotamento RPM inclui uma biblioteca C que torna fácil
+a manipulação de pacotes e bases de dados RPM. Seu objetivo é
+facilitar a criação de gerenciadores gráficos de pacotes e outras
 ferramentas que precisem de conhecimento profundo de pacotes RPM.
 
-%description devel -l ru.UTF-8
-Система управления пакетами RPM содержит библиотеку C, которая
-упрощает манипуляцию пакетами RPM и соответствующими базами данных.
-Эта библиотека предназначена для облегчения создания графических
¿Ð°ÐºÐµÑ\82нÑ\8bÑ\85 Ð¼ÐµÐ½ÐµÐ´Ð¶ÐµÑ\80ов Ð¸ Ð´Ñ\80Ñ\83гиÑ\85 Ñ\83Ñ\82илиÑ\82, ÐºÐ¾Ñ\82оÑ\80Ñ\8bм Ð½ÐµÐ¾Ð±Ñ\85одимо Ñ\80абоÑ\82аÑ\82Ñ\8c Ñ\81
¿Ð°ÐºÐµÑ\82ами RPM.
+%description devel -l ru
+óÉÓÔÅÍÁ ÕÐÒÁ×ÌÅÎÉÑ ÐÁËÅÔÁÍÉ RPM ÓÏÄÅÒÖÉÔ ÂÉÂÌÉÏÔÅËÕ C, ËÏÔÏÒÁÑ
+ÕÐÒÏÝÁÅÔ ÍÁÎÉÐÕÌÑÃÉÀ ÐÁËÅÔÁÍÉ RPM É ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÍÉ ÂÁÚÁÍÉ ÄÁÎÎÙÈ.
+üÔÁ ÂÉÂÌÉÏÔÅËÁ ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÄÌÑ ÏÂÌÅÇÞÅÎÉÑ ÓÏÚÄÁÎÉÑ ÇÒÁÆÉÞÅÓËÉÈ
ÁËÅÔÎÙÈ ÍÅÎÅÄÖÅÒÏ× É ÄÒÕÇÉÈ ÕÔÉÌÉÔ, ËÏÔÏÒÙÍ ÎÅÏÂÈÏÄÉÍÏ ÒÁÂÏÔÁÔØ Ó
ÁËÅÔÁÍÉ RPM.
 
-%description devel -l uk.UTF-8
-Система керування пакетами RPM містить бібліотеку C, котра спрощує
-роботу з пакетами RPM та відповідними базами даних. Ця бібліотека
¿Ñ\80изнаÑ\87ена Ð´Ð»Ñ\8f Ð¿Ð¾Ð»ÐµÐ³Ñ\88еннÑ\8f Ñ\81Ñ\82воÑ\80еннÑ\8f Ð³Ñ\80аÑ\84Ñ\96Ñ\87ниÑ\85 Ð¿Ð°ÐºÐµÑ\82ниÑ\85 Ð¼ÐµÐ½ÐµÐ´Ð¶ÐµÑ\80Ñ\96в Ñ\82а
-інших утиліт, що працюють з пакетами RPM.
+%description devel -l uk
+óÉÓÔÅÍÁ ËÅÒÕ×ÁÎÎÑ ÐÁËÅÔÁÍÉ RPM Í¦ÓÔÉÔؠ¦Â̦ÏÔÅËÕ C, ËÏÔÒÁ ÓÐÒÏÝÕ¤
+ÒÏÂÏÔÕ Ú ÐÁËÅÔÁÍÉ RPM ÔÁ ×¦ÄÐÏצÄÎÉÍÉ ÂÁÚÁÍÉ ÄÁÎÉÈ. ãѠ¦Â̦ÏÔÅËÁ
ÒÉÚÎÁÞÅÎÁ ÄÌÑ ÐÏÌÅÇÛÅÎÎÑ ÓÔ×ÏÒÅÎÎÑ ÇÒÁƦÞÎÉÈ ÐÁËÅÔÎÉÈ ÍÅÎÅÄÖÅҦנÔÁ
+¦ÎÛÉÈ ÕÔÉ̦Ô, ÝÏ ÐÒÁÃÀÀÔØ Ú ÐÁËÅÔÁÍÉ RPM.
 
 %package static
 Summary:       RPM static libraries
-Summary(de.UTF-8):     RPMs statische Libraries
-Summary(pl.UTF-8):     Biblioteki statyczne RPM-a
-Summary(pt_BR.UTF-8):  Bibliotecas estáticas para o desenvolvimento de aplicações RPM
-Summary(ru.UTF-8):     Статическая библиотека для программ, работающих с rpm-пакетами
-Summary(uk.UTF-8):     Статична бібліотека для програм, що працюють з пакетами rpm
+Summary(de):   RPMs statische Libraries
+Summary(pl):   Biblioteki statyczne RPM-a
+Summary(pt_BR):        Bibliotecas estáticas para o desenvolvimento de aplicações RPM
+Summary(ru):   óÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÍ, ÒÁÂÏÔÁÀÝÉÈ Ó rpm-ÐÁËÅÔÁÍÉ
+Summary(uk):   óÔÁÔÉÞÎÁ Â¦Â̦ÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍ, ÝÏ ÐÒÁÃÀÀÔØ Ú ÐÁËÅÔÁÍÉ rpm
 Group:         Development/Libraries
 Requires:      %{name}-devel = %{version}-%{release}
 Requires:      beecrypt-static >= %{beecrypt_ver}
 Requires:      bzip2-static
 Requires:      db-static >= %{reqdb_ver}
 Requires:      elfutils-static
-%{?with_system_libmagic:Requires:      libmagic-static}
 Requires:      popt-static >= %{reqpopt_ver}
 Requires:      zlib-static
 
 %description static
 RPM static libraries.
 
-%description static -l de.UTF-8
+%description static -l de
 RPMs statische Libraries.
 
-%description static -l pl.UTF-8
+%description static -l pl
 Biblioteki statyczne RPM-a.
 
-%description static -l pt_BR.UTF-8
-Bibliotecas estáticas para desenvolvimento.
+%description static -l pt_BR
+Bibliotecas estáticas para desenvolvimento.
 
-%description static -l ru.UTF-8
-Система управления пакетами RPM содержит библиотеку C, которая
-упрощает манипуляцию пакетами RPM и соответствующими базами данных.
-Это статическая библиотека RPM.
+%description static -l ru
+óÉÓÔÅÍÁ ÕÐÒÁ×ÌÅÎÉÑ ÐÁËÅÔÁÍÉ RPM ÓÏÄÅÒÖÉÔ ÂÉÂÌÉÏÔÅËÕ C, ËÏÔÏÒÁÑ
+ÕÐÒÏÝÁÅÔ ÍÁÎÉÐÕÌÑÃÉÀ ÐÁËÅÔÁÍÉ RPM É ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÍÉ ÂÁÚÁÍÉ ÄÁÎÎÙÈ.
+üÔÏ ÓÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ RPM.
 
-%description static -l uk.UTF-8
-Система керування пакетами RPM містить бібліотеку C, котра спрощує
-роботу з пакетами RPM та відповідними базами даних. Це статична
-бібліотека RPM.
+%description static -l uk
+óÉÓÔÅÍÁ ËÅÒÕ×ÁÎÎÑ ÐÁËÅÔÁÍÉ RPM Í¦ÓÔÉÔؠ¦Â̦ÏÔÅËÕ C, ËÏÔÒÁ ÓÐÒÏÝÕ¤
+ÒÏÂÏÔÕ Ú ÐÁËÅÔÁÍÉ RPM ÔÁ ×¦ÄÐÏצÄÎÉÍÉ ÂÁÚÁÍÉ ÄÁÎÉÈ. ãÅ ÓÔÁÔÉÞÎÁ
+¦Â̦ÏÔÅËÁ RPM.
 
 %package utils
 Summary:       Additional utilities for managing rpm packages and database
-Summary(de.UTF-8):     Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken
-Summary(pl.UTF-8):     Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami
+Summary(de):   Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken
+Summary(pl):   Dodatkowe narzêdzia do zarz±dzania baz± RPM-a i pakietami
 Group:         Applications/File
 Requires:      %{name} = %{version}-%{release}
 Requires:      popt >= %{reqpopt_ver}
@@ -386,16 +345,16 @@ Requires: popt >= %{reqpopt_ver}
 %description utils
 Additional utilities for managing rpm packages and database.
 
-%description utils -l de.UTF-8
-Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken.
+%description utils -l de
+Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken.
 
-%description utils -l pl.UTF-8
-Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami.
+%description utils -l pl
+Dodatkowe narzêdzia do zarz±dzania baz± RPM-a i pakietami.
 
 %package utils-perl
 Summary:       Additional utilities for managing rpm packages and database
-Summary(de.UTF-8):     Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken
-Summary(pl.UTF-8):     Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami
+Summary(de):   Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken
+Summary(pl):   Dodatkowe narzêdzia do zarz±dzania baz± RPM-a i pakietami
 Group:         Applications/File
 Requires:      %{name}-utils = %{version}-%{release}
 Requires:      popt >= %{reqpopt_ver}
@@ -403,15 +362,15 @@ Requires: popt >= %{reqpopt_ver}
 %description utils-perl
 Additional utilities for managing rpm packages and database.
 
-%description utils-perl -l de.UTF-8
-Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken.
+%description utils-perl -l de
+Zusatzwerkzeuge für Verwaltung RPM-Pakete und Datenbanken.
 
-%description utils-perl -l pl.UTF-8
-Dodatkowe narzędzia do zarządzania bazą RPM-a i pakietami.
+%description utils-perl -l pl
+Dodatkowe narzêdzia do zarz±dzania baz± RPM-a i pakietami.
 
 %package utils-static
 Summary:       Static rpm utilities
-Summary(pl.UTF-8):     Statyczne narzędzia rpm
+Summary(pl):   Statyczne narzêdzia rpm
 Group:         Applications/System
 Requires:      %{name} = %{version}-%{release}
 
@@ -421,23 +380,22 @@ shared libraries used by rpm become broken. Currently it contains rpmi
 binary, which can be used to install/upgrade/remove packages without
 using shared libraries (well, in fact with exception of NSS modules).
 
-%description utils-static -l pl.UTF-8
-Statyczne narzędzia rpm do naprawy systemu w przypadku zepsucia czegoś
-związanego z bibliotekami współdzielonymi używanymi przez rpm-a.
-Aktualnie pakiet zawiera binarkę rpmi, którą można użyć do instalacji,
-uaktualniania lub usuwania pakietów bez udziału bibliotek statycznych
-(z wyjątkiem modułów NSS).
+%description utils-static -l pl
+Statyczne narzêdzia rpm do naprawy systemu w przypadku zepsucia czego¶
+zwi±zanego z bibliotekami wspó³dzielonymi u¿ywanymi przez rpm-a.
+Aktualnie pakiet zawiera binarkê rpmi, któr± mo¿na u¿yæ do instalacji,
+uaktualniania lub usuwania pakietów bez udzia³u bibliotek statycznych
+(z wyj±tkiem modu³ów NSS).
 
 %package build
 Summary:       Scripts for building binary RPM packages
-Summary(de.UTF-8):     Scripts fürs Bauen binärer RPM-Pakete
-Summary(pl.UTF-8):     Skrypty pomocnicze do budowania binarnych RPM-ów
-Summary(pt_BR.UTF-8):  Scripts e programas executáveis usados para construir pacotes
-Summary(ru.UTF-8):     Скрипты и утилиты, необходимые для сборки пакетов
-Summary(uk.UTF-8):     Скрипти та утиліти, необхідні для побудови пакетів
+Summary(de):   Scripts fürs Bauen binärer RPM-Pakete
+Summary(pl):   Skrypty pomocnicze do budowania binarnych RPM-ów
+Summary(pt_BR):        Scripts e programas executáveis usados para construir pacotes
+Summary(ru):   óËÒÉÐÔÙ É ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÓÂÏÒËÉ ÐÁËÅÔÏ×
+Summary(uk):   óËÒÉÐÔÉ ÔÁ ÕÔÉ̦ÔÉ, ÎÅÏÂȦÄΦ ÄÌÑ ÐÏÂÕÄÏ×É ÐÁËÅÔ¦×
 Group:         Applications/File
 Requires(pre): findutils
-Requires:      %{name}-build-macros >= 1.302
 Requires:      %{name}-utils = %{version}-%{release}
 Requires:      /bin/id
 Requires:      awk
@@ -465,7 +423,7 @@ Requires:   sed
 Requires:      sh-utils
 Requires:      tar
 Requires:      textutils
-Provides:      rpmbuild(find_lang) = %{find_lang_rev}
+Provides:      rpmbuild(macros) = %{rpm_macros_rev}
 Provides:      rpmbuild(monoautodeps)
 Provides:      rpmbuild(noauto) = 3
 %ifarch %{x8664}
@@ -476,60 +434,81 @@ Conflicts:        libtool < 2:1.5-13
 %description build
 Scripts for building binary RPM packages.
 
-%description build -l de.UTF-8
-Scripts fürs Bauen binärer RPM-Pakete.
+%description build -l de
+Scripts fürs Bauen binärer RPM-Pakete.
 
-%description build -l pl.UTF-8
-Skrypty pomocnicze do budowania binarnych RPM-ów.
+%description build -l pl
+Skrypty pomocnicze do budowania binarnych RPM-ów.
 
-%description build -l pt_BR.UTF-8
-Este pacote contém scripts e programas executáveis que são usados para
+%description build -l pt_BR
+Este pacote contém scripts e programas executáveis que são usados para
 construir pacotes usando o RPM.
 
-%description build -l ru.UTF-8
-Различные вспомогательные скрипты и исполняемые программы, которые
-используются для сборки RPM'ов.
+%description build -l ru
+òÁÚÌÉÞÎÙÅ ×ÓÐÏÍÏÇÁÔÅÌØÎÙÅ ÓËÒÉÐÔÙ É ÉÓÐÏÌÎÑÅÍÙÅ ÐÒÏÇÒÁÍÍÙ, ËÏÔÏÒÙÅ
+ÉÓÐÏÌØÚÕÀÔÓÑ ÄÌÑ ÓÂÏÒËÉ RPM'Ï×.
+
+%description build -l uk
+ò¦ÚÎÏÍÁΦÔΦ ÄÏÐÏͦÖΦ ÓËÒÉÐÔÉ ÔÁ ÕÔÉ̦ÔÉ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØÓÑ ÄÌÑ
+ÐÏÂÕÄÏ×É RPM'¦×.
+
+%package build-tools
+Summary:       Scripts for managing .spec files and building RPM packages
+Summary(de):   Scripts fürs Bauen binärer RPM-Pakete
+Summary(pl):   Skrypty pomocnicze do zarz±dznia plikami .spec i budowania RPM-ów
+Summary(pt_BR):        Scripts e programas executáveis usados para construir pacotes
+Summary(ru):   óËÒÉÐÔÙ É ÕÔÉÌÉÔÙ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÓÂÏÒËÉ ÐÁËÅÔÏ×
+Summary(uk):   óËÒÉÐÔÉ ÔÁ ÕÔÉ̦ÔÉ, ÎÅÏÂȦÄΦ ÄÌÑ ÐÏÂÕÄÏ×É ÐÁËÅÔ¦×
+Group:         Applications/File
+Requires:      %{name}-build = %{version}-%{release}
+# these are optional
+#Requires:     cvs
+Requires:      wget
 
-%description build -l uk.UTF-8
-Різноманітні допоміжні скрипти та утиліти, які використовуються для
-побудови RPM'ів.
+%description build-tools
+Scripts for managing .spec files and building RPM packages.
 
-%package javaprov
-Summary:       Additional utilities for checking Java provides/requires in rpm packages
-Group:         Applications/File
-Requires:      %{name} = %{version}-%{release}
-Requires:      file
-Requires:      findutils >= 1:4.2.26
-Requires:      mktemp
-Requires:      unzip
+%description build-tools -l de
+Scripts fürs Bauen RPM-Pakete.
 
-%description javaprov
-Additional utilities for checking Java provides/requires in rpm
-packages.
+%description build-tools -l pl
+Skrypty pomocnicze do zarz±dzania plikami .spec i do budowania RPM-ów.
+
+%description build-tools -l pt_BR
+Este pacote contém scripts e programas executáveis que são usados para
+construir pacotes usando o RPM.
+
+%description build-tools -l ru
+òÁÚÌÉÞÎÙÅ ×ÓÐÏÍÏÇÁÔÅÌØÎÙÅ ÓËÒÉÐÔÙ É ÉÓÐÏÌÎÑÅÍÙÅ ÐÒÏÇÒÁÍÍÙ, ËÏÔÏÒÙÅ
+ÉÓÐÏÌØÚÕÀÔÓÑ ÄÌÑ ÓÂÏÒËÉ RPM'Ï×.
+
+%description build-tools -l uk
+ò¦ÚÎÏÍÁΦÔΦ ÄÏÐÏͦÖΦ ÓËÒÉÐÔÉ ÔÁ ÕÔÉ̦ÔÉ, Ñ˦ ×ÉËÏÒÉÓÔÏ×ÕÀÔØÓÑ ÄÌÑ
+ÐÏÂÕÄÏ×É RPM'¦×.
 
 %package perlprov
-Summary:       Additional utilities for checking Perl provides/requires in rpm packages
-Summary(de.UTF-8):     Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen
-Summary(pl.UTF-8):     Dodatkowe narzędzia do sprawdzenia zależności skryptów perla w pakietach rpm
+Summary:       Additional utilities for checking perl provides/requires in rpm packages
+Summary(de):   Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen
+Summary(pl):   Dodatkowe narzêdzia do sprawdzenia zale¿no¶ci skryptów perla w pakietach rpm
 Group:         Applications/File
 Requires:      %{name} = %{version}-%{release}
 Requires:      perl-devel
 Requires:      perl-modules
 
 %description perlprov
-Additional utilities for checking Perl provides/requires in rpm
+Additional utilities for checking perl provides/requires in rpm
 packages.
 
-%description perlprov -l de.UTF-8
-Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen.
+%description perlprov -l de
+Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen.
 
-%description perlprov -l pl.UTF-8
-Dodatkowe narzędzia do sprawdzenia zależności skryptów Perla w
+%description perlprov -l pl
+Dodatkowe narzêdzia do sprawdzenia zale¿no¶ci skryptów perla w
 pakietach rpm.
 
 %package pythonprov
 Summary:       Python macros, which simplifies creation of rpm packages with Python software
-Summary(pl.UTF-8):     Makra ułatwiające tworzenie pakietów rpm z programami napisanymi w Pythonie
+Summary(pl):   Makra u³atwiaj±ce tworzenie pakietów rpm z programami napisanymi w Pythonie
 Group:         Applications/File
 Requires:      %{name} = %{version}-%{release}
 Requires:      python
@@ -539,29 +518,28 @@ Requires: python-modules
 Python macros, which simplifies creation of rpm packages with Python
 software.
 
-%description pythonprov -l pl.UTF-8
-Makra ułatwiające tworzenie pakietów rpm z programami napisanymi w
+%description pythonprov -l pl
+Makra u³atwiaj±ce tworzenie pakietów rpm z programami napisanymi w
 Pythonie.
 
 %package php-pearprov
 Summary:       Additional utilities for managing rpm packages and database
-Summary(pl.UTF-8):     Dodatkowe narzędzia do sprawdzania zależności skryptów php w rpm
+Summary(pl):   Dodatkowe narzêdzia do sprawdzania zale¿no¶ci skryptów php w rpm
 Group:         Applications/File
 Requires:      %{name} = %{version}-%{release}
-Requires:      sed >= 4.0
 
 %description php-pearprov
 Additional utilities for checking php pear provides/requires in rpm
 packages.
 
-%description php-pearprov -l pl.UTF-8
-Dodatkowe narzędzia do sprawdzenia zależności skryptów php pear w
+%description php-pearprov -l pl
+Dodatkowe narzêdzia do sprawdzenia zale¿no¶ci skryptów php pear w
 pakietach rpm.
 
 %package -n python-rpm
 Summary:       Python interface to RPM library
-Summary(pl.UTF-8):     Pythonowy interfejs do biblioteki RPM-a
-Summary(pt_BR.UTF-8):  Módulo Python para aplicativos que manipulam pacotes RPM
+Summary(pl):   Pythonowy interfejs do biblioteki RPM-a
+Summary(pt_BR):        Módulo Python para aplicativos que manipulam pacotes RPM
 Group:         Development/Languages/Python
 Requires:      %{name} = %{version}-%{release}
 %pyrequires_eq python
@@ -575,33 +553,33 @@ supplied by RPM (RPM Package Manager) libraries.
 This package should be installed if you want to develop Python
 programs that will manipulate RPM packages and databases.
 
-%description -n python-rpm -l pl.UTF-8
-Pakiet rpm-python zawiera moduł, który pozwala aplikacjom napisanym w
-Pythonie na używanie interfejsu dostarczanego przez biblioteki RPM-a.
+%description -n python-rpm -l pl
+Pakiet rpm-python zawiera modu³, który pozwala aplikacjom napisanym w
+Pythonie na u¿ywanie interfejsu dostarczanego przez biblioteki RPM-a.
 
-Pakiet ten powinien zostać zainstalowany, jeśli chcesz pisać w
-Pythonie programy manipulujące pakietami i bazami danych rpm.
+Pakiet ten powinien zostaæ zainstalowany, je¶li chcesz pisaæ w
+Pythonie programy manipuluj±ce pakietami i bazami danych rpm.
 
-%description -n python-rpm -l pt_BR.UTF-8
-O pacote rpm-python contém um módulo que permite que aplicações
+%description -n python-rpm -l pt_BR
+O pacote rpm-python contém um módulo que permite que aplicações
 escritas em Python utilizem a interface fornecida pelas bibliotecas
 RPM (RPM Package Manager).
 
-Esse pacote deve ser instalado se você quiser desenvolver programas em
+Esse pacote deve ser instalado se você quiser desenvolver programas em
 Python para manipular pacotes e bancos de dados RPM.
 
 %package apidocs
 Summary:       RPM API documentation and guides
-Summary(pl.UTF-8):     Documentacja API RPM-a i przewodniki
-Group:         Documentation
+Summary(pl):   Documentacja API RPM-a i przewodniki
+Group:         Documentation   
 
 %description apidocs
-Documentation for RPM API and guides in HTML format generated from rpm
-sources by doxygen.
+Documentation for RPM API and guides in HTML format generated
+from rpm sources by doxygen.
 
-%description apidocs -l pl.UTF-8
-Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
-źrodeł RPM-a przez doxygen.
+%description apidocs -l pl
+Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane
+ze ¼rode³ RPM-a przez doxygen.
 
 %prep
 %setup -q
@@ -624,9 +602,8 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
-#%patch19 -p1
 sed -e 's/^/@pld@/' %{SOURCE2} >>platform.in
-#cp -f platform.in macros.pld.in # what for?
+cp -f platform.in macros.pld.in
 echo '%%define __perl_provides %%{__perl} /usr/lib/rpm/perl.prov' > macros.perl
 echo '%%define __perl_requires %%{__perl} /usr/lib/rpm/perl.req' >> macros.perl
 echo '# obsoleted file' > macros.python
@@ -634,9 +611,11 @@ echo '%%define     __php_provides  /usr/lib/rpm/php.prov' > macros.php
 echo '%%define __php_requires  /usr/lib/rpm/php.req' >> macros.php
 echo '%%define __mono_provides /usr/lib/rpm/mono-find-provides' > macros.mono
 echo '%%define __mono_requires /usr/lib/rpm/mono-find-requires' >> macros.mono
+install %{SOURCE5} scripts/find-lang.sh
 install %{SOURCE9} scripts/php.prov.in
 install %{SOURCE10} scripts/php.req.in
 install %{SOURCE12} scripts/perl.prov
+cat %{SOURCE11} >> macros.in
 %patch20 -p1
 %patch21 -p1
 %patch22 -p1
@@ -655,7 +634,6 @@ install %{SOURCE12} scripts/perl.prov
 %patch35 -p0
 %patch36 -p1
 %patch37 -p1
-%patch38 -p1
 %patch39 -p1
 %patch40 -p1
 %patch41 -p1
@@ -665,31 +643,8 @@ install %{SOURCE12} scripts/perl.prov
 %patch45 -p1
 %patch46 -p1
 %patch47 -p1
-%patch48 -p1
-%patch49 -p1
-%patch50 -p1
-%patch51 -p1
-%patch52 -p1
 %patch0 -p1
 %patch3 -p1
-%if %{with system_libmagic}
-rm -rf file
-%patch53 -p1
-%endif
-%patch54 -p1
-%patch55 -p1
-%patch56 -p1
-%patch57 -p1
-%patch58 -p1
-%patch59 -p0
-%patch60 -p1
-%patch61 -p1
-%patch62 -p1
-%patch63 -p1
-%patch64 -p1
-%patch65 -p1
-cp %{SOURCE17} RPM-GPG-KEY
-install %{SOURCE5} scripts/find-lang.sh
 
 cd scripts
 mv -f perl.req perl.req.in
@@ -711,13 +666,9 @@ for f in doc{,/ja,/pl}/rpm.8 doc{,/ja,/pl}/rpmbuild.8 ; do
 done
 
 %build
-rev=$(awk '/^#.*Id:.*/{print $4}' scripts/find-lang.sh)
-if [ "$rev" != "%find_lang_rev" ]; then
-       : Update find_lang_rev define to $rev, and retry
-       exit 1
-fi
-
-%if %{without system_libmagic}
+%if %{with system_libmagic}
+rm -rf file
+%else
 cd file
 %{__libtoolize}
 %{__aclocal}
@@ -760,7 +711,7 @@ CPPFLAGS="-Dglob=rpm_glob -Dglobfree=rpm_globfree"; export CPPFLAGS
 %{__make} \
        pylibdir=%{py_libdir} \
        myLDFLAGS="%{rpmldflags}" \
-       file_LDFLAGS="" \
+       file_LDFLAGS= \
        debugedit_LDADD="\$(WITH_LIBELF_LIB) -lpopt"
 
 #      %{!?with_static:rpm_LDFLAGS="\$(myLDFLAGS)"} \
@@ -769,7 +720,7 @@ CPPFLAGS="-Dglob=rpm_glob -Dglobfree=rpm_globfree"; export CPPFLAGS
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/%{_lib},/etc/sysconfig,%{_sysconfdir}/rpm,/var/lib/banner}
+install -d $RPM_BUILD_ROOT{/%{_lib},/etc/sysconfig,%{_sysconfdir}/rpm}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT \
@@ -793,12 +744,12 @@ install %{SOURCE8} $RPM_BUILD_ROOT%{_rpmlibdir}/check-files
 install %{SOURCE13} $RPM_BUILD_ROOT%{_rpmlibdir}/user_group.sh
 install scripts/find-php*      $RPM_BUILD_ROOT%{_rpmlibdir}
 install scripts/php.{prov,req} $RPM_BUILD_ROOT%{_rpmlibdir}
-install %{SOURCE11} $RPM_BUILD_ROOT%{_rpmlibdir}/java-find-requires
-install %{SOURCE16} $RPM_BUILD_ROOT%{_rpmlibdir}/java-find-provides
-install %{SOURCE15} $RPM_BUILD_ROOT%{_rpmlibdir}/macros.java
 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/rpm
 
-install %{SOURCE18} $RPM_BUILD_ROOT%{_bindir}/banner.sh
+install %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/builder
+install %{SOURCE31} $RPM_BUILD_ROOT%{_bindir}/adapter.awk
+install %{SOURCE32} $RPM_BUILD_ROOT%{_bindir}/pldnotify.awk
+install %{SOURCE33} $RPM_BUILD_ROOT%{_bindir}/banner.sh
 
 install rpmio/ugid.h $RPM_BUILD_ROOT%{_includedir}/rpm
 
@@ -818,9 +769,6 @@ cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros <<EOF
 # SELinux file contexts policy instead of one stored in packages payload
 %%_install_file_context_path   %%{nil}
 %%_verify_file_context_path    %%{nil}
-
-# If non-zero, all erasures will be automagically repackaged.
-#%%_repackage_all_erasures    1
 EOF
 
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprovfiles <<EOF
@@ -831,8 +779,8 @@ cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoprov <<EOF
 EOF
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqfiles <<EOF
 # global list of files (regexps) which don't generate Requires
-^%{_examplesdir}/
-^%{_docdir}/
+^/usr/src/examples/
+^/usr/share/doc/
 EOF
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreq <<EOF
 # global list of script capabilities (regexps) not to be used in Requires
@@ -892,10 +840,6 @@ cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautoreqdep <<EOF
 ^libpsres.so
 ^libxkbfile.so
 ^libxkbui.so
-# -- fam / gamin
-^libfam.so.0
-# -- mDNSResponder-libs / avahi-compat-libdns_sd
-^libdns_sd.so.1
 EOF
 cat > $RPM_BUILD_ROOT%{_sysconfdir}/rpm/noautocompressdoc <<EOF
 # global list of file masks not to be compressed in DOCDIR
@@ -912,7 +856,7 @@ for a in librpm-%{sover}.so librpmdb-%{sover}.so librpmio-%{sover}.so ; do
 done
 
 # remove arch dependant macros which have no use on noarch
-%{__sed} -i -e '
+sed -i -e '
 /{__spec_install_post_strip}/d
 /{__spec_install_post_chrpath}/d
 /{__spec_install_post_compress_modules}/d
@@ -921,11 +865,9 @@ done
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
 
-for f in $RPM_BUILD_ROOT%{_datadir}/locale/{en_RN,eu_ES,gl,hu,ro,wa,zh,zh_CN.GB2312}/LC_MESSAGES/rpm.mo; do
-       [ -f "$f" ] || continue
+for f in $RPM_BUILD_ROOT%{_datadir}/locale/{en_RN,eu_ES,gl,hu,ro,wa,zh,zh_CN.GB2312}/LC_MESSAGES/rpm.mo ; do
        [ "`file $f | sed -e 's/.*,//' -e 's/message.*//'`" -le 1 ] && rm -f $f
 done
-
 %find_lang %{name}
 
 rm -rf manual
@@ -943,7 +885,8 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc RPM-GPG-KEY CHANGES manual/*
+%doc RPM-PGP-KEY CHANGES manual
+
 %attr(755,root,root) /bin/rpm
 #%attr(755,root,root) %{_bindir}/rpmdb
 #%attr(755,root,root) %{_bindir}/rpmquery
@@ -951,7 +894,8 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 #%attr(755,root,root) %{_bindir}/rpmverify
 
 %dir %{_sysconfdir}/rpm
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/macros
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/rpm/macros
+%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/rpm
 
 %{_mandir}/man8/rpm.8*
 %lang(fr) %{_mandir}/fr/man8/rpm.8*
@@ -966,25 +910,21 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %dir /var/lock/rpm
 /var/lock/rpm/transaction
 
+%dir %{_rpmlibdir}
 #%attr(755,root,root) %{_rpmlibdir}/rpmd
 #%{!?with_static:%attr(755,root,root) %{_rpmlibdir}/rpm[eiu]}
 #%attr(755,root,root) %{_rpmlibdir}/rpmk
 #%attr(755,root,root) %{_rpmlibdir}/rpm[qv]
 
 %doc %attr(755,root,root) %{_rpmlibdir}/convertrpmrc.sh
+%attr(755,root,root) %{_rpmlibdir}/user_group.sh
+
+%attr(755,root,root) %{_bindir}/banner.sh
 
 %{_rpmlibdir}/rpmrc
 %{_rpmlibdir}/rpmpopt*
 %{_rpmlibdir}/macros
 
-%files base
-%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rpm
-%dir %{_rpmlibdir}
-%attr(755,root,root) %{_bindir}/banner.sh
-%attr(755,root,root) %{_rpmlibdir}/user_group.sh
-%dir /var/lib/banner
-
 %files lib
 %defattr(644,root,root,755)
 %attr(755,root,root) /%{_lib}/librpm*-*.so
@@ -1049,7 +989,7 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 
 %files build
 %defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rpm/noauto*
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/rpm/noauto*
 %attr(755,root,root) %{_rpmlibdir}/compress-doc
 %attr(755,root,root) %{_rpmlibdir}/cross-build
 #%attr(755,root,root) %{_rpmlibdir}/find-provides
@@ -1083,6 +1023,10 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %ifarch alpha
 %{_rpmlibdir}/alpha*
 %endif
+%ifarch amd64
+%{_rpmlibdir}/amd64*
+%{_rpmlibdir}/x86_64*
+%endif
 %ifarch ia64
 %{_rpmlibdir}/ia64*
 %endif
@@ -1095,15 +1039,10 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %ifarch sparc sparc64
 %{_rpmlibdir}/sparc*
 %endif
-%ifarch %{x8664}
-%{_rpmlibdir}/amd64*
-%{_rpmlibdir}/x86_64*
-%endif
 # must be here for "Requires: rpm-*prov" to work
 %{_rpmlibdir}/macros.mono
 %{_rpmlibdir}/macros.perl
 %{_rpmlibdir}/macros.php
-%{_rpmlibdir}/macros.java
 # not used yet ... these six depend on perl
 #%attr(755,root,root) %{_rpmlibdir}/http.req
 #%attr(755,root,root) %{_rpmlibdir}/magic.prov
@@ -1113,6 +1052,7 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 #%{_rpmlibdir}/tcl.req
 %{_rpmlibdir}/trpm
 
+%attr(755,root,root) %{_bindir}/javadeps
 %attr(755,root,root) %{_bindir}/gendiff
 %attr(755,root,root) %{_bindir}/rpmbuild
 
@@ -1122,11 +1062,11 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %lang(pl) %{_mandir}/pl/man1/gendiff.1*
 %lang(pl) %{_mandir}/pl/man8/rpmbuild.8*
 
-%files javaprov
+%files build-tools
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/javadeps
-%attr(755,root,root) %{_rpmlibdir}/java-find-requires
-%attr(755,root,root) %{_rpmlibdir}/java-find-provides
+%attr(755,root,root) %{_bindir}/builder
+%attr(755,root,root) %{_bindir}/adapter.awk
+%attr(755,root,root) %{_bindir}/pldnotify.awk
 
 %files perlprov
 %defattr(644,root,root,755)
@@ -1151,13 +1091,12 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %if %{with python}
 %files -n python-rpm
 %defattr(644,root,root,755)
-%dir %{py_sitedir}/rpm
 %attr(755,root,root) %{py_sitedir}/rpm/*.so
-%{py_sitedir}/rpm/*.py[co]
+%attr(755,root,root) %{py_sitedir}/rpm/*.py[co]
 %endif
 
 %if %{with apidocs}
 %files apidocs
 %defattr(644,root,root,755)
-%doc apidocs/html/*
+%doc apidocs
 %endif
index 1ad0c52de40b6c26248cc656cb2d00cbb848fe41..6ec453a4486810c337883cecdf377f9c91077e54 100644 (file)
@@ -6,10 +6,13 @@
 # How verbose the .rpm scripts/triggers should be?
 RPM_SCRIPTVERBOSITY=5
 
-# Should unused users be removed at package deinstallation?
+# Should unused users be removed at package deinstalation?
 RPM_USERDEL=yes
 
 # Should automatic restarts from rpm upgrades be skipped?
-# You can also disable this per service, if service supports it from
-# /etc/sysconfig/SERVICE
-#RPM_SKIP_AUTO_RESTART=yes
+# You want to enable this if you have critical services running and lots of
+# packages trigger the service restart, like apache or php packages upgrade
+# could cause your service being interupted for serveral minutes depending how
+# (un)powerful your server hardware is.
+# You can also disable this per service, if service supports it from /etc/sysconfig/SERVICE
+RPM_SKIP_AUTO_RESTART=no
This page took 0.358381 seconds and 4 git commands to generate.