summaryrefslogtreecommitdiffstats
path: root/RPM4/t
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4/t')
-rw-r--r--RPM4/t/01compile.t12
-rw-r--r--RPM4/t/02header.t78
-rwxr-xr-xRPM4/t/03rpmlib.t86
-rw-r--r--RPM4/t/04spec.t62
-rw-r--r--RPM4/t/05transaction.t147
-rw-r--r--RPM4/t/06sign.t33
-rw-r--r--RPM4/t/07changelogs.t18
-rw-r--r--RPM4/t/07dep.t97
-rw-r--r--RPM4/t/07files.t37
-rw-r--r--RPM4/t/09hdlist.t27
-rw-r--r--RPM4/t/11media.t11
-rw-r--r--RPM4/t/gnupg/passphrase6
-rw-r--r--RPM4/t/gnupg/pubring.gpgbin0 -> 1233 bytes
-rw-r--r--RPM4/t/gnupg/secring.gpgbin0 -> 1371 bytes
-rw-r--r--RPM4/t/gnupg/test-key.gpg26
-rw-r--r--RPM4/t/gnupg/trustdb.gpgbin0 -> 1320 bytes
-rw-r--r--RPM4/t/rpmmacros8
-rw-r--r--RPM4/t/rpmrc369
-rw-r--r--RPM4/t/test-dep-1.0-1mdk.noarch.rpmbin0 -> 2285 bytes
-rw-r--r--RPM4/t/test-dep-1.0-1mdk.src.rpmbin0 -> 2213 bytes
-rw-r--r--RPM4/t/test-dep.spec38
-rw-r--r--RPM4/t/test-rpm-1.0-1mdk.noarch.rpmbin0 -> 2036 bytes
-rw-r--r--RPM4/t/test-rpm-1.0-1mdk.src.rpmbin0 -> 2137 bytes
-rw-r--r--RPM4/t/test-rpm.spec35
24 files changed, 1090 insertions, 0 deletions
diff --git a/RPM4/t/01compile.t b/RPM4/t/01compile.t
new file mode 100644
index 0000000..568a258
--- /dev/null
+++ b/RPM4/t/01compile.t
@@ -0,0 +1,12 @@
+# $Id$
+
+use Test::More tests => 3;
+
+use_ok('RPM4');
+can_ok('RPM4', qw/rpm2header stream2header dumprc dumpmacros newdb/);
+
+#Header
+
+# Db
+can_ok('RPM4::Transaction', qw/traverse transadd transremove transcheck transorder transrun
+ importpubkey checkrpm transreset/);
diff --git a/RPM4/t/02header.t b/RPM4/t/02header.t
new file mode 100644
index 0000000..7bba1a4
--- /dev/null
+++ b/RPM4/t/02header.t
@@ -0,0 +1,78 @@
+# $Id$
+
+use strict;
+use Test::More tests => 40;
+use FindBin qw($Bin);
+use RPM4;
+
+my $headerfile;
+
+{
+my $hdr = RPM4::Header->new();
+isa_ok($hdr, "RPM4::Header", "Creating empty header works");
+ok(! defined $hdr->tag(1000), "empty tag return nothings");
+}
+
+{
+my $hdr = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.src.rpm");
+isa_ok($hdr, "RPM4::Header", "instanciating an header from a source rpm works");
+ok($hdr->hastag(1000) eq 1, "Has tag 1000 (NAME), yes");
+ok($hdr->hastag("NAME") eq 1, "Has 'NAME', yes");
+ok($hdr->hastag(1106) eq 1, "Has tag 1106 (SOURCEPACKAGE), yes");
+ok($hdr->listtag(), "can list tag");
+is($hdr->tag(1000), "test-rpm", "accessing tag by id works");
+is($hdr->tag("NAME"), "test-rpm", "accessing tag by name works");
+is($hdr->NAME(), "test-rpm", "accessing tag directly works");
+ok($hdr->queryformat("%{NAME}-%{VERSION}-%{RELEASE}") eq "test-rpm-1.0-1mdk", "Queryformat is ok");
+ok($hdr->nevr() eq "test-rpm-1.0-1mdk", "header->nevr works");
+ok(scalar($hdr->fullname) eq "test-rpm-1.0-1mdk.src", "scalar fullname works");
+ok(join(",", $hdr->fullname) eq "test-rpm,1.0,1mdk,src", "wantarray fullname works");
+ok($hdr->issrc == 1, "Is a src, Yes !");
+ok($hdr->sourcerpmname eq "test-rpm-1.0-1mdk.src.rpm", "sourcerpmname works");
+ok($hdr->removetag(1000) == 0, "Removing a tag");
+ok(! defined $hdr->tag(1000), "tag is not present");
+ok($hdr->addtag(1000, 6, "new name") == 1, "Adding a tag (string type)");
+ok($hdr->tag(1000) eq "new name", "Added tag return good value");
+}
+
+{
+my $hdr = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm");
+isa_ok($hdr, "RPM4::Header", "instanciating an header from a binary rpm works");
+ok($hdr->hastag(1000) eq 1, "Has tag 1000 (NAME), yes");
+ok($hdr->tagtype(1000) eq RPM4::tagtypevalue("STRING"), "can get type of a tag");
+ok($hdr->hastag(1106) eq 0, "Has tag 1106 (SOURCEPACKAGE), no");
+ok($hdr->listtag(), "can list tag");
+is($hdr->tag(1000), "test-rpm", "accessing tag by id works");
+is($hdr->tag("NAME"), "test-rpm", "accessing tag by name works");
+is($hdr->NAME(), "test-rpm", "accessing tag directly works");
+ok($hdr->queryformat("%{NAME}-%{VERSION}-%{RELEASE}") eq "test-rpm-1.0-1mdk", "Queryformat is ok");
+ok(scalar($hdr->fullname) eq "test-rpm-1.0-1mdk.noarch", "scalar fullname works");
+ok(join(",", $hdr->fullname) eq "test-rpm,1.0,1mdk,noarch", "wantarray fullname works");
+ok($hdr->issrc == 0, "Is a src, No !");
+ok($hdr->sourcerpmname eq "test-rpm-1.0-1mdk.src.rpm", "sourcerpmname works");
+$headerfile = scalar($hdr->fullname).".hdr";
+
+
+my $hdrcopy = $hdr->copy();
+ok(defined $hdrcopy, "copy works");
+ok($hdrcopy->tag(1000) eq 'test-rpm', "tag 1000 (NAME) from copy works");
+
+open(my $hdfh, ">", $headerfile);
+ok($hdr->write($hdfh), "Write the header works");
+close($hdfh);
+
+my $size = $hdr->hsize;
+ok($size != 0, "Header size works");
+ok($size == (stat($headerfile))[7], "file size is same than in memory");
+}
+
+{
+open(my $hdfh, "< $headerfile");
+my $hdr2 = RPM4::Header->new($hdfh);
+isa_ok($hdr2, "RPM4::Header", "instanciating an header from a stream works");
+close $hdfh;
+unlink($headerfile);
+ok($hdr2->tag(1000) eq 'test-rpm', "tag 1000 from header file works");
+}
+
+
diff --git a/RPM4/t/03rpmlib.t b/RPM4/t/03rpmlib.t
new file mode 100755
index 0000000..24681bb
--- /dev/null
+++ b/RPM4/t/03rpmlib.t
@@ -0,0 +1,86 @@
+# $Id$
+
+use strict;
+use Test::More tests => 52;
+use FindBin qw($Bin);
+use RPM4;
+
+ok(! defined(RPM4::setverbosity("DEBUG")), "Set verbosity works");
+{
+my $marker = 0;
+ok(! defined(RPM4::setlogcallback(sub { my %m = @_; $marker = 1; print "$m{priority}: $m{msg}\n" } )),
+ "Setting log callback function works");
+ok(!defined(RPM4::rpmlog("ERR", "This is a rpm debug message")), "rpmlog function works");
+ok($marker == 1, "rpmlogcallback has been called");
+}
+ok(! defined(RPM4::setlogcallback(undef)), "remove callback function");
+ok(RPM4::setlogfile("logfile"), "set a log file");
+ok(!defined(RPM4::rpmlog(7, "This is a rpm debug message")), "rpmlog function works");
+ok(RPM4::setlogfile(undef), "set a log file");
+unlink("logfile");
+
+# Generic query:
+open(my $null, ">", "/dev/null");
+ok(!RPM4::dumprc($null), "Can dumprc");
+ok(!RPM4::dumpmacros($null), "Can dumpmacros");
+close($null);
+ok(length(RPM4::getosname), "Return OS name");
+ok(length(RPM4::getarchname), "Return arch name");
+ok(length(RPM4::buildhost), "Return buildhost");
+
+# Playing with macros
+my $target_cpu = RPM4::expand("%_target_cpu");
+ok(($target_cpu !~ /^\%/), "Getting _target_cpu macro");
+# setting test_macro to test
+ok(RPM4::expand("%test_macro") eq "%test_macro", "\%test_macro is no set");
+RPM4::add_macro("test_macro test");
+ok(RPM4::expand("%test_macro") eq "test", "add_macro works");
+RPM4::del_macro("test_macro");
+ok(RPM4::expand("%test_macro") eq "%test_macro", "del_macro works");
+RPM4::add_macro("test_macro test");
+ok(RPM4::expand("%test_macro") eq "test", "add_macro works");
+ok(!RPM4::resetmacros(), "Reset macro works");
+ok(!RPM4::resetrc(), "Reset rc works");
+ok(RPM4::expand("%test_macro") eq "%test_macro", "resetmacros works");
+RPM4::loadmacrosfile("$Bin/rpmmacros");
+ok(RPM4::expand("%RPM4") eq "perl-RPM4", "Checking macros define in our rpmmacros");
+ok(!RPM4::add_macro("_numeric 1"), "Add numeric macro");
+ok(RPM4::expandnumeric("%_numeric"), "expandnumeric works");
+
+ok(RPM4::readconfig("t/rpmrc") == 0, "Reading alternate config file");
+ok(RPM4::readconfig(undef, "xtentas-MandrakeSoft-osf1") == 0, "Reading conf for xtentas-MandrakeSoft-osf1");
+ok(RPM4::expand("%_target_cpu") eq "xtentas", "the conf is properly load");
+ok(RPM4::readconfig() == 0, "Re-Reading the conf, reset to default");
+ok(RPM4::expand("%_target_cpu") eq $target_cpu, "the conf is properly load");
+
+
+ok(RPM4::tagName(1000) eq "Name", "tagName works");
+ok(RPM4::tagValue("NAME") == 1000, "tagValue works");
+ok(RPM4::tagtypevalue("STRING"), "Get tage type value");
+
+# Version comparison
+ok(RPM4::rpmvercmp("1mdk", "1mdk") == 0, "rpmvercmp with =");
+ok(RPM4::rpmvercmp("1mdk", "2mdk") == -1, "rpmvercmp with <");
+ok(RPM4::rpmvercmp("2mdk", "1mdk") == 1, "rpmvercmp with >");
+
+ok(RPM4::compare_evr("1", "1") == 0, "comparing version only, equal");
+ok(RPM4::compare_evr("2", "1") == 1, "comparing version only, higther");
+ok(RPM4::compare_evr("1", "2") == -1, "comparing version only, lesser");
+ok(RPM4::compare_evr("1-1mdk", "1-1mdk") == 0, "comparing version-release only, equal");
+ok(RPM4::compare_evr("2-1mdk", "1-1mdk") == 1, "comparing version-release only, higther");
+ok(RPM4::compare_evr("1-1mdk", "2-1mdk") == -1, "comparing version-release only, lesser");
+ok(RPM4::compare_evr("1:1-1mdk", "1:1-1mdk") == 0, "comparing epoch:version-release only, equal");
+ok(RPM4::compare_evr("2:1-1mdk", "1:1-1mdk") == 1, "comparing epoch:version-release only, higther");
+ok(RPM4::compare_evr("1:1-1mdk", "2:1-1mdk") == -1, "comparing epoch:version-release only, lesser");
+
+ok(RPM4::compare_evr("0:1-1mdk", "1-1mdk") == 1, "comparing epoch 0 vs no epoch");
+ok(RPM4::compare_evr("1:1-1mdk", "1-1mdk") == 1, "comparing epoch 1 vs no epoch");
+ok(RPM4::compare_evr("1.0-1mdk", "1.0") == 1, "comparing version-release vs version only");
+ok(RPM4::compare_evr("0:1-1mdk", "1.0") == 1, "comparing epoch:version-release vs no version");
+
+ok(RPM4::osscore("osf1") == 0, "get os score");
+ok(RPM4::osscore("osf1", 1) == 0, "get build os score");
+
+ok(RPM4::archscore("noarch") != 0, "get arch score");
+ok(RPM4::archscore("noarch", 1) != 0, "get arch score");
+
diff --git a/RPM4/t/04spec.t b/RPM4/t/04spec.t
new file mode 100644
index 0000000..b1019eb
--- /dev/null
+++ b/RPM4/t/04spec.t
@@ -0,0 +1,62 @@
+# $Id$
+
+use strict;
+use Test::More tests => 23;
+use FindBin qw($Bin);
+use File::Temp qw(tempdir);
+use RPM4;
+
+my %info = RPM4::moduleinfo();
+
+my $testdir = tempdir( CLEANUP => 1 );
+mkdir("$testdir/$_") foreach (qw(BUILD RPMS RPMS/noarch SRPMS));
+
+my $passphrase = "RPM4";
+
+RPM4::add_macro("_tmppath $testdir");
+RPM4::add_macro("_builddir $testdir");
+RPM4::add_macro("_topdir $testdir");
+RPM4::add_macro("_signature gpg");
+RPM4::add_macro("_gpg_name RPM4 test key");
+RPM4::add_macro("_gpg_path $Bin/gnupg");
+
+ok((RPM4::installsrpm("$Bin/test-rpm-1.0-1mdk.src.rpm"))[0] =~ m/test-rpm\.spec$/, "installsrpms works");
+ok(!RPM4::installsrpm("$Bin/test-rpm-1.0-1mdk.noarch.rpm"), "installsrpms works");
+
+my $spec;
+if ($info{Hack} eq "Yes") {
+ ok( defined(RPM4::Spec->new()), "Create an empty spec object");
+} else {
+ ok(! defined(RPM4::Spec->new()), "Create an empty spec object don't works");
+}
+ok(!defined($spec = RPM4::Spec->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm")), "Loading a bad spec file");
+ok($spec = RPM4::Spec->new("$Bin/test-rpm.spec", passphrase => $passphrase), "Loading a spec file");
+
+my @rpms = $spec->binrpm;
+ok(@rpms == 1, "Can find binary package");
+ok($rpms[0] =~ m!noarch/test-rpm-1.0-1mdk.noarch.rpm$!, "binrpm return good value");
+
+ok($spec->srcrpm =~ m!SRPMS/test-rpm-1.0-1mdk.src.rpm$!, "srcrpm return good value");
+
+ok(!defined($spec->check()), "Running spec::check");
+
+my $h;
+ok(defined($h = $spec->srcheader()), "Geting source header before build");
+ok($h->queryformat("%{NAME}") eq "test-rpm", "can querying header give by spec");
+
+ok($spec->build([ qw(PREP) ]) == 0, "simulate rpm -bp (check prep)");
+ok($spec->build([ qw(BUILD) ]) == 0, "simulate rpm -bc");
+ok($spec->build([ qw(INSTALL CHECK) ]) == 0, "simulate rpm -bi");
+ok($spec->build([ qw(FILECHECK) ]) == 0, "simulate rpm -bl");
+ok($spec->build([ qw(PACKAGEBINARY CLEAN) ]) == 0, "simulate rpm -bb (binary, clean)");
+ok($spec->build([ qw(PACKAGESOURCE) ]) == 0, "simulate rpm -bs");
+ok($spec->rpmbuild("bb") == 0, "testing spec->rpmbuild(-bb)");
+ok($spec->build([ qw(RMBUILD RMSOURCE) ]) == 0, "simulate cleaning spec, source, build");
+
+ok(defined($h = $spec->srcheader()), "Geting source header after build");
+ok($h->queryformat("%{NAME}") eq "test-rpm", "can querying header give by spec");
+
+my ($bh) = $spec->binheader();
+ok(defined($bh), "Can get binary header from spec");
+ok($bh->queryformat("%{NAME}") eq "test-rpm", "can querying header give by spec");
+
diff --git a/RPM4/t/05transaction.t b/RPM4/t/05transaction.t
new file mode 100644
index 0000000..8ee1f44
--- /dev/null
+++ b/RPM4/t/05transaction.t
@@ -0,0 +1,147 @@
+# $Id$
+
+use strict;
+use Test::More tests => 50;
+use FindBin qw($Bin);
+use File::Path;
+use File::Temp qw/tempdir/;
+use RPM4;
+use RPM4::Transaction::Problems;
+
+# Test on wrong db
+RPM4::add_macro("_dbpath /dev/null");
+ok(RPM4::rpmdbverify() != 0, "Verify non existing database (get error)");
+
+my $tempdir = tempdir();
+rmtree($tempdir) if $tempdir;
+my $testdir = "$tempdir/testdb";
+mkdir $testdir;
+
+RPM4::add_macro("_dbpath $testdir");
+
+ok(RPM4::rpmdbinit() == 0, "initdb works");
+ok(RPM4::rpmdbrebuild() == 0, "rebuild database");
+ok(RPM4::rpmdbverify() == 0, "Verify empty");
+
+my $ts;
+ok($ts = RPM4::Transaction->new(), "Open a new database");
+ok($ts->traverse(sub { print STDERR $_->tag(1000) . "\n"; }) != -1, "db->traverse()");
+
+ok($ts->importpubkey("$Bin/gnupg/test-key.gpg") == 0, "Importing a public key");
+
+my $hd = RPM4::rpm2header("$Bin/test-dep-1.0-1mdk.noarch.rpm");
+ok($hd, "Reading the header works");
+
+ok($ts->transadd($hd, "$Bin/test-dep-1.0-1mdk.noarch.rpm") == 0, "Adding a package to transaction works");
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok($ts->transorder() == 0, "Run transaction order");
+
+if (0){
+my $pbs = RPM4::Transaction::Problems->new($ts);
+isa_ok(
+ $pbs,
+ 'RPM4::Db::Problems',
+ 'Can retrieve pb from transaction'
+);
+
+ok($pbs->count, "Can get number of problems");
+
+ok($pbs->init() || 1, "Resetting problems counter");
+my $strpb;
+while($pbs->hasnext()) {
+ $strpb .= $pbs->problem();
+}
+ok($strpb, "Can get problem description");
+}
+
+ok(defined($ts->transflag([qw(TEST)])), "Set transflags");
+ok($ts->transrun([ qw(LABEL PERCENT) ]) == 0, "Running transaction justdb");
+ok(!defined($ts->transreset()), "Resetting transaction");
+
+my $h = RPM4::rpm2header("$Bin/test-rpm-1.0-1mdk.noarch.rpm");
+ok($h, "Reading the header works");
+
+ok($ts->transadd($h, "$Bin/test-rpm-1.0-1mdk.noarch.rpm") == 0, "Adding a package to transaction works");
+ok($ts->traverse_transaction(sub {
+ ok($_[0]->fullname, "Can get name from te");
+ ok($_[0]->type, "Can get type from te");
+}), "traverse_transaction works");
+
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok($ts->transorder() == 0, "Run transaction order");
+
+ok(defined($ts->transflag([qw(JUSTDB)])), "Set transflags");
+ok($ts->transrun( sub { my %a = @_; print STDERR "$a{what} $a{filename} $a{amount} / $a{total}\n"; }) == 0, "Running transaction justdb");
+
+ok($ts->injectheader($hd) == 0, "Injecting header in a db");
+
+my $found = 0;
+my ($rhf, $roffset);
+ok($ts->traverse( sub {
+ my ($hf, $offset) = @_;
+ scalar($hf->fullname()) eq "test-dep-1.0-1mdk.noarch" and do {
+ $found++;
+ ($rhf, $roffset) = ($hf, $offset);
+ };
+ 1;
+ }), "Running traverse");
+
+ok($found, "Can find heaer in db");
+ok($ts->deleteheader($roffset) == 0, "Removing header from db");
+
+$ts = undef; # explicitely calling DESTROY to close database
+
+ok($ts = RPM4::newdb(1), "Open existing database");
+$found = 0;
+
+($rhf, $roffset) = (undef, undef);
+ok($ts->traverse( sub {
+ my ($hf, $offset) = @_;
+ scalar($hf->fullname()) eq "test-rpm-1.0-1mdk.noarch" and do {
+ $found++;
+ ($rhf, $roffset) = ($hf, $offset);
+ }
+ }), "Running traverse");
+
+ok($found == 1, "The previously installed rpm is found");
+ok($roffset > 0, "Retrieve offset db");
+
+ok($ts->transremove_pkg("test-rpm(1.0-1mdk)") == 1, "Try to remove a rpm");
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok(!defined($ts->transreset()), "Reseting current transaction");
+
+ok($ts->transremove($roffset), "Removing pkg from header and offset");
+ok($ts->transorder() == 0, "Run transaction order");
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok(defined($ts->transflag([qw(JUSTDB)])), "Set transflags");
+ok($ts->transrun([ qw(LABEL PERCENT) ]) == 0, "Running transaction justdb");
+
+$found = 0;
+
+ok($ts->traverse( sub {
+ my ($hf, $offset) = @_;
+ scalar($hf->fullname()) eq "test-rpm-1.0-1mdk.noarch" and do {
+ $found++;
+ ($rhf, $roffset) = ($hf, $offset);
+ }
+ }), "Running traverse");
+
+ok($found == 0, "The previously removed rpm is not found");
+
+ok($ts->transadd($h, "test-rpm-1.0-1mdk.noarch.rpm", 1, "/usr", 1) == 0, "Adding a package to transaction with prefix");
+ok($ts->transorder() == 0, "Run transaction order");
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok(!defined($ts->transreset()), "Reseting current transaction");
+
+ok($ts->transadd($h, "test-rpm-1.0-1mdk.noarch.rpm", 1, {"/etc" => "/usr" }, 1) == 0, "Adding a package to transaction with relocation works");
+ok($ts->transorder() == 0, "Run transaction order");
+ok($ts->transcheck() == 0, "Checking transaction works");
+ok(!defined($ts->transreset()), "Reseting current transaction");
+
+{
+my $spec = $ts->newspec("$Bin/test-rpm.spec");
+isa_ok($spec, 'RPM4::Spec', 'ts->newspec');
+}
+
+$ts = undef; # explicitely calling DESTROY to close database
+rmtree($tempdir);
diff --git a/RPM4/t/06sign.t b/RPM4/t/06sign.t
new file mode 100644
index 0000000..5dd0c02
--- /dev/null
+++ b/RPM4/t/06sign.t
@@ -0,0 +1,33 @@
+# $Id$
+
+use strict;
+use Test::More tests => 6;
+use FindBin qw($Bin);
+use File::Temp qw(tempdir);
+use File::Copy;
+use RPM4;
+
+my $passphrase = "RPM4";
+
+my $testdir = tempdir( CLEANUP => 1 );
+
+RPM4::add_macro("_dbpath $testdir");
+
+copy("$Bin/test-rpm-1.0-1mdk.noarch.rpm", "$testdir");
+
+RPM4::add_macro("_signature gpg");
+RPM4::add_macro("_gpg_name RPM4 test key");
+RPM4::add_macro("_gpg_path $Bin/gnupg");
+
+ok(RPM4::rpmresign($passphrase, "$testdir/test-rpm-1.0-1mdk.noarch.rpm") == 0, "can resign a rpm");
+
+ok(my $db = RPM4::newdb(1), "Open a new database");
+
+ok($db->checkrpm("$testdir/test-rpm-1.0-1mdk.noarch.rpm") != 0, "checking a rpm, key is missing");
+ok($db->checkrpm("$testdir/test-rpm-1.0-1mdk.noarch.rpm", [ "NOSIGNATURES" ]) == 0, "checking a rpm, no checking the key");
+
+ok($db->importpubkey("$Bin/gnupg/test-key.gpg") == 0, "Importing a public key");
+
+ok($db->checkrpm("$testdir/test-rpm-1.0-1mdk.noarch.rpm") == 0, "checking a rpm file");
+
+$db = undef;
diff --git a/RPM4/t/07changelogs.t b/RPM4/t/07changelogs.t
new file mode 100644
index 0000000..d2c2555
--- /dev/null
+++ b/RPM4/t/07changelogs.t
@@ -0,0 +1,18 @@
+# $Id$
+
+use strict;
+use Test::More tests => 1;
+use FindBin qw($Bin);
+use RPM4;
+use RPM4::Header::Changelogs;
+
+my $htest = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm");
+
+my $ch = RPM4::Header::Changelogs->new($htest);
+
+isa_ok(
+ $ch,
+ 'RPM4::Header::Changelogs',
+ 'Get changelogs object'
+);
+
diff --git a/RPM4/t/07dep.t b/RPM4/t/07dep.t
new file mode 100644
index 0000000..e51327e
--- /dev/null
+++ b/RPM4/t/07dep.t
@@ -0,0 +1,97 @@
+# $Id$
+
+use strict;
+use Test::More tests => 43;
+use FindBin qw($Bin);
+use RPM4;
+use RPM4::Header::Dependencies;
+
+isa_ok(
+ RPM4::rpmlibdep(),
+ 'RPM4::Header::Dependencies',
+ "Can get a dep for rpmlib"
+);
+
+my $htest = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm");
+my $hdep = RPM4::Header->new("$Bin/test-dep-1.0-1mdk.noarch.rpm");
+isa_ok($htest, 'RPM4::Header', '$htest');
+isa_ok($hdep, 'RPM4::Header' , '$hdep');
+
+isa_ok(
+ $hdep->dep("CONFLICTNAME"),
+ 'RPM4::Header::Dependencies',
+ '$hdep->dep("CONFLICTNAME")'
+);
+isa_ok(
+ $hdep->dep("REQUIRENAME"),
+ 'RPM4::Header::Dependencies',
+ '$hdep->dep("REQUIRENAME")'
+);
+isa_ok(
+ $hdep->dep("OBSOLETENAME"),
+ 'RPM4::Header::Dependencies',
+ '$hdep->dep("OBSOLETENAME")'
+);
+isa_ok(
+ $hdep->dep("PROVIDENAME"),
+ 'RPM4::Header::Dependencies',
+ '$hdep->dep("PROVIDENAME")'
+);
+ok(
+ ! defined $hdep->dep("TRIGGERNAME"),
+ "fetching triggers returns undef"
+);
+
+ok($htest->compare($hdep) == 0, "Compare two header");
+ok($hdep->compare($htest) == 0, "Compare two header");
+
+ok(! defined($htest->hchkdep($hdep, "REQUIRENAME")), "test-rpm requires test-dep, no");
+ok( defined($hdep->hchkdep($htest, "REQUIRENAME")), "test-dep requires test-rpm, yes");
+ok(! defined($htest->hchkdep($hdep, "OBSOLETENAME")), "test-rpm obsoletes test-dep, no");
+ok( defined($hdep->hchkdep($htest, "OBSOLETENAME")), "test-dep obsoletes test-rpm, yes");
+ok(! defined($htest->hchkdep($hdep, "CONFLICTNAME")), "test-rpm conflics test-dep, no");
+ok( defined($hdep->hchkdep($htest, "CONFLICTNAME")), "test-dep conflicts test-rpm, yes");
+ok(! defined($htest->hchkdep($hdep, "TRIGGERNAME")), "test-rpm trigger test-dep, no");
+ok(! defined($hdep->hchkdep($htest, "TRIGGERNAME")), "test-dep trigger test-rpm, no");
+ok(! defined($htest->hchkdep($hdep, "PROVIDENAME")), "test-rpm provide test-dep, no");
+ok(! defined($hdep->hchkdep($htest, "PROVIDENAME")), "test-dep provide test-rpm, no");
+
+ok( $hdep->is_better_than($htest), "test-dep better than test-rpm: yes");
+ok(! $htest->is_better_than($hdep), "test-rpm better than test-dep: no");
+
+my ($dep1, $dep2, $dep3);
+isa_ok(
+ RPM4::Header::Dependencies->new("REQUIRENAME",
+ [ "test-rpm", [ qw/LESS EQUAL/ ], "1.0-1mdk" ]
+ ),
+ 'RPM4::Header::Dependencies',
+ 'New REQUIRENAME dependencies'
+);
+
+ok($dep1 = RPM4::newdep("REQUIRENAME", "test-rpm", [ qw/LESS EQUAL/ ], "1.0-1mdk"), "Build a new dep");
+ok($dep2 = RPM4::newdep("REQUIRENAME", "test-rpm", [ qw/GREATER EQUAL/ ], "1.0-1mdk"), "Build a new dep");
+ok($dep3 = RPM4::newdep("REQUIRENAME", "test-rpm", [ "GREATER" ], "1.0-1mdk"), "Build a new dep");
+
+is($dep1->count(), 1, "dependencies number");
+ok(defined($dep1->move()), "Can move into dep");
+ok($dep1->next() == -1, "no further dependency");
+
+ok($dep1->add("test-dep", [ qw/LESS EQUAL/ ], "1.0-1mdk"), "Add a dep entry into existing dep");
+
+ok(scalar($dep1->info()) eq "R test-rpm <= 1.0-1mdk", "Can get info from RPM4::Header::Dep");
+ok(($dep1->info())[3] eq "1.0-1mdk", "Can get info from RPM4::Header::Dep");
+ok($dep1->name() eq 'test-rpm', "Get dep name from RPM4::Header::Dep");
+ok($dep1->flags(), "Get dep flags from RPM4::Header::Dep");
+ok($dep1->evr() eq '1.0-1mdk', "Get dep evr from RPM4::Header::Dep");
+
+ok($dep1->overlap($dep2), "compare two dep");
+ok($dep1->overlap($dep3) == 0, "compare two dep");
+
+ok($htest->matchdep($dep1), "Test single dep PROVIDE");
+ok($htest->matchdep($dep3) == 0, "Test single dep REQUIRE");
+
+ok($hdep->matchdep($dep1) == 0, "Test single dep PROVIDE");
+ok($htest->matchdep($dep2), "Test single dep REQUIRE");
+
+ok( $dep1->matchheadername($htest), "Dependancy match header name: yes");
+ok(! $dep1->matchheadername($hdep), "Dependancy match header name: no");
diff --git a/RPM4/t/07files.t b/RPM4/t/07files.t
new file mode 100644
index 0000000..ee5388f
--- /dev/null
+++ b/RPM4/t/07files.t
@@ -0,0 +1,37 @@
+# $Id$
+
+use strict;
+use Test::More tests => 10;
+use FindBin qw($Bin);
+use RPM4;
+
+my $htest = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm");
+isa_ok($htest, 'RPM4::Header', '$htest');
+
+my $files = $htest->files();
+isa_ok($files, 'RPM4::Header::Files', '$files');
+
+is(
+ $files->count(),
+ 1,
+ "files count OK"
+);
+like(
+ $files->filename(),
+ qr!^/!,
+ "filename OK"
+);
+like(
+ $files->dirname(),
+ qr!^/!,
+ "dirname OK"
+);
+ok(defined($files->basename()), "Can get Files::basename()");
+ok(defined($files->fflags()), "Can get Files::fflags()");
+is(
+ $files->md5(),
+ "b9cb4e3dc1b8007e5c9678d1acecac47",
+ "md5 is OK"
+);
+ok(!defined($files->link()), "Can get Files::link()");
+ok(defined($files->mode()), "Can get Files::mode()");
diff --git a/RPM4/t/09hdlist.t b/RPM4/t/09hdlist.t
new file mode 100644
index 0000000..17d32f4
--- /dev/null
+++ b/RPM4/t/09hdlist.t
@@ -0,0 +1,27 @@
+# $Id$
+
+use strict;
+use Test::More tests => 6;
+use FindBin qw($Bin);
+use File::Temp qw(tempdir);
+use File::Glob;
+
+my $testdir = tempdir( CLEANUP => 1 );
+
+use_ok('RPM4');
+use_ok('RPM4::Index');
+
+my @headers;
+my $callback = sub { my %arg = @_; defined($arg{header}) and push(@headers, $arg{header}); };
+
+my @rpms = <$Bin/*.rpm>;
+
+RPM4::parserpms(callback => $callback, rpms => [ @rpms ]);
+ok(scalar(@headers) == 4, "RPM4::parserpms works");
+
+ok(RPM4::Index::buildhdlist(hdlist => "$testdir/hdlist.cz", rpms => [ @rpms ]),
+ "Creating a hdlist");
+ok(RPM4::Index::buildsynthesis(synthesis => "$testdir/synthesis.hdlist.cz", rpms => [ @rpms ]),
+ "Creating a synthesis");
+ok(RPM4::Index::buildindex(list => "$testdir/list", rpms => [ @rpms ]),
+ "Creating a list file");
diff --git a/RPM4/t/11media.t b/RPM4/t/11media.t
new file mode 100644
index 0000000..6df34bf
--- /dev/null
+++ b/RPM4/t/11media.t
@@ -0,0 +1,11 @@
+# $Id$
+
+use strict;
+use Test::More tests => 1;
+
+use_ok('RPM4::Media');
+
+
+
+
+
diff --git a/RPM4/t/gnupg/passphrase b/RPM4/t/gnupg/passphrase
new file mode 100644
index 0000000..0bff4aa
--- /dev/null
+++ b/RPM4/t/gnupg/passphrase
@@ -0,0 +1,6 @@
+RPM4
+
+# $Id$
+# This is key passphrase, this key is here only for testing.
+# Do not use it for signing/crypting.
+# Do not trust it.
diff --git a/RPM4/t/gnupg/pubring.gpg b/RPM4/t/gnupg/pubring.gpg
new file mode 100644
index 0000000..77672f4
--- /dev/null
+++ b/RPM4/t/gnupg/pubring.gpg
Binary files differ
diff --git a/RPM4/t/gnupg/secring.gpg b/RPM4/t/gnupg/secring.gpg
new file mode 100644
index 0000000..35d1b0a
--- /dev/null
+++ b/RPM4/t/gnupg/secring.gpg
Binary files differ
diff --git a/RPM4/t/gnupg/test-key.gpg b/RPM4/t/gnupg/test-key.gpg
new file mode 100644
index 0000000..f016987
--- /dev/null
+++ b/RPM4/t/gnupg/test-key.gpg
@@ -0,0 +1,26 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.2.4 (GNU/Linux)
+
+mQGiBEDpJpERBACs+drbbg4K8tPXhyTZdgwDDmejQrBFxqiPwu4CSrpx8qvjEieU
+JRGmwrv1pCSgag6bOF+04cnjaHT/FwUQpokDWRFWrHlJoFFHaP32I1n+nj/bv5Bg
+pUKgF5ZU8Jd8OeG9TZzzZUQ/EF9/QvpCN7ZdqkMoTRTzj8O8Pa6L5x/+EwCgpwA2
+1ULjab5DlcODWeBOltLtiGUD/jFBKDvOq+XxeRi4k8gEvI3UPs4utMir/e2hw1yC
+N6G3TZpOJHx+iMuy1LoqrBcwz3pZb1MwucA+QlF/imBBWurirFblOcGuw3Un6+Ef
+AeQ0kqX/76WN161xu6FAYkfIg7XUvdlEMM4svDl0jm7NbzBJHsw3Z84/jusPmCGJ
+hRCzBACTopdtD8FBzvihiCL7Fql4Vqu1U/kt2+fMXPDSduzUe8c0lgI2Irk0DBsH
+w3in1FaZrtai5f521v4b8Xqazcq7lcPVZFTrhPD8b1h21STKi4aB8QwZHZSLbP0A
+0kGLFqhyuBQ0sBRRQXNrjSufIuTto+BOplQ9srYX9dR9nssdB7R9SGRsaXN0IHRl
+c3Qga2V5IChUaGlzIGtleSBpcyBvbmx5IGZvciB0ZXN0aW5nIHJwbSBzaWduaW5n
+IHNvZnR3YXJlLCBETyBOT1QgVVNFUyBJVCwgRE8gTk9UIFRSVVNUIElUKSA8ZGV2
+ZWxAbWFuZHJha2Vzb2Z0LmNvbT6IXgQTEQIAHgUCQOkmkQIbAwYLCQgHAwIDFQID
+AxYCAQIeAQIXgAAKCRAqlxaKod9cSNLHAJ4xiVz5RIwpilxIszS+lOfs72ldFgCd
+HUFDq3t/xU+J/YdyOC2U6ojrbLy5AQ0EQOkmkRAEAMNv7Re/vT+jARIqrbbEyHjv
+vgqKiDEiBwowXOO7e3JVhGUG/vZqRFFUkPXxaXFIfosgbWFqNiKwPwTs5Avtm5gc
+U0BsxaeHsy9O4lCpyPaFc62qtDiqukRCGTRCrK0TmAJULgJmYh90fxAX11KL8fUi
+05qcI/mdM317kC6jYErjAAMFA/9WmDbkYlMAPlrU8oKSduXeFFBLTdG+5XNtf62E
+c+VKDcZKzRohEUYG/FLlzoLKp7nqGEnTaCldqIUIvJvC+5fuAVfhiae3SyAqHNxZ
+lTgIzAqjsaYOdVk2xZQZMiSM+UqTH15oXv/MgK4t/5Muwq5S6feqo/+tqJBFZ+cF
+EU0Yx4hJBBgRAgAJBQJA6SaRAhsMAAoJECqXFoqh31xISlAAn1kzaAaSc20WfhEl
+2uM8BV2NJNICAJ9o75o/N0GbzHxqZacdGVWncQv+PQ==
+=QAx/
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/RPM4/t/gnupg/trustdb.gpg b/RPM4/t/gnupg/trustdb.gpg
new file mode 100644
index 0000000..199a2f2
--- /dev/null
+++ b/RPM4/t/gnupg/trustdb.gpg
Binary files differ
diff --git a/RPM4/t/rpmmacros b/RPM4/t/rpmmacros
new file mode 100644
index 0000000..ae2aeed
--- /dev/null
+++ b/RPM4/t/rpmmacros
@@ -0,0 +1,8 @@
+# rpmmacros test file for perl-RPM4
+# $Id$
+
+%RPM4 perl-RPM4
+
+%_tmppath %(pwd)/testdir
+%_builddir %(pwd)/testdir
+%_topdir %(pwd)/testdir
diff --git a/RPM4/t/rpmrc b/RPM4/t/rpmrc
new file mode 100644
index 0000000..5ee28ee
--- /dev/null
+++ b/RPM4/t/rpmrc
@@ -0,0 +1,369 @@
+#/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc
+# \verbatim
+#
+# $Id$
+#
+# 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/rpmrc, while per-user configuration should
+# be added to ~/.rpmrc.
+#
+#############################################################
+# Values for RPM_OPT_FLAGS for various platforms
+
+optflags: i386 -O2 -fomit-frame-pointer -pipe -march=i386 %{debugcflags}
+optflags: i486 -O2 -fomit-frame-pointer -pipe -march=i486 %{debugcflags}
+optflags: k6 -O2 -fomit-frame-pointer -pipe -march=k6 %{debugcflags}
+optflags: i586 -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro %{debugcflags}
+optflags: i686 -O2 -fomit-frame-pointer -pipe -march=i686 %{debugcflags}
+optflags: athlon -O2 -fomit-frame-pointer -pipe -march=athlon %{debugcflags}
+optflags: ia64 -O2 -pipe %{debugcflags}
+optflags: x86_64 -O2 -pipe %{debugcflags}
+optflags: amd64 -O2 -pipe %{debugcflags}
+
+ # XXX Please note that -mieee has been added in rpm-3.0.5.
+optflags: alpha -O2 -mieee -mcpu=ev5 -pipe %{debugcflags}
+optflags: alphaev5 -O2 -mieee -mcpu=ev5 -pipe %{debugcflags}
+optflags: alphaev56 -O2 -mieee -mcpu=ev56 -pipe %{debugcflags}
+optflags: alphapca56 -O2 -mieee -mcpu=pca56 -pipe %{debugcflags}
+optflags: alphaev6 -O2 -mieee -mcpu=ev6 -pipe %{debugcflags}
+optflags: alphaev67 -O2 -mieee -mcpu=ev67 -pipe %{debugcflags}
+
+optflags: sparc -O2 -m32 -mtune=ultrasparc %{debugcflags}
+optflags: sparcv9 -O2 -m32 -mcpu=ultrasparc %{debugcflags}
+optflags: sparc64 -O2 -m64 -mcpu=ultrasparc %{debugcflags}
+
+optflags: m68k -O2 %{debugcflags} -fomit-frame-pointer
+
+optflags: ppc -O2 -fsigned-char -frename-registers -mcpu=750 -mtune=7450 -pipe %{debugcflags}
+optflags: ppciseries -O2 %{debugcflags} -fsigned-char
+optflags: ppcpseries -O2 %{debugcflags} -fsigned-char
+optflags: ppc64 -O2 %{debugcflags} -fsigned-char
+
+optflags: parisc -O2 %{debugcflags} -mpa-risc-1-0
+optflags: hppa1.0 -O2 %{debugcflags} -mpa-risc-1-0
+optflags: hppa1.1 -O2 %{debugcflags} -mpa-risc-1-0
+optflags: hppa1.2 -O2 %{debugcflags} -mpa-risc-1-0
+optflags: hppa2.0 -O2 %{debugcflags} -mpa-risc-1-0
+
+optflags: mips -O2 %{debugcflags}
+optflags: mipsel -O2 %{debugcflags}
+
+optflags: armv3l -O2 %{debugcflags} -fsigned-char -fomit-frame-pointer -march=armv3
+optflags: armv4b -O2 %{debugcflags} -fsigned-char -fomit-frame-pointer -march=armv4
+optflags: armv4l -O2 %{debugcflags} -fsigned-char -fomit-frame-pointer -march=armv4
+
+optflags: atarist -O2 %{debugcflags} -fomit-frame-pointer
+optflags: atariste -O2 %{debugcflags} -fomit-frame-pointer
+optflags: ataritt -O2 %{debugcflags} -fomit-frame-pointer
+optflags: falcon -O2 %{debugcflags} -fomit-frame-pointer
+optflags: atariclone -O2 %{debugcflags} -fomit-frame-pointer
+optflags: milan -O2 %{debugcflags} -fomit-frame-pointer
+optflags: hades -O2 %{debugcflags} -fomit-frame-pointer
+
+optflags: s390 -O2 %{debugcflags}
+optflags: s390x -O2 %{debugcflags}
+
+#############################################################
+# Canonical arch names and numbers
+
+arch_canon: athlon: athlon 1
+arch_canon: i686: i686 1
+arch_canon: i586: i586 1
+arch_canon: k6: k6 1
+arch_canon: i486: i486 1
+arch_canon: i386: i386 1
+
+arch_canon: alpha: alpha 2
+arch_canon: alphaev5: alphaev5 2
+arch_canon: alphaev56: alphaev56 2
+arch_canon: alphapca56:alphapca56 2
+arch_canon: alphaev6: alphaev6 2
+arch_canon: alphaev67: alphaev67 2
+
+arch_canon: sparc: sparc 3
+arch_canon: sun4: sparc 3
+arch_canon: sun4m: sparc 3
+arch_canon: sun4c: sparc 3
+arch_canon: sun4d: sparc 3
+arch_canon: sparcv9: sparcv9 3
+# This is really a place holder for MIPS.
+arch_canon: mips: mips 4
+
+arch_canon: ppc: ppc 5
+arch_canon: ppciseries: ppciseries 5
+arch_canon: ppcpseries: ppcpseries 5
+
+arch_canon: m68k: m68k 6
+arch_canon: IP: sgi 7
+arch_canon: rs6000: rs6000 8
+arch_canon: ia64: ia64 9
+
+arch_canon: sparc64:sparc64 10
+arch_canon: sun4u: sparc64 10
+arch_canon: mipsel: mipsel 11
+
+arch_canon: armv3l: armv3l 12
+arch_canon: armv4b: armv4b 12
+arch_canon: armv4l: armv4l 12
+
+arch_canon: m68kmint: m68kmint 13
+arch_canon: atarist: m68kmint 13
+arch_canon: atariste: m68kmint 13
+arch_canon: ataritt: m68kmint 13
+arch_canon: falcon: m68kmint 13
+arch_canon: atariclone: m68kmint 13
+arch_canon: milan: m68kmint 13
+arch_canon: hades: m68kmint 13
+
+arch_canon: s390: s390 14
+arch_canon: i370: i370 14
+arch_canon: s390x: s390x 15
+
+arch_canon: ppc64: ppc64 16
+
+arch_canon: sh: sh 17
+arch_canon: xtensa: xtensa 18
+
+arch_canon: amd64: amd64 19
+arch_canon: x86_64: x86_64 19
+
+#############################################################
+# Canonical OS names and numbers
+
+os_canon: Linux: Linux 1
+os_canon: IRIX: Irix 2
+# This is wrong
+os_canon: SunOS5: solaris 3
+os_canon: SunOS4: SunOS 4
+
+os_canon: AmigaOS: AmigaOS 5
+os_canon: AIX: AIX 5
+os_canon: HP-UX: hpux10 6
+os_canon: OSF1: osf1 7
+os_canon: osf4.0: osf1 7
+os_canon: osf3.2: osf1 7
+os_canon: FreeBSD: FreeBSD 8
+os_canon: SCO_SV: SCO_SV3.2v5.0.2 9
+os_canon: IRIX64: Irix64 10
+os_canon: NEXTSTEP: NextStep 11
+os_canon: BSD_OS: bsdi 12
+os_canon: machten: machten 13
+os_canon: CYGWIN32_NT: cygwin32 14
+os_canon: CYGWIN32_95: cygwin32 15
+os_canon: UNIX_SV: MP_RAS: 16
+os_canon: MiNT: FreeMiNT 17
+os_canon: OS/390: OS/390 18
+os_canon: VM/ESA: VM/ESA 19
+os_canon: Linux/390: OS/390 20
+os_canon: Linux/ESA: VM/ESA 20
+
+#############################################################
+# For a given uname().machine, the default build arch
+
+buildarchtranslate: osfmach3_i686: i386
+buildarchtranslate: osfmach3_i586: i386
+buildarchtranslate: osfmach3_i486: i386
+buildarchtranslate: osfmach3_i386: i386
+
+buildarchtranslate: athlon: i586
+buildarchtranslate: i686: i586
+buildarchtranslate: k6: i586
+buildarchtranslate: i586: i586
+buildarchtranslate: i486: i486
+buildarchtranslate: i386: i386
+
+buildarchtranslate: alphaev5: alpha
+buildarchtranslate: alphaev56: alpha
+buildarchtranslate: alphapca56: alpha
+buildarchtranslate: alphaev6: alpha
+buildarchtranslate: alphaev67: alpha
+
+buildarchtranslate: sun4c: sparc
+buildarchtranslate: sun4d: sparc
+buildarchtranslate: sun4m: sparc
+buildarchtranslate: sparcv9: sparc
+buildarchtranslate: sun4u: sparc64
+
+buildarchtranslate: osfmach3_ppc: ppc
+buildarchtranslate: powerpc: ppc
+buildarchtranslate: powerppc: ppc
+buildarchtranslate: ppciseries: ppc
+buildarchtranslate: ppcpseries: ppc
+
+buildarchtranslate: atarist: m68kmint
+buildarchtranslate: atariste: m68kmint
+buildarchtranslate: ataritt: m68kmint
+buildarchtranslate: falcon: m68kmint
+buildarchtranslate: atariclone: m68kmint
+buildarchtranslate: milan: m68kmint
+buildarchtranslate: hades: m68kmint
+
+buildarchtranslate: s390: s390
+buildarchtranslate: s390x: s390x
+
+buildarchtranslate: ia64: ia64
+
+buildarchtranslate: amd64: amd64
+buildarchtranslate: x86_64: amd64
+
+#############################################################
+# Architecture compatibility
+
+arch_compat: alphaev67: alphaev6
+arch_compat: alphaev6: alphapca56
+arch_compat: alphapca56: alphaev56
+arch_compat: alphaev56: alphaev5
+arch_compat: alphaev5: alpha
+arch_compat: alpha: axp noarch
+
+arch_compat: athlon: i686
+arch_compat: i686: i586
+arch_compat: k6: i586
+arch_compat: i586: i486
+arch_compat: i486: i386
+arch_compat: i386: noarch
+
+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
+
+arch_compat: osfmach3_ppc: ppc
+arch_compat: powerpc: ppc
+arch_compat: powerppc: ppc
+arch_compat: ppciseries: ppc
+arch_compat: ppcpseries: ppc
+arch_compat: ppc64: ppc
+arch_compat: ppc: rs6000
+arch_compat: rs6000: noarch
+
+arch_compat: sun4c: sparc
+arch_compat: sun4d: sparc
+arch_compat: sun4m: sparc
+arch_compat: sun4u: sparc64
+arch_compat: sparc64: sparcv9
+arch_compat: sparcv9: sparc
+arch_compat: sparc: noarch
+
+arch_compat: mips: noarch
+arch_compat: mipsel: noarch
+
+arch_compat: hppa2.0: hppa1.2
+arch_compat: hppa1.2: hppa1.1
+arch_compat: hppa1.1: hppa1.0
+arch_compat: hppa1.0: parisc
+arch_compat: parisc: noarch
+
+arch_compat: armv4b: noarch
+arch_compat: armv4l: armv3l
+arch_compat: armv3l: noarch
+
+arch_compat: atarist: m68kmint noarch
+arch_compat: atariste: m68kmint noarch
+arch_compat: ataritt: m68kmint noarch
+arch_compat: falcon: m68kmint noarch
+arch_compat: atariclone: m68kmint noarch
+arch_compat: milan: m68kmint noarch
+arch_compat: hades: m68kmint noarch
+
+arch_compat: i370: noarch
+arch_compat: s390: noarch
+arch_compat: s390x: s390 noarch
+
+arch_compat: ia64: i686 noarch
+
+arch_compat: amd64: x86_64
+arch_compat: x86_64: athlon noarch
+
+os_compat: IRIX64: IRIX
+os_compat: solaris2.7: solaris2.3 solaris2.4 solaris2.5 solaris2.6
+os_compat: solaris2.6: solaris2.3 solaris2.4 solaris2.5
+os_compat: solaris2.5: solaris2.3 solaris2.4
+os_compat: solaris2.4: solaris2.3
+
+os_compat: hpux11.00: hpux10.30
+os_compat: hpux10.30: hpux10.20
+os_compat: hpux10.20: hpux10.10
+os_compat: hpux10.10: hpux10.01
+os_compat: hpux10.01: hpux10.00
+os_compat: hpux10.00: hpux9.07
+os_compat: hpux9.07: hpux9.05
+os_compat: hpux9.05: hpux9.04
+
+os_compat: osf4.0: osf3.2 osf1
+
+os_compat: ncr-sysv4.3: ncr-sysv4.2
+
+os_compat: FreeMiNT: mint MiNT TOS
+os_compat: MiNT: FreeMiNT mint TOS
+os_compat: mint: FreeMiNT MiNT TOS
+os_compat: TOS: FreeMiNT MiNT mint
+
+os_compat: BSD_OS: bsdi
+os_compat: bsdi4.0: bsdi
+
+buildarch_compat: ia64: noarch
+
+buildarch_compat: athlon: i686
+buildarch_compat: i686: i586
+buildarch_compat: k6: i486
+buildarch_compat: i586: i486
+buildarch_compat: i486: i386
+buildarch_compat: i386: noarch
+
+buildarch_compat: sun4c: noarch
+buildarch_compat: sun4d: noarch
+buildarch_compat: sun4m: noarch
+buildarch_compat: sun4u: noarch
+buildarch_compat: sparc64: noarch
+buildarch_compat: sparcv9: sparc
+buildarch_compat: sparc: noarch
+
+buildarch_compat: alphaev67: alphaev6
+buildarch_compat: alphaev6: alphapca56
+buildarch_compat: alphapca56: alphaev56
+buildarch_compat: alphaev56: alphaev5
+buildarch_compat: alphaev5: alpha
+buildarch_compat: alpha: noarch
+
+buildarch_compat: m68k: noarch
+
+buildarch_compat: ppciseries: noarch
+buildarch_compat: ppcpseries: noarch
+buildarch_compat: ppc: noarch
+buildarch_compat: ppc64: noarch
+
+buildarch_compat: mips: noarch
+buildarch_compat: mipsel: noarch
+
+buildarch_compat: armv3l: noarch
+buildarch_compat: armv4b: noarch
+buildarch_compat: armv4l: noarch
+
+buildarch_compat: hppa2.0: hppa1.2
+buildarch_compat: hppa1.2: hppa1.1
+buildarch_compat: hppa1.1: hppa1.0
+buildarch_compat: hppa1.0: parisc
+buildarch_compat: parisc: noarch
+
+buildarch_compat: atarist: m68kmint noarch
+buildarch_compat: atariste: m68kmint noarch
+buildarch_compat: ataritt: m68kmint noarch
+buildarch_compat: falcon: m68kmint noarch
+buildarch_compat: atariclone: m68kmint noarch
+buildarch_compat: milan: m68kmint noarch
+buildarch_compat: hades: m68kmint noarch
+
+buildarch_compat: s390: noarch
+buildarch_compat: s390x: noarch
+
+buildarch_compat: ia64: noarch
+
+buildarch_compat: amd64: noarch
+buildarch_compat: x86_64: noarch
+
+macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros.prelink:/etc/rpm/macros.solve:/etc/rpm/macros.up2date:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros
+
+# \endverbatim
+#*/
diff --git a/RPM4/t/test-dep-1.0-1mdk.noarch.rpm b/RPM4/t/test-dep-1.0-1mdk.noarch.rpm
new file mode 100644
index 0000000..1e36db6
--- /dev/null
+++ b/RPM4/t/test-dep-1.0-1mdk.noarch.rpm
Binary files differ
diff --git a/RPM4/t/test-dep-1.0-1mdk.src.rpm b/RPM4/t/test-dep-1.0-1mdk.src.rpm
new file mode 100644
index 0000000..8b09d78
--- /dev/null
+++ b/RPM4/t/test-dep-1.0-1mdk.src.rpm
Binary files differ
diff --git a/RPM4/t/test-dep.spec b/RPM4/t/test-dep.spec
new file mode 100644
index 0000000..8cfb060
--- /dev/null
+++ b/RPM4/t/test-dep.spec
@@ -0,0 +1,38 @@
+# $Id$
+Summary: test rpm dependencies for perl-URPM test suite
+BuildArch: noarch
+Name: test-dep
+Version: 1.0
+Release: 1mdk
+License: GPL
+Group: Application/Development
+BuildRoot: %{_tmppath}/%{name}-root
+Requires: test-rpm
+Conflicts: test-rpm
+Obsoletes: test-rpm
+
+%description
+test rpm for dependencies
+
+%prep
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%_sysconfdir
+
+date >> $RPM_BUILD_ROOT%_sysconfdir/%name
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%config(noreplace) %_sysconfdir/%name
+
+%changelog
+* Thu Apr 22 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1-1mdk
+- initial build
+
+
diff --git a/RPM4/t/test-rpm-1.0-1mdk.noarch.rpm b/RPM4/t/test-rpm-1.0-1mdk.noarch.rpm
new file mode 100644
index 0000000..6087dd2
--- /dev/null
+++ b/RPM4/t/test-rpm-1.0-1mdk.noarch.rpm
Binary files differ
diff --git a/RPM4/t/test-rpm-1.0-1mdk.src.rpm b/RPM4/t/test-rpm-1.0-1mdk.src.rpm
new file mode 100644
index 0000000..8f3730a
--- /dev/null
+++ b/RPM4/t/test-rpm-1.0-1mdk.src.rpm
Binary files differ
diff --git a/RPM4/t/test-rpm.spec b/RPM4/t/test-rpm.spec
new file mode 100644
index 0000000..bbd60f1
--- /dev/null
+++ b/RPM4/t/test-rpm.spec
@@ -0,0 +1,35 @@
+# $Id$
+Summary: test rpm for perl-URPM test suite
+BuildArch: noarch
+Name: test-rpm
+Version: 1.0
+Release: 1mdk
+License: GPL
+Group: Application/Development
+BuildRoot: %{_tmppath}/%{name}-root
+
+%description
+test rpm
+
+%prep
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%_sysconfdir
+
+date >> $RPM_BUILD_ROOT%_sysconfdir/%name
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%config(noreplace) %_sysconfdir/%name
+
+%changelog
+* Thu Apr 22 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1-1mdk
+- initial build
+
+