summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/2011-January/001604.html
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-January/001604.html')
-rw-r--r--zarb-ml/mageia-sysadm/2011-January/001604.html6093
1 files changed, 6093 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2011-January/001604.html b/zarb-ml/mageia-sysadm/2011-January/001604.html
new file mode 100644
index 000000000..605f17baf
--- /dev/null
+++ b/zarb-ml/mageia-sysadm/2011-January/001604.html
@@ -0,0 +1,6093 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [Mageia-sysadm] [231] import rpm-setup version cleaned by blino
+ </TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B231%5D%20import%20rpm-setup%20version%20cleaned%20by%20blino&In-Reply-To=%3C20110106173006.471AF41A80%40valstar.mageia.org%3E">
+ <META NAME="robots" CONTENT="index,nofollow">
+ <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
+ <LINK REL="Previous" HREF="002500.html">
+ <LINK REL="Next" HREF="001605.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[Mageia-sysadm] [231] import rpm-setup version cleaned by blino</H1>
+ <B>root at mageia.org</B>
+ <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B231%5D%20import%20rpm-setup%20version%20cleaned%20by%20blino&In-Reply-To=%3C20110106173006.471AF41A80%40valstar.mageia.org%3E"
+ TITLE="[Mageia-sysadm] [231] import rpm-setup version cleaned by blino">root at mageia.org
+ </A><BR>
+ <I>Thu Jan 6 18:30:06 CET 2011</I>
+ <P><UL>
+ <LI>Previous message: <A HREF="002500.html">[Mageia-sysadm] Installing and using mgarepo on 2010.1
+</A></li>
+ <LI>Next message: <A HREF="001605.html">[Mageia-sysadm] Upload failed for @188:mgarepo-1.9.3-1mdv2010.1.src.rpm
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#1604">[ date ]</a>
+ <a href="thread.html#1604">[ thread ]</a>
+ <a href="subject.html#1604">[ subject ]</a>
+ <a href="author.html#1604">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>Revision: 231
+Author: boklm
+Date: 2011-01-06 18:30:05 +0100 (Thu, 06 Jan 2011)
+Log Message:
+-----------
+import rpm-setup version cleaned by blino
+
+Added Paths:
+-----------
+ rpm/
+ rpm/rpm-setup/
+ rpm/rpm-setup/trunk/
+ rpm/rpm-setup/trunk/.perl_checker
+ rpm/rpm-setup/trunk/AUTHORS
+ rpm/rpm-setup/trunk/COPYING
+ rpm/rpm-setup/trunk/INSTALL
+ rpm/rpm-setup/trunk/Makefile.am
+ rpm/rpm-setup/trunk/NEWS
+ rpm/rpm-setup/trunk/README
+ rpm/rpm-setup/trunk/TODO
+ rpm/rpm-setup/trunk/autogen.sh
+ rpm/rpm-setup/trunk/brp-compress
+ rpm/rpm-setup/trunk/brp-strip
+ rpm/rpm-setup/trunk/brp-strip-comment-note
+ rpm/rpm-setup/trunk/brp-strip-static-archive
+ rpm/rpm-setup/trunk/build.macros.in
+ rpm/rpm-setup/trunk/configure.ac
+ rpm/rpm-setup/trunk/filter.sh
+ rpm/rpm-setup/trunk/find-debuginfo.sh
+ rpm/rpm-setup/trunk/find-lang.pl
+ rpm/rpm-setup/trunk/find-provides.in
+ rpm/rpm-setup/trunk/find-provides.perl.in
+ rpm/rpm-setup/trunk/find-requires.in
+ rpm/rpm-setup/trunk/gem_helper.rb
+ rpm/rpm-setup/trunk/git-repository--after-tarball
+ rpm/rpm-setup/trunk/git-repository--apply-patch
+ rpm/rpm-setup/trunk/http.req
+ rpm/rpm-setup/trunk/kmod.prov
+ rpm/rpm-setup/trunk/macros-perarch.in
+ rpm/rpm-setup/trunk/macros.in
+ rpm/rpm-setup/trunk/magic.prov
+ rpm/rpm-setup/trunk/magic.req
+ rpm/rpm-setup/trunk/make_arch_macrosfiles.sh.in
+ rpm/rpm-setup/trunk/perl.prov
+ rpm/rpm-setup/trunk/perl.req
+ rpm/rpm-setup/trunk/perl.req-from-meta
+ rpm/rpm-setup/trunk/php.prov
+ rpm/rpm-setup/trunk/php.req
+ rpm/rpm-setup/trunk/pkgconfigdeps.sh
+ rpm/rpm-setup/trunk/pythoneggs.py
+ rpm/rpm-setup/trunk/rpm-spec-mode.el
+ rpm/rpm-setup/trunk/rpmeval.c
+ rpm/rpm-setup/trunk/rpmgenplatform.in
+ rpm/rpm-setup/trunk/rpmrc.in
+ rpm/rpm-setup/trunk/rubygems.rb
+ rpm/rpm-setup/trunk/tests/
+ rpm/rpm-setup/trunk/tests/findlang.pl
+ rpm/rpm-setup/trunk/tests/findlang.sh
+ rpm/rpm-setup/trunk/tests/macros.sh
+ rpm/rpm-setup/trunk/tests.sh
+
+Added: rpm/rpm-setup/trunk/.perl_checker
+===================================================================
+--- rpm/rpm-setup/trunk/.perl_checker (rev 0)
++++ rpm/rpm-setup/trunk/.perl_checker 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,2 @@
++File::Find
++Pod::Usage
+
+Added: rpm/rpm-setup/trunk/AUTHORS
+===================================================================
+Added: rpm/rpm-setup/trunk/COPYING
+===================================================================
+Added: rpm/rpm-setup/trunk/INSTALL
+===================================================================
+--- rpm/rpm-setup/trunk/INSTALL (rev 0)
++++ rpm/rpm-setup/trunk/INSTALL 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,6 @@
++Basic instructions to build :
++ aclocal
++ libtoolize
++ automake -a
++ autoconf
++ ./configure
+
+Added: rpm/rpm-setup/trunk/Makefile.am
+===================================================================
+--- rpm/rpm-setup/trunk/Makefile.am (rev 0)
++++ rpm/rpm-setup/trunk/Makefile.am 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,155 @@
++# $Id: Makefile.am 271263 2010-11-01 23:20:42Z peroyvind $
++
++arch_macrosfiles = $(RPMALLARCH:=.macros)
++
++pkg_data =
++
++pkg_gdata = \
++ macros
++
++pkg_sysconf_macros_tmp = \
++ build.macros
++
++pkg_data_in = $(pkg_gdata:=.in)
++
++pkg_sysconf_macros_in = $(pkg_sysconf_macros_tmp:=.in)
++
++pkg_sysconf_macros = $(pkg_sysconf_macros_tmp)
++
++pkg_gconfig = \
++ platform \
++ $(if $(CANONTARGETCPU32), platform32, )
++
++pkg_scripts = \
++ brp-compress \
++ brp-strip \
++ brp-strip-comment-note \
++ brp-strip-static-archive \
++ filter.sh \
++ find-lang.pl \
++ find-debuginfo.sh \
++ gem_helper.rb \
++ git-repository--after-tarball \
++ git-repository--apply-patch \
++ http.req \
++ magic.prov \
++ magic.req \
++ kmod.prov \
++ perl.prov \
++ perl.req \
++ perl.req-from-meta \
++ php.prov \
++ php.req \
++ pkgconfigdeps.sh \
++ pythoneggs.py \
++ rubygems.rb
++
++pkg_gscripts = \
++ find-provides \
++ find-requires \
++ find-provides.perl
++
++pkg_scripts_in = $(pkg_gscripts:=.in)
++
++BUILT_SOURCES = macros-perarch make_arch_macrosfiles.sh rpmgenplatform
++
++pkglibdir = @RPMVENDORDIR@
++
++noinst_PROGRAMS = rpmeval
++
++rpmeval_SOURCES = rpmeval.c
++
++rpmeval_LDFLAGS = -lrpm
++
++noinst_DATA = $(pkg_gconfig)
++
++pkglib_DATA = \
++ $(pkg_data) \
++ $(pkg_gdata)
++ $(pkg_gconfig)
++
++pkglib_SCRIPTS = \
++ $(pkg_scripts) \
++ $(pkg_gscripts)
++
++EXTRA_DIST = \
++ $(pkg_data) \
++ $(pkg_data_in) \
++ $(pkg_sysconf_macros_in) \
++ $(pkg_scripts) \
++ $(pkg_scripts_in) \
++ macros-perarch.in make_arch_macrosfiles.sh.in \
++ rpmgenplatform.in rpmrc.in \
++ rpm-spec-mode.el \
++ tests.sh tests/macros.sh \
++ tests/findlang.pl tests/findlang.sh
++
++edit = sed \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMVENDOR</A>\@,$(RPMVENDOR),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMVENDORDIR</A>\@,$(RPMVENDORDIR),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMCANONVENDOR</A>\@,$(RPMCANONVENDOR),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMLIBDIR</A>\@,$(RPMLIBDIR),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMSYSCONFDIR</A>\@,$(RPMSYSCONFDIR),g'\
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMOS</A>\@,$(RPMOS),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at CANONTARGETCPU</A>\@,$(CANONTARGETCPU),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at CANONTARGETGNU</A>\@,$(CANONTARGETGNU),g' \
++ -e '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMALLARCH</A>\@,$(RPMALLARCH),g'
++
++%: %.in Makefile
++ $(edit) $&lt; &gt; $@
++
++$(arch_macrosfiles): rpmrc macros-perarch make_arch_macrosfiles.sh
++ arch=`echo $@ | sed 's,\\.macros,,'`; \
++ sh ./make_arch_macrosfiles.sh macros-perarch $$arch &gt; $@
++
++platform: rpmgenplatform Makefile
++ perl rpmgenplatform $(CANONTARGETCPU) &gt; $@
++
++platform32: rpmgenplatform Makefile
++ perl rpmgenplatform $(CANONTARGETCPU32) &gt; $@
++
++install-data-local: $(arch_macrosfiles) $(pkg_gconfig) $(pkg_sysconf_macros_tmp)
++if ONLY_RPMRC
++ echo &quot;not installing per-arch macros which are already in rpmrc and standard rpm per-arch macros&quot;
++else
++ for i in $(RPMALLARCH); do \
++ $(mkinstalldirs) $(DESTDIR)$(RPMVENDORDIR)/platform/$${i}-$(RPMOS); \
++ $(install_sh_DATA) $${i}.macros $(DESTDIR)$(RPMVENDORDIR)/platform/$${i}-$(RPMOS)/macros; \
++ done
++endif
++ [ -d $(DESTDIR)$(RPMSYSCONFDIR)/macros.d ] || $(mkinstalldirs) $(DESTDIR)$(RPMSYSCONFDIR)/macros.d
++ for i in $(pkg_sysconf_macros); do \
++ $(install_sh_DATA) $${i} $(DESTDIR)$(RPMSYSCONFDIR)/macros.d/$${i}; \
++ done
++if RPMPLATFORM
++ for i in $(pkg_gconfig); do \
++ $(install_sh_DATA) $${i} $(DESTDIR)$(RPMSYSCONFDIR)/$${i}; \
++ done
++ $(install_sh_SCRIPT) rpmgenplatform $(DESTDIR)$(bindir)/rpmgenplatform
++endif
++
++.PHONY: ChangeLog test
++
++ChangeLog:
++ @if [ -e &quot;.svn&quot; ]; then \
++ $(MAKE) ChangeLog-svn; \
++ elif [ -e &quot;.git&quot; ]; then \
++ $(MAKE) ChangeLog-git; \
++ else \
++ echo &quot;Unknown SCM (not SVN nor GIT)&quot;;\
++ exit 1; \
++ fi;
++
++ChangeLog-svn:
++ LC_ALL=C svn2cl
++ rm -f *.bak
++
++ChangeLog-git:
++ @git2cl &gt;ChangeLog
++
++test: $(pkg_gdata) $(pkg_gscripts) $(arch_macrosfiles) $(pkg_gconfig)
++ sh tests.sh
++
++CLEANFILES = $(pkg_gdata) $(pkg_gscripts) $(arch_macrosfiles) $(pkg_gconfig)\
++ rpmrc macros-perarch $(pkg_sysconf_macros_tmp) \
++ make_arch_macrosfiles.sh
+
+Added: rpm/rpm-setup/trunk/NEWS
+===================================================================
+--- rpm/rpm-setup/trunk/NEWS (rev 0)
++++ rpm/rpm-setup/trunk/NEWS 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,113 @@
++Version 1.113 - 2 November 2010, by Funda Wang
++- find gstreamer provides
++
++Version 1.112 - 1 November 2010, by Per &#216;yvind Karlsen
++- enable python egg provides/requires.
++
++Version 1.111 - 30 October 2010, by Anssi Hannula
++- generate requires on &quot;python(abi) = x.y&quot; instead of &quot;python &gt;= x.y&quot; for
++ python modules to properly handle the strict dependency
++- remove runtime dependencies from %py_requires as they are now handled
++ automatically
++
++Version 1.110 - 18 October 2010, by Per &#216;yvind Karlsen
++- fix warning from rubygems.rb
++- drop %gem_unpack, equivalent behaviour has been implemented in %setup now
++
++Version 1.109 - 16 October 2010, by Per &#216;yvind Karlsen
++- don't install dependencies for gems when using %gem_install
++- fix build with rpm 5.3
++
++Version 1.108 - 16 October 2010, by Per &#216;yvind Karlsen
++- add gem_helper.rb and it's corresponding macros %gem_unpack, %gem_build &amp;
++ gem_install for simplifying &amp; streamlining ruby gem packaging.
++
++Version 1.107 - 9 September 2010, by Per &#216;yvind Karlsen
++- enable automatic dependency extraction for ruby gems
++
++Version 1.106 - 16 July 2010, by Jerome Quelin
++- extract perl module version when $Full::Package::VERSION is set
++
++Version 1.105 - 14 July 2010, by Jerome Quelin
++- support to extract perl runtime requires from meta spec 2
++
++Version 1.104 - 27 April 2010, by Christophe Fergeau
++- revert previous '-g' addition when stripping shared libraries since it
++ increases shared library sizes by 10 to 20% for no good reason
++
++Version 1.103 - 16 April 2010, by Per &#216;yvind Karlsen
++- strip shared libraries with the '-g' option
++
++Version 1.102 - 8 April 2010, by Michael Scherer
++- do not requires python 2.X branch rpm for python 3.X modules,
++ requires instead python 3.X interpreter
++
++Version 1.101 - 26 March 2010, by Jerome Quelin
++- fix find-requires to call perl.req-from-meta with the correct meta
++ file when there are multiple meta file in the package
++
++Version 1.100 - 14 March 2010, by Jerome Quelin
++- fix find-requires to look for correct meta.yml before calling
++ perl.req-from-meta
++- make perl.prov skip comment lines
++
++Version 1.99 - 9 March 2010, by Per &#216;yvind Karlsen
++- allow for for only stripping files without creating debug package contents by
++ setting DISABLE_DEBUG environment variable.
++
++Version 1.98 - 5 March 2010, by Per &#216;yvind Karlsen
++- Update find-debuginfo.sh from upstream
++- new script: perl.req-from-meta (jquelin)
++
++Version 1.97 - 12 December 2009, by Anssi Hannula
++- fix package build when the debug package is empty (regression introduded in
++ 1.96)
++
++Version 1.96 - 10 December 2009, by Anssi Hannula
++- fix perl.prov to assign versions to provides when the version is declared
++ with 'our' or 'my' keyword, or when it is prepended with code
++ (J&#233;r&#244;me Quelin)
++- replace %sunsparc with %sparc &amp; %sparcx (from rpm5.org, Per &#216;yvind Karlsen)
++- support ELF executables only as a.out has been deprecated since ages
++ ago (fixes objdump 'File format not recognized' errors) (Per &#216;yvind Karlsen)
++- don't try finding debug files in buildroot when there's none
++ (Per &#216;yvind Karlsen)
++
++Version 1.95 - 25 September 2009, by Olivier Blin
++- MIPS and ARM support (from Arnaud Patard):
++ o add mipsel support
++ o introduce CANONTARGETGNU, to be able to use -gnueabi for ARM
++ o add arm support and use -gnueabi instead of -gnu
++
++Version 1.94 - 8 August 2009, by Anssi Hannula
++- update perl_convert_version to keep alphabetic tail in version number
++ (Luca Berra)
++
++Version 1.93 - 28 July 2009, by Christophe Fergeau
++- update perl_convert_version macro (J&#233;r&#244;me Quelin)
++
++Version 1.92 - 9 July 2009, by Christophe Fergeau
++- making sure automatic provides &amp; requires for perl package are using the
++ new macro %perl_convert_version (jquelin)
++- rpm5 fixes (peroyvind)
++
++Version 1.91 - 3 February 2009, by Christophe Fergeau
++- build.macros.in
++ o add new perl_convert_version macro to convert cpan version to rpm version
++- git-repository--after-tarball:
++ o commit the tarball with user &quot;unknown author &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">cooker at mandrivalinux.org</A>&gt;&quot;
++ o commit the tarball using the tarball's modification time
++
++Version 1.90 - 29 January 2009, by Pixel
++
++- call patch with -U (aka --unified-reject-files)
++
++Version 1.89 - 29 January 2009, by Pixel
++
++- when %_with_git_repository is set, define %_after_setup and %_patch to use
++ the new scripts git-repository--after-tarball and git-repository--apply-patch
++
++Version 1.88 - 7 January 2009, by Christophe Fergeau
++
++- fix ugly warning during invocation of php.req
++- RPM5 fixes
+
+Added: rpm/rpm-setup/trunk/README
+===================================================================
+--- rpm/rpm-setup/trunk/README (rev 0)
++++ rpm/rpm-setup/trunk/README 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,37 @@
++rpm-mageia-setup
++$Id: README 22754 2007-02-22 13:03:02Z nanardon $
++
++This package contains configuration and script for the Mageia rpm.
++
++Some file come from .in, this allow to transform path for testing purpose.
++If your file or script contains path, you should make a .in files.
++
++* About macros:
++Only redefine macros in this package if the rpm one does not please to you.
++
++All macros having same body should go into macros.in.
++If the macros body change:
++- add a symbolic value into macros-perarch.in (@foo@)
++- add the value into make_macrosfiles.sh.in
++
++Example:
++%_libdir /use/%_lib =&gt; macros.in
++%_lib lib|lib64 =&gt; macros-perarch.in
++
++* Testing the monster
++
++o First and easy way:
++$ make test
++
++o Live tests:
++
++$ ./configure --with-rpmconfdir=$fakeroot --with-rpmlibdir=/usr/lib/rpm --with-rpmsysconfdir=/etc
++
++This will configure the package for an installation into fakeroot, using rpm files in /usr/lib/rpm.
++$ make
++$ make install
++
++Now we can say to rpm to use fake config:
++rpm --rcfile $fakeroot/mageia/rpmrc other command...
++
++Happy Hacking
+
+Added: rpm/rpm-setup/trunk/TODO
+===================================================================
+--- rpm/rpm-setup/trunk/TODO (rev 0)
++++ rpm/rpm-setup/trunk/TODO 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,3 @@
++- add tests, tests, and tests !
++- rewrite kmod.prov in perl, would make the script clearer
++
+
+Added: rpm/rpm-setup/trunk/autogen.sh
+===================================================================
+--- rpm/rpm-setup/trunk/autogen.sh (rev 0)
++++ rpm/rpm-setup/trunk/autogen.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,5 @@
++#!/bin/sh
++libtoolize --force --copy
++aclocal
++autoconf
++automake -a -c
+
+
+Property changes on: rpm/rpm-setup/trunk/autogen.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/brp-compress
+===================================================================
+--- rpm/rpm-setup/trunk/brp-compress (rev 0)
++++ rpm/rpm-setup/trunk/brp-compress 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,58 @@
++#!/bin/sh
++
++# $Id: brp-compress 11488 2005-04-29 03:14:31Z othauvin $
++
++# If using normal root, avoid changing anything.
++if [ -z &quot;$RPM_BUILD_ROOT&quot; -o &quot;$RPM_BUILD_ROOT&quot; = &quot;/&quot; ]; then
++ exit 0
++fi
++
++cd $RPM_BUILD_ROOT
++
++# Compress man pages
++COMPRESS=&quot;bzip2 -9&quot;
++COMPRESS_EXT=.bz2
++
++for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
++ ./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
++ ./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
++ ./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
++do
++ [ -d $d ] || continue
++ for f in `find $d -type f`
++ do
++ [ -f &quot;$f&quot; ] || continue
++ [ &quot;`basename $f`&quot; = &quot;dir&quot; ] &amp;&amp; continue
++
++ case &quot;$f&quot; in
++ *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
++ *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
++ *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
++ *) b=$f;;
++ esac
++
++ $COMPRESS $b &lt;/dev/null 2&gt;/dev/null || {
++ inode=`ls -i $b | awk '{ print $1 }'`
++ others=`find $d -type f -inum $inode`
++ if [ -n &quot;$others&quot; ]; then
++ for afile in $others ; do
++ [ &quot;$afile&quot; != &quot;$b&quot; ] &amp;&amp; rm -f $afile
++ done
++ $COMPRESS -f $b
++ for afile in $others ; do
++ [ &quot;$afile&quot; != &quot;$b&quot; ] &amp;&amp; ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
++ done
++ else
++ $COMPRESS -f $b
++ fi
++ }
++ done
++
++ for f in `find $d -type l`
++ do
++ l=`ls -l $f | sed -e 's/.* -&gt; //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
++ rm -f $f
++ b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
++ ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
++ done
++done
+
+
+Property changes on: rpm/rpm-setup/trunk/brp-compress
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/brp-strip
+===================================================================
+--- rpm/rpm-setup/trunk/brp-strip (rev 0)
++++ rpm/rpm-setup/trunk/brp-strip 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,13 @@
++#!/bin/sh
++# If using normal root, avoid changing anything.
++if [ -z &quot;$RPM_BUILD_ROOT&quot; -o &quot;$RPM_BUILD_ROOT&quot; = &quot;/&quot; ]; then
++ exit 0
++fi
++
++# Strip ELF binaries
++for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
++ grep -v &quot;^${RPM_BUILD_ROOT}/\?usr/lib/debug&quot; | \
++ grep -v ' shared object,' | \
++ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
++ strip -g $f || :
++done
+
+
+Property changes on: rpm/rpm-setup/trunk/brp-strip
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/brp-strip-comment-note
+===================================================================
+--- rpm/rpm-setup/trunk/brp-strip-comment-note (rev 0)
++++ rpm/rpm-setup/trunk/brp-strip-comment-note 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,18 @@
++#!/bin/sh
++# If using normal root, avoid changing anything.
++if [ -z &quot;$RPM_BUILD_ROOT&quot; -o &quot;$RPM_BUILD_ROOT&quot; = &quot;/&quot; ]; then
++ exit 0
++fi
++
++# Strip .comment and .note sections (the latter only if it is not allocated)
++# for already stripped elf files in the build root
++for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
++ grep -v &quot;^${RPM_BUILD_ROOT}/\?usr/lib/debug&quot; | \
++ sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
++ note=&quot;-R .note&quot;
++ if objdump -h $f 2&gt;/dev/null | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
++ grep ALLOC &gt;/dev/null; then
++ note=
++ fi
++ strip -R .comment $note $f || :
++done
+
+
+Property changes on: rpm/rpm-setup/trunk/brp-strip-comment-note
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/brp-strip-static-archive
+===================================================================
+--- rpm/rpm-setup/trunk/brp-strip-static-archive (rev 0)
++++ rpm/rpm-setup/trunk/brp-strip-static-archive 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,13 @@
++#!/bin/sh
++
++if [ -z &quot;$RPM_BUILD_ROOT&quot; -o &quot;$RPM_BUILD_ROOT&quot; = &quot;/&quot; ]; then
++ exit 0
++fi
++
++# Strip static libraries.
++for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \
++ grep -v &quot;^${RPM_BUILD_ROOT}/\?usr/lib/debug&quot; | \
++ grep 'current ar archive' | \
++ sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p'`; do
++ strip -g $f
++done
+
+
+Property changes on: rpm/rpm-setup/trunk/brp-strip-static-archive
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/build.macros.in
+===================================================================
+--- rpm/rpm-setup/trunk/build.macros.in (rev 0)
++++ rpm/rpm-setup/trunk/build.macros.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,349 @@
++
++%__gzip /usr/bin/gzip
++
++%_sys_macros_dir @RPMSYSCONFDIR@/macros.d
++%build_sysmacrospath() %{_sys_macros_dir}/%{?1:%{1}}%{?!1:%{name}}.macros
++
++# [Pixel, Dec 2008] deprecated, to remove as soon as rpm 4.6.0 dust settles down
++%defaultbuildroot %{_tmppath}/%{name}-%{version}-%{release}-buildroot
++
++
++# when %_with_git_repository is set, these macros modify the behaviour of &quot;%prep&quot; step:
++%_after_setup %{?_with_git_repository:GIT_URL=&quot;%{?git_url}&quot; GIT_REPOSITORY_CACHE=%{?git_repository_cache} @RPMVENDORDIR@/git-repository--after-tarball}
++%_patch %{?_with_git_repository:PKG_NAME=%{name} @RPMVENDORDIR@/git-repository--apply-patch}%{?!_with_git_repository:%__patch -U}
++
++# used by &quot;git-repository--after-tarball&quot;:
++%git_repository_cache %_topdir/%{name}.git
++
++
++# Various programs used in rpm scripts
++%_update_desktop_database_bin %{_bindir}/update-desktop-database
++%_update_mime_database_bin %{_bindir}/update-mime-database
++%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache
++%_gconftool_bin %{_bindir}/gconftool-2
++%_scrollkeeper_bin %{_bindir}/scrollkeeper-update
++
++%__service /sbin/service
++%__chkconfig /sbin/chkconfig
++
++#==============================================================================
++# ---- Required rpmrc macros.
++# Macros that used to be initialized as a side effect of rpmrc parsing.
++# These are the default values that can be overridden by other
++# (e.g. per-platform, per-system, per-packager, per-package) macros.
++#
++
++%debug_package_and_restore %{debug_package} \
++%package __restore__\
++Summary: %{summary}\
++Group: %{group}\
++%description __restore__
++
++%ix86 i386 i486 i586 i686 pentium3 pentium4 athlon k6
++
++%sparc sun4 sun4m sun4c sun4d sun4u sparcv9b sparcv9v2 %{sparcx}
++%sparcx sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
++
++# Multilibs
++%_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$
++
++%_arch_tag_suffix (%_lib)
++%arch_tagged() %{1}%{_arch_tag_suffix} %{?2:%{2} %{3}%{?!3:%{error:undefined 3rd argument in arch_tagged}}}
++
++# Games macros
++%_gamesdir games
++%_gamesbindir %{_prefix}/%{_gamesdir}
++%_gamesdatadir %{_datadir}/%{_gamesdir}
++
++# Menu directories
++%_menudir %{_prefix}/lib/menu
++%_iconsdir %{_datadir}/icons
++%_miconsdir %{_datadir}/icons/mini
++%_liconsdir %{_datadir}/icons/large
++
++%_xfontdir %_datadir/fonts
++
++%_webconfdir %{_sysconfdir}/httpd/conf
++%_webappconfdir %_webconfdir/webapps.d
++# compatibility
++%webappconfdir %_webappconfdir
++
++#==============================================================================
++# ---- Build configuration macros.
++#
++# Package version macro.
++# The type of package to produce, for compatibility with legacy
++# versions of rpm.
++#
++# Script gets packaged file list on input.
++# Returns list of multiarch files that are not marked as such,
++# i.e. files in $RPM_BUILD_ROOT that have arch-dependent values
++#
++# Note: Disable (by commenting out) for legacy compatibility.
++#%__check_multiarch_files @RPMLIBDIR@/check-multiarch-files %{buildroot}
++
++# Use internal dependency generator rather than external helpers?
++%_use_internal_dependency_generator 0
++
++%__find_provides @RPMVENDORDIR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @RPMVENDORDIR@/find-provides
++%__find_requires @RPMVENDORDIR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @RPMVENDORDIR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}
++
++%find_lang @RPMVENDORDIR@/find-lang.pl %{buildroot}
++
++# stuff below has been deprecated by rpm filetriggers [June 2008]
++%update_menus %{nil}
++%clean_menus %{nil}
++%update_desktop_database %{nil}
++%clean_desktop_database %{nil}
++%update_mime_database %{nil}
++%clean_mime_database %{nil}
++%update_scrollkeeper %{nil}
++%clean_scrollkeeper %{nil}
++
++# Update Menu
++%_update_menus_bin %{_bindir}/update-menus
++
++# Update Window Managers session.
++%_fndsession_bin %{_sbindir}/fndSession
++%make_session %{nil}
++%make_dm_session if [ -x %{_fndsession_bin} ]; then %{_fndsession_bin} || true ; fi \
++%{nil}
++
++# For rebuilding gcj-db
++%_rebuildgcjdb_bin %{_bindir}/rebuild-gcj-db
++%update_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
++%{nil}
++
++%clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \
++%{nil}
++
++# Rebuild icon cache
++#
++# following themes are handled through filetriggers:
++%icon_cache_through_filetrigger_hicolor 1
++%icon_cache_through_filetrigger_gnome 1
++%icon_cache_through_filetrigger_oxygen 1
++
++%update_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} ]; then \
++%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true; fi \
++%%{nil}}}
++
++%clean_icon_cache() %{expand: %%{!?icon_cache_through_filetrigger_%1:if [ -x %%{_update_icon_cache_bin} -a -r %%{_iconsdir}/%%{1}/index.theme ]; then \
++%%{_update_icon_cache_bin} --force --quiet %%{_iconsdir}/%%{1} || true ; fi \
++%%{nil}}}
++
++# GConf schemas:
++# installation is handled by filetriggers
++%post_install_gconf_schemas() %{nil}
++# but uninstall still need to be done in %preun:
++%preun_uninstall_gconf_schemas() if [ &quot;$1&quot; = &quot;0&quot; -a -x %{_gconftool_bin} ]; then \
++SCHEMAS=&quot;&quot; \
++for SCHEMA in %{*} ; do \
++ SCHEMAS=&quot;$SCHEMAS %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas&quot; \
++done \
++GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} --makefile-uninstall-rule $SCHEMAS &gt; /dev/null || true ; fi \
++%{nil}
++
++# Mageia Linux version
++# - &quot;9.1&quot; =&gt; 910
++# - &quot;10.2.2&quot; =&gt; 1022
++# (user may copy the following line in specfile)
++%mgaversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_=&quot;$1$2&quot;.($3||0)' /etc/release)
++
++%distsuffix mga
++
++%mkrel(c:) %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}%{?distsuffix:%distsuffix}%{?!distsuffix:mga}%{?distro_release:%distro_release}
++
++#==============================================================================
++# ---- Build policy macros.
++#
++#---------------------------------------------------------------------
++# Expanded at end of %install scriptlet.
++#
++
++%__os_install_post \
++ %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \
++%{nil}
++
++%__debug_install_post \
++ @RPMVENDORDIR@/find-debuginfo.sh &quot;%{_builddir}/%{?buildsubdir}&quot;\
++%{nil}
++
++
++#==============================================================================
++# ---- specfile macros.
++# Macro(s) here can be used reliably for reproducible builds.
++# (Note: Above is the goal, below are the macros under development)
++#
++
++%old_makeinstall \
++ make \\\
++ prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
++ exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
++ bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
++ sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
++ sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
++ datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
++ includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
++ libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
++ libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
++ localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
++ sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
++ mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
++ infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
++ install
++
++
++#------------------------------------------------------------------------------
++# Useful python macros
++%pyver %(python -V 2&gt;&amp;1 | cut -f2 -d&quot; &quot; | cut -f1,2 -d&quot;.&quot;)
++
++#------------------------------------------------------------------------------
++# Useful perl macros
++# (initially from Artur Frysiak &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">wiget at t17.ds.pwr.wroc.pl</A>&gt;)
++# (modified by Pixel &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">pixel at mandriva.com</A>&gt;)
++#
++# [...]
++# Group: Development/Perl
++# [...]
++# %build
++# perl Makefile.PL INSTALLDIRS=vendor
++# %make
++# [...]
++# %install
++# rm -rf $RPM_BUILD_ROOT
++# make install PREFIX=&quot;$RPM_BUILD_ROOT/%{prefix}&quot;
++# [...]
++# %files
++# %defattr(644,root,root,755)
++# %{perl_vendorlib}/CGI
++# or
++# %{perl_vendorarch}/DBI
++# %{perl_vendorarch}/auto/DBI
++# %{_mandir}/*/*
++#
++
++
++%perl_convert_version() %(perl -Mversion -le '
++ $x = &quot;%{1}&quot;;
++ $y = $x;
++ $x =~ s/[[:alpha:]]*$//;
++ $y =~ s/^$x//;
++ $x =~ s/\D*$//;
++ $v = version-&gt;new($x)-&gt;normal;
++ $v =~ s/^v//;
++ print &quot;$v$y&quot;;
++')
++
++# kept for compatibility, but should not be used, especially the ugly perl_archlib!
++%perl_sitearch %(eval &quot;`perl -V:installsitearch`&quot;; echo $installsitearch)
++%perl_archlib %(eval &quot;`perl -V:installarchlib`&quot;; echo $installarchlib)
++
++#--------------------------------------------------------------------------------
++# Macro from conectiva
++
++%rename() \
++Obsoletes: %{1} &lt; %{version}-%{release} \
++Provides: %{1} = %{version}-%{release}
++
++# Shorthand for %{defined with_...}
++# macros provided by rpm 4.4, but buggy :(
++%_with() %{expand: %%{?_with_%1:1} %%{!?_with_%1: %%{?_without_%1:0} %%{!?_without_%1: %%{?with_%1:%%{with_%1}} %%{!?with_%1: %%{?without_%1:!%%{without_%1}} %%{!?without_%1: %%{?2:%%2} %%{!?2:1} } } } } }
++%_without() !%{expand: %%{with %1 %{?2:%2}}}
++
++%_package_i18n(g:f:) \
++%%package -n %{?1:%{1}}%{?!1:%{name}}-i18n\
++Summary: Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
++License: %{license}\
++Group: %{?-g:%{-g*}}%{?!-g:%{group}}\
++\
++%%description -n %{?1:%{1}}%{?!1:%{name}}-i18n\
++Internationalization and locale data for %{?1:%{1}}%{?!1:%{name}}\
++\
++%%files -n %{?1:%{1}}%{?!1:%{name}}-i18n %{?-f:%{-f}}%{?!-f:-f %{?1:%{1}}%{?!1:%{name}}.lang}\
++%{nil}
++
++
++#------------------------------------------------------------------------------
++# Python specific macros
++
++# (from rpm 4.4.6)
++%python_sitearch %(%{__python} -c &quot;from distutils.sysconfig import get_python_lib; print get_python_lib(1)&quot;)
++%python_sitelib %(%{__python} -c &quot;from distutils.sysconfig import get_python_lib; print get_python_lib()&quot;)
++%python_version %(%{__python} -c &quot;import sys; print(sys.version[0:3])&quot;)
++
++# More Python specific macro definitions (originally from PLD).
++#
++%py_ver %(python -c &quot;import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v&quot; 2&gt;/dev/null || echo PYTHON-NOT-FOUND)
++%py_prefix %(python -c &quot;import sys; print sys.prefix&quot; 2&gt;/dev/null || echo PYTHON-NOT-FOUND)
++# backward compatibility
++%py_libdir %py_purelibdir
++%py_platlibdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=1)' 2&gt;/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
++%py_purelibdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1,plat_specific=0)' 2&gt;/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
++%py_incdir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()' 2&gt;/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
++%py_sitedir %py_puresitedir
++%py_platsitedir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)' 2&gt;/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
++%py_puresitedir %(python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()' 2&gt;/dev/null || echo PYTHON-LIBDIR-NOT-FOUND)
++
++%py_compile(O) \
++find %1 -name '*.pyc' -exec rm -f {} \\; \
++python -c &quot;import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)&quot; %1 \
++%{-O: \
++find %1 -name '*.pyo' -exec rm -f {} \\; \
++python -O -c &quot;import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)&quot; %1 \
++}
++%py_requires(d) \
++BuildRequires: python %{-d:python-devel}
++
++
++#------------------------------------------------------------------------------
++# Ocaml macro
++#
++
++%ocaml_sitelib %(if [ -x /usr/bin/ocamlc ]; then ocamlc -where;fi)/site-lib
++
++#------------------------------------------------------------------------------
++# Ruby gem macros
++#
++
++%__gem_helper @RPMVENDORDIR@/gem_helper.rb
++
++%gem_build(f:j:) \
++ %__gem_helper build \\\
++ %{-f:-f%{-f*}} \\\
++ %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
++
++%gem_install(i:n:C) \
++ DESTDIR=${DESTDIR:-%{buildroot}} \\\
++ %__gem_helper install \\\
++ --env-shebang --rdoc --ri --force --ignore-dependencies \\\
++ %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\
++ %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\
++ %{!-C:--fix-permissions}
++
++#------------------------------------------------------------------------------
++# Redefine RPM sections to allow jumping over them using &quot;--without &lt;section&gt;&quot;.
++# This an interesting alternative to --short-circuit.
++# The following are mostly equivalent:
++# % rpmbuild -bi --short-circuit foo.spec &amp;&amp; rpmbuild -bb --short-circuit foo.spec
++# % rpmbuild -bb --without build foo.spec
++
++%prep %%prep \
++[ %{_with prep} -eq 1 ] || exit 0 \
++[ %{_with build} -eq 1 ] || exit 0 \
++[ %{_with install} -eq 1 ] || exit 0 \
++%{nil}
++
++%build %%build \
++[ %{_with install} -eq 1 ] || exit 0 \
++[ %{_with build} -eq 1 ] || exit 0 \
++%{nil}
++
++%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package_and_restore}}}\
++%%install\
++[ %{_with install} -eq 1 ] || exit 0 \
++%{nil}
++
++%check %%check \
++[ %{_with check} -eq 1 ] || exit 0 \
++%{nil}
+
+Added: rpm/rpm-setup/trunk/configure.ac
+===================================================================
+--- rpm/rpm-setup/trunk/configure.ac (rev 0)
++++ rpm/rpm-setup/trunk/configure.ac 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,168 @@
++# -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++# $Id: configure.ac 271266 2010-11-04 10:43:28Z fwang $
++
++AC_PREREQ(2.59)
++AC_INIT(rpm-mageia-setup, 1.114, <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">nanardon at mageia.org</A>)
++AC_CANONICAL_TARGET
++AM_INIT_AUTOMAKE(1.9 -Wno-portability)
++AC_CONFIG_SRCDIR
++
++# Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++AC_PROG_LIBTOOL
++AC_CONFIG_FILES([
++ Makefile
++ ])
++
++dnl See if we have pkgconfig for rpm, resort to old behavior if not
++PKG_CHECK_MODULES([RPM], [rpm], [
++ AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
++ CPPFLAGS=&quot;$RPM_CFLAGS $CPPFLAGS&quot;
++ LDFLAGS=&quot;$RPM_LIBS $LDFLAGS&quot;
++ ], [
++ AC_PATH_PROG(RPM_PATH,rpm,none)
++ if test &quot;$RPM_PATH&quot; = &quot;none&quot;; then
++ AC_MSG_ERROR([RPM executable was not found in your system])
++ else
++ AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
++ fi
++ ]
++)
++
++AC_CHECK_LIB([rpmio], [rpmLoadMacroFile])
++AC_HEADER_STDC
++AC_CHECK_HEADERS([string.h rpm/rpmmacro.h rpm/rpmlib.h rpm/rpmio.h rpm/rpmtag.h])
++
++CANONTARGETCPU=${target_cpu}
++CANONTARGETGNU=-gnu
++
++case &quot;${target_cpu}&quot; in
++ *86|athlon|k6|pentium*)
++ RPMALLARCH=&quot;i386 i486 i586 i686 k6 athlon pentium3 pentium4&quot;
++ CANONTARGETCPU=i586
++ ;;
++ x86_64|amd64)
++ RPMALLARCH=&quot;i386 i486 i586 i686 k6 athlon pentium3 pentium4 amd64 x86_64&quot;
++ CANONTARGETCPU=x86_64
++ CANONTARGETCPU32=i586
++ ;;
++ ppc|powerpc)
++ RPMALLARCH=&quot;ppc&quot;
++ CANONTARGETCPU=ppc
++ ;;
++ ppc64|powerpc64)
++ RPMALLARCH=&quot;ppc ppc32 ppc64&quot;
++ CANONTARGETCPU=ppc64
++ ;;
++ sparc|sparcv9)
++ RPMALLARCH=&quot;sparc&quot;
++ CANONTARGETCPU=sparc
++ ;;
++ sparc64)
++ RPMALLARCH=&quot;sparc sparc64&quot;
++ CANONTARGETCPU=sparc64
++ ;;
++ mipsel)
++ RPMALLARCH=&quot;mipsel mips32el mips64el&quot;
++ CANONTARGETCPU=mipsel
++ ;;
++ armv4tl)
++ RPMALLARCH=&quot;arml armv4tl&quot;
++ CANONTARGETCPU=armv4tl
++ CANONTARGETGNU=-gnueabi
++ ;;
++ armv5tl)
++ RPMALLARCH=&quot;arml armv4tl armv5tl&quot;
++ CANONTARGETCPU=armv5tl
++ CANONTARGETGNU=-gnueabi
++ ;;
++ # some armv5te cpu have buggy instruction so better disable
++ # the &quot;e&quot; extension
++ armv5tel)
++ RPMALLARCH=&quot;arml armv4tl armv5tel armv5tl&quot;
++ CANONTARGETCPU=armv5tl
++ CANONTARGETGNU=-gnueabi
++ ;;
++ armv7l)
++ RPMALLARCH=&quot;arml armv4tl armv5tl armv5tel armv7l&quot;
++ CANONTARGETCPU=armv7l
++ CANONTARGETGNU=-gnueabi
++esac
++RPMALLARCH=&quot;${RPMALLARCH} noarch&quot;
++AC_SUBST(RPMALLARCH)
++AC_SUBST(CANONTARGETCPU)
++AC_SUBST(CANONTARGETCPU32)
++AC_SUBST(CANONTARGETGNU)
++
++#
++# get rid of the 4-th tuple, if config.guess returned &quot;linux-gnu&quot; for build_os
++#
++if echo &quot;$build_os&quot; | grep '.*-gnulibc1' &gt; /dev/null ; then
++ build_os=`echo &quot;${build_os}&quot; | sed 's/-gnulibc1$//'`
++fi
++if echo &quot;$build_os&quot; | grep '.*-gnu' &gt; /dev/null ; then
++ build_os=`echo &quot;${build_os}&quot; | sed 's/-gnu$//'`
++fi
++
++changequote(&lt;, &gt;)
++build_os_exact=&quot;${build_os}&quot;
++build_os_major=`echo &quot;${build_os}&quot; | sed 's/\..*$//'`
++build_os_noversion=`echo &quot;${build_os}&quot; | sed 's/[0-9]*\..*$//'`
++changequote([, ])
++
++dnl Find our os
++RPMOS=&quot;$build_os_noversion&quot;
++AC_SUBST(RPMOS)
++
++# Checks for library functions.
++RPMVENDOR=&quot;Mageia&quot;
++AC_ARG_WITH(vendor, [ --with-vendor the vendor of this config ])
++if test $with_vendor; then
++ RPMVENDOR=$with_vendor
++fi
++AC_SUBST(RPMVENDOR)
++
++RPMCANONVENDOR=`echo &quot;${RPMVENDOR}&quot; | tr [A-Z] [a-z]`
++AC_SUBST(RPMCANONVENDOR)
++
++if test X&quot;$prefix&quot; = XNONE ; then
++ usrprefix=&quot;$ac_default_prefix&quot;
++else
++ usrprefix=$prefix
++fi
++
++RPMLIBDIR=&quot;${usrprefix}/lib/rpm&quot;
++AC_ARG_WITH(rpmlibdir, [ --with-rpmlibdir=dir location of rpm config file ])
++if test $with_rpmlibdir; then
++ RPMLIBDIR=$with_rpmlibdir
++fi
++AC_SUBST(RPMLIBDIR)
++
++RPMCONFDIR=${RPMLIBDIR}
++AC_ARG_WITH(rpmconfdir, [ --with-rpmconfdir=dir location of our config ])
++if test $with_rpmconfdir; then
++ RPMCONFDIR=$with_rpmconfdir
++fi
++AC_SUBST(RPMCONFDIR)
++
++RPMVENDORDIR=&quot;${RPMCONFDIR}/${RPMCANONVENDOR}&quot;
++AC_SUBST(RPMVENDORDIR)
++
++RPMSYSCONFDIR=&quot;/etc/rpm&quot;
++AC_ARG_WITH(rpmsysconfdir, [ --with-rpmsysconfdir=dir location of etc ])
++if test $with_rpmsysconfdir; then
++ RPMSYSCONFDIR=$with_rpmsysconfdir
++fi
++AC_SUBST(RPMSYSCONFDIR)
++
++
++AC_ARG_WITH(rpmplatform, [ --with-rpmplatform use /etc/rpm/platform ])
++AM_CONDITIONAL([RPMPLATFORM],[test $with_rpmplatform])
++
++AC_ARG_WITH(only-rpmrc, [ --with-only-rpmrc rpm uses rpmrc ])
++AM_CONDITIONAL([ONLY_RPMRC],[test $with_only_rpmrc])
++
++AC_OUTPUT
+
+Added: rpm/rpm-setup/trunk/filter.sh
+===================================================================
+--- rpm/rpm-setup/trunk/filter.sh (rev 0)
++++ rpm/rpm-setup/trunk/filter.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,36 @@
++#!/bin/sh
++#---------------------------------------------------------------
++# Project : Mageia
++# Module : rpm
++# File : filter.sh
++# Version : $Id: filter.sh 227371 2007-09-08 15:34:39Z anssi $
++# Author : Frederic Lepied
++# Created On : Tue May 13 15:45:17 2003
++# Purpose : filter using grep and first argument the
++# command passed as the rest of the command line
++#---------------------------------------------------------------
++
++GREP_ARG=&quot;$1&quot;
++FILE_GREP_ARG=&quot;$2&quot;
++BUILDROOT=&quot;$3&quot;
++PROG=&quot;$4&quot;
++shift 4
++
++# use ' ' to signify no arg as rpm filter empty strings from
++# command line :(
++if [ &quot;$FILE_GREP_ARG&quot; != ' ' ]; then
++ # get rid of double and trailing slashes
++ BUILDROOT=&quot;$(echo &quot;$BUILDROOT&quot; | perl -pe 's,/+,/,g;s,/$,,')&quot;
++ perl -pe &quot;s,^$BUILDROOT,,&quot; | grep -v &quot;$FILE_GREP_ARG&quot; | perl -pe &quot;s,^,$BUILDROOT,&quot;
++else
++ cat
++fi | \
++$PROG &quot;$@&quot; | \
++if [ &quot;$GREP_ARG&quot; != ' ' ]; then
++ grep -v &quot;$GREP_ARG&quot;
++else
++ cat
++fi
++exit 0
++
++# filter.sh ends here
+
+
+Property changes on: rpm/rpm-setup/trunk/filter.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/find-debuginfo.sh
+===================================================================
+--- rpm/rpm-setup/trunk/find-debuginfo.sh (rev 0)
++++ rpm/rpm-setup/trunk/find-debuginfo.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,353 @@
++#!/bin/bash
++#find-debuginfo.sh - automagically generate debug info and file list
++#for inclusion in an rpm spec file.
++#
++# Usage: find-debuginfo.sh [--strict-build-id] [-g]
++# [-o debugfiles.list]
++# [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
++# [builddir]
++#
++# The -g flag says to use strip -g instead of full strip on DSOs.
++# The --strict-build-id flag says to exit with failure status if
++# any ELF binary processed fails to contain a build-id note.
++#
++# A single -o switch before any -l or -p switches simply renames
++# the primary output file from debugfiles.list to something else.
++# A -o switch that follows a -p switch or some -l switches produces
++# an additional output file with the debuginfo for the files in
++# the -l filelist file, or whose names match the -p pattern.
++# The -p argument is an grep -E -style regexp matching the a file name,
++# and must not use anchors (^ or $).
++#
++# All file names in switches are relative to builddir (. if not given).
++#
++
++debugedit=/usr/lib/rpm/debugedit
++if [ ! -x $debugedit ]; then
++ # rpm5 since 5.2 has moved these binaries to a separate 'bin' subdirectory
++ if [ -x /usr/lib/rpm/bin/debugedit ]; then
++ debugedit=/usr/lib/rpm/bin/debugedit
++ fi
++fi
++
++# With -g arg, pass it to strip on libraries.
++strip_g=false
++
++# Barf on missing build IDs.
++strict=false
++
++BUILDDIR=.
++out=debugfiles.list
++nout=0
++while [ $# -gt 0 ]; do
++ case &quot;$1&quot; in
++ --strict-build-id)
++ strict=true
++ ;;
++ -g)
++ strip_g=true
++ ;;
++ -o)
++ if [ -z &quot;${lists[$nout]}&quot; -a -z &quot;${ptns[$nout]}&quot; ]; then
++ out=$2
++ else
++ outs[$nout]=$2
++ ((nout++))
++ fi
++ shift
++ ;;
++ -l)
++ lists[$nout]=&quot;${lists[$nout]} $2&quot;
++ shift
++ ;;
++ -p)
++ ptns[$nout]=$2
++ shift
++ ;;
++ *)
++ BUILDDIR=$1
++ shift
++ break
++ ;;
++ esac
++ shift
++done
++
++i=0
++while ((i &lt; nout)); do
++ outs[$i]=&quot;$BUILDDIR/${outs[$i]}&quot;
++ l=''
++ for f in ${lists[$i]}; do
++ l=&quot;$l $BUILDDIR/$f&quot;
++ done
++ lists[$i]=$l
++ ((++i))
++done
++
++LISTFILE=&quot;$BUILDDIR/$out&quot;
++SOURCEFILE=&quot;$BUILDDIR/debugsources.list&quot;
++LINKSFILE=&quot;$BUILDDIR/debuglinks.list&quot;
++
++&gt; &quot;$SOURCEFILE&quot;
++&gt; &quot;$LISTFILE&quot;
++&gt; &quot;$LINKSFILE&quot;
++
++debugdir=&quot;${RPM_BUILD_ROOT}/usr/lib/debug&quot;
++
++strip_to_debug()
++{
++ local g=
++ $strip_g &amp;&amp; case &quot;$(file -bi &quot;$2&quot;)&quot; in
++ application/x-sharedlib*) g=-g ;;
++ esac
++ eu-strip --remove-comment $g $([ -n &quot;$DISABLE_DEBUG&quot; ] || echo -f &quot;$1&quot;) &quot;$2&quot; || exit
++ [ -n &quot;$DISABLE_DEBUG&quot; ] || chmod 444 &quot;$1&quot; || exit
++}
++
++# Make a relative symlink to $1 called $3$2
++shopt -s extglob
++link_relative()
++{
++ local t=&quot;$1&quot; f=&quot;$2&quot; pfx=&quot;$3&quot;
++ local fn=&quot;${f#/}&quot; tn=&quot;${t#/}&quot;
++ local fd td d
++
++ while fd=&quot;${fn%%/*}&quot;; td=&quot;${tn%%/*}&quot;; [ &quot;$fd&quot; = &quot;$td&quot; ]; do
++ fn=&quot;${fn#*/}&quot;
++ tn=&quot;${tn#*/}&quot;
++ done
++
++ d=&quot;${fn%/*}&quot;
++ if [ &quot;$d&quot; != &quot;$fn&quot; ]; then
++ d=&quot;${d//+([!\/])/..}&quot;
++ tn=&quot;${d}/${tn}&quot;
++ fi
++
++ mkdir -p &quot;$(dirname &quot;$pfx$f&quot;)&quot; &amp;&amp; ln -snf &quot;$tn&quot; &quot;$pfx$f&quot;
++}
++
++# Make a symlink in /usr/lib/debug/$2 to $1
++debug_link()
++{
++ local l=&quot;/usr/lib/debug$2&quot;
++ local t=&quot;$1&quot;
++ echo &gt;&gt; &quot;$LINKSFILE&quot; &quot;$l $t&quot;
++ link_relative &quot;$t&quot; &quot;$l&quot; &quot;$RPM_BUILD_ROOT&quot;
++}
++
++# Make a build-id symlink for id $1 with suffix $3 to file $2.
++make_id_link()
++{
++ local id=&quot;$1&quot; file=&quot;$2&quot;
++ local idfile=&quot;.build-id/${id:0:2}/${id:2}&quot;
++ [ $# -eq 3 ] &amp;&amp; idfile=&quot;${idfile}$3&quot;
++ local root_idfile=&quot;$RPM_BUILD_ROOT/usr/lib/debug/$idfile&quot;
++
++ if [ ! -L &quot;$root_idfile&quot; ]; then
++ debug_link &quot;$file&quot; &quot;/$idfile&quot;
++ return
++ fi
++
++ [ $# -eq 3 ] &amp;&amp; return 0
++
++ local other=$(readlink -m &quot;$root_idfile&quot;)
++ other=${other#$RPM_BUILD_ROOT}
++ if cmp -s &quot;$root_idfile&quot; &quot;$RPM_BUILD_ROOT$file&quot; ||
++ eu-elfcmp -q &quot;$root_idfile&quot; &quot;$RPM_BUILD_ROOT$file&quot; 2&gt; /dev/null; then
++ # Two copies. Maybe one has to be setuid or something.
++ echo &gt;&amp;2 &quot;*** WARNING: identical binaries are copied, not linked:&quot;
++ echo &gt;&amp;2 &quot; $file&quot;
++ echo &gt;&amp;2 &quot; and $other&quot;
++ else
++ # This is pathological, break the build.
++ echo &gt;&amp;2 &quot;*** ERROR: same build ID in nonidentical files!&quot;
++ echo &gt;&amp;2 &quot; $file&quot;
++ echo &gt;&amp;2 &quot; and $other&quot;
++ exit 2
++ fi
++}
++
++get_debugfn()
++{
++ dn=$(dirname &quot;${1#$RPM_BUILD_ROOT}&quot;)
++ bn=$(basename &quot;$1&quot; .debug).debug
++
++ debugdn=${debugdir}${dn}
++ debugfn=${debugdn}/${bn}
++}
++
++set -o pipefail
++
++strict_error=ERROR
++$strict || strict_error=WARNING
++
++[[ -n &quot;$EXCLUDE_FROM_STRIP&quot; ]] &amp;&amp; \
++EXCLUDE_REGEXP=`perl -e 'print &quot;(&quot;, join(&quot;|&quot;, @ARGV), &quot;)&quot;' $EXCLUDE_FROM_STRIP`
++
++echo $EXCLUDE_REGEXP
++# Strip ELF binaries
++find &quot;$RPM_BUILD_ROOT&quot; ! -path &quot;${debugdir}/*.debug&quot; -type f \
++ \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
++ -print |
++file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
++xargs --no-run-if-empty stat -c '%h %D_%i %n' |
++while read nlinks inum f; do
++ [[ -n &quot;$EXCLUDE_REGEXP&quot; ]] &amp;&amp; grep -E -q &quot;$EXCLUDE_REGEXP&quot; &lt;&lt;&lt; &quot;$f&quot; &amp;&amp; \
++ continue
++ [ -n &quot;$DISABLE_DEBUG&quot; ] &amp;&amp; strip_to_debug &quot;&quot; &quot;$f&quot; &amp;&amp; continue
++
++ get_debugfn &quot;$f&quot;
++ [ -f &quot;${debugfn}&quot; ] &amp;&amp; continue
++
++ # If this file has multiple links, keep track and make
++ # the corresponding .debug files all links to one file too.
++ if [ $nlinks -gt 1 ]; then
++ eval linked=\$linked_$inum
++ if [ -n &quot;$linked&quot; ]; then
++ link=$debugfn
++ get_debugfn &quot;$linked&quot;
++ echo &quot;hard linked $link to $debugfn&quot;
++ ln -nf &quot;$debugfn&quot; &quot;$link&quot;
++ continue
++ else
++ eval linked_$inum=\$f
++ echo &quot;file $f has $[$nlinks - 1] other hard links&quot;
++ fi
++ fi
++
++ echo &quot;extracting debug info from $f&quot;
++ id=$($debugedit -b &quot;$RPM_BUILD_DIR&quot; -d /usr/src/debug \
++ -i -l &quot;$SOURCEFILE&quot; &quot;$f&quot;) || exit
++ if [ -z &quot;$id&quot; ]; then
++ echo &gt;&amp;2 &quot;*** ${strict_error}: No build ID note found in $f&quot;
++ $strict &amp;&amp; exit 2
++ fi
++
++ # A binary already copied into /usr/lib/debug doesn't get stripped,
++ # just has its file names collected and adjusted.
++ case &quot;$dn&quot; in
++ /usr/lib/debug/*)
++ [ -z &quot;$id&quot; ] || make_id_link &quot;$id&quot; &quot;$dn/$(basename $f)&quot;
++ continue ;;
++ esac
++
++ mkdir -p &quot;${debugdn}&quot;
++ if test -w &quot;$f&quot;; then
++ strip_to_debug &quot;${debugfn}&quot; &quot;$f&quot;
++ else
++ chmod u+w &quot;$f&quot;
++ strip_to_debug &quot;${debugfn}&quot; &quot;$f&quot;
++ chmod u-w &quot;$f&quot;
++ fi
++
++ if [ -n &quot;$id&quot; ]; then
++ make_id_link &quot;$id&quot; &quot;$dn/$(basename $f)&quot;
++ make_id_link &quot;$id&quot; &quot;/usr/lib/debug$dn/$bn&quot; .debug
++ fi
++done || exit
++
++# For each symlink whose target has a .debug file,
++# make a .debug symlink to that file.
++find $RPM_BUILD_ROOT ! -path &quot;${debugdir}/*&quot; -type l -print |
++while read f
++do
++ t=$(readlink -m &quot;$f&quot;).debug
++ f=${f#$RPM_BUILD_ROOT}
++ t=${t#$RPM_BUILD_ROOT}
++ if [ -f &quot;$debugdir$t&quot; ]; then
++ echo &quot;symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug&quot;
++ debug_link &quot;/usr/lib/debug$t&quot; &quot;${f}.debug&quot;
++ fi
++done
++
++if [ -s &quot;$SOURCEFILE&quot; ]; then
++ mkdir -p &quot;${RPM_BUILD_ROOT}/usr/src/debug&quot;
++ LC_ALL=C sort -z -u &quot;$SOURCEFILE&quot; | grep -E -v -z '(&lt;internal&gt;|&lt;built-in&gt;)$' |
++ (cd &quot;$RPM_BUILD_DIR&quot;; cpio -pd0mL &quot;${RPM_BUILD_ROOT}/usr/src/debug&quot;)
++ # stupid cpio creates new directories in mode 0700, fixup
++ find &quot;${RPM_BUILD_ROOT}/usr/src/debug&quot; -type d -print0 |
++ xargs --no-run-if-empty -0 chmod a+rx
++fi
++
++if [ -d &quot;${RPM_BUILD_ROOT}/usr/lib&quot; -o -d &quot;${RPM_BUILD_ROOT}/usr/src&quot; ]; then
++ ((nout &gt; 0)) ||
++ test ! -d &quot;${RPM_BUILD_ROOT}/usr/lib/debug&quot; ||
++ (cd &quot;${RPM_BUILD_ROOT}/usr/lib&quot;; find debug -type d) |
++ sed 's,^,%dir /usr/lib/,' &gt;&gt; &quot;$LISTFILE&quot;
++
++ (cd &quot;${RPM_BUILD_ROOT}/usr&quot;
++ test ! -d lib/debug || find lib/debug ! -type d
++ test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
++ ) | sed 's,^,/usr/,' &gt;&gt; &quot;$LISTFILE&quot;
++fi
++
++# Append to $1 only the lines from stdin not already in the file.
++append_uniq()
++{
++ grep -F -f &quot;$1&quot; -x -v &gt;&gt; &quot;$1&quot;
++}
++
++# Helper to generate list of corresponding .debug files from a file list.
++filelist_debugfiles()
++{
++ local extra=&quot;$1&quot;
++ shift
++ sed 's/^%[a-z0-9_][a-z0-9_]*([^)]*) *//
++s/^%[a-z0-9_][a-z0-9_]* *//
++/^$/d
++'&quot;$extra&quot; &quot;$@&quot;
++}
++
++# Write an output debuginfo file list based on given input file lists.
++filtered_list()
++{
++ local out=&quot;$1&quot;
++ shift
++ test $# -gt 0 || return
++ grep -F -f &lt;(filelist_debugfiles 's,^.*$,/usr/lib/debug&amp;.debug,' &quot;$@&quot;) \
++ -x $LISTFILE &gt;&gt; $out
++ sed -n -f &lt;(filelist_debugfiles 's/[\\.*+#]/\\&amp;/g
++h
++s,^.*$,s# &amp;$##p,p
++g
++s,^.*$,s# /usr/lib/debug&amp;.debug$##p,p
++' &quot;$@&quot;) &quot;$LINKSFILE&quot; | append_uniq &quot;$out&quot;
++}
++
++# Write an output debuginfo file list based on an grep -E -style regexp.
++pattern_list()
++{
++ local out=&quot;$1&quot; ptn=&quot;$2&quot;
++ test -n &quot;$ptn&quot; || return
++ grep -E -x -e &quot;$ptn&quot; &quot;$LISTFILE&quot; &gt;&gt; &quot;$out&quot;
++ sed -n -r &quot;\#^$ptn #s/ .*\$//p&quot; &quot;$LINKSFILE&quot; | append_uniq &quot;$out&quot;
++}
++
++#
++# When given multiple -o switches, split up the output as directed.
++#
++i=0
++while ((i &lt; nout)); do
++ &gt; ${outs[$i]}
++ filtered_list ${outs[$i]} ${lists[$i]}
++ pattern_list ${outs[$i]} &quot;${ptns[$i]}&quot;
++ grep -Fvx -f ${outs[$i]} &quot;$LISTFILE&quot; &gt; &quot;${LISTFILE}.new&quot;
++ mv &quot;${LISTFILE}.new&quot; &quot;$LISTFILE&quot;
++ ((++i))
++done
++if ((nout &gt; 0)); then
++ # Now add the right %dir lines to each output list.
++ (cd &quot;${RPM_BUILD_ROOT}&quot;; find usr/lib/debug -type d) |
++ sed 's#^.*$#\\@^/&amp;/@{h;s@^.*$@%dir /&amp;@p;g;}#' |
++ LC_ALL=C sort -ur &gt; &quot;${LISTFILE}.dirs.sed&quot;
++ i=0
++ while ((i &lt; nout)); do
++ sed -n -f &quot;${LISTFILE}.dirs.sed&quot; &quot;${outs[$i]}&quot; | sort -u &gt; &quot;${outs[$i]}.new&quot;
++ cat &quot;${outs[$i]}&quot; &gt;&gt; &quot;${outs[$i]}.new&quot;
++ mv -f &quot;${outs[$i]}.new&quot; &quot;${outs[$i]}&quot;
++ ((++i))
++ done
++ sed -n -f &quot;${LISTFILE}.dirs.sed&quot; &quot;${LISTFILE}&quot; | sort -u &gt; &quot;${LISTFILE}.new&quot;
++ cat &quot;$LISTFILE&quot; &gt;&gt; &quot;${LISTFILE}.new&quot;
++ mv &quot;${LISTFILE}.new&quot; &quot;$LISTFILE&quot;
++fi
+
+
+Property changes on: rpm/rpm-setup/trunk/find-debuginfo.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/find-lang.pl
+===================================================================
+--- rpm/rpm-setup/trunk/find-lang.pl (rev 0)
++++ rpm/rpm-setup/trunk/find-lang.pl 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,147 @@
++#!/usr/bin/perl
++
++# $Id: find-lang.pl 243013 2008-06-23 13:01:50Z pixel $
++
++use strict;
++use warnings;
++use File::Find;
++use Getopt::Long;
++use Pod::Usage;
++
++GetOptions(
++ 'all-name' =&gt; \my $allname,
++ 'with-gnome' =&gt; \my $withgnome,
++ 'with-kde' =&gt; \my $withkde,
++ 'with-html' =&gt; \my $withhtml,
++ 'without-mo' =&gt; \my $withoutmo,
++ 'with-man' =&gt; \my $withman,
++ 'debug' =&gt; \my $debug,
++) or pod2usage();
++
++my ($buildroot, @searchname) = @ARGV;
++$buildroot or die &quot;No buildroot given\n&quot;;
++$buildroot =~ s:/+$::; # removing trailing /
++my ($pkgname) = @searchname or die &quot;Main name to find missing\n&quot;;
++
++sub debug {
++ $debug or return;
++ my ($msg, @val) = @_;
++ printf(&quot;DEBUG: $msg\n&quot;, @val);
++}
++
++my %finallist; # filename =&gt; attr, easy way to perform uniq
++
++File::Find::find(
++ sub {
++ my $file = substr($File::Find::name, length($buildroot));
++ -f $File::Find::name or -l $File::Find::name or return;
++ debug(&quot;next file is %s&quot;, $file);
++ my $langfile = $file;
++ if ($file =~ m:^((.*/share/locale)/([^/@]+)[^/]*).*/([^/]+)\.mo:) {
++ if ($withoutmo) {
++ return;
++ }
++ my ($pkg, $lang, $parent, $langfile) = ($4, $3, $2, $1);
++ if (pkg_match($pkg)) {
++ own_file($file, $lang);
++ }
++ } elsif ($file =~ m:^((.*/gnome/help)/([^/]+)/([^/]+)).*:) {
++ if (!$withgnome) {
++ return;
++ }
++ my ($pkg, $lang, $parent, $langfile) = ($3, $4, $2, $1);
++ if (pkg_match($pkg)) {
++ parent_to_own($langfile, $file, $lang);
++ }
++ } elsif ($file =~ m:^((.*/doc/kde)/HTML/([^/@]+)[^/]*)/([^/]+)/.*:) {
++ if (!$withkde) {
++ return;
++ }
++ my ($pkg, $lang, $parent, $langfile) = ($4, $3, $2, $1);
++ if (pkg_match($pkg)) {
++ parent_to_own($langfile, $file, $lang);
++ }
++ } elsif ($file =~ m:^((.*/doc)/HTML/([^/@]+)[^/]*)/([^/_]+).*:) {
++ if (!$withhtml) {
++ return;
++ }
++ my ($pkg, $lang, $parent, $langfile) = ($4, $3, $2, $1);
++ if (pkg_match($pkg)) {
++ parent_to_own($langfile, $file, $lang);
++ }
++ } elsif ($file =~ m:^((/+usr/share/man)/([^/@\.]+)[^/]*)/man[^/]+/([^/.]+)\.\d[^/]*:) {
++ if (!$withman) {
++ return;
++ }
++ my ($pkg, $lang, $parent, $langfile) = ($4, $3, undef, $1);
++ $file =~ s/\.[^\.]+$//;
++ $file .= '.*';
++ if (pkg_match($pkg)) {
++ parent_to_own($langfile, $file, $lang);
++ }
++ } else {
++ return;
++ }
++ },
++ $buildroot || '/'
++);
++
++open(my $hlang, '&gt;', &quot;$pkgname.lang&quot;) or die &quot;canno't open $pkgname.lang\n&quot;;
++
++foreach my $f (sort keys %finallist) {
++ my ($lang, @otherlang) = keys %{ $finallist{$f}{'lang'} || {}};
++ my $l = sprintf(&quot;%s%s%s&quot;,
++ $finallist{$f}{'dir'} ? '%dir ' : '',
++ @otherlang == 0 &amp;&amp; $lang &amp;&amp; $lang ne 'C'
++ ? &quot;%lang($lang) &quot;
++ : '', # skip if multiple lang, 'C' or dir
++ $f
++ );
++ debug('OUT: %s', $l);
++ print $hlang &quot;$l\n&quot;;
++
++}
++
++close($hlang);
++
++exit(0);
++
++sub pkg_match {
++ my ($pkg) = @_;
++ if ($allname) { return 1 };
++ if (grep { $_ eq $pkg } @searchname) {
++ return 1;
++ }
++ return;
++}
++
++sub own_file {
++ my ($file, $lang) = @_;
++ $finallist{$file}{'lang'}{$lang} = 1;
++}
++
++sub parent_to_own {
++ my ($parent, $file, $lang) = @_;
++ debug(&quot;parent_to_own: $parent, $file, $lang&quot;);
++ if ($allname) {
++ #my @subdir = grep { $_ } split('/', substr($file, length($parent)));
++ #$parent .= '/' . shift(@subdir);
++ $finallist{$parent}{'lang'}{$lang} = 1;
++ debug(&quot;Parent %s will be %s&quot;, $parent, $lang);
++ } else {
++ my @subdir = grep { $_ } split('/', substr($file, length($parent)));
++ pop(@subdir);
++ $finallist{$parent}{dir} = 1;
++ $finallist{$parent}{'lang'}{$lang} = 1;
++ debug(&quot;Parent %s will be %s&quot;, $parent, $lang);
++ while (my $part = shift(@subdir)) {
++ $parent .= &quot;/$part&quot;;
++ $finallist{$parent}{dir} = 1;
++ $finallist{$parent}{'lang'}{$lang} = 1;
++ debug(&quot;Parent %s will be %s&quot;, $parent, $lang);
++ }
++ own_file($file, $lang);
++ debug(&quot;Parent %s will be %s&quot;, $file, $lang);
++
++ }
++}
+
+Added: rpm/rpm-setup/trunk/find-provides.in
+===================================================================
+--- rpm/rpm-setup/trunk/find-provides.in (rev 0)
++++ rpm/rpm-setup/trunk/find-provides.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,117 @@
++#!/bin/bash
++
++# This script reads filenames from STDIN and outputs any relevant provides
++# information that needs to be included in the package.
++
++filelist=`sed &quot;s/['\&quot;]/\\\&amp;/g&quot;`
++
++solist=$(echo &quot;$filelist&quot; | egrep -v &quot;^/lib/ld\.so|/usr/lib(64)?/gcj/&quot; | egrep '(/usr(/X11R6)?)?/lib(64)?/.*\.so' | \
++ xargs file -L 2&gt;/dev/null | grep &quot;ELF.*shared object&quot; | cut -d: -f1)
++pythonlist=
++tcllist=
++rubygemlist=$(echo &quot;$filelist&quot;| egrep &quot;\.gemspec$&quot;)
++
++#
++# --- Alpha does not mark 64bit dependencies
++case `uname -m` in
++ alpha*) mark64=&quot;&quot; ;;
++ *) mark64=&quot;()(64bit)&quot; ;;
++esac
++
++#
++# --- Library sonames and weak symbol versions (from glibc).
++for f in $solist; do
++ soname=$(objdump -p $f 2&gt;/dev/null | awk '/SONAME/ {print $2}')
++
++ lib64=`if file -L $f 2&gt;/dev/null | \
++ grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;$mark64&quot;; fi`
++ if [ &quot;$soname&quot; != &quot;&quot; ]; then
++ if [ ! -L $f ]; then
++ echo $soname$lib64
++ objdump -p $f 2&gt;/dev/null | awk '
++ BEGIN { START=0 ; }
++ /Version definitions:/ { START=1; }
++ /^[0-9]/ &amp;&amp; (START==1) { print $4; }
++ /^$/ { START=0; }
++ ' | \
++ grep -v $soname | \
++ while read symbol ; do
++ echo &quot;$soname($symbol)`echo $lib64 | sed 's/()//'`&quot;
++ done
++ fi
++ else
++ echo ${f##*/}$lib64
++ fi
++done | sort -u
++
++#
++# --- Perl modules.
++[ -x @RPMVENDORDIR@/perl.prov ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/perl.prov | grep 'perl([[:upper:]]' | sort -u
++
++#
++# --- Python modules.
++[ -x @RPMVENDORDIR@/pythoneggs.py -a -n &quot;$filelist&quot; ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/pythoneggs.py --provides | sort -u
++
++#
++# --- Tcl modules.
++[ -x @RPMVENDORDIR@/tcl.prov -a -n &quot;$tcllist&quot; ] &amp;&amp;
++ echo &quot;$tcllist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/tcl.prov | sort -u
++
++#
++# --- Php modules.
++[ -x @RPMVENDORDIR@/php.prov ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/php.prov | sort -u
++
++#
++# --- Kernel modules.
++[ -x @RPMVENDORDIR@/kmod.prov ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/kmod.prov | sort -u
++
++#
++# --- Pkgconfig deps
++[ -x @RPMVENDORDIR@/pkgconfigdeps.sh ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/pkgconfigdeps.sh -P | sort -u
++
++if [ -n &quot;$LIBTOOLDEP&quot; ]; then
++#
++# --- libtooldep deps
++[ -x @RPMLIBDIR@/libtooldeps.sh ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMLIBDIR@/libtooldeps.sh -P | sort -u
++
++fi
++
++#
++# --- Ruby gems
++[ -x @RPMVENDORDIR@/rubygems.rb -a -n &quot;$rubygemlist&quot; ] &amp;&amp;
++ echo $rubygemlist | tr '[:blank:]' \\n | @RPMVENDORDIR@/rubygems.rb --provides | sort -u
++
++#
++# --- .so files.
++for i in `echo $filelist | tr '[:blank:]' &quot;\n&quot; | egrep '(/usr(/X11R6)?)?/lib(|64)(/gcc(-lib)?/.+)?/[^/]+\.so$'`; do
++ objd=`objdump -p ${i} | grep SONAME`
++ [ -h ${i} -a -n &quot;${objd}&quot; ] &amp;&amp; \
++ lib64=`if file -L $i 2&gt;/dev/null | grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;(64bit)&quot;; fi` &amp;&amp; \
++ echo ${objd} | perl -p -e &quot;s/.*SONAME\s+(\S+)\.so.*/devel(\1$lib64)/g&quot;
++done | sort -u
++
++#
++# --- mono provides
++if [ -x /usr/bin/mono-find-provides ]; then
++echo $filelist | tr '[:blank:]' '\n' | /usr/bin/mono-find-provides
++fi
++
++
++#
++# --- haskell provides
++if [ -x /usr/bin/haskell-find-provides ]; then
++echo $filelist | tr '[:blank:]' '\n' | /usr/bin/haskell-find-provides
++fi
++
++#
++# --- gstreamer modules.
++[ -x @RPMVENDORDIR@/gstreamer.prov ] &amp;&amp;
++ echo &quot;$solist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/gstreamer.prov | sort -u
++
++exit 0
+
+
+Property changes on: rpm/rpm-setup/trunk/find-provides.in
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/find-provides.perl.in
+===================================================================
+--- rpm/rpm-setup/trunk/find-provides.perl.in (rev 0)
++++ rpm/rpm-setup/trunk/find-provides.perl.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,4 @@
++#!/bin/sh
++
++exec @RPMVENDORDIR@/find-provides
++
+
+
+Property changes on: rpm/rpm-setup/trunk/find-provides.perl.in
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/find-requires.in
+===================================================================
+--- rpm/rpm-setup/trunk/find-requires.in (rev 0)
++++ rpm/rpm-setup/trunk/find-requires.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,289 @@
++#!/bin/bash
++
++#
++# Auto-generate requirements for ELF executables and library
++# sonames, script interpreters, and perl modules.
++#
++
++ulimit -c 0
++
++#
++# --- Set needed to 0 for traditional find-requires behavior.
++needed=1
++if [ X&quot;$3&quot; = Xldd ]; then
++ needed=0
++elif [ X&quot;$3&quot; = Xobjdump ]; then
++ needed=1
++fi
++
++# --- Mageia specific part
++case &quot;$LD_PRELOAD&quot; in
++ *libfakeroot*)
++ unset LD_PRELOAD
++ ;;
++esac
++
++RPM_BUILD_ROOT=$1
++RPM_ARCH=$2
++
++if [ -n &quot;$RPM_BUILD_ROOT&quot; ]; then
++ lib_path_64=$RPM_BUILD_ROOT/usr/X11R6/lib64:$RPM_BUILD_ROOT/usr/lib64:$RPM_BUILD_ROOT/lib64
++ lib_path_32=$RPM_BUILD_ROOT/usr/X11R6/lib:$RPM_BUILD_ROOT/usr/lib:$RPM_BUILD_ROOT/lib
++ LD_LIBRARY_PATH=$lib_path_64:$lib_path_32
++ export LD_LIBRARY_PATH
++fi
++
++
++#
++# --- Grab the file manifest and classify files.
++#filelist=`sed &quot;s/['\&quot;]/\\\&amp;/g&quot;`
++filelist=`sed &quot;s/[]['\&quot;*?{}]/\\\\\&amp;/g&quot;`
++exelist=`echo &quot;$filelist&quot; | xargs -r file | egrep -v &quot;:.* (commands|script) &quot; | \
++ grep &quot;:.*ELF.*executable&quot; | cut -d: -f1`
++scriptlist=`echo &quot;$filelist&quot; | grep -v /usr/doc | grep -v /usr/share/doc | xargs -r file | \
++ egrep &quot;:.* (commands|script) &quot; | cut -d: -f1`
++liblist=`echo &quot;$filelist&quot; | egrep -v &quot;/usr/lib(64)?/gcj/&quot; | xargs -r file | \
++ grep &quot;:.*shared object&quot; | cut -d : -f1`
++ocamllist=`echo &quot;$filelist&quot; | xargs -r file | \
++ grep &quot;:.*Objective caml interface file&quot; | cut -d : -f1`
++phplist=`echo &quot;$filelist&quot; | grep -v /usr/doc | grep -v /usr/share/doc | egrep &quot;\.php$&quot;`
++
++interplist=
++perllist=
++pythonlist=
++tcllist=
++rubygemlist=`echo &quot;$filelist&quot;| egrep &quot;\.gemspec$&quot;`
++
++uniqdeplist=
++
++#
++# --- Alpha does not mark 64bit dependencies
++case `uname -m` in
++ alpha*) mark64=&quot;&quot; ;;
++ *) mark64=&quot;()(64bit)&quot; ;;
++esac
++
++if [ &quot;$needed&quot; -eq 0 ]; then
++#
++# --- Executable dependency sonames.
++ for f in $exelist; do
++ [ -r $f -a -x $f ] || continue
++ lib64=`if file -L $f 2&gt;/dev/null | \
++ grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;$mark64&quot;; fi`
++ ldd $f | awk '/=&gt;/ {
++ if ($1 !~ /libNoVersion.so/ &amp;&amp; $1 !~ /4[um]lib.so/) {
++ gsub(/'\''&quot;/,&quot;\\&amp;&quot;,$1);
++ printf &quot;%s'$lib64'\n&quot;, $1
++ }
++ }'
++ done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
++
++#
++# --- Library dependency sonames.
++ for f in $liblist; do
++ [ -r $f ] || continue
++ lib64=`if file -L $f 2&gt;/dev/null | \
++ grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;$mark64&quot;; fi`
++ ldd $f | awk '/=&gt;/ {
++ if ($1 !~ /libNoVersion.so/ &amp;&amp; $1 !~ /4[um]lib.so/) {
++ gsub(/'\''&quot;/,&quot;\\&amp;&quot;,$1);
++ printf &quot;%s'$lib64'\n&quot;, $1
++ }
++ }'
++ done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
++fi
++
++#
++# --- Perl or python deps
++perlepoch=`rpm -q --qf '%|EPOCH?{[%{EPOCH}]:}|' perl-base`
++if [ $? != 0 ]; then
++ unset perlepoch
++fi
++
++tmpdeplist=
++for f in $filelist; do
++ dep=&quot;`echo $f | sed -n -e &quot;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s at .</A>*/usr/lib/perl5/\(vendor_perl/\|site_perl/\|\)\([.0-9]\{1,\}\).*\\$@perl-base &gt;= $perlepoch\<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">2 at p</A>&quot;`&quot;
++ if [[ -n $dep &amp;&amp; -z `echo $uniqdeplist $tmpdeplist|grep &quot;$dep&quot;` ]]; then
++ tmpdeplist+=&quot;$dep\n&quot;
++ fi
++done
++echo -n -e $tmpdeplist | sort -u
++uniqdeplist+=&quot;$tmpdeplist&quot;
++
++
++#
++# --- Script interpreters.
++for f in $scriptlist; do
++ [ -r $f -a -x $f ] || continue
++ interp=`head -n 1 $f | grep '^#!' | sed -e 's/^\#\![ ]*//' | cut -d&quot; &quot; -f1`
++ interplist=&quot;$interplist $interp&quot;
++ case $interp in
++ */perl) perllist=&quot;$perllist $f&quot; ;;
++ esac
++done
++if [ -n &quot;$interplist&quot; ]; then
++ tmpdeplist=
++ for i in `echo &quot;$interplist&quot; | tr '[:blank:]' \\\n `; do
++ dep=`rpm -qf $i --qf '%{name}\n'` &amp;&amp; i=$dep
++ if [[ -z `echo $uniqdeplist $tmpdeplist|grep &quot;$i&quot;` ]]; then
++ tmpdeplist+=&quot;$i\n&quot;
++ fi
++ done
++ echo -n -e $tmpdeplist | sort -u | grep -v 'libsafe|libfakeroot'
++ uniqdeplist=&quot;$tmpdeplist&quot;
++fi
++
++#
++# --- Add perl module files to perllist.
++for f in $filelist; do
++ [ -r $f -a &quot;${f%.pm}&quot; != &quot;${f}&quot; ] &amp;&amp; perllist=&quot;$perllist $f&quot;
++done
++
++#
++# --- Weak symbol versions (from glibc).
++[ -n &quot;$mark64&quot; ] &amp;&amp; mark64=&quot;(64bit)&quot;
++for f in $liblist $exelist ; do
++ [ -r $f ] || continue
++ lib64=`if file -L $f 2&gt;/dev/null | \
++ grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;$mark64&quot;; fi`
++ objdump -p $f | awk 'BEGIN { START=0; LIBNAME=&quot;&quot;; needed='$needed'; }
++ /^$/ { START=0; }
++ /^Dynamic Section:$/ { START=1; }
++ (START==1) &amp;&amp; /NEEDED/ {
++ if (needed) {
++ if (&quot;'$lib64'&quot; != &quot;&quot;) {
++ sub(/$/, &quot;()'$lib64'&quot;, $2) ;
++ }
++ print $2 ;
++ }
++ }
++ (START==1) &amp;&amp; /GNU_HASH/ {
++ print &quot;rtld(GNU_HASH)&quot;;
++ }
++ /^Version References:$/ { START=2; }
++ (START==2) &amp;&amp; /required from/ {
++ sub(/:/, &quot;&quot;, $3);
++ LIBNAME=$3;
++ }
++ (START==2) &amp;&amp; (LIBNAME!=&quot;&quot;) &amp;&amp; ($4!=&quot;&quot;) &amp;&amp; (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
++ print LIBNAME &quot;(&quot; $4 &quot;)'$lib64'&quot;;
++ }
++ '
++done | sort -u | grep -v 'libsafe|libfakeroot'
++
++# --- OCaml dependency
++if [ -x /usr/bin/ocamlc -a -n &quot;$ocamllist&quot; ]; then
++ version=`ocamlc -v | grep version | awk '{print $6}' | sed -e 's/+/./'`
++ echo &quot;ocaml = $version&quot;
++fi
++
++#
++# --- Perl modules.
++perlmeta=$( echo $filelist | tr '[:blank:]' \\n | egrep 'doc/[^/]+/META.(yml|json)$' | head -1 )
++if [ -n &quot;$perlmeta&quot; ]
++then
++ [ -x @RPMVENDORDIR@/perl.req-from-meta ] &amp;&amp; \
++ @RPMVENDORDIR@/perl.req-from-meta $perlmeta
++else
++ [ -x @RPMVENDORDIR@/perl.req -a -n &quot;$perllist&quot; ] &amp;&amp; \
++ echo $perllist | tr '[:blank:]' \\n | @RPMVENDORDIR@/perl.req | grep 'perl([[:upper:]]' | egrep -v '^perl\((Be|FreeBSD|HPUX|Mac|MSDOS|MVS|OS2|Riscos|SGI|Solaris|VMS|Win32|WinNT)::' | sort -u
++fi
++
++#
++# --- If libperl.so exists and if XS modules are found, depend on perlapi-&lt;version&gt; and libperl.so
++if [ -n &quot;$perllist&quot; ]; then
++ if perl -V:useshrplib | grep -q true ; then
++ if echo $perllist | grep -q `perl -MConfig -e 'print $Config{archname}'` ; then
++ version=`perl -MConfig -e 'print $Config{version}'`
++ echo perlapi-$version
++
++ f=`perl -MConfig -e 'print $Config{archlib}'`/CORE/libperl.so
++ lib64=`if file -L $f 2&gt;/dev/null | \
++ grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;()$mark64&quot;; fi`
++ echo libperl.so$lib64
++ fi
++ fi
++fi
++
++#
++# --- Python modules.
++[ -x @RPMVENDORDIR@/pythoneggs.py -a -n &quot;$filelist&quot; ] &amp;&amp; \
++ echo $filelist | tr '[:blank:]' \\n | @RPMVENDORDIR@/pythoneggs.py --requires | sort -u
++
++#
++# --- Tcl modules.
++[ -x @RPMVENDORDIR@/tcl.req -a -n &quot;$tcllist&quot; ] &amp;&amp; \
++ echo $tcllist | tr '[:blank:]' \\n | @RPMVENDORDIR@/tcl.req | sort -u
++
++#
++# --- Php modules.
++[ -x @RPMVENDORDIR@/php.req -a -n &quot;$phplist&quot; ] &amp;&amp; \
++ echo $phplist | tr '[:blank:]' \\n | @RPMVENDORDIR@/php.req | sort -u
++
++#
++# --- Pkgconfig deps
++[ -x @RPMVENDORDIR@/pkgconfigdeps.sh ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMVENDORDIR@/pkgconfigdeps.sh -R | sort -u
++
++
++if [ -n &quot;$LIBTOOLDEP&quot; ]; then
++#
++# --- libtooldep deps
++[ -x @RPMLIBDIR@/libtooldeps.sh ] &amp;&amp;
++ echo &quot;$filelist&quot; | tr '[:blank:]' \\n | @RPMLIBDIR@/libtooldeps.sh -R | sort -u
++
++fi
++
++#
++# --- Ruby gems
++[ -x @RPMVENDORDIR@/rubygems.rb -a -n &quot;$rubygemlist&quot; ] &amp;&amp;
++ echo $rubygemlist | tr '[:blank:]' \\n | @RPMVENDORDIR@/rubygems.rb --requires | sort -u
++
++#
++# --- .so files.
++for i in `echo $filelist | tr '[:blank:]' &quot;\n&quot; | egrep &quot;(/usr(/X11R6)?)?/lib(|64)/[^/]+\.so$&quot;`; do
++ objd=`objdump -p ${i} | grep SONAME`
++ lib64=`if file -L $i 2&gt;/dev/null | grep &quot;ELF 64-bit&quot; &gt;/dev/null; then echo &quot;(64bit)&quot;; fi` &amp;&amp; \
++ if [ -h ${i} -a -n &quot;${objd}&quot; ]; then
++ if [ &quot;$needed&quot; -eq 0 ]; then
++ ldd ${i} \
++ | grep -v &quot;statically linked&quot; \
++ | grep -v &quot;/\(lib\|lib64\)/\(ld\|ld64\|ld-linux.*\)\.so&quot; \
++ | perl -p -e &quot;s/\s+(\S+)\.so.*/devel(\1$lib64)/g&quot;
++ else
++ objdump -p $i | grep -v &quot;\(ld\|ld64\|ld-linux.*\)\.so&quot; \
++ | awk 'BEGIN { START=0; }
++ /^$/ { START=0; }
++ /^Dynamic Section:$/ { START=1; }
++ (START==1) &amp;&amp; /NEEDED/ {
++ sub(/^/, &quot;devel(&quot;, $2) ;
++ sub(/\.so.*$/, &quot;'$lib64')&quot;, $2) ;
++ print $2 ;
++ }
++ '
++ fi
++ fi
++done | egrep -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\(64bit\))?\)' | sort -u
++
++#
++# --- pkgconfig
++echo $filelist | tr '[:blank:]' '\n' | egrep -q '/usr/(share|lib(64)?)/pkgconfig/.*\.pc' &amp;&amp; echo pkgconfig
++
++#
++# --- multiarch-utils
++echo $filelist | tr '[:blank:]' '\n' | grep -q '/multiarch-.*-linux/' &amp;&amp; echo multiarch-utils
++
++#
++# --- mono requires
++if [ -x /usr/bin/mono-find-requires ]; then
++echo $filelist | tr '[:blank:]' '\n' | /usr/bin/mono-find-requires
++fi
++
++#
++# haskell requires
++if [ -x /usr/bin/haskell-find-requires ]; then
++echo $filelist | tr '[:blank:]' '\n' | /usr/bin/haskell-find-requires
++fi
++
++
++exit 0
+
+
+Property changes on: rpm/rpm-setup/trunk/find-requires.in
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/gem_helper.rb
+===================================================================
+--- rpm/rpm-setup/trunk/gem_helper.rb (rev 0)
++++ rpm/rpm-setup/trunk/gem_helper.rb 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,173 @@
++#!/usr/bin/env ruby
++#--
++# Copyright 2010 Per &#216;yvind Karlsen &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">peroyvind at mandriva.org</A>&gt;
++# This program is free software. It may be redistributed and/or modified under
++# the terms of the LGPL version 2.1 (or later).
++#++
++
++require 'optparse'
++
++if ARGV[0] == &quot;build&quot; or ARGV[0] == &quot;install&quot;
++ require 'yaml'
++ require 'zlib'
++
++ filter = nil
++ opts = nil
++ keepcache = false
++ fixperms = false
++ gemdir = nil
++ dry_run = false
++ files = []
++ argv = ARGV[1..-1]
++ # Push this into some environment variables as the modified classes doesn't
++ # seem to be able to access our global variables.. &lt;/lameworkaround&gt;
++ ENV['GEM_MODE'] = ARGV[0]
++ if ARGV[0] == &quot;build&quot;
++ opts = OptionParser.new(&quot;#{$0} &lt;--filter PATTERN&gt;&quot;)
++ opts.on(&quot;-f&quot;, &quot;--filter PATTERN&quot;, &quot;Filter pattern to use for gem files&quot;) do |val|
++ filter = val
++ end
++ opts.on(&quot;-j&quot;, &quot;--jobs JOBS&quot;, &quot;Number of jobs to run simultaneously.&quot;) do |val|
++ ENV['jobs'] = &quot;-j&quot;+val
++ end
++ opts.on(&quot;--dry-run&quot;, &quot;Only show the files the gem will include&quot;) do
++ ARGV.delete(&quot;--dry-run&quot;)
++ dry_run = true
++ end
++ elsif ARGV[0] == &quot;install&quot;
++ opts = OptionParser.new(&quot;#{$0} &lt;--keep-cache&gt;&quot;)
++ opts.on(&quot;--keep-cache&quot;, &quot;Don't delete gem copy from cache&quot;) do
++ ARGV.delete(&quot;--keep-cache&quot;)
++ keepcache = true
++ end
++ opts.on(&quot;--fix-permissions&quot;, &quot;Force standard permissions for files installed&quot;) do
++ ARGV.delete(&quot;--fix-permissions&quot;)
++ fixperms = true
++ end
++ opts.on(&quot;-i&quot;, &quot;--install-dir GEMDIR&quot;, &quot;Gem repository directory&quot;) do |val|
++ gemdir = val
++ end
++ end
++ while argv.length &gt; 0
++ begin
++ opts.parse!(argv)
++ rescue OptionParser::InvalidOption =&gt; e
++ e.recover(argv)
++ end
++ argv.delete_at(0)
++ end
++
++ file_data = Zlib::GzipReader.open(&quot;metadata.gz&quot;)
++ header = YAML::load(file_data)
++ file_data.close()
++ body = header.instance_variable_get :@ivars
++
++ require 'rubygems'
++ spec = Gem::Specification.from_yaml(YAML.dump(header))
++
++ if ARGV[0] == &quot;install&quot;
++ system(&quot;gem %s %s.gem&quot; % [ARGV.join(' '), spec.full_name])
++ if !keepcache
++ require 'fileutils'
++ FileUtils.rm_rf(&quot;%s/cache&quot; % gemdir)
++ end
++ if fixperms
++ chmod = &quot;chmod u+r,u+w,g-w,g+r,o+r -R %s&quot; % gemdir
++ print &quot;\nFixing permissions:\n\n%s\n&quot; % chmod
++ system(&quot;%s&quot; % chmod)
++ print &quot;\n&quot;
++ end
++ end
++
++ if body['extensions'].size &gt; 0
++ require 'rubygems/ext'
++ module Gem::Ext
++ class Builder
++ def self.make(dest_path, results)
++ make_program = ENV['make']
++ unless make_program then
++ make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
++ end
++ cmd = make_program
++ if ENV['GEM_MODE'] == &quot;build&quot;
++ cmd += &quot; %s&quot; % ENV['jobs']
++ elsif ENV['GEM_MODE'] == &quot;install&quot;
++ cmd += &quot; DESTDIR='%s' install&quot; % ENV['DESTDIR']
++ end
++ results &lt;&lt; cmd
++ results &lt;&lt; `#{cmd} #{redirector}`
++
++ raise Gem::ExtensionBuildError, &quot;make failed:\n\n#{results}&quot; unless
++ $?.success?
++ end
++ end
++ end
++
++ require 'rubygems/installer'
++ module Gem
++ class Installer
++ def initialize(spec, options={})
++ @gem_dir = Dir.pwd
++ @spec = spec
++ end
++ end
++ class ConfigFile
++ def really_verbose
++ true
++ end
++ end
++ end
++
++ unless dry_run
++ Gem::Installer.new(spec).build_extensions
++ else
++ for ext in body['extensions']
++ files.push(ext[0..ext.rindex(&quot;/&quot;)-1]+&quot;.so&quot;)
++ end
++ end
++
++ body['extensions'].clear()
++ end
++ if ARGV[0] == &quot;build&quot;
++ body['test_files'].clear()
++
++ # We don't want ext/ in require_paths, it will only contain content for
++ # building extensions which needs to be installed in sitearchdir anyways..
++ idx = 0
++ for i in 0..body['require_paths'].size()-1
++ if body['require_paths'][idx].match(&quot;^ext(/|$)&quot;)
++ body['require_paths'].delete_at(idx)
++ else
++ idx += 1
++ end
++ end
++
++ # We'll get rid of all the files we don't really need to install
++ idx = 0
++ for i in 0..body['files'].size()-1
++ if filter and body['files'][idx].match(filter)
++ match = true
++ else
++ match = false
++ for path in body['require_paths']
++ if body['files'][idx].match(&quot;^%s/&quot; % path)
++ match = true
++ end
++ end
++ end
++ if !match
++ body['files'].delete_at(idx)
++ else
++ idx += 1
++ end
++ end
++
++ spec = Gem::Specification.from_yaml(YAML.dump(header))
++ unless dry_run
++ Gem::Builder.new(spec).build
++ else
++ files.concat(spec.files)
++ print &quot;%s\n&quot; % files.join(&quot;\n&quot;)
++ end
++ end
++end
+
+
+Property changes on: rpm/rpm-setup/trunk/gem_helper.rb
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/git-repository--after-tarball
+===================================================================
+--- rpm/rpm-setup/trunk/git-repository--after-tarball (rev 0)
++++ rpm/rpm-setup/trunk/git-repository--after-tarball 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,70 @@
++#!/bin/sh -ex
++
++# usage: git-repository--after-tarball [&lt;tarballs&gt;]
++# with optional environment variables:
++# - GIT_URL=&quot;<A HREF="git://xxx/foo.git">git://xxx/foo.git</A> [branch]&quot;
++# - GIT_REPOSITORY_CACHE=/zzz/foo.git
++#
++# the GIT_REPOSITORY_CACHE can be used with or without GIT_URL
++# - if GIT_URL is given, GIT_REPOSITORY_CACHE will be a &quot;bare&quot; clone of GIT_URL
++# - otherwise, GIT_REPOSITORY_CACHE can be created using:
++# % git clone --bare BUILD/foo-1 $GIT_REPOSITORY_CACHE
++# where foo-1 is the previous version
++
++
++tarballs=&quot;$*&quot;
++
++
++git_clone_in_cwd() {
++ URL=$1
++ [ -n &quot;$2&quot; ] &amp;&amp; BRANCH=&quot;origin/$2&quot;
++
++ git clone $URL .git-tmp
++
++ cd .git-tmp
++ git checkout $BRANCH
++ cd ..
++
++ mv .git-tmp/.git .
++ rm -r .git-tmp
++}
++
++our_git_clone() {
++ URL=$1
++ HEAD=$2
++
++ if [ -n &quot;$GIT_REPOSITORY_CACHE&quot; ]; then
++ if [ -d &quot;$GIT_REPOSITORY_CACHE&quot; ]; then
++ cd &quot;$GIT_REPOSITORY_CACHE&quot;
++ git fetch $GIT_URL
++ cd -
++ else
++ git clone --bare $URL &quot;$GIT_REPOSITORY_CACHE&quot;
++ fi
++ git_clone_in_cwd &quot;$GIT_REPOSITORY_CACHE&quot; $HEAD
++ else
++ git_clone_in_cwd $URL $HEAD
++ fi
++}
++
++set_GIT_AUTHOR_DATE() {
++ # taking date of first tarball, sorry for the other tarballs ;)
++ tarball=$1
++ export GIT_AUTHOR_DATE=`stat -c '%y' &quot;$RPM_SOURCE_DIR/$tarball&quot;`
++}
++
++if [ ! -e .git ]; then
++ if [ -n &quot;$GIT_URL&quot; ]; then
++ our_git_clone $GIT_URL
++ elif [ -n &quot;$GIT_REPOSITORY_CACHE&quot; -a -d &quot;$GIT_REPOSITORY_CACHE&quot; ]; then
++ git_clone_in_cwd &quot;$GIT_REPOSITORY_CACHE&quot; vanilla
++ else
++ git init
++ fi
++fi
++git add .
++set_GIT_AUTHOR_DATE $tarballs
++git commit -q -a --author=&quot;unknown author &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">mageia-dev at mageia.org</A>&gt;&quot; -m &quot;imported $tarballs&quot;
++git branch -f vanilla
++git branch -f patches-applied
++git checkout patches-applied
+
+
+Property changes on: rpm/rpm-setup/trunk/git-repository--after-tarball
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/git-repository--apply-patch
+===================================================================
+--- rpm/rpm-setup/trunk/git-repository--apply-patch (rev 0)
++++ rpm/rpm-setup/trunk/git-repository--apply-patch 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,158 @@
++#!/usr/bin/perl
++
++# this script can be used instead of &quot;/usr/bin/patch [options] -i xxx.patch&quot;
++
++
++use strict;
++use warnings;
++
++my @argv = @ARGV;
++my $verbose;
++
++my @patches;
++while ($argv[-1] =~ /\.(patch|diff)$/) {
++ unshift @patches, pop @argv;
++}
++
+<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">+ at patches</A> or die &quot;git-repository--apply-patch can not work with compressed patches\n&quot;; # happens when the patch is passed through stdin
++
++my @opts;
++while (@argv) {
++ my $s = shift @argv;
++ if ($s eq '-b') {
++ # we don't want .xxx files
++ } elsif ($s eq '--suffix') {
++ # we don't want .xxx files
++ shift @argv;
++ } elsif ($s eq '-i') {
++ # ignore &quot;-i&quot;
++ } else {
++ push @opts, $s;
++ }
++}
++
++# we really don't want .orig when using git (even when there are hunks)
++push @opts, '--no-backup-if-mismatch';
++
++foreach my $patch_file (@patches) {
++ my @header = get_patch_header($patch_file);
++
++ if (grep { /^Subject:/ } @header) {
++ my $patch_file_ = fix_git_patch($patch_file);
++ system_(&quot;git am &quot; . ($patch_file_ || $patch_file));
++ $patch_file_ and unlink $patch_file_;
++ } else {
++ system_(&quot;patch @opts -i $patch_file&quot;);
++
++ my ($patch_name) = $patch_file =~ m!([^/]*)\.(patch|diff)$!;
++
++ system_('git add .');
++ git_commit(commit_line_from_patch_name($patch_name) .
++ (@header ? &quot;\n\n&quot; . join('', cleanup_patch_header(@header)) : ''),
++ # use the date of the patch for the commit:
++ (stat($patch_file))[9] . &quot; +0000&quot;);
++ }
++}
++
++sub system_ {
++ my ($cmd) = @_;
++ print &quot;$cmd\n&quot; if $verbose;
++ system($cmd) == 0 or die &quot;$cmd failed\n&quot;;
++}
++
++sub git_commit {
++ my ($msg, $date) = @_;
++
++ $ENV{GIT_AUTHOR_DATE} = $date;
++ open(my $F, '| git commit -q --author=&quot;unknown author &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">mageia-dev at mageia.org</A>&gt;&quot; --file=-');
++ print $F $msg;
++ close $F or die &quot;git commit failed\n&quot;;
++}
++
++sub commit_line_from_patch_name {
++ my ($name) = @_;
++
++ # remove prefix (eg: &quot;libtool-1.5.26-xxx&quot; =&gt; &quot;xxx&quot;)
++ my $re_name = qr([a-z][\w+]*([_-][a-z][\w+]*)*)i;
++ my $re_rc = qr((rc\d*|RC\d+|beta\d*|pre\d*|p\d+|test));
++ my $re_special_version = qr([a-z]([._-]$re_rc?)?|[._-]?$re_rc?|[a-z]);
++ $name =~ s/^ $re_name [._-] \d+ (\.\d+)+ $re_special_version [._-]//x;
++
++ if (my $pkg_name = $ENV{PKG_NAME}) {
++ $name =~ s/^\Q$pkg_name\E[_-]//;
++ }
++
++ # replace &quot;-&quot; (resp. &quot;_&quot;) with spaces if there is no spaces nor &quot;_&quot; (resp. &quot;-&quot;)
++ if ($name !~ /[\s_]/ &amp;&amp; $name !~ /--/) {
++ $name =~ s/-/ /g;
++ } elsif ($name !~ /[\s-]/ &amp;&amp; $name !~ /__/) {
++ $name =~ s/_/ /g;
++ }
++ $name;
++}
++
++sub get_patch_header {
++ my ($file) = @_;
++ open(my $F, '&lt;', $file) or die &quot;can not open $file: $!\n&quot;;
++
++ my @header;
++ while (my $s = &lt;$F&gt;) {
++ last if $s =~ /^--- /;
++ push @header, $s;
++ }
++ pop @header while @header &amp;&amp; $header[-1] !~ /^\s*$/;
++
++ @header;
++}
++
++sub cleanup_patch_header {
++ my (@header) = @_;
++
++ my @r;
++ foreach (@header) {
++ s/^##\s// or last;
++ push @r, $_;
++ }
++ @r == @header and return @r;
++
++ @header;
++}
++
++# &quot;git format-patch&quot; and &quot;git am&quot; do not agree how to handle commit logs when
++# the first line is not separated from the rest.
++# eg:
++#
++# &gt; Subject: [PATCH 01/34] Delay NSS initialization until actually used
++# &gt; - since NSS is allergic (ie becomes non-functional) after forking, delay
++# &gt; it's initialization until really needed, ie lazy init in rpmDigestInit()
++#
++# workarounding by transforming header to:
++#
++# &gt; Subject: [PATCH 01/34] Delay NSS initialization until actually used
++# &gt;
++# &gt; - since NSS is allergic (ie becomes non-functional) after forking, delay
++# &gt; it's initialization until really needed, ie lazy init in rpmDigestInit()
++sub fix_git_patch {
++ my ($file) = @_;
++ open(my $F, '&lt;', $file) or die &quot;can not open $file: $!\n&quot;;
++
++ my ($last_line, @l);
++ while (my $s = &lt;$F&gt;) {
++ push @l, $s;
++
++ if ($s !~ /^\S+:\s/ &amp;&amp; $last_line &amp;&amp; $last_line =~ /^Subject:/) {
++ # argh, we are in the header, but the value is weird
++ # applying the fix
++ $l[-1] = &quot;\n&quot; . $l[-1];
++ push @l, &lt;$F&gt;;
++ output(&quot;$file.tmp&quot;, @l);
++ return &quot;$file.tmp&quot;;
++ } elsif ($s =~ /^\s*$/ || $s =~ /^--- /) {
++ last;
++ }
++ $last_line = $s;
++ }
++ undef;
++}
++
++sub output { my $f = shift; open(my $F, '&gt;', $f) or die &quot;output in file $f failed: $!\n&quot;; print $F $_ foreach @_; 1 }
+
+
+Property changes on: rpm/rpm-setup/trunk/git-repository--apply-patch
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/http.req
+===================================================================
+--- rpm/rpm-setup/trunk/http.req (rev 0)
++++ rpm/rpm-setup/trunk/http.req 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,165 @@
++#!/usr/bin/perl
++
++# This file can find requirements of html and jhtml files (cgi, gif,
++# java dependencies). It is a bit of a hack but it turns out to work
++# well. We track only dependencies between Relative URLs, absolute
++# URL's are assumed to be extenernal to the RPM system. We do not
++# parse the HTML but look through the set of strings (text surrounded
++# by quotes) for something which looks like a reference. This avoids
++# writing a full HTML parsers and tends to work really well. In this
++# manner we can track dependencies for: href, src, action and other
++# HTML tags which have not been invented yet.
++
++
++# The reference:
++#
++# href=&quot;<A HREF="http://www.perl.org/images/arrow.gif">http://www.perl.org/images/arrow.gif</A>&quot;
++#
++# does not create a dependency but the reference
++#
++# href=&quot;images/arrow.gif&quot;
++#
++# will create a dependency.
++
++# Additionally this program will find the requirements for sun jhtml
++# (html with embedded java) since jhtml is deprecated so is this part
++# of the code.
++
++# These references create dependencies:
++
++# &lt;form action=&quot;signup.jhtml&quot; method=&quot;POST&quot;&gt;
++#
++# &lt;img src=&quot;images/spacer.gif&quot; width=1&gt;
++#
++# &lt;A HREF=&quot;signup.jhtml&quot;&gt;
++#
++# adWidget.writeAd(out, &quot;login.html&quot;, &quot;expired&quot;);
++#
++# response.sendRedirect(&quot;<A HREF="http://">http://</A>&quot;+request.getServerName()+&quot;/mailcom/login.jhtml&quot;);
++
++
++# Notice how we look for strings WITH the proper ending. This is
++# because the java sometimes has really strange double quoting
++# conventions. Look at how splitting out the strings in this
++# fragment would get you the wrong text.
++
++# &lt;img src=&quot;`c.getImage(&quot;bhunterlogo.gif&quot;)`&quot; width=217 &gt;
++
++# Ignore non relative references since these dependencies can not be
++# met. (ie, no package you install will ever provide
++# '<A HREF="http://www.yahoo.com">http://www.yahoo.com</A>').
++
++# I use basename since I have seen too many http references which
++# begin with '../' and I can not figure out where the document root
++# is for the webserver this would just kill the dependnecy tracking
++# mechanism.
++
++
++
++use File::Basename;
++
++# this is the pattern of extensions to call requirements
++
++$DEPS_PAT = '\.((cgi)|(ps)|(pdf)|(png)|(jpg)|(gif)|(tiff)|(tif)|(xbm)|(html)|(htm)|(shtml)|(jhtml))'; #'
++
++if (&quot;@ARGV&quot;) {
++ foreach (@ARGV) {
++ process_file($_);
++ }
++} else {
++
++ # notice we are passed a list of filenames NOT as common in unix the
++ # contents of the file.
++
++ foreach (&lt;&gt;) {
++ process_file($_);
++ }
++}
++
++
++
++foreach $key (sort keys %seen) {
++ print &quot;$key\n&quot;;
++}
++
++
++sub process_file {
++
++ my ($file) = @_;
++ chomp $file;
++
++ open(FILE, &quot;&lt;$file&quot;)||
++ die(&quot;$0: Could not open file: '$file' : $!\n&quot;);
++
++ # we have to suck in the whole file at once because too many people
++ # split lines around &lt;java&gt;&lt;/java&gt; tags.
++
++ my (@file) = &lt;FILE&gt;;
++
++ $_= &quot;@file&quot;;
++
++ # ignore line based comments ( careful although it has two slashes
++ # '<A HREF="http://www.yahoo.com">http://www.yahoo.com</A>' is not a comment! )
++
++ s!^\s*//.*$!!mg;
++ s!//\s.*$!!mg;
++ s!\s//.*$!!mg;
++
++ # ignore multi-line comments
++ # (use non greedy operators)
++
++ s!/\*.*?\*/!!g;
++ s/&lt;!--.*?--&gt;//g;
++
++ # Ignore non relative references since these dependencies can not be
++ # met. (ie, no package you install will ever provide
++ # '<A HREF="http://www.yahoo.com">http://www.yahoo.com</A>').
++
++ # I use basename since I have seen too many http references which
++ # begin with '../' and I can not figure out where the document root
++ # is for the webserver this would just kill the dependnecy tracking
++ # mechanism.
++
++
++ # Notice how we look for strings WITH the proper ending. This is
++ # because the java sometimes has really strange double quoting
++ # conventions. Look at how splitting out the strings in this
++ # fragment would get you the wrong text.
++
++ # &lt;img src=&quot;`c.getImage(&quot;bhunterlogo.gif&quot;)`&quot; width=217 &gt;
++
++ while ( m{\&quot;([^\&quot;]+$DEPS_PAT)\&quot;}g ) {
++ my $string = $1;
++ chomp $string;
++ if ( $string !~ m!<A HREF="http://!">http://!</A> ) {
++ $string = basename($string);
++ $string =~ s!\s+!!g;
++ $seen{&quot;http(${string})&quot;} = 1;
++ }
++ }
++
++ {
++
++ # This section is only for use with (Sun) jhtml dependencies, and
++ # since jhtml is deprecated so is this code.
++
++ # java imports in jhtml (may have stars for leaf class)
++ # these may span several lines
++
++ while ( m!&lt;java type=((import)|(extends))&gt;\s*([^&lt;]+)\s*&lt;!g ) {
++ my $java_list = $4;
++ $java_list =~ s/;/ /g;
++ $java_list =~ s/\n+/ /g;
++ $java_list =~ s/\s+/ /g;
++ foreach $java_class ( split(/\s+/, $java_list) ) {
++ $seen{&quot;java(${java_class})&quot;} = 1;
++ }
++ }
++
++ }
++
++ close(FILE)||
++ die(&quot;$0: Could not close file: '$file' : $!\n&quot;);
++
++ return ;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/http.req
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/kmod.prov
+===================================================================
+--- rpm/rpm-setup/trunk/kmod.prov (rev 0)
++++ rpm/rpm-setup/trunk/kmod.prov 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,26 @@
++#!/bin/sh
++
++provideslist=`sed &quot;s/['\&quot;]/\\\&amp;/g&quot;`
++modulelist=$(echo &quot;$provideslist&quot; | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.gz)?$')
++echo $modulelist | xargs -r /sbin/modinfo | \
++ perl -lne '
++$name = $1 if m!^filename:\s*(?:.*/)?([^/]+)\.k?o!;
++$ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/;
++if (/^vermagic:/) {
++ print &quot;kmod\($name\)&quot; . ($ver ? &quot; = $ver&quot; : &quot;&quot;) if $name;
++ undef $name; undef $ver;
++}
++'
++dkmslist=$(echo &quot;$provideslist&quot; | egrep '(/var/lib/dkms-binary/[^/]+/[^/]+|/usr/src)/[^/]+/dkms.conf$')
++[ -n &quot;$dkmslist&quot; ] &amp;&amp; for d in $dkmslist; do
++ VERSION=`sed -rne 's/^PACKAGE_VERSION=&quot;?([^&quot;]+)&quot;?$/\1/;T;p' $d`
++ [ -z &quot;$VERSION&quot; ] &amp;&amp; continue
++ PACKAGE_NAME=`sed -rne 's/^PACKAGE_NAME=&quot;?([^&quot;]+)&quot;?$/\1/;T;p' $d`
++ MODULES=`sed -rne 's/^DEST_MODULE_NAME\[[0-9]+\]=&quot;?([^&quot;]+)&quot;?$/\1/;T;p' $d`
++ [ -z &quot;$MODULES&quot; ] &amp;&amp; MODULES=`sed -rne 's/^BUILT_MODULE_NAME\[[0-9]+\]=&quot;?([^&quot;]+)&quot;?$/\1/;T;p' $d`
++ # default on PACKAGE_NAME if no BUILT_MODULE_NAME is specified
++ [ -z &quot;$MODULES&quot; ] &amp;&amp; MODULES=$PACKAGE_NAME
++ echo &quot;$MODULES&quot; | sed -re &quot;s/\\\$PACKAGE_NAME/$PACKAGE_NAME/&quot; | while read m; do
++ echo &quot;kmod($m) = $VERSION&quot;
++ done
++done
+
+
+Property changes on: rpm/rpm-setup/trunk/kmod.prov
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/macros-perarch.in
+===================================================================
+--- rpm/rpm-setup/trunk/macros-perarch.in (rev 0)
++++ rpm/rpm-setup/trunk/macros-perarch.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,22 @@
++# Per-platform rpm configuration file.
++# $Id: macros-perarch.in 233523 2008-01-28 17:41:27Z pixel $
++
++#==============================================================================
++# ---- per-platform macros.
++#
++%_arch @RPMARCH@
++%_os @RPMOS@
++%optflags @RPMOPTFLAGS@
++
++#==============================================================================
++# ---- configure macros.
++#
++%_lib @LIB@
++
+<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">+ at MULTILIBSTART</A>@
++#---------------------------------------------------------------------
++# Multilibs
++%_multilibno @MULTILIBNO@
++%_multilibpatt (/%{_lib}|/usr/%{_lib}(|/gconv)|/usr/local/%{_lib}|/usr/X11R6/%{_lib}|/opt/%{_lib})/[^/]*\\.([oa]|la|so[0-9.]*)$
+<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">+ at MULTILIBEND</A>@
++
+
+Added: rpm/rpm-setup/trunk/macros.in
+===================================================================
+--- rpm/rpm-setup/trunk/macros.in (rev 0)
++++ rpm/rpm-setup/trunk/macros.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,56 @@
++# @RPMVENDORDIR@/macros:
++# Main Mangeia rpm configuration
++# Only modified macros goes here
++#
++# $Id: macros.in 260920 2009-09-25 10:10:18Z blino $
++#
++# This is a global RPM configuration file. All changes made here will
++# be lost when the rpm package is upgraded. Any per-system configuration
++# should be added to /etc/rpm/macros, while per-user configuration should
++# be added to ~/.rpmmacros.
++
++%_host_vendor @RPMCANONVENDOR@
++%_real_vendor @RPMCANONVENDOR@
++
++%_vendor @RPMVENDOR@
++
++%_gnu @CANONTARGETGNU@
++%_target_platform %{_target_cpu}-%{_real_vendor}-%{_target_os}%{?_gnu}
++
++%_host %{_host_cpu}-%{_real_vendor}-%{_host_os}
++
++%_changelog_truncate 3 years ago
++
++# use LZMA to compress binary packages:
++%_binary_payload w5.lzdio
++
++#==============================================================================
++# ---- GPG/PGP/PGP5 signature macros.
++# Macro(s) to hold the arguments passed to GPG/PGP for package
++# signing and verification.
++#
++
++# We disable the gpg key automatic querying
++%_hkp_keyserver_query %nil
++
++
++# Verify digest/signature flags for various rpm modes:
++# 0x30300 (_RPMVSF_NODIGESTS) --nohdrchk if set, don't check digest(s)
++# 0xc0c00 (_RPMVSF_NOSIGNATURES) --nosignature if set, don't check signature(s)
++# 0xf0000 (_RPMVSF_NOPAYLOAD) --nolegacy if set, check header+payload (if possible)
++# 0x00f00 (_RPMVSF_NOHEADER) --nohdrchk if set, don't check rpmdb headers
++%_vsflags_query 0xc0c00
++
++
++# Open all indices before doing chroot(2).
++#
++%_openall_before_chroot 1
++
++%_repackage_all_erasures 0
++
++%_query_all_fmt %%{name}-%%{version}-%%{release}
++
++%_rpmlock_path %{_dbpath}/__db.000
++
++# activate filetriggers (cf <A HREF="http://wiki.mandriva.com/en/Rpm_filetriggers">http://wiki.mandriva.com/en/Rpm_filetriggers</A>)
++%_filetriggers_dir /var/lib/rpm/filetriggers
+
+Added: rpm/rpm-setup/trunk/magic.prov
+===================================================================
+--- rpm/rpm-setup/trunk/magic.prov (rev 0)
++++ rpm/rpm-setup/trunk/magic.prov 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,167 @@
++#!/usr/bin/perl
++
++use File::Basename;
++use Getopt::Long;
++
++# this dependency analysis program is the only one which need to know
++# the RPM buildroot to do its work.
++
++# Figuring out what files are really executables via magic numbers is
++# hard. Not only is every '#!' an executable of some type (with a
++# potentially infinite supply of interpreters) but there are thousands
++# of valid binary magic numbers for old OS's and old CPU types.
++
++# Permissions do not always help discriminate binaries from the rest
++# of the files, on Solaris the shared libraries are marked as
++# 'executable'.
++
++# -rwxr-xr-x 1 bin bin 1013248 Jul 1 1998 /lib/libc.so.1
++
++# I would like to let the 'file' command take care of the magic
++# numbers for us. Alas! under linux file prints different kind of
++# messages for each interpreter, there is no common word 'script' to
++# look for.
++
++# ' perl commands text'
++# ' Bourne shell script text'
++# ' a /usr/bin/wish -f script text'
++
++# WORSE on solaris there are entries which say:
++
++# ' current ar archive, not a dynamic executable or shared object'
++
++# how do I grep for 'executable' when people put a 'not executable' in
++# there? I trim off everything after the first comma (if there is
++# one) and if the result has the string 'executable' in it then it may
++# be one.
++
++
++# so we must also do some magic number processing ourselves, and be
++# satisfied with 'good enough'.
++
++# I look for files which have atleast one of the executable bits set
++# and are either labled 'executable' by the file command (see above
++# restriction) OR have a '#!' as their first two characters.
++
++
++$is_mode_executable=oct(111);
++
++# set a known path
++
++$ENV{'PATH'}= (
++ ':/usr/bin'.
++ ':/bin'.
++ '');
++
++# taint perl requires we clean up these bad environmental variables.
++
++delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
++
++$BUILDROOT = '';
++%option_linkage = (
++ &quot;buildroot&quot; =&gt; \$BUILDROOT,
++ );
++
++if( !GetOptions (\%option_linkage, &quot;buildroot=s&quot;) ) {
++ die(&quot;Illegal options in \@ARGV: '@ARGV'\n&quot;);
++
++}
++
++if ($BUILDROOT == '/') {
++ $BUILDROOT = '';
++}
++
++if (&quot;@ARGV&quot;) {
++ foreach (@ARGV) {
++ process_file($_);
++ }
++} else {
++
++ # notice we are passed a list of filenames NOT as common in unix the
++ # contents of the file.
++
++ foreach (&lt;&gt;) {
++ process_file($_);
++ }
++}
++
++
++foreach $module (sort keys %provides) {
++ print &quot;executable($module)\n&quot;;
++}
++
++exit 0;
++
++
++
++
++sub is_file_script {
++
++ my ($file) = @_;
++ chomp $file;
++
++ my $out = 0;
++ open(FILE, &quot;&lt;$file&quot;)||
++ die(&quot;$0: Could not open file: '$file' : $!\n&quot;);
++
++ my $rc = sysread(FILE,$line,2);
++
++ if ( ($rc &gt; 1) &amp;&amp; ($line =~ m/^\#\!/) ) {
++ $out = 1;
++ }
++
++ close(FILE) ||
++ die(&quot;$0: Could not close file: '$file' : $!\n&quot;);
++
++ return $out;
++}
++
++
++
++sub is_file_binary_executable {
++ my ($file) = @_;
++
++ $file_out=`file $file`;
++ # trim off any extra descriptions.
++ $file_out =~ s/\,.*$//;
++
++ my $out = 0;
++ if ($file_out =~ m/executable/ ) {
++ $out = 1;
++ }
++ return $out;
++}
++
++
++sub process_file {
++ my ($file) = @_;
++ chomp $file;
++
++ my $prov_name = $file;
++ $prov_name =~ s!^$BUILDROOT!!;
++
++ # If its a link find the file it points to. Dead links do not
++ # provide anything.
++
++ while (-l $file) {
++ my $newfile = readlink($file);
++ if ($newfile !~ m!^/!) {
++ $newfile = dirname($file).'/'.$newfile;
++ } else {
++ $newfile = $BUILDROOT.$newfile;
++ }
++ $file = $newfile;
++ }
++
++ (-f $file) || return ;
++ ( (stat($file))[2] &amp; $is_mode_executable ) || return ;
++
++ is_file_script($file) ||
++ is_file_binary_executable($file) ||
++ return ;
++
++ $provides{$prov_name}=1;
++ $provides{basename($prov_name)}=1;
++
++ return ;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/magic.prov
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/magic.req
+===================================================================
+--- rpm/rpm-setup/trunk/magic.req (rev 0)
++++ rpm/rpm-setup/trunk/magic.req 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,143 @@
++#!/usr/bin/perl
++
++# Given a list of filenames on the command line or on stdin this
++# script returns the interpreter that is required to run the
++# filenames. Usually this is extracted from the #! line of the file
++# but we also handle the various 'exec' tricks that people use to
++# start the interpreter via an intermediate shell.
++
++# Also we want to convert:
++# /usr/local/bin/perl5.00404
++# /usr/local/bin/tclsh8.0
++# into dependencies with RPM version numbers.
++
++
++
++
++
++# These have all been seen on our system or are &quot;recommended&quot; in
++# various man pages.
++
++# Examples:
++
++# #!/bin/sh
++# # the next line restarts using wish \
++# exec wish &quot;$0&quot; &quot;$@&quot;
++
++
++# #!/bin/sh -- # -*- perl -*- -p
++# eval 'exec /usr/bin/perl -wS $0 ${1+&quot;$@&quot;}'
++# if $running_under_some_shell;
++
++
++# #!/bin/sh -- # -*- perl -*- -p
++# eval '(exit $?0)' &amp;&amp; eval 'exec /usr/bin/perl -wS $0 ${1+&quot;$@&quot;}'
++
++
++# #!/bin/sh -- # -*- perl -*- -p
++# &amp; eval 'exec /usr/bin/perl -wS $0 $argv:q'
++# if $running_under_some_shell;
++
++
++# #! /usr/bin/env python
++
++
++use File::Basename;
++
++if (&quot;@ARGV&quot;) {
++ foreach (@ARGV) {
++ process_file($_);
++ }
++} else {
++
++ # notice we are passed a list of filenames NOT as common in unix the
++ # contents of the file.
++
++ foreach (&lt;&gt;) {
++ process_file($_);
++ }
++}
++
++
++foreach $prog (sort keys %require) {
++
++
++ # ignore variable interpolation and any program whose name is made
++ # up only of non word characters ('&lt;', '&amp;&amp;', etc).
++
++ ( ( $prog != /\$/ ) || ( $prog =~ /^\W+$/ ) ) &amp;&amp;
++ next;
++
++ # filenames of the form './miniperl' will be reported in canonical
++ # manner 'miniperl'
++
++ $prog =~ s!^\./!!;
++
++ if ( $prog !~ /\$/ ) {
++ print &quot;exectuable($prog)\n&quot;;
++ }
++
++ $prog=basename($prog);
++
++ if ( $prog !~ /\$/ ) {
++ print &quot;exectuable($prog)\n&quot;;
++
++ # get the correct version dependencies for magic numbers like:
++ # /usr/local/bin/perl5.00404
++ # /usr/local/bin/tclsh8.0
++ # these are always PACKAGE versions since typical executables do not
++ # have versions
++
++ my $version = &quot;&quot;;
++ if ($module =~ s/([.0-9]+)$//) {
++ $version = &quot;$1&quot;;
++ print &quot;$prog&gt;=$version\n&quot;;
++ }
++
++ }
++
++}
++
++exit 0;
++
++
++sub process_file {
++
++ my ($file) = @_;
++ chomp $file;
++
++ my ($version, $magic) = ();
++
++ (-f $file) || return ;
++
++ open(FILE, &quot;&lt;$file&quot;)||
++ die(&quot;$0: Could not open file: '$file' : $!\n&quot;);
++
++ my $rc = sysread(FILE,$line,1000);
++
++ $rc =~ s/\#.*\n//g;
++
++ # Ignore all parameter substitution.
++ # I have no hope of parsing something like:
++ # exec ${SHELL:-/bin/sh}
++ $rc =~ s/\$\{.*\}//g;
++ $rc =~ s/echo\s+.*[\n;]//g;
++
++ if ( ($rc &gt; 1) &amp;&amp; ($line =~ m/^\#\!\s*/) ) {
++
++ if ($line =~ m/\b(exec|env)\s+([\'\&quot;\`\\]+)?([^ \t\n\r]+)/) {
++ $require{$3} = 1;
++ }
++
++ # strip off extra lines and any arguments
++ if ($line =~ m/^\#\!\s*([^ \t\n\r]+)/) {
++ $require{$1} = 1;
++ }
++
++ }
++
++ close(FILE) ||
++ die(&quot;$0: Could not close file: '$file' : $!\n&quot;);
++
++ return ;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/magic.req
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/make_arch_macrosfiles.sh.in
+===================================================================
+--- rpm/rpm-setup/trunk/make_arch_macrosfiles.sh.in (rev 0)
++++ rpm/rpm-setup/trunk/make_arch_macrosfiles.sh.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,74 @@
++#!/bin/sh
++
++# $Id: make_arch_macrosfiles.sh.in 233560 2008-01-29 15:58:29Z pixel $
++
++MINPUT=&quot;$1&quot;
++ARCH=&quot;$2&quot;
++
++LIB=lib
++OS=@RPMOS@
++OPTFLAGS=`perl -ane &quot;m/^optflags:\s*${ARCH}\b\s*(.*)/ and print \\$1&quot; &lt; rpmrc`
++MULTILIBNO=
++
++case $ARCH in
++ i*86|k6|athlon|pentium*)
++ MULTILIBNO=1
++ CANONARCH=i386
++ ;;
++ amd64|x86_64)
++ MULTILIBNO=2
++ CANONARCH=x86_64
++ LIB=lib64
++ ;;
++ sparc|sparcv9)
++ MULTILIBNO=1
++ CANONARCH=sparc
++ ;;
++ sparc64)
++ MULTILIBNO=2
++ CANONARCH=sparc64
++ LIB=lib64
++ ;;
++ ppc|powerpc|ppc32)
++ MULTILIBNO=1
++ CANONARCH=ppc
++ ;;
++ ppc64|powerpc64)
++ MULTILIBNO=2
++ CANONARCH=ppc64
++ LIB=lib64
++ ;;
++ alpha)
++ CANONARCH=alpha
++ ;;
++ s390)
++ CANONARCH=s390-linux
++ MULTILIBNO=1
++ ;;
++ s390x)
++ CANONARCH=s390x
++ LIB=lib64;
++ MULTILIBNO=2 ;;
++ *)
++ CANONARCH=$ARCH
++ LIB=lib
++ ;;
++esac
++
++if [ -n &quot;$MULTILIBNO&quot; ]; then
++ MULTILIBSED='-e /^@MULTILIB/d -e <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at MULTILIBNO</A>@,'$MULTILIBNO,
++else
++ MULTILIBSED='-e /^@MULTILIBSTART@/,/^@MULTILIBEND@/d'
++fi
++
++if [ -n &quot;$OPTFLAGS&quot; ]; then
++ OPTFLAGSSED=&quot;s/@RPMOPTFLAGS@/${OPTFLAGS}/g&quot;
++else
++ OPTFLAGSSED='s,^%optflags.*,,'
++fi
++
++cat &quot;$MINPUT&quot; | sed \
++ -e &quot;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at RPMARCH</A>@,$CANONARCH,g&quot; \
++ -e &quot;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">s, at LIB</A>@,$LIB,g&quot; \
++ -e &quot;$OPTFLAGSSED&quot; \
++ $MULTILIBSED
+
+Added: rpm/rpm-setup/trunk/perl.prov
+===================================================================
+--- rpm/rpm-setup/trunk/perl.prov (rev 0)
++++ rpm/rpm-setup/trunk/perl.prov 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,187 @@
++#!/usr/bin/perl
++
++# RPM (and it's source code) is covered under two separate licenses.
++
++# The entire code base may be distributed under the terms of the GNU
++# General Public License (GPL), which appears immediately below.
++# Alternatively, all of the source code in the lib subdirectory of the
++# RPM source code distribution as well as any code derived from that
++# code may instead be distributed under the GNU Library General Public
++# License (LGPL), at the choice of the distributor. The complete text
++# of the LGPL appears at the bottom of this file.
++
++# This alternative is allowed to enable applications to be linked
++# against the RPM library (commonly called librpm) without forcing
++# such applications to be distributed under the GPL.
++
++# Any questions regarding the licensing of RPM should be addressed to
++# Erik Troan &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">ewt at redhat.com</A>&gt;.
++
++# a simple script to print the proper name for perl libraries.
++
++# To save development time I do not parse the perl grammmar but
++# instead just lex it looking for what I want. I take special care to
++# ignore comments and pod's.
++
++# it would be much better if perl could tell us the proper name of a
++# given script.
++
++# The filenames to scan are either passed on the command line or if
++# that is empty they are passed via stdin.
++
++# If there are lines in the file which match the pattern
++# (m/^\s*\$VERSION\s*=\s+/)
++# then these are taken to be the version numbers of the modules.
++# Special care is taken with a few known idioms for specifying version
++# numbers of files under rcs/cvs control.
++
++# If there are strings in the file which match the pattern
++# m/^\s*\$RPM_Provides\s*=\s*[&quot;'](.*)['&quot;]/i
++# then these are treated as additional names which are provided by the
++# file and are printed as well.
++
++# I plan to rewrite this in C so that perl is not required by RPM at
++# build time.
++
++# by Ken Estes Mail.com <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">kestes at staff.mail.com</A>
++
++if (&quot;@ARGV&quot;) {
++ foreach (@ARGV) {
++ next if !/\.pm$/;
++ process_file($_);
++ }
++} else {
++
++ # notice we are passed a list of filenames NOT as common in unix the
++ # contents of the file.
++
++ foreach (&lt;&gt;) {
++ chomp $_;
++ next if !/\.pm$/;
++ process_file($_) if -f $_;
++ }
++}
++
++
++foreach $module (sort keys %require) {
++ if (length($require{$module}) == 0) {
++ print &quot;perl($module)\n&quot;;
++ } else {
++
++ # I am not using rpm3.0 so I do not want spaces arround my
++ # operators. Also I will need to change the processing of the
++ # $RPM_* variable when I upgrade.
++
++ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' };
++ print &quot;perl($module) = $v\n&quot;;
++ }
++}
++
++exit 0;
++
++
++
++sub process_file {
++
++ my ($file) = @_;
++
++ open(FILE, &quot;&lt;$file&quot;) || return;
++
++ my ($package, $version, $incomment, $inover) = ();
++
++ while (&lt;FILE&gt;) {
++
++ # skip the documentation
++
++ # we should not need to have item in this if statement (it
++ # properly belongs in the over/back section) but people do not
++ # read the perldoc.
++
++ if (m/^=(head1|head2|pod|item)/) {
++ $incomment = 1;
++ }
++
++ if (m/^=(cut)/) {
++ $incomment = 0;
++ $inover = 0;
++ }
++
++ if (m/^=(over)/) {
++ $inover = 1;
++ }
++
++ if (m/^=(back)/) {
++ $inover = 0;
++ }
++
++ if ($incomment || $inover || m/^\s*#/) {
++ next;
++ }
++
++ # skip the data section
++ if (m/^__(DATA|END)__$/) {
++ last;
++ }
++
++ # not everyone puts the package name of the file as the first
++ # package name so we report all namespaces as if they were
++ # provided packages (really ugly).
++
++ if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
++ # some internal packages, like DB, might be temporarily redefined inside a module.
++ if (!($package &amp;&amp; $1 eq 'DB')) {
++ $package=$1;
++ undef $version;
++ $require{$package}=undef;
++ }
++ }
++
++ # after we found the package name take the first assignment to
++ # $VERSION as the version number. Exporter requires that the
++ # variable be called VERSION so we are safe.
++
++ # here are examples of VERSION lines from the perl distribution
++
++ #FindBin.pm:$VERSION = $VERSION = sprintf(&quot;%d.%02d&quot;, q$Revision: 270245 $ =~ /(\d+)\.(\d+)/);
++ #ExtUtils/Install.pm:$VERSION = substr q$Revision: 270245 $, 10;
++ #CGI/Apache.pm:$VERSION = (qw$Revision: 270245 $)[1];
++ #DynaLoader.pm:$VERSION = $VERSION = &quot;1.03&quot;; # avoid typo warning
++ #$Locale::Maketext::Simple::VERSION = '0.21';
++
++ if (
++ ($package) &amp;&amp;
++ (m/^(.*;)?\s*((my|our)\s+)?\$(${package}::)?VERSION\s*=\s+/)
++ ) {
++
++ # first see if the version string contains the string
++ # '$Revision' this often causes bizzare strings and is the most
++ # common method of non static numbering.
++
++ if (m/(\$Revision: (\d+[.0-9]+))/) {
++ $version= $2;
++ } elsif (m/[\'\&quot;]?(\d+[.0-9]+)[\'\&quot;]?/) {
++
++ # look for a static number hard coded in the script
++
++ $version= $1;
++ }
++ $require{$package}=$version;
++ }
++
++ # Each keyword can appear multiple times. Don't
++ # bother with datastructures to store these strings,
++ # if we need to print it print it now.
++
++ if ( m/^\s*\$RPM_Provides\s*=\s*[&quot;'](.*)['&quot;]/i) {
++ foreach $_ (split(/\s+/, $1)) {
++ print &quot;$_\n&quot;;
++ }
++ }
++
++ }
++
++ close(FILE) ||
++ die(&quot;$0: Could not close file: '$file' : $!\n&quot;);
++
++ return ;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/perl.prov
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/perl.req
+===================================================================
+--- rpm/rpm-setup/trunk/perl.req (rev 0)
++++ rpm/rpm-setup/trunk/perl.req 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,245 @@
++#!/usr/bin/perl
++
++# RPM (and it's source code) is covered under two separate licenses.
++
++# The entire code base may be distributed under the terms of the GNU
++# General Public License (GPL), which appears immediately below.
++# Alternatively, all of the source code in the lib subdirectory of the
++# RPM source code distribution as well as any code derived from that
++# code may instead be distributed under the GNU Library General Public
++# License (LGPL), at the choice of the distributor. The complete text
++# of the LGPL appears at the bottom of this file.
++
++# This alternatively is allowed to enable applications to be linked
++# against the RPM library (commonly called librpm) without forcing
++# such applications to be distributed under the GPL.
++
++# Any questions regarding the licensing of RPM should be addressed to
++# Erik Troan &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">ewt at redhat.com</A>&gt;.
++
++# a simple makedepends like script for perl.
++
++# To save development time I do not parse the perl grammmar but
++# instead just lex it looking for what I want. I take special care to
++# ignore comments and pod's.
++
++# It would be much better if perl could tell us the dependencies of a
++# given script.
++
++# The filenames to scan are either passed on the command line or if
++# that is empty they are passed via stdin.
++
++# If there are strings in the file which match the pattern
++# m/^\s*\$RPM_Requires\s*=\s*[&quot;'](.*)['&quot;]/i
++# then these are treated as additional names which are required by the
++# file and are printed as well.
++
++# I plan to rewrite this in C so that perl is not required by RPM at
++# build time.
++
++# by Ken Estes Mail.com <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">kestes at staff.mail.com</A>
++
++if (&quot;@ARGV&quot;) {
++ foreach (@ARGV) {
++ process_file($_);
++ }
++} else {
++
++ # notice we are passed a list of filenames NOT as common in unix the
++ # contents of the file.
++
++ foreach (&lt;&gt;) {
++ chomp $_;
++ process_file($_) if -f $_;
++ }
++}
++
++
++foreach $module (sort keys %require) {
++ if (length($require{$module}) == 0) {
++ print &quot;perl($module)\n&quot;;
++ } else {
++
++ # I am not using rpm3.0 so I do not want spaces arround my
++ # operators. Also I will need to change the processing of the
++ # $RPM_* variable when I upgrade.
++
++ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' };
++ print &quot;perl($module) &gt;= $v\n&quot;;
++ }
++}
++
++exit 0;
++
++
++
++sub process_file {
++
++ my ($file) = @_;
++
++ open(FILE, &quot;&lt;$file&quot;) || return;
++
++ while (&lt;FILE&gt;) {
++
++ # skip the &quot;= &lt;&lt;&quot; block
++
++ if ( ( m/^\s*\$(.*)\s*=\s*&lt;&lt;\s*[&quot;'](.*)['&quot;]/i) ||
++ ( m/^\s*\$(.*)\s*=\s*&lt;&lt;\s*(.*);/i) ) {
++ $tag = $2;
++ while (&lt;FILE&gt;) {
++ ( $_ =~ /^$tag/) &amp;&amp; last;
++ }
++ }
++
++ # skip the documentation
++
++ # we should not need to have item in this if statement (it
++ # properly belongs in the over/back section) but people do not
++ # read the perldoc.
++
++ if ( (m/^=(head1|head2|pod|item)/) .. (m/^=(cut)/) ) {
++ next;
++ }
++
++ if ( (m/^=(over)/) .. (m/^=(back)/) ) {
++ next;
++ }
++
++ # skip the data section
++ if (m/^__(DATA|END)__$/) {
++ last;
++ }
++
++ # Each keyword can appear multiple times. Don't
++ # bother with datastructures to store these strings,
++ # if we need to print it print it now.
++
++ if ( m/^\s*\$RPM_Requires\s*=\s*[&quot;'](.*)['&quot;]/i) {
++ foreach $_ (split(/\s+/, $1)) {
++ print &quot;$_\n&quot;;
++ }
++ }
++
++ if (
++
++# ouch could be in a eval, perhaps we do not want these since we catch
++# an exception they must not be required
++
++# eval { require Term::ReadLine } or die $@;
++# eval &quot;require Term::Rendezvous;&quot; or die $@;
++# eval { require Carp } if defined $^S; # If error/warning during compilation,
++
++
++ (m/^(\s*) # we hope the inclusion starts the line
++ (require|use)\s+(?!\{) # do not want 'do {' loops
++ # quotes around name are always legal
++ [\'\&quot;]?([^\;\ \'\&quot;\t]*)[\'\&quot;]?[\t\;\ ]
++ # the syntax for 'use' allows version requirements
++ \s*([.0-9]*)
++ /x)
++ ) {
++ my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4);
++ my $usebase;
++
++ # we only consider require statements that are flush against
++ # the left edge. any other require statements give too many
++ # false positives, as they are usually inside of an if statement
++ # as a fallback module or a rarely used option
++
++ ($whitespace ne &quot;&quot; &amp;&amp; $statement eq &quot;require&quot;) &amp;&amp; next;
++
++ # if there is some interpolation of variables just skip this
++ # dependency, we do not want
++ # do &quot;$ENV{LOGDIR}/$rcfile&quot;;
++
++ ($module =~ m/\$/) &amp;&amp; next;
++
++ # skip if the phrase was &quot;use of&quot; -- shows up in gimp-perl, et al
++ next if $module eq 'of';
++
++ # if the module ends in a comma we probaly caught some
++ # documentation of the form 'check stuff,\n do stuff, clean
++ # stuff.' there are several of these in the perl distribution
++
++ ($module =~ m/[,&gt;]$/) &amp;&amp; next;
++
++ # if the module name starts in a dot it is not a module name.
++ # Is this necessary? Please give me an example if you turn this
++ # back on.
++
++ # ($module =~ m/^\./) &amp;&amp; next;
++
++ # if the module ends with .pm strip it to leave only basename.
++ # starts with /, which means its an absolute path to a file
++ if ($module =~ m(^/)) {
++ print &quot;$module\n&quot;;
++ next;
++ }
++
++ # as seen in some perl scripts
++ # use base qw(App::CLI Class::Accessor::Chained::Fast App::CLI::Command);
++ if ($module eq 'base') {
++ $require{$module} = $version;
++ $line{$module} = $current_line;
++ ($module = $_) =~ s/use\s*base\s*//;
++ $module =~ s/qw\((.*)\)\s*;/$1/;
++ $module =~ s/qw(.)(.*)\1\s*;/$2/;
++ $module =~ s/\s*;$//;
++ $module =~ s/#.*//;
++ $usebase = 1;
++ }
++ # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc
++ # we can strip qw.*$, as well as (.*$:
++ $module =~ s/qw.*$//;
++ $module =~ s/\(.*$//;
++
++ $module =~ s/\.pm$//;
++
++ # some perl programmers write 'require URI/URL;' when
++ # they mean 'require URI::URL;'
++
++ $module =~ s/\//::/;
++
++ # trim off trailing parenthesis if any. Sometimes people pass
++ # the module an empty list.
++
++ $module =~ s/\(\s*\)$//;
++
++ # if module is a number then both require and use interpret that
++ # to mean that a particular version of perl is specified. Don't
++ # add a dependency, though, since the rpm will already require
++ # perl-base at the build version (via find-requires)
++ next if $module =~ /^v?\d/;
++
++ # ph files do not use the package name inside the file.
++ # perlmodlib documentation says:
++ # the .ph files made by h2ph will probably end up as
++ # extension modules made by h2xs.
++ # so do not spend much effort on these.
++
++ # there is no easy way to find out if a file named systeminfo.ph
++ # will be included with the name sys/systeminfo.ph so only use the
++ # basename of *.ph files
++
++ ($module =~ m/\.ph$/) &amp;&amp; next;
++
++ # if the module was loaded trough base, we need to split the list
++ if ($usebase) {
++ my $current_line = $_;
++ foreach (split(/\s+/, $module)) {
++ next unless $_;
++ $require{$_} = $version;
++ $line{$_} = $current_line;
++ }
++ } else {
++ $require{$module}=$version;
++ $line{$module}=$current_line;
++ }
++ }
++ }
++
++ close(FILE) ||
++ die(&quot;$0: Could not close file: '$file' : $!\n&quot;);
++
++ return ;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/perl.req
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/perl.req-from-meta
+===================================================================
+--- rpm/rpm-setup/trunk/perl.req-from-meta (rev 0)
++++ rpm/rpm-setup/trunk/perl.req-from-meta 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,56 @@
++#!/usr/bin/perl
++
++use strict;
++use warnings;
++
++use JSON qw{ from_json };
++use YAML qw{ Load };
++
++# slurp the file
++my $path = shift;
++open my $fh, '&lt;', $path or die &quot;can't open $path: $!&quot;;
++my $data = do { local $/; &lt;$fh&gt; };
++close $fh;
++
++# parse meta - either yaml or json
++my $meta = $path =~ /\.yml$/
++ ? Load( $data )
++ : from_json( $data );
++
++# dump the requires with their version
++my $requires = $meta-&gt;{&quot;meta-spec&quot;}{version} &gt;= 2
++ ? $meta-&gt;{prereqs}{runtime}{requires}
++ : $meta-&gt;{requires};
++foreach my $module ( sort keys %$requires ) {
++ next if $module eq 'perl'; # minimum perl version
++ my $version = $requires-&gt;{$module};
++ if ( $version == 0 ) {
++ print &quot;perl($module)\n&quot;;
++ } else {
++ my $v = qx{ rpm --eval '%perl_convert_version $version' };
++ print &quot;perl($module) &gt;= $v&quot;;
++ }
++}
++
++exit;
++
++=head1 NAME
++
++perl.req-from-meta - extract requires from meta file
++
++=head1 SYNOPSIS
++
++ $ perl.req-from-meta /path/to/META.yml
++ $ perl.req-from-meta /path/to/META.json
++
++=head1 DESCRIPTION
++
++This script will extract Perl requirements from the distribution meta
++file. For each such requires, it'll convert the minimum version to
++follow Mageia perl versioning (using C&lt;%perl_convert_version&gt;), and
++print them as:
++
++ perl(Foo::Bar)
++ perl(App::Frobnizer) &gt;= 1.23.456
++
++Minimum perl version are skipped.
+
+
+Property changes on: rpm/rpm-setup/trunk/perl.req-from-meta
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/php.prov
+===================================================================
+--- rpm/rpm-setup/trunk/php.prov (rev 0)
++++ rpm/rpm-setup/trunk/php.prov 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,20 @@
++#!/usr/bin/perl
++#####################################################################
++# #
++# Check system dependences between php-pear modules #
++# #
++# Pawe\xB3 Go\xB3aszewski &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">blues at ds.pg.gda.pl</A>&gt; #
++# Micha\xB3 Moskal &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">malekith at pld-linux.org</A>&gt; #
++# ------------------------------------------------------------------#
++# TODO: #
++#####################################################################
++
++$pear = &quot;/usr/share/pear&quot;;
++
++foreach (@ARGV ? @ARGV : &lt;&gt;) {
++ chomp;
++ $f = $_;
++ next unless ($f =~ /$pear.*\.php$/);
++ $f =~ s/.*$pear\///;
++ print &quot;pear($f)\n&quot;;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/php.prov
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/php.req
+===================================================================
+--- rpm/rpm-setup/trunk/php.req (rev 0)
++++ rpm/rpm-setup/trunk/php.req 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,81 @@
++#!/usr/bin/perl
++#####################################################################
++# #
++# Check system dependences between php-pear modules #
++# #
++# Pawe\xB3 Go\xB3aszewski &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">blues at ds.pg.gda.pl</A>&gt; #
++# Micha\xB3 Moskal &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">malekith at pld-linux.org</A>&gt; #
++# ------------------------------------------------------------------#
++# TODO: #
++# - extension_loaded - dependencies. #
++# - some clean-up... #
++#####################################################################
++
++$pear = &quot;/usr/share/pear&quot;;
++
+<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">+ at files</A> = ();
++%req = ();
++
++foreach (@ARGV ? $ARGV : &lt;&gt; ) {
++ chomp;
++ $f = $_;
++ push @files, $f;
++ open(F, &quot;&lt; $f&quot;) or die;
++
++ if ($f =~ /$pear/) {
++ $file_dir = $f;
++ $file_dir =~ s|.*$pear/||;
++ $file_dir =~ s|/[^/]*$||;
++ } else {
++ $file_dir = undef;
++ }
++
++ while (&lt;F&gt;) {
++ # skip comments
++ next if (/^\s*(#|\/\/|\*|\/\*)/);
++ while (/(\W|^)(require|include)(_once)?
++ \s* \(? \s* (&quot;([^&quot;]*)&quot;|'([^']*)')
++ \s* \)? \s* ;/xg) {
++
++ if ($5 ne &quot;&quot;) {
++ $x = $5;
++ } elsif ($6 ne &quot;&quot;) {
++ $x = $6;
++ } else {
++ next;
++ }
++ do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//;
++ do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//;
++ next if ($x =~ m|^\.\.?/| or $x =~ /\$/);
++ next unless ($x =~ /\.php$/);
++ $req{$x} = 1;
++ }
++
++ next unless (defined $file_dir);
++
++ while (/(\W|^)(require|include)(_once)?
++ \s* \(? \s* dirname \s* \( \s* __FILE__ \s* \) \s* \. \s*
++ (&quot;([^&quot;]*)&quot;|'([^']*)')
++ \s* \)? \s* ;/xg) {
++ if ($5 ne &quot;&quot;) {
++ $x = $5;
++ } elsif ($6 ne &quot;&quot;) {
++ $x = $6;
++ } else {
++ next;
++ }
++
++ next unless ($x =~ /\.php$/);
++
++ $x = &quot;$file_dir/$x&quot;;
++ do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//;
++ do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//;
++ $req{$x} = 1;
++ }
++ }
++}
++
++f: for $f (keys %req) {
++ for $g (@files) { next f if ($g =~ /\Q$f\E$/); }
++ print &quot;pear($f)\n&quot;;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/php.req
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/pkgconfigdeps.sh
+===================================================================
+--- rpm/rpm-setup/trunk/pkgconfigdeps.sh (rev 0)
++++ rpm/rpm-setup/trunk/pkgconfigdeps.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,46 @@
++#!/bin/bash
++
++pkgconfig=/usr/bin/pkg-config
++test -x $pkgconfig || {
++ cat &gt; /dev/null
++ exit 0
++}
++
++[ $# -ge 1 ] || {
++ cat &gt; /dev/null
++ exit 0
++}
++
++case $1 in
++-P|--provides)
++ while read filename ; do
++ case &quot;${filename}&quot; in
++ *.pc)
++ # Assume that this file doesn't contain useful information.
++ pcfiles=${pcfiles}&quot; ${filename}&quot;
++ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(dirname ${filename})
++ ;;
++ esac
++ done
++ # Query the dependencies of the package.
++ PKG_CONFIG_PATH=$PKG_CONFIG_PATH $pkgconfig --print-provides $pcfiles 2&gt; /dev/null | while read n r v ; do
++ # We have a dependency. Make a note that we need the pkgconfig
++ # tool for this package.
++ echo &quot;pkgconfig($n)&quot; &quot;$r&quot; &quot;$v&quot;
++ done
++ # The dependency on the pkgconfig package itself.
++ ;;
++-R|--requires)
++ while read filename ; do
++ case &quot;${filename}&quot; in
++ *.pc)
++ pcfiles=${pcfiles}&quot; ${filename}&quot;
++ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(dirname ${filename})
++ esac
++ done
++ PKG_CONFIG_PATH=$PKG_CONFIG_PATH $pkgconfig --print-requires ${pcfiles} 2&gt; /dev/null | while read n r v ; do
++ echo &quot;pkgconfig($n)&quot; &quot;$r&quot; &quot;$v&quot;
++ done
++ ;;
++esac
++exit 0
+
+
+Property changes on: rpm/rpm-setup/trunk/pkgconfigdeps.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/pythoneggs.py
+===================================================================
+--- rpm/rpm-setup/trunk/pythoneggs.py (rev 0)
++++ rpm/rpm-setup/trunk/pythoneggs.py 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,180 @@
++#!/usr/bin/env python
++# -*- coding: utf-8 -*-
++#
++# Copyright 2010 Per &#216;yvind Karlsen &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">peroyvind at mandriva.org</A>&gt;
++#
++# This program is free software. It may be redistributed and/or modified under
++# the terms of the LGPL version 2.1 (or later).
++#
++# RPM5 python (egg) dependency generator.
++#
++
++from getopt import getopt
++from os.path import basename, dirname, isdir, sep, splitext
++from sys import argv, stdin, version
++from pkg_resources import Distribution, FileMetadata, PathMetadata
++from distutils.sysconfig import get_python_lib
++
++
++opts, args = getopt(argv[1:], 'hPRSCOE',
++ ['help', 'provides', 'requires', 'suggests', 'conflicts', 'obsoletes', 'extras'])
++
++Provides = False
++Requires = False
++Suggests = False
++Conflicts = False
++Obsoletes = False
++Extras = False
++
++for o, a in opts:
++ if o in ('-h', '--help'):
++ print '-h, --help\tPrint help'
++ print '-P, --provides\tPrint Provides'
++ print '-R, --requires\tPrint Requires'
++ print '-S, --suggests\tPrint Suggests'
++ print '-C, --conflicts\tPrint Conflicts'
++ print '-O, --obsoletes\tPrint Obsoletes (unused)'
++ print '-E, --extras\tPrint Extras '
++ exit(1)
++ elif o in ('-P', '--provides'):
++ Provides = True
++ elif o in ('-R', '--requires'):
++ Requires = True
++ elif o in ('-S', '--suggests'):
++ Suggests = True
++ elif o in ('-C', '--conflicts'):
++ Conflicts = True
++ elif o in ('-O', '--obsoletes'):
++ Obsoletes = True
++ elif o in ('-E', '--extras'):
++ Extras = True
++
++if Requires:
++ py_abi = True
++else:
++ py_abi = False
++py_deps = {}
++if args:
++ files = args
++else:
++ files = stdin.readlines()
++for f in files:
++ f = f.strip()
++ lower = f.lower()
++ name = 'python(abi)'
++ # add dependency based on path, versioned if within versioned python directory
++ if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')):
++ if not name in py_deps:
++ py_deps[name] = []
++ purelib = get_python_lib(standard_lib=1, plat_specific=0).split(version[:3])[0]
++ platlib = get_python_lib(standard_lib=1, plat_specific=1).split(version[:3])[0]
++ for lib in (purelib, platlib):
++ if lib in f:
++ spec = ('==',f.split(lib)[1].split(sep)[0])
++ if not spec in py_deps[name]:
++ py_deps[name].append(spec)
++ # Determine provide, requires, conflicts &amp; suggests based on egg metadata
++ if lower.endswith('.egg') or \
++ lower.endswith('.egg-info') or \
++ lower.endswith('.egg-link'):
++ dist_name = basename(f)
++ if isdir(f):
++ path_item = dirname(f)
++ metadata = PathMetadata(path_item, f)
++ else:
++ path_item = f
++ metadata = FileMetadata(f)
++ dist = Distribution.from_location(path_item, dist_name, metadata)
++ if Provides:
++ # If egg metadata says package name is python, we provide python(abi)
++ if dist.key == 'python':
++ name = 'python(abi)'
++ if not name in py_deps:
++ py_deps[name] = []
++ py_deps[name].append(('==', dist.py_version))
++ name = 'pythonegg(%s)' % dist.project_name
++ if not name in py_deps:
++ py_deps[name] = []
++ if dist.version:
++ spec = ('==', dist.version)
++ if not spec in py_deps[name]:
++ py_deps[name].append(spec)
++ if Requires or (Suggests and dist.extras):
++ name = 'python(abi)'
++ # If egg metadata says package name is python, we don't add dependency on python(abi)
++ if dist.key == 'python':
++ py_abi = False
++ if name in py_deps:
++ py_deps.pop(name)
++ elif py_abi and dist.py_version:
++ if not name in py_deps:
++ py_deps[name] = []
++ spec = ('==', dist.py_version)
++ if not spec in py_deps[name]:
++ py_deps[name].append(spec)
++ deps = dist.requires()
++ if Suggests:
++ depsextras = dist.requires(extras=dist.extras)
++ if not Requires:
++ for dep in reversed(depsextras):
++ if dep in deps:
++ depsextras.remove(dep)
++ deps = depsextras
++ # add requires/suggests based on egg metadata
++ for dep in deps:
++ name = 'pythonegg(%s)' % dep.project_name
++ for spec in dep.specs:
++ if spec[0] != '!=':
++ if not name in py_deps:
++ py_deps[name] = []
++ if not spec in py_deps[name]:
++ py_deps[name].append(spec)
++ if not dep.specs:
++ py_deps[name] = []
++ # Unused, for automatic sub-package generation based on 'extras' from egg metadata
++ # TODO: implement in rpm later, or...?
++ if Extras:
++ deps = dist.requires()
++ extras = dist.extras
++ print extras
++ for extra in extras:
++ print '%%package\textras-%s' % extra
++ print 'Summary:\t%s extra for %s python egg' % (extra, dist.project_name)
++ print 'Group:\t\tDevelopment/Python'
++ depsextras = dist.requires(extras=[extra])
++ for dep in reversed(depsextras):
++ if dep in deps:
++ depsextras.remove(dep)
++ deps = depsextras
++ for dep in deps:
++ for spec in dep.specs:
++ if spec[0] == '!=':
++ print 'Conflicts:\t%s %s %s' % (dep.project_name, '==', spec[1])
++ else:
++ print 'Requires:\t%s %s %s' % (dep.project_name, spec[0], spec[1])
++ print '%%description\t%s' % extra
++ print '%s extra for %s python egg' % (extra, dist.project_name)
++ print '%%files\t\textras-%s\n' % extra
++ if Conflicts:
++ # Should we really add conflicts for extras?
++ # Creating a meta package per extra with suggests on, which has
++ # the requires/conflicts in stead might be a better solution...
++ for dep in dist.requires(extras=dist.extras):
++ name = dep.project_name
++ for spec in dep.specs:
++ if spec[0] == '!=':
++ if not name in py_deps:
++ py_deps[name] = []
++ spec = ('==', spec[1])
++ if not spec in py_deps[name]:
++ py_deps[name].append(spec)
++names = py_deps.keys()
++names.sort()
++for name in names:
++ if py_deps[name]:
++ # Print out versioned provides, requires, suggests, conflicts
++ for spec in py_deps[name]:
++ print '%s %s %s' % (name, spec[0], spec[1])
++ else:
++ # Print out unversioned provides, requires, suggests, conflicts
++ print name
+
+
+Property changes on: rpm/rpm-setup/trunk/pythoneggs.py
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/rpm-spec-mode.el
+===================================================================
+--- rpm/rpm-setup/trunk/rpm-spec-mode.el (rev 0)
++++ rpm/rpm-setup/trunk/rpm-spec-mode.el 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,1366 @@
++;;; rpm-spec-mode.el --- RPM spec file editing commands for Emacs/XEmacs
++
++;; $Id: rpm-spec-mode.el 232641 2007-12-20 09:58:22Z pixel $
++
++;; Copyright (C) 1997-2002 Stig Bj\xF8rlykke, &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">stigb at tihlde.org</A>&gt;
++
++;; Author: Stig Bj\xF8rlykke, &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">stigb at tihlde.org</A>&gt;
++;; Keywords: unix, languages
++;; Version: 0.12
++
++;; This file is part of XEmacs.
++
++;; XEmacs is free software; you can redistribute it and/or modify
++;; it under the terms of the GNU General Public License as published by
++;; the Free Software Foundation; either version 2, or (at your option)
++;; any later version.
++
++;; XEmacs is distributed in the hope that it will be useful,
++;; but WITHOUT ANY WARRANTY; without even the implied warranty of
++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++;; General Public License for more details.
++
++;; You should have received a copy of the GNU General Public License
++;; along with XEmacs; see the file COPYING. If not, write to the
++;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
++;; MA 02111-1307, USA.
++
++;;; Synched up with: not in GNU Emacs.
++
++;;; Thanx to:
++
++;; Tore Olsen &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">toreo at tihlde.org</A>&gt; for some general fixes.
++;; Steve Sanbeg &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">sanbeg at dset.com</A>&gt; for navigation functions and
++;; some Emacs fixes.
++;; Tim Powers &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">timp at redhat.com</A>&gt; and Trond Eivind Glomsr\xF8d
++;; &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">teg at redhat.com</A>&gt; for Red Hat adaptions and some fixes.
++;; Chmouel Boudjnah &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">chmouel at mandrakesoft.com</A>&gt; for Mandrake fixes.
++
++;;; ToDo:
++
++;; - rewrite function names.
++;; - autofill changelog entries.
++;; - customize rpm-tags-list and rpm-group-tags-list.
++;; - get values from `rpm --showrc'.
++;; - ssh/rsh for compile.
++;; - finish integrating the new navigation functions in with existing stuff.
++;; - use a single prefix consistently (internal)
++
++;;; Commentary:
++
++;; This mode is used for editing spec files used for building RPM packages.
++;;
++;; Most recent version is available from:
++;; &lt;URL:<A HREF="http://www.tihlde.org/~stigb/rpm-spec-mode.el">http://www.tihlde.org/~stigb/rpm-spec-mode.el</A>&gt;
++;;
++;; Put this in your .emacs file to enable autoloading of rpm-spec-mode,
++;; and auto-recognition of &quot;.spec&quot; files:
++;;
++;; (autoload 'rpm-spec-mode &quot;rpm-spec-mode.el&quot; &quot;RPM spec mode.&quot; t)
++;; (setq auto-mode-alist (append '((&quot;\\.spec&quot; . rpm-spec-mode))
++;; auto-mode-alist))
++;;------------------------------------------------------------
++;;
++
++;;; Code:
++(require 'cl)
++
++(defconst rpm-spec-mode-version &quot;0.12&quot; &quot;Version of `rpm-spec-mode'.&quot;)
++
++;Fix for GNU/Emacs
++(if (not(featurep 'xemacs))
++ (fset 'define-obsolete-variable-alias 'make-obsolete))
++
++(defgroup rpm-spec nil
++ &quot;RPM spec mode with Emacs/XEmacs enhancements.&quot;
++ :prefix &quot;rpm-spec-&quot;
++ :group 'languages)
++
++(defcustom rpm-spec-build-command &quot;rpmbuild&quot;
++ &quot;Command for building a RPM package.&quot;
++ :type 'string
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-add-attr nil
++ &quot;Add \&quot;%attr\&quot; entry for file listings or not.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-short-circuit nil
++ &quot;Skip straight to specified stage.
++(ie, skip all stages leading up to the specified stage). Only valid
++in \&quot;%build\&quot; and \&quot;%install\&quot; stage.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-no-deps nil
++ &quot;Do not verify the dependencies.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-timecheck &quot;0&quot;
++ &quot;Set the \&quot;timecheck\&quot; age (0 to disable).
++The timecheck value expresses, in seconds, the maximum age of a file
++being packaged. Warnings will be printed for all files beyond the
++timecheck age.&quot;
++ :type 'integer
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-buildroot &quot;&quot;
++ &quot;Override the BuildRoot tag with directory &lt;dir&gt;.&quot;
++ :type 'string
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-target &quot;&quot;
++ &quot;Interpret given string as `arch-vendor-os'.
++Set the macros _target, _target_arch and _target_os accordingly&quot;
++ :type 'string
++ :group 'rpm-spec)
++
++(define-obsolete-variable-alias
++ 'rpm-completion-ignore-case 'rpm-spec-completion-ignore-case)
++
++(defcustom rpm-spec-completion-ignore-case t
++ &quot;*Non-nil means that case differences are ignored during completion.
++A value of nil means that case is significant.
++This is used during Tempo template completion.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-clean nil
++ &quot;Remove the build tree after the packages are made.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-rmsource nil
++ &quot;Remove the source and spec file after the packages are made.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-nobuild nil
++ &quot;Do not execute any build stages. Useful for testing out spec files.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-sign-gpg nil
++ &quot;Embed a GPG signature in the package.
++This signature can be used to verify the integrity and the origin of
++the package.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-nodeps nil
++ &quot;Do not verify build dependencies.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-old-rpm nil
++ &quot;Set if using `rpm' as command for building packages.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(define-obsolete-variable-alias
++ 'rpm-initialize-sections 'rpm-spec-initialize-sections)
++
++(defcustom rpm-spec-initialize-sections t
++ &quot;Automatically add empty section headings to new spec files.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-use-tabs nil
++ &quot;Use tabs instead of a space to indent tags.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(define-obsolete-variable-alias
++ 'rpm-insert-version 'rpm-spec-insert-changelog-version)
++
++(defcustom rpm-spec-insert-changelog-version t
++ &quot;Automatically add version in a new change log entry.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-insert-changelog-version-with-shell t
++ &quot;Automatically add version with shell in a new change log entry.&quot;
++ :type 'boolean
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-user-full-name nil
++ &quot;*Full name of the user.
++This is used in the change log and the Packager tag. It defaults to the
++value returned by function `user-full-name'.&quot;
++ :type '(choice (const :tag &quot;Use `user-full-name'&quot; nil)
++ string)
++ :group 'rpm-spec)
++
++(defcustom rpm-spec-user-mail-address nil
++ &quot;*Email address of the user.
++This is used in the change log and the Packager tag. It defaults to the
++value returned by function `user-mail-address'.&quot;
++ :type '(choice (const :tag &quot;Use `user-mail-address'&quot; nil)
++ string)
++ :group 'rpm-spec)
++
++(defgroup rpm-spec-faces nil
++ &quot;Font lock faces for `rpm-spec-mode'.&quot;
++ :group 'rpm-spec
++ :group 'faces)
++
++;;------------------------------------------------------------
++;; variables used by navigation functions.
++
++(defconst rpm-sections
++ '(&quot;preamble&quot; &quot;description&quot; &quot;prep&quot; &quot;setup&quot; &quot;build&quot; &quot;install&quot; &quot;clean&quot;
++ &quot;changelog&quot; &quot;files&quot;)
++ &quot;Partial list of section names.&quot;)
++(defvar rpm-section-list
++ '((&quot;preamble&quot;) (&quot;description&quot;) (&quot;prep&quot;) (&quot;setup&quot;) (&quot;build&quot;) (&quot;install&quot;)
++ (&quot;clean&quot;) (&quot;changelog&quot;) (&quot;files&quot;))
++ &quot;Partial list of section names.&quot;)
++(defconst rpm-scripts
++ '(&quot;pre&quot; &quot;post&quot; &quot;preun&quot; &quot;postun&quot;
++ &quot;trigger&quot; &quot;triggerin&quot; &quot;triggerun&quot; &quot;triggerpostun&quot;)
++ &quot;List of rpm scripts.&quot;)
++(defconst rpm-section-seperate &quot;^%\\(\\w+\\)\\s-&quot;)
++(defconst rpm-section-regexp
++ (eval-when-compile
++ (concat &quot;^%&quot;
++ (regexp-opt
++ ;; From RPM 4.1 sources, file build/parseSpec.c: partList[].
++ '(&quot;build&quot; &quot;changelog&quot; &quot;clean&quot; &quot;description&quot; &quot;files&quot; &quot;install&quot;
++ &quot;package&quot; &quot;post&quot; &quot;postun&quot; &quot;pre&quot; &quot;prep&quot; &quot;preun&quot; &quot;trigger&quot;
++ &quot;triggerin&quot; &quot;triggerpostun&quot; &quot;triggerun&quot; &quot;verifyscript&quot;) t)
++ &quot;\\b&quot;))
++ &quot;Regular expression to match beginning of a section.&quot;)
++
++;;------------------------------------------------------------
++
++(defface rpm-spec-tag-face
++ '(( ((class color) (background light)) (:foreground &quot;blue&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;blue&quot;) ))
++ &quot;*The face used for tags.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-macro-face
++ '(( ((class color) (background light)) (:foreground &quot;purple&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;yellow&quot;) ))
++ &quot;*The face used for macros.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-var-face
++ '(( ((class color) (background light)) (:foreground &quot;maroon&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;maroon&quot;) ))
++ &quot;*The face used for environment variables.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-doc-face
++ '(( ((class color) (background light)) (:foreground &quot;magenta&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;magenta&quot;) ))
++ &quot;*The face used for document files.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-dir-face
++ '(( ((class color) (background light)) (:foreground &quot;green&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;green&quot;) ))
++ &quot;*The face used for directories.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-package-face
++ '(( ((class color) (background light)) (:foreground &quot;red&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;red&quot;) ))
++ &quot;*The face used for files.&quot;
++ :group 'rpm-spec-faces)
++
++(defface rpm-spec-ghost-face
++ '(( ((class color) (background light)) (:foreground &quot;red&quot;) )
++ ( ((class color) (background dark)) (:foreground &quot;red&quot;) ))
++ &quot;*The face used for ghost tags.&quot;
++ :group 'rpm-spec-faces)
++
++;;; GNU emacs font-lock needs these...
++(defvar rpm-spec-macro-face
++ 'rpm-spec-macro-face &quot;*Face for macros.&quot;)
++(defvar rpm-spec-var-face
++ 'rpm-spec-var-face &quot;*Face for environment variables.&quot;)
++(defvar rpm-spec-tag-face
++ 'rpm-spec-tag-face &quot;*Face for tags.&quot;)
++(defvar rpm-spec-package-face
++ 'rpm-spec-package-face &quot;*Face for package tag.&quot;)
++(defvar rpm-spec-dir-face
++ 'rpm-spec-dir-face &quot;*Face for directory entries.&quot;)
++(defvar rpm-spec-doc-face
++ 'rpm-spec-doc-face &quot;*Face for documentation entries.&quot;)
++(defvar rpm-spec-ghost-face
++ 'rpm-spec-ghost-face &quot;*Face for \&quot;%ghost\&quot; files.&quot;)
++
++(defvar rpm-default-umask &quot;-&quot;
++ &quot;*Default umask for files, specified with \&quot;%attr\&quot;.&quot;)
++(defvar rpm-default-owner &quot;root&quot;
++ &quot;*Default owner for files, specified with \&quot;%attr\&quot;.&quot;)
++(defvar rpm-default-group &quot;root&quot;
++ &quot;*Default group for files, specified with \&quot;%attr\&quot;.&quot;)
++
++;;------------------------------------------------------------
++
++(defvar rpm-no-gpg nil &quot;Tell rpm not to sign package.&quot;)
++
++(defvar rpm-tags-list
++ ;; From RPM 4.1 sources, file build/parsePreamble.c: preambleList[].&quot;)
++ '((&quot;AutoProv&quot;)
++ (&quot;AutoReq&quot;)
++ (&quot;AutoReqProv&quot;)
++ (&quot;BuildArch&quot;)
++ (&quot;BuildArchitectures&quot;)
++ (&quot;BuildConflicts&quot;)
++ (&quot;BuildPreReq&quot;)
++ (&quot;BuildRequires&quot;)
++ (&quot;BuildRoot&quot;)
++ (&quot;Conflicts&quot;)
++ (&quot;License&quot;)
++ (&quot;%description&quot;)
++ (&quot;Distribution&quot;)
++ (&quot;DistURL&quot;)
++ (&quot;DocDir&quot;)
++ (&quot;Epoch&quot;)
++ (&quot;ExcludeArch&quot;)
++ (&quot;ExcludeOS&quot;)
++ (&quot;ExclusiveArch&quot;)
++ (&quot;ExclusiveOS&quot;)
++ (&quot;%files&quot;)
++ (&quot;Group&quot;)
++ (&quot;Icon&quot;)
++ (&quot;%ifarch&quot;)
++ (&quot;License&quot;)
++ (&quot;Name&quot;)
++ (&quot;NoPatch&quot;)
++ (&quot;NoSource&quot;)
++ (&quot;Obsoletes&quot;)
++ (&quot;%package&quot;)
++ (&quot;Packager&quot;)
++ (&quot;Patch&quot;)
++ (&quot;Prefix&quot;)
++ (&quot;Prefixes&quot;)
++ (&quot;PreReq&quot;)
++ (&quot;Provides&quot;)
++ (&quot;Release&quot;)
++ (&quot;Requires&quot;)
++ (&quot;RHNPlatform&quot;)
++ (&quot;Serial&quot;)
++ (&quot;Source&quot;)
++ (&quot;Summary&quot;)
++ (&quot;URL&quot;)
++ (&quot;Vendor&quot;)
++ (&quot;Version&quot;))
++ &quot;List of elements that are valid tags.&quot;)
++
++;; echo &quot;(defvar rpm-group-tags-list&quot;
++;; echo &quot; ;; Auto generated from Mageia GROUPS file&quot;
++;; printf &quot;\t%s\n&quot; &quot;'(&quot;
++;; cat /usr/share/doc/*/GROUPS | while read i; do
++;; printf &quot;\t %s%s%s\n&quot; '(&quot;' &quot;$i&quot; '&quot;)'
++;; done
++;; printf &quot;\t%s\n\t%s&quot; &quot;)&quot; '&quot;List of elements that are valid group tags.&quot;)'
++
++(defvar rpm-group-tags-list
++ ;; Auto generated from Mageia GROUPS file
++ '(
++ (&quot;Accessibility&quot;)
++ (&quot;Archiving/Backup&quot;)
++ (&quot;Archiving/Cd burning&quot;)
++ (&quot;Archiving/Compression&quot;)
++ (&quot;Archiving/Other&quot;)
++ (&quot;Books/Computer books&quot;)
++ (&quot;Books/Faqs&quot;)
++ (&quot;Books/Howtos&quot;)
++ (&quot;Books/Literature&quot;)
++ (&quot;Books/Other&quot;)
++ (&quot;Communications&quot;)
++ (&quot;Databases&quot;)
++ (&quot;Development/C&quot;)
++ (&quot;Development/C++&quot;)
++ (&quot;Development/Databases&quot;)
++ (&quot;Development/GNOME and GTK+&quot;)
++ (&quot;Development/Java&quot;)
++ (&quot;Development/KDE and Qt&quot;)
++ (&quot;Development/Kernel&quot;)
++ (&quot;Development/Other&quot;)
++ (&quot;Development/Perl&quot;)
++ (&quot;Development/PHP&quot;)
++ (&quot;Development/Python&quot;)
++ (&quot;Development/Ruby&quot;)
++ (&quot;Editors&quot;)
++ (&quot;Education&quot;)
++ (&quot;Emulators&quot;)
++ (&quot;File tools&quot;)
++ (&quot;Games/Adventure&quot;)
++ (&quot;Games/Arcade&quot;)
++ (&quot;Games/Boards&quot;)
++ (&quot;Games/Cards&quot;)
++ (&quot;Games/Other&quot;)
++ (&quot;Games/Puzzles&quot;)
++ (&quot;Games/Sports&quot;)
++ (&quot;Games/Strategy&quot;)
++ (&quot;Graphical desktop/Enlightenment&quot;)
++ (&quot;Graphical desktop/FVWM based&quot;)
++ (&quot;Graphical desktop/GNOME&quot;)
++ (&quot;Graphical desktop/Icewm&quot;)
++ (&quot;Graphical desktop/KDE&quot;)
++ (&quot;Graphical desktop/Other&quot;)
++ (&quot;Graphical desktop/Sawfish&quot;)
++ (&quot;Graphical desktop/WindowMaker&quot;)
++ (&quot;Graphical desktop/Xfce&quot;)
++ (&quot;Graphics&quot;)
++ (&quot;Monitoring&quot;)
++ (&quot;Networking/Chat&quot;)
++ (&quot;Networking/File transfer&quot;)
++ (&quot;Networking/IRC&quot;)
++ (&quot;Networking/Instant messaging&quot;)
++ (&quot;Networking/Mail&quot;)
++ (&quot;Networking/News&quot;)
++ (&quot;Networking/Other&quot;)
++ (&quot;Networking/Remote access&quot;)
++ (&quot;Networking/WWW&quot;)
++ (&quot;Office&quot;)
++ (&quot;Publishing&quot;)
++ (&quot;Sciences/Astronomy&quot;)
++ (&quot;Sciences/Biology&quot;)
++ (&quot;Sciences/Chemistry&quot;)
++ (&quot;Sciences/Computer science&quot;)
++ (&quot;Sciences/Geosciences&quot;)
++ (&quot;Sciences/Mathematics&quot;)
++ (&quot;Sciences/Other&quot;)
++ (&quot;Sciences/Physics&quot;)
++ (&quot;Shells&quot;)
++ (&quot;Sound&quot;)
++ (&quot;System/Base&quot;)
++ (&quot;System/Configuration/Boot and Init&quot;)
++ (&quot;System/Configuration/Hardware&quot;)
++ (&quot;System/Configuration/Networking&quot;)
++ (&quot;System/Configuration/Other&quot;)
++ (&quot;System/Configuration/Packaging&quot;)
++ (&quot;System/Configuration/Printing&quot;)
++ (&quot;System/Fonts/Console&quot;)
++ (&quot;System/Fonts/True type&quot;)
++ (&quot;System/Fonts/Type1&quot;)
++ (&quot;System/Fonts/X11 bitmap&quot;)
++ (&quot;System/Internationalization&quot;)
++ (&quot;System/Kernel and hardware&quot;)
++ (&quot;System/Libraries&quot;)
++ (&quot;System/Servers&quot;)
++ (&quot;System/X11&quot;)
++ (&quot;Terminals&quot;)
++ (&quot;Text tools&quot;)
++ (&quot;Toys&quot;)
++ (&quot;Video&quot;)
++ )
++ &quot;List of elements that are valid group tags.&quot;)
++
++(defvar rpm-spec-mode-syntax-table nil
++ &quot;Syntax table in use in `rpm-spec-mode' buffers.&quot;)
++(unless rpm-spec-mode-syntax-table
++ (setq rpm-spec-mode-syntax-table (make-syntax-table))
++ (modify-syntax-entry ?\\ &quot;\\&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?\n &quot;&gt; &quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?\f &quot;&gt; &quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?\# &quot;&lt; &quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?/ &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?* &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?+ &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?- &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?= &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?% &quot;_&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?&lt; &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?&gt; &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?&amp; &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?| &quot;.&quot; rpm-spec-mode-syntax-table)
++ (modify-syntax-entry ?\' &quot;.&quot; rpm-spec-mode-syntax-table))
++
++(defvar rpm-spec-mode-map nil
++ &quot;Keymap used in `rpm-spec-mode'.&quot;)
++(unless rpm-spec-mode-map
++ (setq rpm-spec-mode-map (make-sparse-keymap))
++ (and (functionp 'set-keymap-name)
++ (set-keymap-name rpm-spec-mode-map 'rpm-spec-mode-map))
++ (define-key rpm-spec-mode-map &quot;\C-c\C-c&quot; 'rpm-change-tag)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-e&quot; 'rpm-add-change-log-entry)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-i&quot; 'rpm-insert-tag)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-n&quot; 'rpm-forward-section)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-o&quot; 'rpm-goto-section)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-p&quot; 'rpm-backward-section)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-r&quot; 'rpm-increase-release-tag)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-u&quot; 'rpm-insert-true-prefix)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-ba&quot; 'rpm-build-all)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bb&quot; 'rpm-build-binary)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bc&quot; 'rpm-build-compile)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bi&quot; 'rpm-build-install)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bl&quot; 'rpm-list-check)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bp&quot; 'rpm-build-prepare)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-bs&quot; 'rpm-build-source)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-dd&quot; 'rpm-insert-dir)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-do&quot; 'rpm-insert-docdir)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-fc&quot; 'rpm-insert-config)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-fd&quot; 'rpm-insert-doc)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-ff&quot; 'rpm-insert-file)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-fg&quot; 'rpm-insert-ghost)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xa&quot; 'rpm-toggle-add-attr)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xb&quot; 'rpm-change-buildroot-option)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xc&quot; 'rpm-toggle-clean)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xd&quot; 'rpm-toggle-nodeps)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xf&quot; 'rpm-files-group)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xg&quot; 'rpm-toggle-sign-gpg)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xi&quot; 'rpm-change-timecheck-option)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xn&quot; 'rpm-toggle-nobuild)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xo&quot; 'rpm-files-owner)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xp&quot; 'rpm-change-target-option)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xr&quot; 'rpm-toggle-rmsource)
++ (define-key rpm-spec-mode-map &quot;\C-cxd&quot; 'rpm-toggle-no-deps)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xs&quot; 'rpm-toggle-short-circuit)
++ (define-key rpm-spec-mode-map &quot;\C-c\C-xu&quot; 'rpm-files-umask)
++ ;;(define-key rpm-spec-mode-map &quot;\C-q&quot; 'indent-spec-exp)
++ ;;(define-key rpm-spec-mode-map &quot;\t&quot; 'sh-indent-line)
++ )
++
++(defconst rpm-spec-mode-menu
++ (purecopy '(&quot;RPM spec&quot;
++ [&quot;Insert Tag...&quot; rpm-insert-tag t]
++ [&quot;Change Tag...&quot; rpm-change-tag t]
++ &quot;---&quot;
++ [&quot;Go to section...&quot; rpm-mouse-goto-section :keys &quot;C-c C-o&quot;]
++ [&quot;Forward section&quot; rpm-forward-section t]
++ [&quot;Backward section&quot; rpm-backward-section t]
++ &quot;---&quot;
++ [&quot;Add change log entry...&quot; rpm-add-change-log-entry t]
++ [&quot;Increase release tag&quot; rpm-increase-release-tag t]
++ &quot;---&quot;
++ (&quot;Add file entry&quot;
++ [&quot;Regular file...&quot; rpm-insert-file t]
++ [&quot;Config file...&quot; rpm-insert-config t]
++ [&quot;Document file...&quot; rpm-insert-doc t]
++ [&quot;Ghost file...&quot; rpm-insert-ghost t]
++ &quot;---&quot;
++ [&quot;Directory...&quot; rpm-insert-dir t]
++ [&quot;Document directory...&quot; rpm-insert-docdir t]
++ &quot;---&quot;
++ [&quot;Insert %{prefix}&quot; rpm-insert-true-prefix t]
++ &quot;---&quot;
++ [&quot;Default add \&quot;%attr\&quot; entry&quot; rpm-toggle-add-attr
++ :style toggle :selected rpm-spec-add-attr]
++ [&quot;Change default umask for files...&quot; rpm-files-umask t]
++ [&quot;Change default owner for files...&quot; rpm-files-owner t]
++ [&quot;Change default group for files...&quot; rpm-files-group t])
++ (&quot;Build Options&quot;
++ [&quot;Short circuit&quot; rpm-toggle-short-circuit
++ :style toggle :selected rpm-spec-short-circuit]
++ [&quot;No deps&quot; rpm-toggle-no-deps
++ :style toggle :selected rpm-spec-no-deps]
++ [&quot;Remove source&quot; rpm-toggle-rmsource
++ :style toggle :selected rpm-spec-rmsource]
++ [&quot;Clean&quot; rpm-toggle-clean
++ :style toggle :selected rpm-spec-clean]
++ [&quot;No build&quot; rpm-toggle-nobuild
++ :style toggle :selected rpm-spec-nobuild]
++ [&quot;GPG sign&quot; rpm-toggle-sign-gpg
++ :style toggle :selected rpm-spec-sign-gpg]
++ [&quot;Ignore dependencies&quot; rpm-toggle-nodeps
++ :style toggle :selected rpm-spec-nodeps]
++ &quot;---&quot;
++ [&quot;Change timecheck value...&quot; rpm-change-timecheck-option t]
++ [&quot;Change buildroot value...&quot; rpm-change-buildroot-option t]
++ [&quot;Change target value...&quot; rpm-change-target-option t])
++ (&quot;RPM Build&quot;
++ [&quot;Execute \&quot;%prep\&quot; stage&quot; rpm-build-prepare t]
++ [&quot;Do a \&quot;list check\&quot;&quot; rpm-list-check t]
++ [&quot;Do the \&quot;%build\&quot; stage&quot; rpm-build-compile t]
++ [&quot;Do the \&quot;%install\&quot; stage&quot; rpm-build-install t]
++ &quot;---&quot;
++ [&quot;Build binary package&quot; rpm-build-binary t]
++ [&quot;Build source package&quot; rpm-build-source t]
++ [&quot;Build binary and source&quot; rpm-build-all t])
++ &quot;---&quot;
++ [&quot;About rpm-spec-mode&quot; rpm-about-rpm-spec-mode t]
++ )))
++
++(defvar rpm-spec-font-lock-keywords
++ '(
++ (&quot;%[a-zA-Z0-9-_]+&quot; 0 rpm-spec-macro-face)
++ (&quot;^\\([a-zA-Z0-9]+\\)\\(\([a-zA-Z0-9,]+\)\\):&quot;
++ (1 rpm-spec-tag-face)
++ (2 rpm-spec-ghost-face))
++ (&quot;^\\([a-zA-Z0-9]+\\):&quot; 1 rpm-spec-tag-face)
++ (&quot;%\\(de\\(fine\\|scription\\)\\|files\\|package\\)[ \t]+\\([^-][^ \t\n]*\\)&quot;
++ (3 rpm-spec-package-face))
++ (&quot;%p\\(ost\\|re\\)\\(un\\)?[ \t]+\\([^-][^ \t\n]*\\)&quot;
++ (3 rpm-spec-package-face))
++ (&quot;%configure &quot; 0 rpm-spec-macro-face)
++ (&quot;%dir[ \t]+\\([^ \t\n]+\\)[ \t]*&quot; 1 rpm-spec-dir-face)
++ (&quot;%doc\\(dir\\)?[ \t]+\\(.*\\)\n&quot; 2 rpm-spec-doc-face)
++ (&quot;%\\(ghost\\|config\\)[ \t]+\\(.*\\)\n&quot; 2 rpm-spec-ghost-face)
++ (&quot;^%.+-[a-zA-Z][ \t]+\\([a-zA-Z0-9\.-]+\\)&quot; 1 rpm-spec-doc-face)
++ (&quot;^\\(.+\\)(\\([a-zA-Z]\\{2,2\\}\\)):&quot;
++ (1 rpm-spec-tag-face)
++ (2 rpm-spec-doc-face))
++ (&quot;^\\*\\(.*[0-9] \\)\\(.*\\)\\(&lt;.*&gt;\\)\\(.*\\)\n&quot;
++ (1 rpm-spec-dir-face)
++ (2 rpm-spec-package-face)
++ (3 rpm-spec-tag-face)
++ (4 font-lock-warning-face))
++ (&quot;%{[^{}]*}&quot; 0 rpm-spec-macro-face)
++ (&quot;$[a-zA-Z0-9_]+&quot; 0 rpm-spec-var-face)
++ (&quot;${[a-zA-Z0-9_]+}&quot; 0 rpm-spec-var-face)
++ )
++ &quot;Additional expressions to highlight in `rpm-spec-mode'.&quot;)
++
++;;Initialize font lock for xemacs
++(put 'rpm-spec-mode 'font-lock-defaults '(rpm-spec-font-lock-keywords))
++
++(defvar rpm-spec-mode-abbrev-table nil
++ &quot;Abbrev table in use in `rpm-spec-mode' buffers.&quot;)
++(define-abbrev-table 'rpm-spec-mode-abbrev-table ())
++
++;;------------------------------------------------------------
++
++;;;###autoload
++(defun rpm-spec-mode ()
++ &quot;Major mode for editing RPM spec files.
++This is much like C mode except for the syntax of comments. It uses
++the same keymap as C mode and has the same variables for customizing
++indentation. It has its own abbrev table and its own syntax table.
++
++Turning on RPM spec mode calls the value of the variable `rpm-spec-mode-hook'
++with no args, if that value is non-nil.&quot;
++ (interactive)
++ (kill-all-local-variables)
++ (condition-case nil
++ (require 'shindent)
++ (error
++ (require 'sh-script)))
++ (require 'cc-mode)
++ (use-local-map rpm-spec-mode-map)
++ (setq major-mode 'rpm-spec-mode)
++ (rpm-update-mode-name)
++ (setq local-abbrev-table rpm-spec-mode-abbrev-table)
++ (set-syntax-table rpm-spec-mode-syntax-table)
++
++ (require 'easymenu)
++ (easy-menu-define rpm-spec-call-menu rpm-spec-mode-map
++ &quot;Post menu for `rpm-spec-mode'.&quot; rpm-spec-mode-menu)
++ (easy-menu-add rpm-spec-mode-menu)
++
++ (if (= (buffer-size) 0)
++ (rpm-spec-initialize))
++
++ (if (executable-find &quot;rpmbuild&quot;)
++ (setq rpm-spec-build-command &quot;rpmbuild&quot;)
++ (setq rpm-spec-old-rpm t)
++ (setq rpm-spec-build-command &quot;rpm&quot;))
++
++ (make-local-variable 'paragraph-start)
++ (setq paragraph-start (concat &quot;$\\|&quot; page-delimiter))
++ (make-local-variable 'paragraph-separate)
++ (setq paragraph-separate paragraph-start)
++ (make-local-variable 'paragraph-ignore-fill-prefix)
++ (setq paragraph-ignore-fill-prefix t)
++; (make-local-variable 'indent-line-function)
++; (setq indent-line-function 'c-indent-line)
++ (make-local-variable 'require-final-newline)
++ (setq require-final-newline t)
++ (make-local-variable 'comment-start)
++ (setq comment-start &quot;# &quot;)
++ (make-local-variable 'comment-end)
++ (setq comment-end &quot;&quot;)
++ (make-local-variable 'comment-column)
++ (setq comment-column 32)
++ (make-local-variable 'comment-start-skip)
++ (setq comment-start-skip &quot;#+ *&quot;)
++; (make-local-variable 'comment-indent-function)
++; (setq comment-indent-function 'c-comment-indent)
++ ;;Initialize font lock for GNU emacs.
++ (make-local-variable 'font-lock-defaults)
++ (setq font-lock-defaults '(rpm-spec-font-lock-keywords nil t))
++ (run-hooks 'rpm-spec-mode-hook))
++
++(defun rpm-command-filter (process string)
++ &quot;Filter to process normal output.&quot;
++ (save-excursion
++ (set-buffer (process-buffer process))
++ (save-excursion
++ (goto-char (process-mark process))
++ (insert-before-markers string)
++ (set-marker (process-mark process) (point)))))
++
++; insert one space, or the number of tabs if rpm-spec-use-tabs is true
++(defun rpm-insert-space-or-tabs (tabs)
++ (if rpm-spec-use-tabs
++ (if (&gt; tabs 0)
++ (concat &quot;\t&quot; (rpm-insert-space-or-tabs (1- tabs)))
++ &quot;&quot;)
++ &quot; &quot;))
++
++;;------------------------------------------------------------
++
++(defun rpm-add-change-log-entry (&amp;optional change-log-entry)
++ &quot;Find change log and add an entry for today.&quot;
++ (interactive &quot;P&quot;)
++ (goto-char (point-min))
++ (if (search-forward-regexp &quot;^%changelog[ \t]*$&quot; nil t)
++ (let* ((address (or rpm-spec-user-mail-address user-mail-address))
++ (fullname (or rpm-spec-user-full-name user-full-name))
++ (string (concat &quot;* &quot; (substring (current-time-string) 0 11)
++ (substring (current-time-string) -4) &quot; &quot;
++ fullname &quot; &lt;&quot; address &quot;&gt; &quot;
++ (or
++ (and rpm-spec-insert-changelog-version
++ (or (and rpm-spec-insert-changelog-version-with-shell
++ (rpm-find-spec-version-with-shell))
++ (rpm-find-spec-version))))
++ &quot;&quot;)))
++ (if (not (search-forward string nil t))
++ (insert &quot;\n&quot; string &quot;\n&quot;)
++ (progn (next-line 1)
++ (beginning-of-line)))
++ (unless (eq (point) (1- (point-max)))
++ (insert &quot;\n&quot;)
++ (previous-line 1))
++ (insert &quot;- &quot;)
++ (if change-log-entry
++ (insert (concat (format &quot;%s.&quot; change-log-entry)))))
++ (message &quot;No \&quot;%%changelog\&quot; entry found...&quot;)))
++
++;;------------------------------------------------------------
++
++(defun rpm-insert-f (&amp;optional filetype filename)
++ &quot;Insert new \&quot;%files\&quot; entry.&quot;
++ (save-excursion
++ (and (rpm-goto-section &quot;files&quot;) (rpm-end-of-section))
++ (if (or (eq filename 1) (not filename))
++ (insert (read-file-name
++ (concat filetype &quot;filename: &quot;) &quot;&quot; &quot;&quot; nil) &quot;\n&quot;)
++ (insert filename &quot;\n&quot;))
++ (forward-line -1)
++ (if rpm-spec-add-attr
++ (let ((rpm-default-mode rpm-default-umask))
++ (insert &quot;%attr(&quot; rpm-default-mode &quot;, &quot; rpm-default-owner &quot;, &quot;
++ rpm-default-group &quot;) &quot;)))
++ (insert filetype)))
++
++(defun rpm-insert-file (&amp;optional filename)
++ &quot;Insert regular file.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;&quot; filename))
++
++(defun rpm-insert-config (&amp;optional filename)
++ &quot;Insert config file.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;%config &quot; filename))
++
++(defun rpm-insert-doc (&amp;optional filename)
++ &quot;Insert doc file.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;%doc &quot; filename))
++
++(defun rpm-insert-ghost (&amp;optional filename)
++ &quot;Insert ghost file.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;%ghost &quot; filename))
++
++(defun rpm-insert-dir (&amp;optional dirname)
++ &quot;Insert directory.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;%dir &quot; dirname))
++
++(defun rpm-insert-docdir (&amp;optional dirname)
++ &quot;Insert doc directory.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-insert-f &quot;%docdir &quot; dirname))
++
++;;------------------------------------------------------------
++(defun rpm-completing-read (prompt table &amp;optional pred require init hist)
++ &quot;Read from the minibuffer, with completion.
++Like `completing-read', but the variable `rpm-spec-completion-ignore-case'
++controls whether case is significant.&quot;
++ (let ((completion-ignore-case rpm-spec-completion-ignore-case))
++ (completing-read prompt table pred require init hist)))
++
++(defun rpm-insert (&amp;optional what file-completion)
++ &quot;Insert given tag. Use file-completion if argument is t.&quot;
++ (beginning-of-line)
++ (if (not what)
++ (setq what (rpm-completing-read &quot;Tag: &quot; rpm-tags-list)))
++ (if (string-match &quot;^%&quot; what)
++ (setq read-text (concat &quot;Packagename for &quot; what &quot;: &quot;)
++ insert-text (concat what &quot; &quot;))
++ (setq read-text (concat what &quot;: &quot;)
++ insert-text (concat what &quot;: &quot;)))
++ (cond
++ ((string-equal what &quot;Group&quot;)
++ (rpm-insert-group))
++ ((string-equal what &quot;Source&quot;)
++ (rpm-insert-n &quot;Source&quot;))
++ ((string-equal what &quot;Patch&quot;)
++ (rpm-insert-n &quot;Patch&quot;))
++ (t
++ (if file-completion
++ (insert insert-text (read-file-name (concat read-text) &quot;&quot; &quot;&quot; nil) &quot;\n&quot;)
++ (insert insert-text (read-from-minibuffer (concat read-text)) &quot;\n&quot;)))))
++
++(defun rpm-topdir ()
++ (or
++ (getenv &quot;RPM&quot;)
++ (getenv &quot;rpm&quot;)
++ (if (file-directory-p &quot;~/rpm&quot;) &quot;~/rpm/&quot;)
++ (if (file-directory-p &quot;~/RPM&quot;) &quot;~/RPM/&quot;)
++ (if (file-directory-p &quot;/usr/src/redhat/&quot;) &quot;/usr/src/redhat/&quot;)
++ &quot;/usr/src/RPM&quot;))
++
++(defun rpm-insert-n (what &amp;optional arg)
++ &quot;Insert given tag with possible number.&quot;
++ (save-excursion
++ (goto-char (point-max))
++ (if (search-backward-regexp (concat &quot;^&quot; what &quot;\\([0-9]*\\):&quot;) nil t)
++ (let ((release (1+ (string-to-int (match-string 1)))))
++ (forward-line 1)
++ (let ((default-directory (concat (rpm-topdir) &quot;/SOURCES/&quot;)))
++ (insert what (int-to-string release) &quot;: &quot;
++ (read-file-name (concat what &quot;file: &quot;) &quot;&quot; &quot;&quot; nil) &quot;\n&quot;)))
++ (goto-char (point-min))
++ (rpm-end-of-section)
++ (insert what &quot;: &quot; (read-from-minibuffer (concat what &quot;file: &quot;)) &quot;\n&quot;))))
++
++(defun rpm-change (&amp;optional what arg)
++ &quot;Update given tag.&quot;
++ (save-excursion
++ (if (not what)
++ (setq what (rpm-completing-read &quot;Tag: &quot; rpm-tags-list)))
++ (cond
++ ((string-equal what &quot;Group&quot;)
++ (rpm-change-group))
++ ((string-equal what &quot;Source&quot;)
++ (rpm-change-n &quot;Source&quot;))
++ ((string-equal what &quot;Patch&quot;)
++ (rpm-change-n &quot;Patch&quot;))
++ (t
++ (goto-char (point-min))
++ (if (search-forward-regexp (concat &quot;^&quot; what &quot;:\\s-*\\(.*\\)$&quot;) nil t)
++ (replace-match
++ (concat what &quot;: &quot; (read-from-minibuffer
++ (concat &quot;New &quot; what &quot;: &quot;) (match-string 1))))
++ (message (concat what &quot; tag not found...&quot;)))))))
++
++(defun rpm-change-n (what &amp;optional arg)
++ &quot;Change given tag with possible number.&quot;
++ (save-excursion
++ (goto-char (point-min))
++ (let ((number (read-from-minibuffer (concat what &quot; number: &quot;))))
++ (if (search-forward-regexp
++ (concat &quot;^&quot; what number &quot;:\\s-*\\(.*\\)&quot;) nil t)
++ (let ((default-directory (concat (rpm-topdir) &quot;/SOURCES/&quot;)))
++ (replace-match
++ (concat what number &quot;: &quot;
++ (read-file-name (concat &quot;New &quot; what number &quot; file: &quot;)
++ &quot;&quot; &quot;&quot; nil (match-string 1)))))
++ (message (concat what &quot; number \&quot;&quot; number &quot;\&quot; not found...&quot;))))))
++
++(defun rpm-insert-group (group)
++ &quot;Insert Group tag.&quot;
++ (interactive (list (rpm-completing-read &quot;Group: &quot; rpm-group-tags-list)))
++ (beginning-of-line)
++ (insert &quot;Group:&quot; (rpm-insert-space-or-tabs 2) group &quot;\n&quot;))
++
++(defun rpm-change-group (&amp;optional arg)
++ &quot;Update Group tag.&quot;
++ (interactive &quot;p&quot;)
++ (save-excursion
++ (goto-char (point-min))
++ (if (search-forward-regexp &quot;^Group:[ \t]*\\(.*\\)$&quot; nil t)
++ (replace-match
++ (concat &quot;Group:&quot;
++ (rpm-insert-space-or-tabs 2)
++ (rpm-completing-read &quot;Group: &quot; rpm-group-tags-list
++ nil nil (match-string 1))))
++ (message &quot;Group tag not found...&quot;))))
++
++(defun rpm-insert-tag (&amp;optional arg)
++ &quot;Insert or change a tag.&quot;
++ (interactive &quot;p&quot;)
++ (if current-prefix-arg
++ (rpm-change)
++ (rpm-insert)))
++
++(defun rpm-change-tag (&amp;optional arg)
++ &quot;Change a tag.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-change))
++
++(defun rpm-insert-packager (&amp;optional arg)
++ &quot;Insert Packager tag.&quot;
++ (interactive &quot;p&quot;)
++ (beginning-of-line)
++ (insert &quot;Packager:&quot;
++ (rpm-insert-space-or-tabs 1)
++ (or rpm-spec-user-full-name (user-full-name))
++ &quot; &lt;&quot; (or rpm-spec-user-mail-address (user-mail-address)) &quot;&gt;\n&quot;))
++
++(defun rpm-change-packager (&amp;optional arg)
++ &quot;Update Packager tag.&quot;
++ (interactive &quot;p&quot;)
++ (rpm-change &quot;Packager&quot;))
++
++;;------------------------------------------------------------
++
++(defun rpm-current-section nil
++ (interactive)
++ (save-excursion
++ (rpm-forward-section)
++ (rpm-backward-section)
++ (if (bobp) &quot;preamble&quot;
++ (buffer-substring (match-beginning 1) (match-end 1)))))
++
++(defun rpm-backward-section nil
++ &quot;Move backward to the beginning of the previous section.
++Go to beginning of previous section.&quot;
++ (interactive)
++ (or (re-search-backward rpm-section-regexp nil t)
++ (goto-char (point-min))))
++
++(defun rpm-beginning-of-section nil
++ &quot;Move backward to the beginning of the current section.
++Go to beginning of current section.&quot;
++ (interactive)
++ (or (and (looking-at rpm-section-regexp) (point))
++ (re-search-backward rpm-section-regexp nil t)
++ (goto-char (point-min))))
++
++(defun rpm-forward-section nil
++ &quot;Move forward to the beginning of the next section.&quot;
++ (interactive)
++ (forward-char)
++ (if (re-search-forward rpm-section-regexp nil t)
++ (progn (forward-line 0) (point))
++ (goto-char (point-max))))
++
++(defun rpm-end-of-section nil
++ &quot;Move forward to the end of this section.&quot;
++ (interactive)
++ (forward-char)
++ (if (re-search-forward rpm-section-regexp nil t)
++ (forward-line -1)
++ (goto-char (point-max)))
++;; (while (or (looking-at paragraph-separate) (looking-at &quot;^\\s-*#&quot;))
++ (while (looking-at &quot;^\\s-*\\($\\|#\\)&quot;)
++ (forward-line -1))
++ (forward-line 1)
++ (point))
++
++(defun rpm-goto-section (section)
++ &quot;Move point to the beginning of the specified section;
++leave point at previous location.&quot;
++ (interactive (list (rpm-completing-read &quot;Section: &quot; rpm-section-list)))
++ (push-mark)
++ (goto-char (point-min))
++ (or
++ (equal section &quot;preamble&quot;)
++ (re-search-forward (concat &quot;^%&quot; section &quot;\\b&quot;) nil t)
++ (let ((s (cdr rpm-sections)))
++ (while (not (equal section (car s)))
++ (re-search-forward (concat &quot;^%&quot; (car s) &quot;\\b&quot;) nil t)
++ (setq s (cdr s)))
++ (if (re-search-forward rpm-section-regexp nil t)
++ (forward-line -1) (goto-char (point-max)))
++ (insert &quot;\n%&quot; section &quot;\n&quot;))))
++
++(defun rpm-mouse-goto-section (&amp;optional section)
++ (interactive
++ (x-popup-menu
++ nil
++ (list &quot;sections&quot;
++ (cons &quot;Sections&quot; (mapcar (lambda (e) (list e e)) rpm-sections))
++ (cons &quot;Scripts&quot; (mapcar (lambda (e) (list e e)) rpm-scripts))
++ )))
++ ;; If user doesn't pick a section, exit quietly.
++ (and section
++ (if (member section rpm-sections)
++ (rpm-goto-section section)
++ (goto-char (point-min))
++ (or (re-search-forward (concat &quot;^%&quot; section &quot;\\b&quot;) nil t)
++ (and (re-search-forward &quot;^%files\\b&quot; nil t) (forward-line -1))
++ (goto-char (point-max))))))
++
++(defun rpm-insert-true-prefix ()
++ (interactive)
++ (insert &quot;%{prefix}&quot;))
++
++;;------------------------------------------------------------
++
++(defun rpm-build (buildoptions)
++ &quot;Build this RPM package.&quot;
++ (setq rpm-buffer-name
++ (concat &quot;*&quot; rpm-spec-build-command &quot; &quot;
++ (file-name-nondirectory buffer-file-name) &quot;*&quot;))
++ (rpm-process-check rpm-buffer-name)
++ (if (get-buffer rpm-buffer-name)
++ (kill-buffer rpm-buffer-name))
++ (create-file-buffer rpm-buffer-name)
++ (display-buffer rpm-buffer-name)
++ (setq buildoptions (list buildoptions buffer-file-name))
++ (if (or rpm-spec-short-circuit rpm-spec-nobuild)
++ (setq rpm-no-gpg t))
++ (if rpm-spec-rmsource
++ (setq buildoptions (cons &quot;--rmsource&quot; buildoptions)))
++ (if rpm-spec-clean
++ (setq buildoptions (cons &quot;--clean&quot; buildoptions)))
++ (if rpm-spec-short-circuit
++ (setq buildoptions (cons &quot;--short-circuit&quot; buildoptions)))
++ (if rpm-spec-no-deps
++ (setq buildoptions (cons &quot;--nodeps&quot; buildoptions)))
++ (if (and (not (equal rpm-spec-timecheck &quot;0&quot;))
++ (not (equal rpm-spec-timecheck &quot;&quot;)))
++ (setq buildoptions (cons &quot;--timecheck&quot; (cons rpm-spec-timecheck
++ buildoptions))))
++ (if (not (equal rpm-spec-buildroot &quot;&quot;))
++ (setq buildoptions (cons &quot;--buildroot&quot; (cons rpm-spec-buildroot
++ buildoptions))))
++ (if (not (equal rpm-spec-target &quot;&quot;))
++ (setq buildoptions (cons &quot;--target&quot; (cons rpm-spec-target
++ buildoptions))))
++ (if rpm-spec-nobuild
++ (setq buildoptions (cons (if rpm-spec-old-rpm &quot;--test&quot; &quot;--nobuild&quot;)
++ buildoptions)))
++ (if rpm-spec-nodeps
++ (setq buildoptions (cons &quot;--nodeps&quot; buildoptions)))
++ (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
++ (setq buildoptions (cons &quot;--sign&quot; buildoptions)))
++ (save-excursion
++ (set-buffer (get-buffer rpm-buffer-name))
++ (goto-char (point-max)))
++ (let ((process
++ (apply 'start-process rpm-spec-build-command rpm-buffer-name
++ rpm-spec-build-command buildoptions)))
++ (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
++ (let ((rpm-passwd-cache (read-passwd &quot;GPG passphrase: &quot;)))
++ (process-send-string process (concat rpm-passwd-cache &quot;\n&quot;))))
++ (set-process-filter process 'rpm-command-filter)))
++
++(defun rpm-build-prepare (&amp;optional arg)
++ &quot;Run a `rpmbuild -bp'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg t)
++ (rpm-build &quot;-bp&quot;))
++
++(defun rpm-list-check (&amp;optional arg)
++ &quot;Run a `rpmbuild -bl'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg t)
++ (rpm-build &quot;-bl&quot;))
++
++(defun rpm-build-compile (&amp;optional arg)
++ &quot;Run a `rpmbuild -bc'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg t)
++ (rpm-build &quot;-bc&quot;))
++
++(defun rpm-build-install (&amp;optional arg)
++ &quot;Run a `rpmbuild -bi'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg t)
++ (rpm-build &quot;-bi&quot;))
++
++(defun rpm-build-binary (&amp;optional arg)
++ &quot;Run a `rpmbuild -bb'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg nil)
++ (rpm-build &quot;-bb&quot;))
++
++(defun rpm-build-source (&amp;optional arg)
++ &quot;Run a `rpmbuild -bs'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg nil)
++ (rpm-build &quot;-bs&quot;))
++
++(defun rpm-build-all (&amp;optional arg)
++ &quot;Run a `rpmbuild -ba'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-no-gpg nil)
++ (rpm-build &quot;-ba&quot;))
++
++(defun rpm-process-check (buffer)
++ &quot;Check if BUFFER has a running process.
++If so, give the user the choice of aborting the process or the current
++command.&quot;
++ (let ((process (get-buffer-process (get-buffer buffer))))
++ (if (and process (eq (process-status process) 'run))
++ (if (yes-or-no-p (concat &quot;Process `&quot; (process-name process)
++ &quot;' running. Kill it? &quot;))
++ (delete-process process)
++ (error &quot;Cannot run two simultaneous processes ...&quot;)))))
++
++;;------------------------------------------------------------
++
++(defun rpm-toggle-short-circuit (&amp;optional arg)
++ &quot;Toggle `rpm-spec-short-circuit'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-short-circuit (not rpm-spec-short-circuit))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--short-circuit' &quot;
++ (if rpm-spec-short-circuit &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-no-deps (&amp;optional arg)
++ &quot;Toggle rpm-spec-no-deps.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-no-deps (not rpm-spec-no-deps))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--nodeps' &quot;
++ (if rpm-spec-no-deps &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-rmsource (&amp;optional arg)
++ &quot;Toggle `rpm-spec-rmsource'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-rmsource (not rpm-spec-rmsource))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--rmsource' &quot;
++ (if rpm-spec-rmsource &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-clean (&amp;optional arg)
++ &quot;Toggle `rpm-spec-clean'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-clean (not rpm-spec-clean))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--clean' &quot;
++ (if rpm-spec-clean &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-nobuild (&amp;optional arg)
++ &quot;Toggle `rpm-spec-nobuild'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-nobuild (not rpm-spec-nobuild))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `&quot; (if rpm-spec-old-rpm &quot;--test&quot; &quot;--nobuild&quot;) &quot;' &quot;
++ (if rpm-spec-nobuild &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-sign-gpg (&amp;optional arg)
++ &quot;Toggle `rpm-spec-sign-gpg'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-sign-gpg (not rpm-spec-sign-gpg))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--sign' &quot;
++ (if rpm-spec-sign-gpg &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-add-attr (&amp;optional arg)
++ &quot;Toggle `rpm-spec-add-attr'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-add-attr (not rpm-spec-add-attr))
++ (rpm-update-mode-name)
++ (message (concat &quot;Default add \&quot;attr\&quot; entry turned &quot;
++ (if rpm-spec-add-attr &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-toggle-nodeps (&amp;optional arg)
++ &quot;Toggle `rpm-spec-nodeps'.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-nodeps (not rpm-spec-nodeps))
++ (rpm-update-mode-name)
++ (message (concat &quot;Turned `--nodeps' &quot;
++ (if rpm-spec-nodeps &quot;on&quot; &quot;off&quot;) &quot;.&quot;)))
++
++(defun rpm-update-mode-name ()
++ &quot;Update `mode-name' according to values set.&quot;
++ (setq mode-name &quot;RPM-SPEC&quot;)
++ (setq modes (concat (if rpm-spec-add-attr &quot;A&quot;)
++ (if rpm-spec-clean &quot;C&quot;)
++ (if rpm-spec-nodeps &quot;D&quot;)
++ (if rpm-spec-sign-gpg &quot;G&quot;)
++ (if rpm-spec-nobuild &quot;N&quot;)
++ (if rpm-spec-rmsource &quot;R&quot;)
++ (if rpm-spec-short-circuit &quot;S&quot;)
++ (if rpm-spec-no-deps &quot;D&quot;)
++ ))
++ (if (not (equal modes &quot;&quot;))
++ (setq mode-name (concat mode-name &quot;:&quot; modes))))
++
++;;------------------------------------------------------------
++
++(defun rpm-change-timecheck-option (&amp;optional arg)
++ &quot;Change the value for timecheck.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-timecheck
++ (read-from-minibuffer &quot;New timecheck: &quot; rpm-spec-timecheck)))
++
++(defun rpm-change-buildroot-option (&amp;optional arg)
++ &quot;Change the value for buildroot.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-buildroot
++ (read-from-minibuffer &quot;New buildroot: &quot; rpm-spec-buildroot)))
++
++(defun rpm-change-target-option (&amp;optional arg)
++ &quot;Change the value for target.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-spec-target
++ (read-from-minibuffer &quot;New target: &quot; rpm-spec-target)))
++
++(defun rpm-files-umask (&amp;optional arg)
++ &quot;Change the default umask for files.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-default-umask
++ (read-from-minibuffer &quot;Default file umask: &quot; rpm-default-umask)))
++
++(defun rpm-files-owner (&amp;optional arg)
++ &quot;Change the default owner for files.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-default-owner
++ (read-from-minibuffer &quot;Default file owner: &quot; rpm-default-owner)))
++
++(defun rpm-files-group (&amp;optional arg)
++ &quot;Change the source directory.&quot;
++ (interactive &quot;p&quot;)
++ (setq rpm-default-group
++ (read-from-minibuffer &quot;Default file group: &quot; rpm-default-group)))
++
++(defun rpm-increase-release-tag (&amp;optional arg)
++ &quot;Increase the release tag by 1.&quot;
++ (interactive &quot;p&quot;)
++ (save-excursion
++ (goto-char (point-min))
++ (if (search-forward-regexp &quot;^Release:\\([ \t]*\\)\\(\\([^.\n]+\\.\\)*\\)\\([0-9]+\\)\\(.*\\)&quot; nil t)
++ (let ((release (1+ (string-to-int (match-string 4)))))
++ (setq release (concat (match-string 1) (match-string 2) (int-to-string release) (match-string 5)))
++ (replace-match (concat &quot;Release:&quot; release))
++ (message (concat &quot;Release tag changed to &quot; release &quot;.&quot;)))
++ (if (search-forward-regexp &quot;^Release:[ \t]*%{?\\([^}]*\\)}?$&quot; nil t)
++ (rpm-increase-release-with-macros)
++ (message &quot;No Release tag found...&quot;)))))
++
++;;------------------------------------------------------------
++
++(defun rpm-spec-field-value (field max)
++ &quot;Get the value of FIELD, searching up to buffer position MAX.
++See `search-forward-regexp'.&quot;
++ (save-excursion
++ (ignore-errors
++ (let ((str
++ (progn
++ (goto-char (point-min))
++ (search-forward-regexp (concat
++ field &quot;:[ \t]*\\(.*?\\)[ \t]*$&quot;) max)
++ (match-string 1))))
++ (if (string-match &quot;%{?\\([^}]*\\)}?$&quot; str)
++ (progn
++ (goto-char (point-min))
++ (search-forward-regexp
++ (concat &quot;%define[ \t]+&quot; (substring str (match-beginning 1)
++ (match-end 1))
++ &quot;[ \t]+\\(.*\\)&quot;))
++ (match-string 1))
++ str)))))
++
++(defun rpm-find-spec-version (&amp;optional with-epoch)
++ &quot;Get the version string.
++If WITH-EPOCH is non-nil, the string contains the Epoch/Serial value,
++if one is present in the file.&quot;
++ (save-excursion
++ (goto-char (point-min))
++ (let* ((max (search-forward-regexp rpm-section-regexp))
++ (version (rpm-spec-field-value &quot;Version&quot; max))
++ (release (rpm-spec-field-value &quot;Release&quot; max))
++ (epoch (rpm-spec-field-value &quot;Epoch&quot; max)) )
++ (when (and version (&lt; 0 (length version)))
++ (unless epoch (setq epoch (rpm-spec-field-value &quot;Serial&quot; max)))
++ (concat (and with-epoch epoch (concat epoch &quot;:&quot;))
++ version
++ (and release (concat &quot;-&quot; release)))))))
++
++(defun rpm--with-temp-file (prefix f)
++ (let ((file (make-temp-file prefix)))
++ (unwind-protect
++ (funcall f file)
++ (delete-file file))))
++
++(defun rpm-find-spec-version-with-shell ()
++ &quot;Find the version and release with the rpm command
++ more robust but slower than the lisp version&quot;
++ (rpm--with-temp-file &quot;spec&quot; (lambda (tmpfile)
++ (write-region (point-min) (point-max) tmpfile nil 1)
++ (let ((relver))
++ (with-temp-buffer
++ (apply 'call-process &quot;rpm&quot; nil t nil
++ (list &quot;-q&quot; &quot;--qf&quot; &quot;'%{VERSION}-%{RELEASE}\\n'&quot; &quot;--specfile&quot; tmpfile))
++ (goto-char (point-min))
++ (if (re-search-forward &quot;\\([0-9]+.+\\)&quot; nil t)
++ (setq relver (match-string 1)))
++ )
++ relver)
++ )))
++
++(defun rpm-increase-release-with-macros ()
++ (save-excursion
++ (let ((str
++ (progn
++ (goto-char (point-min))
++ (search-forward-regexp (concat &quot;Release:[ \t]*\\(.+\\).*$&quot;) nil)
++ (match-string 1)))
++ (increase-macro (lambda (macros)
++ (goto-char (point-min))
++ (if (search-forward-regexp
++ (concat &quot;%define[ \t]+&quot; macros
++ &quot;\\([ \t]+\\)\\(\\([^.\n]+\\.\\)*\\)\\([0-9]+\\)\\(.*\\)&quot;) nil t)
++ (let ((dinrel (concat macros (match-string 1) (match-string 2)
++ (int-to-string (1+ (string-to-int
++ (match-string 4))))
++ (match-string 5))))
++ (replace-match (concat &quot;%define &quot; dinrel))
++ (message (concat &quot;Release tag changed to &quot; dinrel &quot;.&quot;))
++ t)))))
++
++ (if (string-match &quot;%{?\\([^}]*\\)}?$&quot; str)
++ (let ((macros (substring str (match-beginning 1) (match-end 1))))
++ (or (funcall increase-macro macros)
++ (and (search-forward-regexp
++ (concat &quot;%define[ \t]+&quot; macros &quot;[ \t]+%mkrel[ \t]+%{rel}&quot;) nil t)
++ (funcall increase-macro &quot;rel&quot;))
++ (and (search-forward-regexp &quot;\\(%mkrel[ \t]+\\)\\([0-9]+\\)$&quot; nil t)
++ (replace-match (concat (match-string 1) (int-to-string (1+ (string-to-int (match-string 2)))))))
++ ))))))
++
++;;------------------------------------------------------------
++
++(defun rpm-spec-initialize ()
++ &quot;Create a default spec file if one does not exist or is empty.&quot;
++ (let (file name version (release &quot;1&quot;))
++ (setq file (if (buffer-file-name)
++ (file-name-nondirectory (buffer-file-name))
++ (buffer-name)))
++ (string-match &quot;\\(.*\\).spec&quot; file)
++ (setq name (match-string 1 file))
++
++ (insert
++ &quot;%define name &quot; (or name &quot;&quot;)
++ &quot;\n%define version &quot; (or version &quot;&quot;)
++ &quot;\n%define release %mkrel &quot; (or release &quot;&quot;)
++ &quot;\n\nSummary:&quot; (rpm-insert-space-or-tabs 1)
++ &quot;\nName:&quot; (rpm-insert-space-or-tabs 2) &quot;%{name}&quot;
++ &quot;\nVersion:&quot; (rpm-insert-space-or-tabs 1) &quot;%{version}&quot;
++ &quot;\nRelease:&quot; (rpm-insert-space-or-tabs 1) &quot;%{release}&quot;
++ &quot;\nSource0:&quot; (rpm-insert-space-or-tabs 1) &quot;%{name}-%{version}.tar.bz2&quot;
++ &quot;\nLicense:&quot; (rpm-insert-space-or-tabs 1)
++ &quot;\nGroup:&quot; (rpm-insert-space-or-tabs 2)
++ &quot;\nUrl:&quot; (rpm-insert-space-or-tabs 2)
++ &quot;\nBuildRoot:&quot; (rpm-insert-space-or-tabs 1) &quot;%{_tmppath}/%{name}-%{version}-%{release}-buildroot\n&quot;
++ &quot;\n\n%description\n&quot;
++ &quot;\n%prep\n%setup -q\n\n%build\n\n%install\nrm -rf %{buildroot}&quot;
++ &quot;\n\n\n%clean\nrm -rf %{buildroot}&quot;
++ &quot;\n\n%files\n%defattr(-,root,root)\n&quot;
++ &quot;\n\n%changelog\n&quot;))
++ (goto-char (point-min)))
++
++;;------------------------------------------------------------
++
++(defun rpm-about-rpm-spec-mode (&amp;optional arg)
++ &quot;About `rpm-spec-mode'.&quot;
++ (interactive &quot;p&quot;)
++ (message
++ (concat &quot;rpm-spec-mode version &quot;
++ rpm-spec-mode-version
++ &quot; by Stig Bj\xF8rlykke, &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">stigb at tihlde.org</A>&gt;&quot;)))
++
++;;;###autoload
++(add-to-list 'auto-mode-alist '(&quot;\\.spec$&quot; . rpm-spec-mode))
++
++(provide 'rpm-spec-mode)
++
++;;; rpm-spec-mode.el ends here
+
+Added: rpm/rpm-setup/trunk/rpmeval.c
+===================================================================
+--- rpm/rpm-setup/trunk/rpmeval.c (rev 0)
++++ rpm/rpm-setup/trunk/rpmeval.c 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,36 @@
++/* $Id: rpmeval.c 271130 2010-10-16 11:12:45Z peroyvind $ */
++
++#include &lt;stdint.h&gt;
++
++#ifdef HAVE_RPM_RPMLIB_H
++#include &lt;rpm/rpmlib.h&gt;
++#else
++#include &lt;rpm/rpmio.h&gt;
++#include &lt;rpm/rpmtag.h&gt;
++#endif
++#include &lt;rpm/rpmmacro.h&gt;
++
++int main(int argc, char **argv)
++{
++ rpmRC rc;
++ char *results;
++ if (argc != 3) {
++ fprintf(stdout, &quot;Not enough arguments: %d\n&quot;, argc);
++ return 1;
++ }
++ if (rc = rpmReadConfigFiles(NULL, NULL)) {
++ fprintf(stderr, &quot;Cannot load configuration\n&quot;);
++ return rc;
++ }
++ if (rc = rpmLoadMacroFile(rpmGlobalMacroContext, argv[1]
++#ifndef RPMDBI_LABEL
++ ,2
++#endif
++ )) {
++ fprintf(stderr, &quot;Cannot read %s\n&quot;, argv[1]);
++ return rc;
++ }
++ results = rpmExpand(argv[2], NULL);
++ fprintf(stdout, &quot;%s\n&quot;, results);
++ return 0;
++}
+
+
+Property changes on: rpm/rpm-setup/trunk/rpmeval.c
+___________________________________________________________________
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/rpmgenplatform.in
+===================================================================
+--- rpm/rpm-setup/trunk/rpmgenplatform.in (rev 0)
++++ rpm/rpm-setup/trunk/rpmgenplatform.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,41 @@
++#!/usr/bin/perl
++
++# $Id$
++use strict;
++use warnings;
++use Getopt::Long;
++
++GetOptions(
++ 'o=s' =&gt; \my $output,
++);
++
++my @ALLARCH=qw{
++ noarch
++ @RPMALLARCH@
++};
++
++my $anysuffix = '-.*<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">- at RPMOS</A>@';
++my $suffix = '<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">- at RPMCANONVENDOR</A>@<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">- at RPMOS</A>@-gnu';
++my $canonarch = $ARGV[0] || `uname -m`;
++chomp($canonarch);
++
++my $houtput;
++if ($output &amp;&amp; $output ne '-') {
++ open($houtput, '&gt;', $output) or die &quot;Cannot open `$output': $!\n&quot;;
++} else {
++ $houtput = *STDOUT;
++}
++
++foreach my $suf ($suffix, $anysuffix) {
++ my $found = 0;
++ my %done = ();
++ foreach my $arch (reverse @ALLARCH) {
++ $arch eq $canonarch and $found = 1;
++ $found or next;
++ $done{$arch} and next;
++ $done{$arch} = 1;
++ print $houtput &quot;$arch$suf\n&quot;;
++ }
++}
++
++close($houtput) if ($houtput);
+
+Added: rpm/rpm-setup/trunk/rpmrc.in
+===================================================================
+--- rpm/rpm-setup/trunk/rpmrc.in (rev 0)
++++ rpm/rpm-setup/trunk/rpmrc.in 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,103 @@
++# $Id: rpmrc.in 232782 2008-01-07 17:34:01Z pixel $
++#
++# @RPMVENDORDIR@/rpmrc
++
++#############################################################
++# Values for RPM_OPT_FLAGS for various platforms
++
++optflags: i386 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=i386 -fasynchronous-unwind-tables
++optflags: i486 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=i486 -fasynchronous-unwind-tables
++optflags: k6 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=k6 -fasynchronous-unwind-tables
++optflags: i586 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables
++optflags: i686 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=i686 -fasynchronous-unwind-tables
++optflags: athlon %{__common_cflags_with_ssp} -fomit-frame-pointer -march=athlon -fasynchronous-unwind-tables
++optflags: pentium3 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=pentium3 -fasynchronous-unwind-tables
++optflags: pentium4 %{__common_cflags_with_ssp} -fomit-frame-pointer -march=pentium4 -fasynchronous-unwind-tables
++
++optflags: x86_64 %{__common_cflags_with_ssp}
++optflags: amd64 %{__common_cflags_with_ssp}
++optflags: ia32e %{__common_cflags_with_ssp}
++
++optflags: ia64 %{__common_cflags}
++
++ # XXX Please note that -mieee has been added in rpm-3.0.5.
++optflags: alpha %{__common_cflags} -mieee -mcpu=ev5
++optflags: alphaev5 %{__common_cflags} -mieee -mcpu=ev5
++optflags: alphaev56 %{__common_cflags} -mieee -mcpu=ev56
++optflags: alphapca56 %{__common_cflags} -mieee -mcpu=pca56
++optflags: alphaev6 %{__common_cflags} -mieee -mcpu=ev6
++optflags: alphaev67 %{__common_cflags} -mieee -mcpu=ev67
++
++optflags: sparc %{__common_cflags} -m32 -mtune=ultrasparc
++optflags: sparcv9 %{__common_cflags} -m32 -mcpu=ultrasparc
++optflags: sparc64 %{__common_cflags} -m64 -mcpu=ultrasparc
++
++optflags: m68k %{__common_cflags} -fomit-frame-pointer
++
++optflags: ppc %{__common_cflags_with_ssp} -fsigned-char -mcpu=750 -mtune=7450
++optflags: ppciseries %{__common_cflags_with_ssp} -fsigned-char
++optflags: ppcpseries %{__common_cflags_with_ssp} -fsigned-char
++optflags: ppc32 %{__common_cflags_with_ssp} -m32 -fsigned-char -mcpu=power4 -mtune=cell
++optflags: ppc64 %{__common_cflags_with_ssp} -m64 -fsigned-char -mcpu=power4 -mtune=cell
++
++optflags: parisc %{__common_cflags} -mpa-risc-1-0
++optflags: hppa1.0 %{__common_cflags} -mpa-risc-1-0
++optflags: hppa1.1 %{__common_cflags} -mpa-risc-1-0
++optflags: hppa1.2 %{__common_cflags} -mpa-risc-1-0
++optflags: hppa2.0 %{__common_cflags} -mpa-risc-1-0
++
++optflags: mips %{__common_cflags}
++optflags: mipsel %{__common_cflags}
++
++optflags: armv3l %{__common_cflags} -fsigned-char -fomit-frame-pointer -march=armv3
++optflags: armv4b %{__common_cflags} -fsigned-char -fomit-frame-pointer -march=armv4
++optflags: armv4l %{__common_cflags} -fsigned-char -fomit-frame-pointer -march=armv4
++
++optflags: atarist %{__common_cflags} -fomit-frame-pointer
++optflags: atariste %{__common_cflags} -fomit-frame-pointer
++optflags: ataritt %{__common_cflags} -fomit-frame-pointer
++optflags: falcon %{__common_cflags} -fomit-frame-pointer
++optflags: atariclone %{__common_cflags} -fomit-frame-pointer
++optflags: milan %{__common_cflags} -fomit-frame-pointer
++optflags: hades %{__common_cflags} -fomit-frame-pointer
++
++optflags: s390 %{__common_cflags_with_ssp}
++optflags: s390x %{__common_cflags_with_ssp}
++
++#############################################################
++# Canonical arch names and numbers
++
++arch_canon: sparc64:sparc64 10
++arch_canon: sun4u: sparc64 10
++
++arch_canon: x86_64: x86_64 19
++
++#############################################################
++# Canonical OS names and numbers
++
++#############################################################
++# For a given uname().machine, the default build arch
++
++buildarchtranslate: athlon: i586
++buildarchtranslate: pentium4: i586
++buildarchtranslate: pentium3: i586
++buildarchtranslate: i686: i586
++buildarchtranslate: k6: i586
++buildarchtranslate: i586: i586
++buildarchtranslate: i486: i486
++buildarchtranslate: i386: i386
++buildarchtranslate: i386: i386
++
++#############################################################
++# Architecture compatibility
++
++arch_compat: k6: i586
++
++arch_compat: osfmach3_i686: i686 osfmach3_i586
++arch_compat: osfmach3_i586: i586 osfmach3_i486
++arch_compat: osfmach3_i486: i486 osfmach3_i386
++arch_compat: osfmach3_i386: i486
++
++buildarch_compat: k6: i486
++
++macrofiles: @RPMLIBDIR@/macros:@RPMLIBDIR@/%{_target}/macros:@RPMVENDORDIR@/macros:@RPMVENDORDIR@/%{_target}/macros:@RPMSYSCONFDIR@/macros:@RPMSYSCONFDIR@/%{_target}/macros:@RPMSYSCONFDIR@/macros.cdb:@RPMSYSCONFDIR@/macros.d/*.macros:~/.rpmmacros
+
+Added: rpm/rpm-setup/trunk/rubygems.rb
+===================================================================
+--- rpm/rpm-setup/trunk/rubygems.rb (rev 0)
++++ rpm/rpm-setup/trunk/rubygems.rb 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,84 @@
++#!/usr/bin/env ruby
++#--
++# Copyright 2010 Per &#216;yvind Karlsen &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">peroyvind at mandriva.org</A>&gt;
++# This program is free software. It may be redistributed and/or modified under
++# the terms of the LGPL version 2.1 (or later).
++#++
++
++require 'optparse'
++require 'rubygems'
++
++provides = false
++requires = false
++
++opts = OptionParser.new(&quot;#{$0} &lt;--provides|--requires&gt;&quot;)
++opts.on(&quot;-P&quot;, &quot;--provides&quot;, &quot;Print provides&quot;) do |val|
++ provides = true
++end
++opts.on(&quot;-R&quot;, &quot;--requires&quot;, &quot;Print requires&quot;) do |val|
++ requires= true
++end
++
++rest = opts.permute(ARGV)
++
++if rest.size != 0 or (!provides and !requires) or (provides and requires)
++ $stderr.puts &quot;Use either --provides OR --requires&quot;
++ $stderr.puts opts
++ exit(1)
++end
++
++specpath = &quot;%s/specifications/.*\.gemspec$&quot; % Gem::dir
++gems = []
++for gemspec in $stdin.readlines
++ if gemspec.match(specpath)
++ gems.push(gemspec.chomp)
++ end
++end
++if gems.length &gt; 0
++ if requires
++ require 'rbconfig'
++
++ module Gem
++ class Requirement
++ def rpm_dependency_transform(name, version)
++ pessimistic = &quot;&quot;
++ if version == &quot;&gt; 0.0.0&quot; or version == &quot;&gt;= 0&quot;
++ version = &quot;&quot;
++ else
++ if version[0..1] == &quot;~&gt;&quot;
++ pessimistic = &quot;rubygem(%s) &lt; %s\n&quot; % [name, Gem::Version.create(version[3..-1]).bump]
++ version = version.gsub(/\~&gt;/, '=&gt;')
++ end
++ version = version.gsub(/^/, ' ')
++ end
++ version = &quot;rubygem(%s)%s\n%s&quot; % [name, version, pessimistic]
++ end
++
++ def to_rpm(name)
++ result = as_list
++ return result.map { |version| rpm_dependency_transform(name, version) }
++ end
++
++ end
++ end
++ # TODO: Should we add a strict dependency on ruby version here?
++ #print &quot;ruby &lt; %s%s\n&quot; % [Config::CONFIG[&quot;ruby_version&quot;][0..-2], Config::CONFIG[&quot;ruby_version&quot;][-1..-1].to_i + 1]
++ print &quot;ruby &gt;= %s\n&quot; % Config::CONFIG[&quot;ruby_version&quot;]
++ end
++
++ for gem in gems
++ data = File.read(gem)
++ spec = eval(data)
++ if provides
++ print &quot;rubygem(%s) = %s\n&quot; % [spec.name, spec.version]
++ end
++ if requires
++ for d in spec.dependencies
++ print d.requirement.to_rpm(d.name)
++ end
++ for d in spec.required_rubygems_version.to_rpm(&quot;rubygems&quot;)
++ print d.gsub(/(rubygem\()|(\))/, &quot;&quot;)
++ end
++ end
++ end
++end
+
+
+Property changes on: rpm/rpm-setup/trunk/rubygems.rb
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Added: rpm/rpm-setup/trunk/tests/findlang.pl
+===================================================================
+--- rpm/rpm-setup/trunk/tests/findlang.pl (rev 0)
++++ rpm/rpm-setup/trunk/tests/findlang.pl 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,44 @@
++#!/usr/bin/perl
++
++use strict;
++use warnings;
++
++use Test::More qw(no_plan);
++
++my $pwd = `pwd`;
++chomp($pwd);
++my $testarbo = &quot;$pwd/find-lang-root&quot;;
++
++
++my %files = (
++ # file =&gt; [ lang, is_%dir ]
++ '/usr/share/man/fr' =&gt; [ 'fr', 1 ],
++ '/usr/share/man/fr/man1' =&gt; [ 'fr', 1 ],
++ '/usr/share/man/fr/man1/lang.1.*' =&gt; [ 'fr', 0 ],
++ '/usr/share/locale/pt_BR' =&gt; [ 'pt_BR', 1 ],
++ '/usr/share/gnome/help/lang/pt_BR' =&gt; [ 'pt_BR', 1 ],
++ '/usr/share/gnome/help/lang/pt_BR/any.html' =&gt; [ 'pt_BR', 0 ],
++ '/usr/share/gnome/help/lang/en_GB' =&gt; [ 'en_GB', 1 ],
++ '/usr/share/gnome/help/lang/en_GB/any.html' =&gt; [ 'en_GB', 0 ],
++ '/usr/share/gnome/help/lang' =&gt; [ '', 1 ],
++ '/usr/share/locale/pt_BR/LC_MESSAGES' =&gt; [ 'pt_BR', 1 ],
++ '/usr/share/locale/pt_BR/LC_MESSAGES/lang.mo' =&gt; [ 'pt_BR', 0 ],
++);
++
++system(&quot;/usr/bin/perl find-lang.pl $testarbo lang --with-man --with-gnome&quot;) and die &quot;can't run find-lang $@&quot;;
++
++open(my $h, '&lt;', 'lang.lang') or die &quot;can't open lang.lang&quot;;
++
++while (my $line = &lt;$h&gt;) {
++ chomp($line);
++ $line =~ /svn/ and next;
++ my ($file) = $line =~ / ([^ ]+)$/;
++ my ($lang) = $line =~ /%lang\(([^\)]+)\)/;
++ $lang ||= '';
++ my $dir = $line =~ /%dir/;
++ $dir ||= 0;
++ print STDERR &quot;$file\n&quot;;
++ is($lang, $files{$file}[0], &quot;lang is find&quot;);
++ is($dir, $files{$file}[1], &quot;%dir is properly set if need&quot;);
++}
++
+
+Added: rpm/rpm-setup/trunk/tests/findlang.sh
+===================================================================
+--- rpm/rpm-setup/trunk/tests/findlang.sh (rev 0)
++++ rpm/rpm-setup/trunk/tests/findlang.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,12 @@
++#!/bin/sh
++
++rm -fr find-lang-root
++for file in \
++ find-lang-root/usr/share/man/fr/man1/lang.1.lzma \
++ find-lang-root/usr/share/locale/pt_BR/LC_MESSAGES/lang.mo \
++ find-lang-root/usr/share/gnome/help/lang/pt_BR/any.html \
++ find-lang-root/usr/share/gnome/help/lang/en_GB/any.html
++do install -D Makefile $file
++done
++
++exec perl tests/findlang.pl
+
+
+Property changes on: rpm/rpm-setup/trunk/tests/findlang.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/tests/macros.sh
+===================================================================
+--- rpm/rpm-setup/trunk/tests/macros.sh (rev 0)
++++ rpm/rpm-setup/trunk/tests/macros.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,27 @@
++#!/bin/sh
++
++# $Id: macros.sh 242828 2008-06-02 12:41:00Z pixel $
++
++RPMEVAL=./rpmeval
++
++err=0
++
++mcheck() {
++ macro=$1
++ is=$2
++ echo -n &quot;${macro}... &quot;
++ res=`$RPMEVAL macros ${macro}`
++ if [ &quot;X${res}&quot; != &quot;X${is}&quot; ]; then
++ echo &quot;give ${res} not ${is}&quot;
++ err=$[ $err + 1]
++ else
++ echo &quot;OK&quot;
++ fi
++}
++
++mcheck %_var /var
++mcheck %_bindir /usr/bin
++mcheck %_sbindir /usr/sbin
++mcheck %_prefix /usr
++
++exit $err
+
+
+Property changes on: rpm/rpm-setup/trunk/tests/macros.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+
+Added: rpm/rpm-setup/trunk/tests.sh
+===================================================================
+--- rpm/rpm-setup/trunk/tests.sh (rev 0)
++++ rpm/rpm-setup/trunk/tests.sh 2011-01-06 17:30:05 UTC (rev 231)
+@@ -0,0 +1,18 @@
++#!/bin/sh
++
++# $Id: tests.sh 22753 2007-02-22 13:01:24Z nanardon $
++
++allerrs=0
++
++for i in tests/*.sh; do
++ /bin/sh ${i}
++ err=$?
++ if [ $err -ne 0 ]; then
++ echo &quot;${i}: $err test(s) failed&quot;
++ allerrs=$[ $allerrs + $err ]
++ else
++ echo &quot;${i}: All test succefully passed&quot;
++ fi
++done
++
++exit $allerrs
+
+
+Property changes on: rpm/rpm-setup/trunk/tests.sh
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: svn:eol-style
+ + native
+-------------- next part --------------
+An HTML attachment was scrubbed...
+URL: &lt;/pipermail/mageia-sysadm/attachments/20110106/a538e442/attachment-0001.html&gt;
+</PRE>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI>Previous message: <A HREF="002500.html">[Mageia-sysadm] Installing and using mgarepo on 2010.1
+</A></li>
+ <LI>Next message: <A HREF="001605.html">[Mageia-sysadm] Upload failed for @188:mgarepo-1.9.3-1mdv2010.1.src.rpm
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#1604">[ date ]</a>
+ <a href="thread.html#1604">[ thread ]</a>
+ <a href="subject.html#1604">[ subject ]</a>
+ <a href="author.html#1604">[ author ]</a>
+ </LI>
+ </UL>
+
+<hr>
+<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm
+mailing list</a><br>
+</body></html>