summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungKyu Song <hk76.song@samsung.com>2013-02-15 15:17:47 +0900
committerHyungKyu Song <hk76.song@samsung.com>2013-02-15 15:17:47 +0900
commitb46eb1a024c9c9b6f6896e4c276b41bdd409a0f4 (patch)
tree38d0fee2842a8b373db46dd2a8fbbcb66552028c
parent77cb8e110c0e530e1fb90e6fb04fdb41178ff2ae (diff)
downloadobs-build-b46eb1a024c9c9b6f6896e4c276b41bdd409a0f4.tar.gz
obs-build-b46eb1a024c9c9b6f6896e4c276b41bdd409a0f4.tar.bz2
obs-build-b46eb1a024c9c9b6f6896e4c276b41bdd409a0f4.zip
Tizen 2.0 Release2.0_release
-rw-r--r--Build.pm1388
-rw-r--r--Build/Arch.pm186
-rw-r--r--Build/Deb.pm343
-rw-r--r--Build/Kiwi.pm311
-rw-r--r--Build/Rpm.pm940
-rw-r--r--Build/Susetags.pm66
-rw-r--r--Build/Zypp.pm33
-rw-r--r--Makefile98
-rw-r--r--README6
-rw-r--r--baselibs_global-deb.conf39
-rw-r--r--baselibs_global-sle.conf45
-rw-r--r--baselibs_global.conf21
-rwxr-xr-xbuild2352
-rw-r--r--build.181
-rw-r--r--build_kiwi.sh270
-rwxr-xr-xchangelog2spec222
-rwxr-xr-xcommon_functions104
-rwxr-xr-xcomputeblocklists100
-rw-r--r--configs/arch.conf16
-rw-r--r--configs/debian.conf6
-rw-r--r--configs/sl10.0.conf49
-rw-r--r--configs/sl10.1.conf31
-rw-r--r--configs/sl10.2.conf208
-rw-r--r--configs/sl10.3.conf316
-rw-r--r--configs/sl11.0.conf377
-rw-r--r--configs/sl11.1.conf407
-rw-r--r--configs/sl11.2.conf452
-rw-r--r--configs/sl11.3.conf489
-rw-r--r--configs/sl11.4.conf600
-rw-r--r--configs/sl12.1.conf638
-rw-r--r--configs/sl12.2.conf637
-rw-r--r--configs/sl8.1.conf52
-rw-r--r--configs/sl8.2.conf56
-rw-r--r--configs/sl9.0.conf56
-rw-r--r--configs/sl9.1.conf57
-rw-r--r--configs/sl9.2.conf43
-rw-r--r--configs/sl9.3.conf43
-rw-r--r--configs/sles10.conf35
l---------configs/sles11.conf1
-rw-r--r--configs/sles11sp2.conf486
-rw-r--r--configs/sles8.conf54
-rw-r--r--configs/sles9.conf57
-rw-r--r--configs/spectool.conf4
-rw-r--r--configs/ul1.conf54
-rwxr-xr-xcreatearchdeps72
-rwxr-xr-xcreaterepomddeps495
-rwxr-xr-xcreaterpmdeps136
-rwxr-xr-xcreateyastdeps104
-rwxr-xr-xdebtransform306
-rwxr-xr-xdebtransformbz211
-rwxr-xr-xdebtransformzip14
-rwxr-xr-xdownload71
-rwxr-xr-xexpanddeps213
-rwxr-xr-xextractbuild166
-rwxr-xr-xgetbinaryid57
-rwxr-xr-xgetchangetarget35
-rwxr-xr-xgetmacros36
-rwxr-xr-xgetoptflags47
-rwxr-xr-xgettype36
-rwxr-xr-xinit_buildsystem1002
-rwxr-xr-xinitscript_qemu_vm28
-rw-r--r--initvm.c329
-rwxr-xr-xkillchroot88
-rw-r--r--lxc.conf15
-rwxr-xr-xmkbaselibs651
-rwxr-xr-xmkdrpms135
-rwxr-xr-xorder76
-rw-r--r--qemu-reg19
-rwxr-xr-xsigndummy39
-rwxr-xr-xspec2changelog79
-rwxr-xr-xspec_add_patch143
-rwxr-xr-xspectool406
-rwxr-xr-xsubstitutedeps257
-rwxr-xr-xt/dist19
-rw-r--r--test/Fedora_11.conf305
-rw-r--r--test/Fedora_12.conf311
-rw-r--r--test/baselibs.conf1
-rw-r--r--test/common100
-rw-r--r--test/config8
-rw-r--r--test/libdummy1.spec28
-rwxr-xr-xtest/testbuild.11.0-i3869
-rwxr-xr-xtest/testbuild.11.0-x86_647
-rwxr-xr-xtest/testbuild.11.1-i3869
-rwxr-xr-xtest/testbuild.11.2-i3869
-rwxr-xr-xtest/testbuild.8.1-i3869
-rwxr-xr-xtest/testbuild.Fedora11-i3869
-rwxr-xr-xtest/testbuild.Fedora11-x86_647
-rwxr-xr-xtest/testbuild.Fedora12-i3869
-rwxr-xr-xtest/testbuild.Fedora12-x86_647
-rwxr-xr-xtest/testbuild.sles10-i38610
-rwxr-xr-xtest/testbuild.sles10-x86_648
-rwxr-xr-xtest/testbuild.sles9-i38610
-rwxr-xr-xunrpm39
-rwxr-xr-xvc152
94 files changed, 15929 insertions, 2032 deletions
diff --git a/Build.pm b/Build.pm
index bc33e07..96fba28 100644
--- a/Build.pm
+++ b/Build.pm
@@ -1,32 +1,186 @@
-
package Build;
+use strict;
+use Digest::MD5;
+use Build::Rpm;
+use Data::Dumper;
+
our $expand_dbg;
-use strict;
+our $do_rpm;
+our $do_deb;
+our $do_kiwi;
+our $do_arch;
+
+sub import {
+ for (@_) {
+ $do_rpm = 1 if $_ eq ':rpm';
+ $do_deb = 1 if $_ eq ':deb';
+ $do_kiwi = 1 if $_ eq ':kiwi';
+ $do_arch = 1 if $_ eq ':arch';
+ }
+ $do_rpm = $do_deb = $do_kiwi = $do_arch = 1 if !$do_rpm && !$do_deb && !$do_kiwi && !$do_arch;
+ if ($do_deb) {
+ require Build::Deb;
+ }
+ if ($do_kiwi) {
+ require Build::Kiwi;
+ }
+ if ($do_arch) {
+ require Build::Arch;
+ }
+}
my $std_macros = q{
+%define nil
%define ix86 i386 i486 i586 i686 athlon
-%define arm armv4l armv4b armv5l armv5b armv5tel armv5teb
-%define arml armv4l armv5l armv5tel
-%define armb armv4b armv5b armv5teb
+%define arm armv4l armv5l armv6l armv7l armv4b armv5l armv5b armv5el armv5eb armv5tel armv5teb armv6el armv6eb armv7el armv7eb armv7hl armv7nhl armv8el
+%define arml armv4l armv5l armv6l armv7l armv5tel armv5el armv6el armv7el armv7hl armv7nhl armv8el
+%define armb armv4b armv5b armv5teb armv5eb armv6eb armv7eb
+%define sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
};
+my $extra_macros = '';
sub unify {
my %h = map {$_ => 1} @_;
return grep(delete($h{$_}), @_);
}
+sub define($)
+{
+ my $def = shift;
+ $extra_macros .= '%define '.$def."\n";
+}
+
+sub init_helper_hashes {
+ my ($config) = @_;
+
+ $config->{'preferh'} = { map {$_ => 1} @{$config->{'prefer'}} };
+
+ my %ignore;
+ for (@{$config->{'ignore'}}) {
+ if (!/:/) {
+ $ignore{$_} = 1;
+ next;
+ }
+ my @s = split(/[,:]/, $_);
+ my $s = shift @s;
+ $ignore{"$s:$_"} = 1 for @s;
+ }
+ $config->{'ignoreh'} = \%ignore;
+
+ my %conflicts;
+ for (@{$config->{'conflict'}}) {
+ my @s = split(/[,:]/, $_);
+ my $s = shift @s;
+ push @{$conflicts{$s}}, @s;
+ push @{$conflicts{$_}}, $s for @s;
+ }
+ for (keys %conflicts) {
+ $conflicts{$_} = [ unify(@{$conflicts{$_}}) ]
+ }
+ $config->{'conflicth'} = \%conflicts;
+}
+
+# 'canonicalize' dist string as found in rpm dist tags
+sub dist_canon($$) {
+ my ($rpmdist, $arch) = @_;
+ $rpmdist = lc($rpmdist);
+ $rpmdist =~ s/-/_/g;
+ $rpmdist =~ s/opensuse/suse linux/;
+ my $rpmdista;
+ if ($rpmdist =~ /\(/) {
+ $rpmdista = $rpmdist;
+ $rpmdista =~ s/.*\(//;
+ $rpmdista =~ s/\).*//;
+ } else {
+ $rpmdista = $arch;
+ }
+ $rpmdista =~ s/i[456]86/i386/;
+ $rpmdist = '' unless $rpmdista =~ /^(i386|x86_64|ia64|ppc|ppc64|s390|s390x)$/;
+ my $dist = 'default';
+ if ($rpmdist =~ /unitedlinux 1\.0.*/) {
+ $dist = "ul1-$rpmdista";
+ } elsif ($rpmdist =~ /suse sles_(\d+)/) {
+ $dist = "sles$1-$rpmdista";
+ } elsif ($rpmdist =~ /suse linux enterprise (\d+)/) {
+ $dist = "sles$1-$rpmdista";
+ } elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
+ # alpha version
+ $dist = "$1.".($2 + 1)."-$rpmdista";
+ } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
+ $dist = "$1-$rpmdista";
+ }
+ return $dist;
+}
+
+sub read_config_dist {
+ my ($dist, $archpath, $configdir) = @_;
+
+ my $arch = $archpath;
+ $arch = 'noarch' unless defined $arch;
+ $arch =~ s/:.*//;
+ $arch = 'noarch' if $arch eq '';
+ die("Please specify a distribution!\n") unless defined $dist;
+ if ($dist !~ /\//) {
+ my $saved = $dist;
+ $configdir = '.' unless defined $configdir;
+ $dist =~ s/-.*//;
+ $dist = "sl$dist" if $dist =~ /^\d/;
+ $dist = "$configdir/$dist.conf";
+ if (! -e $dist) {
+ $dist =~ s/-.*//;
+ $dist = "sl$dist" if $dist =~ /^\d/;
+ $dist = "$configdir/$dist.conf";
+ }
+ if (! -e $dist) {
+ warn "$saved.conf not found, using default.conf\n" unless $saved eq 'default';
+ $dist = "$configdir/default.conf";
+ }
+ }
+ die("$dist: $!\n") unless -e $dist;
+ my $cf = read_config($arch, $dist);
+ die("$dist: parse error\n") unless $cf;
+ return $cf;
+}
+
sub read_config {
my ($arch, $cfile) = @_;
- return undef unless !defined($cfile) || -e $cfile;
- my @macros = split("\n", $std_macros);
+ my @macros = split("\n", $std_macros.$extra_macros);
push @macros, "%define _target_cpu $arch";
push @macros, "%define _target_os linux";
- my $config = {'macros' => \@macros};
- my (@spec);
- read_spec($config, $cfile, \@spec) if $cfile;
+ my $config = {'macros' => \@macros, 'arch' => $arch};
+ my @config;
+ if (ref($cfile)) {
+ @config = @$cfile;
+ } elsif (defined($cfile)) {
+ local *CONF;
+ return undef unless open(CONF, '<', $cfile);
+ @config = <CONF>;
+ close CONF;
+ chomp @config;
+ }
+ # create verbatim macro blobs
+ my @newconfig;
+ while (@config) {
+ push @newconfig, shift @config;
+ next unless $newconfig[-1] =~ /^\s*macros:\s*$/si;
+ $newconfig[-1] = "macros:\n";
+ while (@config) {
+ my $l = shift @config;
+ last if $l =~ /^\s*:macros\s*$/si;
+ $newconfig[-1] .= "$l\n";
+ }
+ }
+ my @spec;
+ $config->{'save_expanded'} = 1;
+ Build::Rpm::parse($config, \@newconfig, \@spec);
+ delete $config->{'save_expanded'};
$config->{'preinstall'} = [];
+ $config->{'vminstall'} = [];
+ $config->{'cbpreinstall'} = [];
+ $config->{'cbinstall'} = [];
+ $config->{'runscripts'} = [];
$config->{'required'} = [];
$config->{'support'} = [];
$config->{'keep'} = [];
@@ -34,12 +188,17 @@ sub read_config {
$config->{'ignore'} = [];
$config->{'conflict'} = [];
$config->{'substitute'} = {};
- my $inmacro = 0;
+ $config->{'substitute_vers'} = {};
+ $config->{'optflags'} = {};
+ $config->{'order'} = {};
+ $config->{'exportfilter'} = {};
+ $config->{'publishfilter'} = [];
+ $config->{'rawmacros'} = '';
+ $config->{'release'} = '<CI_CNT>.<B_CNT>';
+ $config->{'repotype'} = [];
+ $config->{'patterntype'} = [];
+ $config->{'fileprovides'} = {};
for my $l (@spec) {
- if ($inmacro) {
- push @macros, ref($l) ? $l->[0] : $l;
- next;
- }
$l = $l->[1] if ref $l;
next unless defined $l;
my @l = split(' ', $l);
@@ -47,49 +206,122 @@ sub read_config {
my $ll = shift @l;
my $l0 = lc($ll);
if ($l0 eq 'macros:') {
- $inmacro = 1;
+ $l =~ s/.*?\n//s;
+ if ($l =~ /^!\n/s) {
+ $config->{'rawmacros'} = substr($l, 2);
+ } else {
+ $config->{'rawmacros'} .= $l;
+ }
next;
}
- if ($l0 eq 'preinstall:' || $l0 eq 'required:' || $l0 eq 'support:' || $l0 eq 'keep:' || $l0 eq 'prefer:' || $l0 eq 'ignore:' || $l0 eq 'conflict:') {
- push @{$config->{substr($l0, 0, -1)}}, @l;
+ if ($l0 eq 'preinstall:' || $l0 eq 'vminstall:' || $l0 eq 'cbpreinstall:' || $l0 eq 'cbinstall:' || $l0 eq 'required:' || $l0 eq 'support:' || $l0 eq 'keep:' || $l0 eq 'prefer:' || $l0 eq 'ignore:' || $l0 eq 'conflict:' || $l0 eq 'runscripts:') {
+ my $t = substr($l0, 0, -1);
+ for my $l (@l) {
+ if ($l eq '!*') {
+ $config->{$t} = [];
+ } elsif ($l =~ /^!/) {
+ $config->{$t} = [ grep {"!$_" ne $l} @{$config->{$t}} ];
+ } else {
+ push @{$config->{$t}}, $l;
+ }
+ }
} elsif ($l0 eq 'substitute:') {
next unless @l;
$ll = shift @l;
- push @{$config->{'substitute'}->{$ll}}, @l;
+ if ($ll eq '!*') {
+ $config->{'substitute'} = {};
+ } elsif ($ll =~ /^!(.*)$/) {
+ delete $config->{'substitute'}->{$1};
+ } else {
+ $config->{'substitute'}->{$ll} = [ @l ];
+ }
+ } elsif ($l0 eq 'fileprovides:') {
+ next unless @l;
+ $ll = shift @l;
+ if ($ll eq '!*') {
+ $config->{'fileprovides'} = {};
+ } elsif ($ll =~ /^!(.*)$/) {
+ delete $config->{'fileprovides'}->{$1};
+ } else {
+ $config->{'fileprovides'}->{$ll} = [ @l ];
+ }
+ } elsif ($l0 eq 'exportfilter:') {
+ next unless @l;
+ $ll = shift @l;
+ $config->{'exportfilter'}->{$ll} = [ @l ];
+ } elsif ($l0 eq 'publishfilter:') {
+ $config->{'publishfilter'} = [ @l ];
+ } elsif ($l0 eq 'optflags:') {
+ next unless @l;
+ $ll = shift @l;
+ $config->{'optflags'}->{$ll} = join(' ', @l);
+ } elsif ($l0 eq 'order:') {
+ for my $l (@l) {
+ if ($l eq '!*') {
+ $config->{'order'} = {};
+ } elsif ($l =~ /^!(.*)$/) {
+ delete $config->{'order'}->{$1};
+ } else {
+ $config->{'order'}->{$l} = 1;
+ }
+ }
+ } elsif ($l0 eq 'repotype:') { #type of generated repository data
+ $config->{'repotype'} = [ @l ];
+ } elsif ($l0 eq 'type:') { #kind of packaging system (spec, dsc or kiwi)
+ $config->{'type'} = $l[0];
+ } elsif ($l0 eq 'patterntype:') { #kind of generated patterns in repository
+ $config->{'patterntype'} = [ @l ];
+ } elsif ($l0 eq 'release:') {
+ $config->{'release'} = $l[0];
+ } elsif ($l0 eq 'cicntstart:') {
+ $config->{'cicntstart'} = $l[0];
+ } elsif ($l0 eq 'releaseprg:') {
+ $config->{'releaseprg'} = $l[0];
+ } elsif ($l0 eq 'changetarget:' || $l0 eq 'target:') {
+ $config->{'target'} = join(' ', @l);
+ } elsif ($l0 eq 'hostarch:') {
+ $config->{'hostarch'} = join(' ', @l);
} elsif ($l0 !~ /^[#%]/) {
warn("unknown keyword in config: $l0\n");
}
}
- for my $l (qw{preinstall required support keep}) {
+ for my $l (qw{preinstall vminstall cbpreinstall cbinstall required support keep runscripts repotype patterntype}) {
$config->{$l} = [ unify(@{$config->{$l}}) ];
}
for my $l (keys %{$config->{'substitute'}}) {
+ $config->{'substitute_vers'}->{$l} = [ map {/^(.*?)(=)?$/g} unify(@{$config->{'substitute'}->{$l}}) ];
$config->{'substitute'}->{$l} = [ unify(@{$config->{'substitute'}->{$l}}) ];
- }
- $config->{'preferh'} = { map {$_ => 1} @{$config->{'prefer'}} };
- my %ignore;
- for (@{$config->{'ignore'}}) {
- if (!/:/) {
- $ignore{$_} = 1;
- next;
+ s/=$// for @{$config->{'substitute'}->{$l}};
+ }
+ init_helper_hashes($config);
+ if (!$config->{'type'}) {
+ # Fallback to old guessing method if no type (spec, dsc or kiwi) is defined
+ if (grep {$_ eq 'rpm'} @{$config->{'preinstall'} || []}) {
+ $config->{'type'} = 'spec';
+ } elsif (grep {$_ eq 'debianutils'} @{$config->{'preinstall'} || []}) {
+ $config->{'type'} = 'dsc';
+ } elsif (grep {$_ eq 'pacman'} @{$config->{'preinstall'} || []}) {
+ $config->{'type'} = 'arch';
+ } else {
+ $config->{'type'} = 'UNDEFINED';
}
- my @s = split(/[,:]/, $_);
- my $s = shift @s;
- $ignore{"$s:$_"} = 1 for @s;
- }
- $config->{'ignoreh'} = \%ignore;
- my %conflicts;
- for (@{$config->{'conflict'}}) {
- my @s = split(/[,:]/, $_);
- my $s = shift @s;
- push @{$conflicts{$s}}, @s;
- push @{$conflicts{$_}}, $s for @s;
}
- for (keys %conflicts) {
- $conflicts{$_} = [ unify(@{$conflicts{$_}}) ]
+ # add rawmacros to our macro list
+ if ($config->{'rawmacros'} ne '') {
+ for my $rm (split("\n", $config->{'rawmacros'})) {
+ if (@macros && $macros[-1] =~ /\\$/) {
+ if ($rm =~ /\\$/) {
+ push @macros, '...\\';
+ } else {
+ push @macros, '...';
+ }
+ } elsif ($rm !~ /^%/) {
+ push @macros, $rm;
+ } else {
+ push @macros, "%define ".substr($rm, 1);
+ }
+ }
}
- $config->{'conflicth'} = \%conflicts;
- $config->{'type'} = (grep {$_ eq 'rpm'} @{$config->{'preinstall'} || []}) ? 'spec' : 'dsc';
return $config;
}
@@ -101,9 +333,11 @@ sub do_subst {
while (@deps) {
my $d = shift @deps;
next if $done{$d};
- if ($subst->{$d}) {
- unshift @deps, @{$subst->{$d}};
- push @res, $d if grep {$_ eq $d} @{$subst->{$d}};
+ my $ds = $d;
+ $ds =~ s/\s*[<=>].*$//s;
+ if ($subst->{$ds}) {
+ unshift @deps, @{$subst->{$ds}};
+ push @res, $d if grep {$_ eq $ds} @{$subst->{$ds}};
} else {
push @res, $d;
}
@@ -112,10 +346,30 @@ sub do_subst {
return @res;
}
+sub do_subst_vers {
+ my ($config, @deps) = @_;
+ my @res;
+ my %done;
+ my $subst = $config->{'substitute_vers'};
+ while (@deps) {
+ my ($d, $dv) = splice(@deps, 0, 2);
+ next if $done{$d};
+ if ($subst->{$d}) {
+ unshift @deps, map {defined($_) && $_ eq '=' ? $dv : $_} @{$subst->{$d}};
+ push @res, $d, $dv if grep {defined($_) && $_ eq $d} @{$subst->{$d}};
+ } else {
+ push @res, $d, $dv;
+ }
+ $done{$d} = 1;
+ }
+ return @res;
+}
+
+# Delivers all packages which get used for building
sub get_build {
my ($config, $subpacks, @deps) = @_;
my @ndeps = grep {/^-/} @deps;
- my %keep = map {$_ => 1} $config->{'keep'};
+ my %keep = map {$_ => 1} (@deps, @{$config->{'keep'} || []}, @{$config->{'preinstall'}});
for (@{$subpacks || []}) {
push @ndeps, "-$_" unless $keep{$_};
}
@@ -127,14 +381,15 @@ sub get_build {
@deps = grep {!$ndeps{"-$_"}} @deps;
@deps = do_subst($config, @deps);
@deps = grep {!$ndeps{"-$_"}} @deps;
- @deps = expand($config, @deps);
+ @deps = expand($config, @deps, @ndeps);
return @deps;
}
+# Delivers all packages which shall have an influence to other package builds (get_build reduced by support packages)
sub get_deps {
my ($config, $subpacks, @deps) = @_;
my @ndeps = grep {/^-/} @deps;
- my %keep = map {$_ => 1} $config->{'keep'};
+ my %keep = map {$_ => 1} (@deps, @{$config->{'keep'} || []}, @{$config->{'preinstall'}});
for (@{$subpacks || []}) {
push @ndeps, "-$_" unless $keep{$_};
}
@@ -146,7 +401,7 @@ sub get_deps {
@deps = grep {!$ndeps{"-$_"}} @deps;
my %bdeps = map {$_ => 1} (@{$config->{'preinstall'}}, @{$config->{'support'}});
delete $bdeps{$_} for @deps;
- @deps = expand($config, @deps);
+ @deps = expand($config, @deps, @ndeps);
if (@deps && $deps[0]) {
my $r = shift @deps;
@deps = grep {!$bdeps{$_}} @deps;
@@ -160,74 +415,202 @@ sub get_preinstalls {
return @{$config->{'preinstall'}};
}
+sub get_vminstalls {
+ my ($config) = @_;
+ return @{$config->{'vminstall'}};
+}
+
+sub get_cbpreinstalls {
+ my ($config) = @_;
+ return @{$config->{'cbpreinstall'}};
+}
+
+sub get_cbinstalls {
+ my ($config) = @_;
+ return @{$config->{'cbinstall'}};
+}
+
+sub get_runscripts {
+ my ($config) = @_;
+ return @{$config->{'runscripts'}};
+}
+
###########################################################################
-sub readrpmdeps {
- my ($config, $pkgidp, @depfiles) = @_;
+sub readdeps {
+ my ($config, $pkginfo, @depfiles) = @_;
- my %provides = ();
my %requires = ();
local *F;
- my %prov;
+ my %provides;
+ my $dofileprovides = %{$config->{'fileprovides'}};
for my $depfile (@depfiles) {
if (ref($depfile) eq 'HASH') {
for my $rr (keys %$depfile) {
- $prov{$rr} = $depfile->{$rr}->{'provides'};
+ $provides{$rr} = $depfile->{$rr}->{'provides'};
$requires{$rr} = $depfile->{$rr}->{'requires'};
}
next;
}
+ # XXX: we don't support different architectures per file
open(F, "<$depfile") || die("$depfile: $!\n");
while(<F>) {
my @s = split(' ', $_);
my $s = shift @s;
- my @ss;
+ my @ss;
while (@s) {
- if ($s[0] =~ /^\//) {
+ if (!$dofileprovides && $s[0] =~ /^\//) {
shift @s;
next;
}
if ($s[0] =~ /^rpmlib\(/) {
- shift @s;
- shift @s;
- shift @s;
- next;
+ splice(@s, 0, 3);
+ next;
}
push @ss, shift @s;
- if (@s && $s[0] =~ /^[<=>]/) {
- shift @s;
- shift @s;
+ while (@s) {
+ if ($s[0] =~ /^[\(<=>|]/) {
+ $ss[-1] .= " $s[0] $s[1]";
+ $ss[-1] =~ s/ \((.*)\)/ $1/;
+ $ss[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ } else {
+ last;
+ }
}
}
- my %ss;
+ my %ss;
@ss = grep {!$ss{$_}++} @ss;
- if ($s =~ s/^P:(.*):$/$1/) {
- my $pkgid = $s;
- $s =~ s/-[^-]+-[^-]+-[^-]+$//;
- $prov{$s} = \@ss;
- $pkgidp->{$s} = $pkgid if $pkgidp;
- } elsif ($s =~ s/^R:(.*):$/$1/) {
- my $pkgid = $s;
- $s =~ s/-[^-]+-[^-]+-[^-]+$//;
- $requires{$s} = \@ss;
- $pkgidp->{$s} = $pkgid if $pkgidp;
+ if ($s =~ /^(P|R):(.*)\.(.*)-\d+\/\d+\/\d+:$/) {
+ my $pkgid = $2;
+ my $arch = $3;
+ if ($1 eq "R") {
+ $requires{$pkgid} = \@ss;
+ $pkginfo->{$pkgid}->{'requires'} = \@ss if $pkginfo;
+ next;
+ }
+ # handle provides
+ $provides{$pkgid} = \@ss;
+ if ($pkginfo) {
+ # extract ver and rel from self provides
+ my ($v, $r) = map { /\Q$pkgid\E = ([^-]+)(?:-(.+))?$/ } @ss;
+ die("$pkgid: no self provides\n") unless $v;
+ $pkginfo->{$pkgid}->{'name'} = $pkgid;
+ $pkginfo->{$pkgid}->{'version'} = $v;
+ $pkginfo->{$pkgid}->{'release'} = $r if defined($r);
+ $pkginfo->{$pkgid}->{'arch'} = $arch;
+ $pkginfo->{$pkgid}->{'provides'} = \@ss;
+ }
}
}
close F;
}
- for my $p (keys %prov) {
- push @{$provides{$_}}, $p for unify(@{$prov{$p}});
- }
$config->{'providesh'} = \%provides;
$config->{'requiresh'} = \%requires;
+ makewhatprovidesh($config);
}
-sub forgetrpmdeps {
- my $config;
+sub makewhatprovidesh {
+ my ($config) = @_;
+
+ my %whatprovides;
+ my $provides = $config->{'providesh'};
+
+ for my $p (keys %$provides) {
+ my @pp = @{$provides->{$p}};
+ s/[ <=>].*// for @pp;
+ push @{$whatprovides{$_}}, $p for unify(@pp);
+ }
+ for my $p (keys %{$config->{'fileprovides'}}) {
+ my @pp = map {@{$whatprovides{$_} || []}} @{$config->{'fileprovides'}->{$p}};
+ @{$whatprovides{$p}} = unify(@{$whatprovides{$p} || []}, @pp) if @pp;
+ }
+ $config->{'whatprovidesh'} = \%whatprovides;
+}
+
+sub setdeps {
+ my ($config, $provides, $whatprovides, $requires) = @_;
+ $config->{'providesh'} = $provides;
+ $config->{'whatprovidesh'} = $whatprovides;
+ $config->{'requiresh'} = $requires;
+}
+
+sub forgetdeps {
+ my ($config) = @_;
delete $config->{'providesh'};
+ delete $config->{'whatprovidesh'};
delete $config->{'requiresh'};
}
+my %addproviders_fm = (
+ '>' => 1,
+ '=' => 2,
+ '>=' => 3,
+ '<' => 4,
+ '<=' => 6,
+);
+
+sub addproviders {
+ my ($config, $r) = @_;
+
+ my @p;
+ my $whatprovides = $config->{'whatprovidesh'};
+ $whatprovides->{$r} = \@p;
+ if ($r =~ /\|/) {
+ for my $or (split(/\s*\|\s*/, $r)) {
+ push @p, @{$whatprovides->{$or} || addproviders($config, $or)};
+ }
+ @p = unify(@p) if @p > 1;
+ return \@p;
+ }
+ return \@p if $r !~ /^(.*?)\s*([<=>]{1,2})\s*(.*?)$/;
+ my $rn = $1;
+ my $rv = $3;
+ my $rf = $addproviders_fm{$2};
+ return \@p unless $rf;
+ my $provides = $config->{'providesh'};
+ my @rp = @{$whatprovides->{$rn} || []};
+ for my $rp (@rp) {
+ for my $pp (@{$provides->{$rp} || []}) {
+ if ($pp eq $rn) {
+ # debian: unversioned provides do not match
+ # kiwi: supports only rpm, so we need to hand it like it
+ next if $config->{'type'} eq 'dsc';
+ push @p, $rp;
+ last;
+ }
+ next unless $pp =~ /^\Q$rn\E\s*([<=>]{1,2})\s*(.*?)$/;
+ my $pv = $2;
+ my $pf = $addproviders_fm{$1};
+ next unless $pf;
+ if ($pf & $rf & 5) {
+ push @p, $rp;
+ last;
+ }
+ if ($pv eq $rv) {
+ next unless $pf & $rf & 2;
+ push @p, $rp;
+ last;
+ }
+ my $rr = $rf == 2 ? $pf : ($rf ^ 5);
+ $rr &= 5 unless $pf & 2;
+ # verscmp for spec and kiwi types
+ my $vv;
+ if ($config->{'type'} eq 'dsc') {
+ $vv = Build::Deb::verscmp($pv, $rv, 1);
+ } else {
+ $vv = Build::Rpm::verscmp($pv, $rv, 1);
+ }
+ if ($rr & (1 << ($vv + 1))) {
+ push @p, $rp;
+ last;
+ }
+ }
+ }
+ @p = unify(@p) if @p > 1;
+ return \@p;
+}
+
sub expand {
my ($config, @p) = @_;
@@ -235,52 +618,62 @@ sub expand {
my $prefer = $config->{'preferh'};
my $ignore = $config->{'ignoreh'};
- my $provides = $config->{'providesh'};
+ my $whatprovides = $config->{'whatprovidesh'};
my $requires = $config->{'requiresh'};
my %xignore = map {substr($_, 1) => 1} grep {/^-/} @p;
@p = grep {!/^-/} @p;
-
- my %p = map {$_ => 1} grep {$requires->{$_}} @p;
- my %aconflicts;
- for my $p (keys %p) {
- $aconflicts{$_} = 1 for @{$conflicts->{$p} || []};
+ my %p; # expanded packages
+ my %aconflicts; # packages we are conflicting with
+
+ # add direct dependency packages. this is different from below,
+ # because we add packages even if to dep is already provided and
+ # we break ambiguities if the name is an exact match.
+ for my $p (splice @p) {
+ my @q = @{$whatprovides->{$p} || addproviders($config, $p)};
+ if (@q > 1) {
+ my $pn = $p;
+ $pn =~ s/ .*//;
+ @q = grep {$_ eq $pn} @q;
+ }
+ if (@q != 1) {
+ push @p, $p;
+ next;
+ }
+ print "added $q[0] because of $p (direct dep)\n" if $expand_dbg;
+ push @p, $q[0];
+ $p{$q[0]} = 1;
+ $aconflicts{$_} = 1 for @{$conflicts->{$q[0]} || []};
}
+ my @pamb = ();
+ my $doamb = 0;
while (@p) {
- my $didsomething = 0;
my @error = ();
- my @uerror = ();
- my @usolve = ();
+ my @rerror = ();
for my $p (splice @p) {
for my $r (@{$requires->{$p} || [$p]}) {
- next if $ignore->{"$p:$r"} || $xignore{"$p:$r"};
- next if $ignore->{$r} || $xignore{$r};
- my @q = @{$provides->{$r} || []};
+ my $ri = (split(/[ <=>]/, $r, 2))[0];
+ next if $ignore->{"$p:$ri"} || $xignore{"$p:$ri"};
+ next if $ignore->{$ri} || $xignore{$ri};
+ my @q = @{$whatprovides->{$r} || addproviders($config, $r)};
next if grep {$p{$_}} @q;
next if grep {$xignore{$_}} @q;
next if grep {$ignore->{"$p:$_"} || $xignore{"$p:$_"}} @q;
@q = grep {!$aconflicts{$_}} @q;
if (!@q) {
if ($r eq $p) {
- return undef, "nothing provides $r";
+ push @rerror, "nothing provides $r";
} else {
- return undef, "nothing provides $r needed by $p";
+ next if $r =~ /^\//;
+ push @rerror, "nothing provides $r needed by $p";
}
+ next;
}
- if (@q > 1 && grep {$conflicts->{$_}} @q) {
- # delay this one as some conflict later on might
- # clear things up
- push @p, $p unless @p && $p[-1] eq $p;
+ if (@q > 1 && !$doamb) {
+ push @pamb, $p unless @pamb && $pamb[-1] eq $p;
print "undecided about $p:$r: @q\n" if $expand_dbg;
- if ($r ne $p) {
- push @uerror, "have choice for $r needed by $p: @q";
- } else {
- push @uerror, "have choice for $r: @q";
- }
- push @usolve, @q;
- push @usolve, map {"$p:$_"} @q;
next;
}
if (@q > 1) {
@@ -294,688 +687,211 @@ sub expand {
@q = @pq;
}
}
+ if (@q > 1 && $r =~ /\|/) {
+ # choice op, implicit prefer of first match...
+ my %pq = map {$_ => 1} @q;
+ for my $rr (split(/\s*\|\s*/, $r)) {
+ next unless $whatprovides->{$rr};
+ my @pq = grep {$pq{$_}} @{$whatprovides->{$rr}};
+ next unless @pq;
+ @q = @pq;
+ last;
+ }
+ }
if (@q > 1) {
if ($r ne $p) {
push @error, "have choice for $r needed by $p: @q";
- } else {
+ } else {
push @error, "have choice for $r: @q";
- }
- push @p, $p unless @p && $p[-1] eq $p;
+ }
+ push @pamb, $p unless @pamb && $pamb[-1] eq $p;
next;
}
push @p, $q[0];
print "added $q[0] because of $p:$r\n" if $expand_dbg;
$p{$q[0]} = 1;
$aconflicts{$_} = 1 for @{$conflicts->{$q[0]} || []};
- $didsomething = 1;
@error = ();
+ $doamb = 0;
}
}
- if (!$didsomething && @error) {
- return undef, @error;
- }
- if (!$didsomething && @usolve) {
- # only conflicts left
- print "looking at conflicts: @usolve\n" if $expand_dbg;
- @usolve = grep {$prefer->{$_}} @usolve;
- if (@usolve > 1) {
- my %usolve = map {$_ => 1} @usolve;
- @usolve = (grep {$usolve{$_}} @{$config->{'prefer'}})[0];
- }
- if (@usolve) {
- $usolve[0] =~ s/:.*//;
- push @p, $usolve[0];
- print "added $usolve[0]\n" if $expand_dbg;
- $p{$usolve[0]} = 1;
- $aconflicts{$_} = 1 for @{$conflicts->{$usolve[0]} || []};
- next;
- }
- return undef, @uerror;
+ return undef, @rerror if @rerror;
+ next if @p; # still work to do
+
+ # only ambig stuff left
+ if (@pamb && !$doamb) {
+ @p = @pamb;
+ @pamb = ();
+ $doamb = 1;
+ print "now doing undecided dependencies\n" if $expand_dbg;
+ next;
}
+ return undef, @error if @error;
}
return 1, (sort keys %p);
}
-sub add_all_providers {
+sub order {
my ($config, @p) = @_;
- my $provides = $config->{'providesh'};
+
my $requires = $config->{'requiresh'};
- my %a;
+ my $whatprovides = $config->{'whatprovidesh'};
+ my %deps;
+ my %rdeps;
+ my %needed;
+ my %p = map {$_ => 1} @p;
for my $p (@p) {
- for my $r (@{$requires->{$p} || [$p]}) {
- $a{$_} = 1 for @{$provides->{$r} || []};
+ my @r;
+ for my $r (@{$requires->{$p} || []}) {
+ my @q = @{$whatprovides->{$r} || addproviders($config, $r)};
+ push @r, grep {$_ ne $p && $p{$_}} @q;
}
- }
- push @p, keys %a;
- return unify(@p);
-}
-
-###########################################################################
-
-sub expr {
- my $expr = shift;
- my $lev = shift;
-
- $lev ||= 0;
- my ($v, $v2);
- $expr =~ s/^\s+//;
- my $t = substr($expr, 0, 1);
- if ($t eq '(') {
- ($v, $expr) = expr(substr($expr, 1), 0);
- return undef unless defined $v;
- return undef unless $expr =~ s/^\)//;
- } elsif ($t eq '!') {
- ($v, $expr) = expr(substr($expr, 1), 0);
- return undef unless defined $v;
- $v = !$v;
- } elsif ($t eq '-') {
- ($v, $expr) = expr(substr($expr, 1), 0);
- return undef unless defined $v;
- $v = -$v;
- } elsif ($expr =~ /^([0-9]+)(.*?)$/) {
- $v = $1;
- $expr = $2;
- } elsif ($expr =~ /^([a-zA-Z_0-9]+)(.*)$/) {
- $v = "\"$1\"";
- $expr = $2;
- } elsif ($expr =~ /^(\".*?\")(.*)$/) {
- $v = $1;
- $expr = $2;
- } else {
- return;
- }
- while (1) {
- $expr =~ s/^\s+//;
- if ($expr =~ /^&&/) {
- return ($v, $expr) if $lev > 1;
- ($v2, $expr) = expr(substr($expr, 2), 1);
- return undef unless defined $v2;
- $v &&= $v2;
- } elsif ($expr =~ /^\|\|/) {
- return ($v, $expr) if $lev > 1;
- ($v2, $expr) = expr(substr($expr, 2), 1);
- return undef unless defined $v2;
- $v &&= $v2;
- } elsif ($expr =~ /^>=/) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 2), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v ge $v2 : $v >= $v2) ? 1 : 0;
- } elsif ($expr =~ /^>/) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 1), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v gt $v2 : $v > $v2) ? 1 : 0;
- } elsif ($expr =~ /^<=/) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 2), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v le $v2 : $v <= $v2) ? 1 : 0;
- } elsif ($expr =~ /^</) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 1), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v lt $v2 : $v < $v2) ? 1 : 0;
- } elsif ($expr =~ /^==/) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 2), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v eq $v2 : $v == $v2) ? 1 : 0;
- } elsif ($expr =~ /^!=/) {
- return ($v, $expr) if $lev > 2;
- ($v2, $expr) = expr(substr($expr, 2), 2);
- return undef unless defined $v2;
- $v = (($v =~ /^\"/) ? $v ne $v2 : $v != $v2) ? 1 : 0;
- } elsif ($expr =~ /^\+/) {
- return ($v, $expr) if $lev > 3;
- ($v2, $expr) = expr(substr($expr, 1), 3);
- return undef unless defined $v2;
- $v += $v2;
- } elsif ($expr =~ /^-/) {
- return ($v, $expr) if $lev > 3;
- ($v2, $expr) = expr(substr($expr, 1), 3);
- return undef unless defined $v2;
- $v -= $v2;
- } elsif ($expr =~ /^\*/) {
- ($v2, $expr) = expr(substr($expr, 1), 4);
- return undef unless defined $v2;
- $v *= $v2;
- } elsif ($expr =~ /^\//) {
- ($v2, $expr) = expr(substr($expr, 1), 4);
- return undef unless defined $v2 && 0 + $v2;
- $v /= $v2;
- } else {
- return ($v, $expr);
+ if (%{$config->{'order'} || {}}) {
+ push @r, grep {$_ ne $p && $config->{'order'}->{"$_:$p"}} @p;
}
+ @r = unify(@r);
+ $deps{$p} = \@r;
+ $needed{$p} = @r;
+ push @{$rdeps{$_}}, $p for @r;
}
-}
-
-sub read_spec {
- my ($config, $specfile, $xspec) = @_;
-
- my $packname;
- my $packvers;
- my @subpacks;
- my @packdeps;
- my $hasnfb;
- my %macros;
-
- my $specdata;
- local *SPEC;
- if (ref($specfile) eq 'GLOB') {
- *SPEC = $specfile;
- } elsif (ref($specfile) eq 'ARRAY') {
- $specdata = [ @$specfile ];
- } elsif (!open(SPEC, '<', $specfile)) {
- warn("$specfile: $!\n");
- return (undef, "open: $!", undef);
- }
- my @macros = @{$config->{'macros'}};
- my $skip = 0;
- my $main_preamble = 1;
- my $inspec = 0;
- while (1) {
- my $line;
- if (@macros) {
- $line = pop @macros;
- } elsif ($specdata) {
- $inspec = 1;
- last unless @$specdata;
- $line = shift @$specdata;
- } else {
- $inspec = 1;
- $line = <SPEC>;
- last unless defined $line;
- chomp $line;
- }
- push @$xspec, $line if $inspec && $xspec;
- if ($line =~ /^#\s*neededforbuild\s*(\S.*)$/) {
- next if $hasnfb;
- $hasnfb = $1;
- next;
- }
- if ($line =~ /^\s*#/) {
- next unless $line =~ /^#!BuildIgnore/;
- }
- my $expandedline = '';
- if (!$skip) {
- my $tries = 0;
- while ($line =~ /^(.*?)%(\{([^\}]+)\}|[0-9a-zA-Z_]+|%|\()(.*?)$/) {
- if ($tries++ > 1000) {
- $line = 'MACRO';
- last;
- }
- $expandedline .= $1;
- $line = $4;
- my $macname = defined($3) ? $3 : $2;
- my $mactest = 0;
- if ($macname =~ /^\!\?/ || $macname =~ /^\?\!/) {
- $mactest = -1;
- } elsif ($macname =~ /^\?/) {
- $mactest = 1;
- }
- $macname =~ s/^[\!\?]+//;
- my $macalt;
- ($macname, $macalt) = split(':', $macname, 2);
- if ($macname eq '%') {
- $expandedline .= '%';
- next;
- } elsif ($macname eq '(') {
- $line = 'MACRO';
- last;
- } elsif ($macname eq 'define') {
- if ($line =~ /^\s*([0-9a-zA-Z_]+)(\([^\)]*\))?\s*(.*?)$/) {
- my $macname = $1;
- my $macargs = $2;
- my $macbody = $3;
- $macbody = undef if $macargs;
- $macros{$macname} = $macbody;
- }
- $line = '';
- last;
- } elsif (exists($macros{$macname})) {
- if (!defined($macros{$macname})) {
- $line = 'MACRO';
- last;
- }
- $macalt = $macros{$macname} unless defined $macalt;
- $macalt = '' if $mactest == -1;
- $line = "$macalt$line";
- } elsif ($mactest) {
- $macalt = '' if !defined($macalt) || $mactest == 1;
- $line = "$macalt$line";
- } else {
- $expandedline .= "%$2";
- }
+ @p = sort {$needed{$a} <=> $needed{$b} || $a cmp $b} @p;
+ my @good;
+ my @res;
+ # the big sort loop
+ while (@p) {
+ @good = grep {$needed{$_} == 0} @p;
+ if (@good) {
+ @p = grep {$needed{$_}} @p;
+ push @res, @good;
+ for my $p (@good) {
+ $needed{$_}-- for @{$rdeps{$p}};
}
- }
- $line = $expandedline . $line;
- if ($line =~ /^\s*%else\b/) {
- $skip = 1 - $skip if $skip < 2;
next;
}
- if ($line =~ /^\s*%endif\b/) {
- $skip-- if $skip;
- next;
- }
- $skip++ if $skip && $line =~ /^\s*%if/;
-
- if ($skip) {
- $xspec->[-1] = [ $xspec->[-1], undef ] if $xspec;
- next;
- }
-
- if ($line =~ /^\s*%ifarch(.*)$/) {
- my $arch = $macros{'_target_cpu'} || 'unknown';
- my @archs = grep {$_ eq $arch} split(/\s+/, $1);
- $skip = 1 if !@archs;
- next;
- }
- if ($line =~ /^\s*%ifnarch(.*)$/) {
- my $arch = $macros{'_target_cpu'} || 'unknown';
- my @archs = grep {$_ eq $arch} split(/\s+/, $1);
- $skip = 1 if @archs;
- next;
- }
- if ($line =~ /^\s*%ifos(.*)$/) {
- my $os = $macros{'_target_os'} || 'unknown';
- my @oss = grep {$_ eq $os} split(/\s+/, $1);
- $skip = 1 if !@oss;
- next;
- }
- if ($line =~ /^\s*%ifnos(.*)$/) {
- my $os = $macros{'_target_os'} || 'unknown';
- my @oss = grep {$_ eq $os} split(/\s+/, $1);
- $skip = 1 if @oss;
- next;
- }
- if ($line =~ /^\s*%if(.*)$/) {
- my ($v, $r) = expr($1);
- $v = 0 if $v && $v eq '\"\"';
- $skip = 1 unless $v;
- next;
- }
- if ($main_preamble && ($line =~ /^Name:\s*(\S+)/i)) {
- $packname = $1;
- $macros{'name'} = $packname;
- }
- if ($main_preamble && ($line =~ /^Version:\s*(\S+)/i)) {
- $packvers = $1;
- $macros{'version'} = $packvers;
- }
- if ($main_preamble && ($line =~ /^(BuildRequires|BuildConflicts|\#\!BuildIgnore):\s*(\S.*)$/i)) {
- my $what = $1;
- my $deps = $2;
- my @deps = $deps =~ /([^\s\[\(,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
- if (defined($hasnfb)) {
- next unless $xspec;
- if ((grep {$_ eq 'glibc' || $_ eq 'rpm' || $_ eq 'gcc' || $_ eq 'bash'} @deps) > 2) {
- # ignore old generetad BuildRequire lines.
- $xspec->[-1] = [ $xspec->[-1], undef ];
- }
- next;
+ # uh oh, cycle alert. find and remove all cycles.
+ my %notdone = map {$_ => 1} @p;
+ $notdone{$_} = 0 for @res; # already did those
+ my @todo = @p;
+ while (@todo) {
+ my $v = shift @todo;
+ if (ref($v)) {
+ $notdone{$$v} = 0; # finished this one
+ next;
}
- my $replace = 0;
- my @ndeps = ();
- while (@deps) {
- my ($pack, $vers, $qual) = splice(@deps, 0, 3);
- if (defined($qual)) {
- $replace = 1;
- my $arch = $macros{'_target_cpu'} || '';
- my $proj = $macros{'_target_project'} || '';
- $qual =~ s/^\s*\[//;
- $qual =~ s/\]$//;
- my $isneg = 0;
- my $bad;
- for my $q (split('[\s,]', $qual)) {
- $isneg = 1 if $q =~ s/^\!//;
- $bad = 1 if !defined($bad) && !$isneg;
- if ($isneg) {
- if ($q eq $arch || $q eq $proj) {
- $bad = 1;
- last;
- }
- } elsif ($q eq $arch || $q eq $proj) {
- $bad = 0;
- }
- }
- next if $bad;
- }
- push @ndeps, $pack;
+ my $s = $notdone{$v};
+ next unless $s;
+ my @e = grep {$notdone{$_}} @{$deps{$v}};
+ if (!@e) {
+ $notdone{$v} = 0; # all deps done, mark as finished
+ next;
}
- $replace = 1 if grep {/^-/} @ndeps;
- if ($what ne 'BuildRequires') {
- push @packdeps, map {"-$_"} @ndeps;
+ if ($s == 1) {
+ $notdone{$v} = 2; # now under investigation
+ unshift @todo, @e, \$v;
next;
}
- push @packdeps, @ndeps;
- next unless $xspec && $inspec;
- if ($replace) {
- my @cndeps = grep {!/^-/} @ndeps;
- if (@cndeps) {
- $xspec->[-1] = [ $xspec->[-1], "BuildRequires: ".join(' ', @cndeps) ];
- } else {
- $xspec->[-1] = [ $xspec->[-1], ''];
- }
+ # reached visited package, found a cycle!
+ my @cyc = ();
+ my $cycv = $v;
+ # go back till $v is reached again
+ while(1) {
+ die unless @todo;
+ $v = shift @todo;
+ next unless ref($v);
+ $v = $$v;
+ $notdone{$v} = 1 if $notdone{$v} == 2;
+ unshift @cyc, $v;
+ last if $v eq $cycv;
}
- next;
- }
-
- if ($line =~ /^\s*%package\s+(-n\s+)?(\S+)/) {
- if ($1) {
- push @subpacks, $2;
+ unshift @todo, $cycv;
+ print STDERR "cycle: ".join(' -> ', @cyc)."\n";
+ my $breakv;
+ my @breakv = (@cyc, $cyc[0]);
+ while (@breakv > 1) {
+ last if $config->{'order'}->{"$breakv[0]:$breakv[1]"};
+ shift @breakv;
+ }
+ if (@breakv > 1) {
+ $breakv = $breakv[0];
} else {
- push @subpacks, "$packname-$2" if defined $packname;
+ $breakv = (sort {$needed{$a} <=> $needed{$b} || $a cmp $b} @cyc)[-1];
}
- }
-
- if ($line =~ /^\s*%(package|prep|build|install|check|clean|preun|postun|pretrans|posttrans|pre|post|files|changelog|description|triggerpostun|triggerun|triggerin|trigger|verifyscript)/) {
- $main_preamble = 0;
- }
- }
- close SPEC unless ref $specfile;
- if (defined($hasnfb)) {
- if (!@packdeps) {
- @packdeps = split(' ', $hasnfb);
+ push @cyc, $cyc[0]; # make it loop
+ shift @cyc while $cyc[0] ne $breakv;
+ $v = $cyc[1];
+ print STDERR " breaking dependency $breakv -> $v\n";
+ $deps{$breakv} = [ grep {$_ ne $v} @{$deps{$breakv}} ];
+ $rdeps{$v} = [ grep {$_ ne $breakv} @{$rdeps{$v}} ];
+ $needed{$breakv}--;
}
}
- unshift @subpacks, $packname;
- return ($packname, $packvers, \@subpacks, @packdeps);
+ return @res;
}
-###########################################################################
-
-sub read_dsc {
- my ($bconf, $fn) = @_;
- local *F;
- open(F, '<', $fn) || return ();
- my @control = <F>;
- close F;
- chomp @control;
- splice(@control, 0, 3) if @control > 3 && $control[0] =~ /^-----BEGIN/;
- my $name;
- my $version;
- my @deps;
- while (@control) {
- my $c = shift @control;
- last if $c eq ''; # new paragraph
- my ($tag, $data) = split(':', $c, 2);
- next unless defined $data;
- $tag = uc($tag);
- while (@control && $control[0] =~ /^\s/) {
- $data .= "\n".substr(shift @control, 1);
- }
- $data =~ s/^\s+//s;
- $data =~ s/\s+$//s;
- if ($tag eq 'VERSION') {
- $version = $data;
- $version =~ s/-[^-]+$//;
- } elsif ($tag eq 'SOURCE') {
- $name = $data;
- } elsif ($tag eq 'BUILD-DEPENDS') {
- my @d = split(/,\s*/, $data);
- s/\s.*// for @d;
- push @deps, @d;
- } elsif ($tag eq 'BUILD-CONFLICTS' || $tag eq 'BUILD-IGNORE') {
- my @d = split(/,\s*/, $data);
- s/\s.*// for @d;
- push @deps, map {"-$_"} @d;
+sub add_all_providers {
+ my ($config, @p) = @_;
+ my $whatprovides = $config->{'whatprovidesh'};
+ my $requires = $config->{'requiresh'};
+ my %a;
+ for my $p (@p) {
+ for my $r (@{$requires->{$p} || [$p]}) {
+ my $rn = (split(' ', $r, 2))[0];
+ $a{$_} = 1 for @{$whatprovides->{$rn} || []};
}
}
- return ($name, $version, undef, @deps);
+ push @p, keys %a;
+ return unify(@p);
}
###########################################################################
-sub rpmq {
- my $rpm = shift;
- my @stags = @_;
- my %stags = map {0+$_ => $_} @stags;
-
- my ($magic, $sigtype, $headmagic, $cnt, $cntdata, $lead, $head, $index, $data, $tag, $type, $offset, $count);
-
- local *RPM;
- if (ref($rpm) eq 'GLOB') {
- *RPM = $rpm;
- } elsif (!open(RPM, '<', $rpm)) {
- warn("$rpm: $!\n");
- return ();
- }
- if (read(RPM, $lead, 96) != 96) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- ($magic, $sigtype) = unpack('N@78n', $lead);
- if ($magic != 0xedabeedb || $sigtype != 5) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- if (read(RPM, $head, 16) != 16) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- ($headmagic, $cnt, $cntdata) = unpack('N@8NN', $head);
- if ($headmagic != 0x8eade801) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- if (read(RPM, $index, $cnt * 16) != $cnt * 16) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- $cntdata = ($cntdata + 7) & ~7;
- if (read(RPM, $data, $cntdata) != $cntdata) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- if (read(RPM, $head, 16) != 16) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- ($headmagic, $cnt, $cntdata) = unpack('N@8NN', $head);
- if ($headmagic != 0x8eade801) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- if (read(RPM, $index, $cnt * 16) != $cnt * 16) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- if (read(RPM, $data, $cntdata) != $cntdata) {
- warn("Bad rpm $rpm\n");
- close RPM;
- return ();
- }
- close RPM;
- my %res = ();
- while($cnt-- > 0) {
- ($tag, $type, $offset, $count, $index) = unpack('N4a*', $index);
- $tag = 0+$tag;
- if ($stags{$tag}) {
- eval {
- my $otag = $stags{$tag};
- if ($type == 0) {
- $res{$otag} = [ '' ];
- } elsif ($type == 1) {
- $res{$otag} = [ unpack("\@${offset}c$count", $data) ];
- } elsif ($type == 2) {
- $res{$otag} = [ unpack("\@${offset}c$count", $data) ];
- } elsif ($type == 3) {
- $res{$otag} = [ unpack("\@${offset}n$count", $data) ];
- } elsif ($type == 4) {
- $res{$otag} = [ unpack("\@${offset}N$count", $data) ];
- } elsif ($type == 5) {
- $res{$otag} = [ undef ];
- } elsif ($type == 6) {
- $res{$otag} = [ unpack("\@${offset}Z*", $data) ];
- } elsif ($type == 7) {
- $res{$otag} = [ unpack("\@${offset}a$count", $data) ];
- } elsif ($type == 8 || $type == 9) {
- my $d = unpack("\@${offset}a*", $data);
- my @res = split("\0", $d, $count + 1);
- $res{$otag} = [ splice @res, 0, $count ];
- } else {
- $res{$otag} = [ undef ];
- }
- };
- if ($@) {
- warn("Bad rpm $rpm: $@\n");
- return ();
- }
- }
- }
- return %res;
+sub show {
+ my ($conffile, $fn, $field, $arch) = @ARGV;
+ my $cf = read_config($arch, $conffile);
+ die unless $cf;
+ my $d = Build::parse($cf, $fn);
+ die("$d->{'error'}\n") if $d->{'error'};
+ $d->{'sources'} = [ map {$d->{$_}} grep {/^source/} sort keys %$d ];
+ my $x = $d->{$field};
+ $x = [ $x ] unless ref $x;
+ print "$_\n" for @$x;
}
-sub rpmq_add_flagsvers {
- my $res = shift;
- my $name = shift;
- my $flags = shift;
- my $vers = shift;
-
- return unless $res;
- my @flags = @{$res->{$flags} || []};
- my @vers = @{$res->{$vers} || []};
- for (@{$res->{$name}}) {
- if (@flags && ($flags[0] & 0xe) && @vers) {
- $_ .= ' ';
- $_ .= '<' if $flags[0] & 2;
- $_ .= '>' if $flags[0] & 4;
- $_ .= '=' if $flags[0] & 8;
- $_ .= " $vers[0]";
- }
- shift @flags;
- shift @vers;
- }
+sub parse {
+ my ($cf, $fn, @args) = @_;
+ return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $fn =~ /\.spec$/;
+ return Build::Deb::parse($cf, $fn, @args) if $do_deb && $fn =~ /\.dsc$/;
+ return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ /config\.xml$/;
+ return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ /\.kiwi$/;
+ return Build::Arch::parse($cf, $fn, @args) if $do_arch && $fn =~ /PKGBUILD$/;
+ return undef;
}
-###########################################################################
-
-my $have_zlib;
-eval {
- require Compress::Zlib;
- $have_zlib = 1;
-};
-
-sub ungzip {
- my $data = shift;
- local (*TMP, *TMP2);
- open(TMP, "+>", undef) or die("could not open tmpfile\n");
- syswrite TMP, $data;
- sysseek(TMP, 0, 0);
- my $pid = open(TMP2, "-|");
- die("fork: $!\n") unless defined $pid;
- if (!$pid) {
- open(STDIN, "<&TMP");
- exec 'gunzip';
- die("gunzip: $!\n");
- }
- close(TMP);
- $data = '';
- 1 while sysread(TMP2, $data, 1024, length($data)) > 0;
- close(TMP2) || die("gunzip error");
- return $data;
+sub query {
+ my ($binname, %opts) = @_;
+ my $handle = $binname;
+ if (ref($binname) eq 'ARRAY') {
+ $handle = $binname->[1];
+ $binname = $binname->[0];
+ }
+ return Build::Rpm::query($handle, %opts) if $do_rpm && $binname =~ /\.rpm$/;
+ return Build::Deb::query($handle, %opts) if $do_deb && $binname =~ /\.deb$/;
+ return Build::Kiwi::queryiso($handle, %opts) if $do_kiwi && $binname =~ /\.iso$/;
+ return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/;
+ return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.arch$/;
+ return undef;
}
-sub debq {
- my ($fn) = @_;
-
- local *F;
- if (ref($fn) eq 'GLOB') {
- *F = $fn;
- } elsif (!open(F, '<', $fn)) {
- warn("$fn: $!\n");
- return ();
- }
- my $data = '';
- sysread(F, $data, 4096);
- if (length($data) < 8+60) {
- warn("$fn: not a debian package\n");
- close F unless ref $fn;
- return ();
- }
- if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary ") {
- close F unless ref $fn;
- return ();
- }
- my $len = substr($data, 8+48, 10);
- $len += $len & 1;
- if (length($data) < 8+60+$len+60) {
- my $r = 8+60+$len+60 - length($data);
- $r -= length($data);
- if ((sysread(F, $data, $r < 4096 ? 4096 : $r, length($data)) || 0) < $r) {
- warn("$fn: unexpected EOF\n");
- close F unless ref $fn;
- return ();
- }
- }
- $data = substr($data, 8 + 60 + $len);
- if (substr($data, 0, 16) ne 'control.tar.gz ') {
- warn("$fn: control.tar.gz is not second ar entry\n");
- close F unless ref $fn;
- return ();
- }
- $len = substr($data, 48, 10);
- if (length($data) < 60+$len) {
- my $r = 60+$len - length($data);
- if ((sysread(F, $data, $r, length($data)) || 0) < $r) {
- warn("$fn: unexpected EOF\n");
- close F unless ref $fn;
- return ();
- }
- }
- close F;
- $data = substr($data, 60, $len);
- if ($have_zlib) {
- $data = Compress::Zlib::memGunzip($data);
- } else {
- $data = ungzip($data);
- }
- if (!$data) {
- warn("$fn: corrupt control.tar.gz file\n");
- return ();
- }
- my $control;
- while (length($data) >= 512) {
- my $n = substr($data, 0, 100);
- $n =~ s/\0.*//s;
- my $len = oct('00'.substr($data, 124,12));
- my $blen = ($len + 1023) & ~511;
- if (length($data) < $blen) {
- warn("$fn: corrupt control.tar.gz file\n");
- return ();
- }
- if ($n eq './control') {
- $control = substr($data, 512, $len);
- last;
- }
- $data = substr($data, $blen);
- }
- my %res;
- my @control = split("\n", $control);
- while (@control) {
- my $c = shift @control;
- last if $c eq ''; # new paragraph
- my ($tag, $data) = split(':', $c, 2);
- next unless defined $data;
- $tag = uc($tag);
- while (@control && $control[0] =~ /^\s/) {
- $data .= "\n".substr(shift @control, 1);
- }
- $data =~ s/^\s+//s;
- $data =~ s/\s+$//s;
- $res{$tag} = $data;
- }
- return %res;
+sub queryhdrmd5 {
+ my ($binname) = @_;
+ return Build::Rpm::queryhdrmd5(@_) if $do_rpm && $binname =~ /\.rpm$/;
+ return Build::Deb::queryhdrmd5(@_) if $do_deb && $binname =~ /\.deb$/;
+ return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.iso$/;
+ return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw$/;
+ return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw.install$/;
+ return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/;
+ return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.arch$/;
+ return undef;
}
1;
diff --git a/Build/Arch.pm b/Build/Arch.pm
new file mode 100644
index 0000000..abcbf07
--- /dev/null
+++ b/Build/Arch.pm
@@ -0,0 +1,186 @@
+package Build::Arch;
+
+use strict;
+use Digest::MD5;
+
+eval { require Archive::Tar; };
+*Archive::Tar::new = sub {die("Archive::Tar is not available\n")} unless defined &Archive::Tar::new;
+
+
+# Archlinux support, based on the GSoC work of Nikolay Rysev <mad.f3ka@gmail.com>
+
+# parse a PKGBUILD file
+
+sub quote {
+ my ($str) = @_;
+ $str =~ s/([ \t\"\'])/sprintf("%%%02X", ord($1))/ge;
+ return $str;
+}
+
+sub unquotesplit {
+ my ($str) = @_;
+ $str =~ s/%/%25/g;
+ $str =~ s/^[ \t]+//;
+ while ($str =~ /([\"\'])/) {
+ my $q = $1;
+ $str =~ s/$q(.*?)$q/quote($1)/e;
+ }
+ my @args = split(/[ \t]+/, $str);
+ for (@args) {
+ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge
+ }
+ return @args;
+}
+
+sub parse {
+ my ($config, $pkgbuild) = @_;
+ my $ret;
+ local *PKG;
+ if (!open(PKG, '<', $pkgbuild)) {
+ $ret->{'error'} = "$pkgbuild: $!";
+ return $ret;
+ }
+ my %vars;
+ while (<PKG>) {
+ chomp;
+ next if /^\s*$/;
+ next if /^\s*#/;
+ last unless /^([a-zA-Z0-9_]*)=(\(?)(.*?)$/;
+ my $var = $1;
+ my $val = $3;
+ if ($2) {
+ while ($val !~ s/\)\s*$//s) {
+ my $nextline = <PKG>;
+ last unless defined $nextline;
+ chomp $nextline;
+ $val .= ' ' . $nextline;
+ }
+ }
+ $vars{$var} = [ unquotesplit($val) ];
+ }
+ close PKG;
+ $ret->{'name'} = $vars{'pkgname'}->[0] if $vars{'pkgname'};
+ $ret->{'version'} = $vars{'pkgver'}->[0] if $vars{'pkgver'};
+ $ret->{'deps'} = $vars{'makedepends'} || [];
+ return $ret;
+}
+
+sub islzma {
+ my ($fn) = @_;
+ local *F;
+ return 0 unless open(F, '<', $fn);
+ my $h;
+ return 0 unless read(F, $h, 5) == 5;
+ close F;
+ return $h eq "\3757zXZ";
+}
+
+sub lzmadec {
+ my ($fn) = @_;
+ my $nh;
+ my $pid = open($nh, '-|');
+ return undef unless defined $pid;
+ if (!$pid) {
+ $SIG{'PIPE'} = 'DEFAULT';
+ exec('xzdec', '-dc', $fn);
+ die("xzdec: $!\n");
+ }
+ return $nh;
+}
+
+sub query {
+ my ($handle, %opts) = @_;
+ if (ref($handle)) {
+ die("arch pkg query not implemented for file handles\n");
+ }
+ if ($handle =~ /\.xz$/ || islzma($handle)) {
+ $handle = lzmadec($handle);
+ }
+ my $tar = Archive::Tar->new;
+ my @read = $tar->read($handle, 1, {'filter' => '^\.PKGINFO$', 'limit' => 1});
+ die("$handle: not an arch package file\n") unless @read == 1;
+ my $pkginfo = $read[0]->get_content;
+ die("$handle: not an arch package file\n") unless $pkginfo;
+ my %vars;
+ for my $l (split('\n', $pkginfo)) {
+ next unless $l =~ /^(.*?) = (.*)$/;
+ push @{$vars{$1}}, $2;
+ }
+ my $ret = {};
+ $ret->{'name'} = $vars{'pkgname'}->[0] if $vars{'pkgname'};
+ $ret->{'hdrmd5'} = Digest::MD5::md5_hex($pkginfo);
+ $ret->{'provides'} = $vars{'provides'} || [];
+ $ret->{'requires'} = $vars{'depend'} || [];
+ if ($vars{'pkgname'}) {
+ my $selfprovides = $vars{'pkgname'}->[0];
+ $selfprovides .= "=$vars{'pkgver'}->[0]" if $vars{'pkgver'};
+ push @{$ret->{'provides'}}, $selfprovides unless @{$ret->{'provides'} || []} && $ret->{'provides'}->[-1] eq $selfprovides;
+ }
+ if ($opts{'evra'}) {
+ if ($vars{'pkgver'}) {
+ my $evr = $vars{'pkgver'}->[0];
+ if ($evr =~ /^([0-9]+):(.*)$/) {
+ $ret->{'epoch'} = $1;
+ $evr = $2;
+ }
+ $ret->{'version'} = $evr;
+ if ($evr =~ /^(.*)-(.*?)$/) {
+ $ret->{'version'} = $1;
+ $ret->{'release'} = $2;
+ }
+ }
+ $ret->{'arch'} = $vars{'arch'}->[0] if $vars{'arch'};
+ }
+ if ($opts{'description'}) {
+ $ret->{'description'} = $vars{'pkgdesc'}->[0] if $vars{'pkgdesc'};
+ }
+ # arch packages don't seem to have a source :(
+ # fake it so that the package isn't confused with a src package
+ $ret->{'source'} = $ret->{'name'} if defined $ret->{'name'};
+ return $ret;
+}
+
+sub queryhdrmd5 {
+ my ($handle) = @_;
+ if (ref($handle)) {
+ die("arch pkg query not implemented for file handles\n");
+ }
+ if ($handle =~ /\.xz$/ || islzma($handle)) {
+ $handle = lzmadec($handle);
+ }
+ my $tar = Archive::Tar->new;
+ my @read = $tar->read($handle, 1, {'filter' => '^\.PKGINFO$', 'limit' => 1});
+ die("$handle: not an arch package file\n") unless @read == 1;
+ my $pkginfo = $read[0]->get_content;
+ die("$handle: not an arch package file\n") unless $pkginfo;
+ return Digest::MD5::md5_hex($pkginfo);
+}
+
+sub parserepodata {
+ my ($d, $data) = @_;
+ $d ||= {};
+ $data =~ s/^\n+//s;
+ my @parts = split(/\n\n+/s, $data);
+ for my $part (@parts) {
+ my @p = split("\n", $part);
+ my $p = shift @p;
+ if ($p eq '%NAME%') {
+ $d->{'name'} = $p[0];
+ } elsif ($p eq '%VERSION%') {
+ $d->{'version'} = $p[0];
+ } elsif ($p eq '%ARCH%') {
+ $d->{'arch'} = $p[0];
+ } elsif ($p eq '%BUILDDATE%') {
+ $d->{'buildtime'} = $p[0];
+ } elsif ($p eq '%FILENAME%') {
+ $d->{'filename'} = $p[0];
+ } elsif ($p eq '%PROVIDES%') {
+ push @{$d->{'provides'}}, @p;
+ } elsif ($p eq '%DEPENDS%') {
+ push @{$d->{'requires'}}, @p;
+ }
+ }
+ return $d;
+}
+
+1;
diff --git a/Build/Deb.pm b/Build/Deb.pm
new file mode 100644
index 0000000..3878fd4
--- /dev/null
+++ b/Build/Deb.pm
@@ -0,0 +1,343 @@
+package Build::Deb;
+
+use strict;
+use Digest::MD5;
+
+my $have_zlib;
+eval {
+ require Compress::Zlib;
+ $have_zlib = 1;
+};
+
+sub parse {
+ my ($bconf, $fn) = @_;
+ my $ret;
+ my @control;
+
+ # get arch and os from macros
+ my ($arch, $os);
+ for (@{$bconf->{'macros'} || []}) {
+ $arch = $1 if /^%define _target_cpu (\S+)/;
+ $os = $1 if /^%define _target_os (\S+)/;
+ }
+ # map to debian names
+ $os = 'linux' if !defined($os);
+ $arch = 'all' if !defined($arch) || $arch eq 'noarch';
+ $arch = 'i386' if $arch =~ /^i[456]86$/;
+ $arch = 'powerpc' if $arch eq 'ppc';
+ $arch = 'amd64' if $arch eq 'x86_64';
+ $arch = 'armel' if $arch =~ /^armv[4567]l$/;
+ $arch = 'armhf' if $arch eq 'armv7hl';
+
+ if (ref($fn) eq 'ARRAY') {
+ @control = @$fn;
+ } else {
+ local *F;
+ if (!open(F, '<', $fn)) {
+ $ret->{'error'} = "$fn: $!";
+ return $ret;
+ }
+ @control = <F>;
+ close F;
+ chomp @control;
+ }
+ splice(@control, 0, 3) if @control > 3 && $control[0] =~ /^-----BEGIN/;
+ my $name;
+ my $version;
+ my @deps;
+ while (@control) {
+ my $c = shift @control;
+ last if $c eq ''; # new paragraph
+ my ($tag, $data) = split(':', $c, 2);
+ next unless defined $data;
+ $tag = uc($tag);
+ while (@control && $control[0] =~ /^\s/) {
+ $data .= "\n".substr(shift @control, 1);
+ }
+ $data =~ s/^\s+//s;
+ $data =~ s/\s+$//s;
+ if ($tag eq 'VERSION') {
+ $version = $data;
+ $version =~ s/-[^-]+$//;
+ } elsif ($tag eq 'SOURCE') {
+ $name = $data;
+ } elsif ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-CONFLICTS' || $tag eq 'BUILD-IGNORE' || $tag eq 'BUILD-DEPENDS-INDEP') {
+ my @d = split(/,\s*/, $data);
+ for my $d (@d) {
+ my @alts = split('\s*\|\s*', $d);
+ my @needed;
+ for my $c (@alts) {
+ if ($c =~ /^(.*?)\s*\[(.*)\]$/) {
+ $c = $1;
+ my $isneg = 0;
+ my $bad;
+ for my $q (split('[\s,]', $2)) {
+ $isneg = 1 if $q =~ s/^\!//;
+ $bad = 1 if !defined($bad) && !$isneg;
+ if ($isneg) {
+ if ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any") {
+ $bad = 1;
+ last;
+ }
+ } elsif ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any") {
+ $bad = 0;
+ }
+ }
+ push @needed, $c unless $bad;
+ } else {
+ push @needed, $c;
+ }
+ }
+ next unless @needed;
+ $d = join(' | ', @needed);
+ $d =~ s/ \(([^\)]*)\)/ $1/g;
+ $d =~ s/>>/>/g;
+ $d =~ s/<</</g;
+ if ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-DEPENDS-INDEP') {
+ push @deps, $d;
+ } else {
+ push @deps, "-$d";
+ }
+ }
+ }
+ }
+ $ret->{'name'} = $name;
+ $ret->{'version'} = $version;
+ $ret->{'deps'} = \@deps;
+ return $ret;
+}
+
+sub ungzip {
+ my $data = shift;
+ local (*TMP, *TMP2);
+ open(TMP, "+>", undef) or die("could not open tmpfile\n");
+ syswrite TMP, $data;
+ sysseek(TMP, 0, 0);
+ my $pid = open(TMP2, "-|");
+ die("fork: $!\n") unless defined $pid;
+ if (!$pid) {
+ open(STDIN, "<&TMP");
+ exec 'gunzip';
+ die("gunzip: $!\n");
+ }
+ close(TMP);
+ $data = '';
+ 1 while sysread(TMP2, $data, 1024, length($data)) > 0;
+ close(TMP2) || die("gunzip error");
+ return $data;
+}
+
+sub debq {
+ my ($fn) = @_;
+
+ local *DEBF;
+ if (ref($fn) eq 'GLOB') {
+ *DEBF = *$fn;
+ } elsif (!open(DEBF, '<', $fn)) {
+ warn("$fn: $!\n");
+ return ();
+ }
+ my $data = '';
+ sysread(DEBF, $data, 4096);
+ if (length($data) < 8+60) {
+ warn("$fn: not a debian package\n");
+ close DEBF unless ref $fn;
+ return ();
+ }
+ if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary ") {
+ close DEBF unless ref $fn;
+ return ();
+ }
+ my $len = substr($data, 8+48, 10);
+ $len += $len & 1;
+ if (length($data) < 8+60+$len+60) {
+ my $r = 8+60+$len+60 - length($data);
+ $r -= length($data);
+ if ((sysread(DEBF, $data, $r < 4096 ? 4096 : $r, length($data)) || 0) < $r) {
+ warn("$fn: unexpected EOF\n");
+ close DEBF unless ref $fn;
+ return ();
+ }
+ }
+ $data = substr($data, 8 + 60 + $len);
+ if (substr($data, 0, 16) ne 'control.tar.gz ') {
+ warn("$fn: control.tar.gz is not second ar entry\n");
+ close DEBF unless ref $fn;
+ return ();
+ }
+ $len = substr($data, 48, 10);
+ if (length($data) < 60+$len) {
+ my $r = 60+$len - length($data);
+ if ((sysread(DEBF, $data, $r, length($data)) || 0) < $r) {
+ warn("$fn: unexpected EOF\n");
+ close DEBF unless ref $fn;
+ return ();
+ }
+ }
+ close DEBF unless ref($fn);
+ $data = substr($data, 60, $len);
+ my $controlmd5 = Digest::MD5::md5_hex($data); # our header signature
+ if ($have_zlib) {
+ $data = Compress::Zlib::memGunzip($data);
+ } else {
+ $data = ungzip($data);
+ }
+ if (!$data) {
+ warn("$fn: corrupt control.tar.gz file\n");
+ return ();
+ }
+ my $control;
+ while (length($data) >= 512) {
+ my $n = substr($data, 0, 100);
+ $n =~ s/\0.*//s;
+ my $len = oct('00'.substr($data, 124,12));
+ my $blen = ($len + 1023) & ~511;
+ if (length($data) < $blen) {
+ warn("$fn: corrupt control.tar.gz file\n");
+ return ();
+ }
+ if ($n eq './control') {
+ $control = substr($data, 512, $len);
+ last;
+ }
+ $data = substr($data, $blen);
+ }
+ my %res;
+ my @control = split("\n", $control);
+ while (@control) {
+ my $c = shift @control;
+ last if $c eq ''; # new paragraph
+ my ($tag, $data) = split(':', $c, 2);
+ next unless defined $data;
+ $tag = uc($tag);
+ while (@control && $control[0] =~ /^\s/) {
+ $data .= "\n".substr(shift @control, 1);
+ }
+ $data =~ s/^\s+//s;
+ $data =~ s/\s+$//s;
+ $res{$tag} = $data;
+ }
+ $res{'CONTROL_MD5'} = $controlmd5;
+ return %res;
+}
+
+sub query {
+ my ($handle, %opts) = @_;
+
+ my %res = debq($handle);
+ return undef unless %res;
+ my $name = $res{'PACKAGE'};
+ my $src = $name;
+ if ($res{'SOURCE'}) {
+ $src = $res{'SOURCE'};
+ $src =~ s/\s.*$//;
+ }
+ my @provides = split(',\s*', $res{'PROVIDES'} || '');
+ push @provides, "$name = $res{'VERSION'}";
+ my @depends = split(',\s*', $res{'DEPENDS'} || '');
+ my @predepends = split(',\s*', $res{'PRE-DEPENDS'} || '');
+ push @depends, @predepends;
+ s/ \(([^\)]*)\)/ $1/g for @provides;
+ s/ \(([^\)]*)\)/ $1/g for @depends;
+ s/>>/>/g for @provides;
+ s/<</</g for @provides;
+ s/>>/>/g for @depends;
+ s/<</</g for @depends;
+ my $data = {
+ name => $name,
+ hdrmd5 => $res{'CONTROL_MD5'},
+ provides => \@provides,
+ requires => \@depends,
+ };
+ $data->{'source'} = $src if $src ne '';
+ if ($opts{'evra'}) {
+ $res{'VERSION'} =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $data->{'epoch'} = $1 if defined $1;
+ $data->{'version'} = $2;
+ $data->{'release'} = $3 if defined $3;
+ $data->{'arch'} = $res{'ARCHITECTURE'};
+ }
+ if ($opts{'description'}) {
+ $data->{'description'} = $res{'DESCRIPTION'};
+ }
+ return $data;
+}
+
+sub queryhdrmd5 {
+ my ($bin) = @_;
+
+ local *F;
+ open(F, '<', $bin) || die("$bin: $!\n");
+ my $data = '';
+ sysread(F, $data, 4096);
+ if (length($data) < 8+60) {
+ warn("$bin: not a debian package\n");
+ close F;
+ return undef;
+ }
+ if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary ") {
+ warn("$bin: not a debian package\n");
+ close F;
+ return undef;
+ }
+ my $len = substr($data, 8+48, 10);
+ $len += $len & 1;
+ if (length($data) < 8+60+$len+60) {
+ my $r = 8+60+$len+60 - length($data);
+ $r -= length($data);
+ if ((sysread(F, $data, $r < 4096 ? 4096 : $r, length($data)) || 0) < $r) {
+ warn("$bin: unexpected EOF\n");
+ close F;
+ return undef;
+ }
+ }
+ $data = substr($data, 8 + 60 + $len);
+ if (substr($data, 0, 16) ne 'control.tar.gz ') {
+ warn("$bin: control.tar.gz is not second ar entry\n");
+ close F;
+ return undef;
+ }
+ $len = substr($data, 48, 10);
+ if (length($data) < 60+$len) {
+ my $r = 60+$len - length($data);
+ if ((sysread(F, $data, $r, length($data)) || 0) < $r) {
+ warn("$bin: unexpected EOF\n");
+ close F;
+ return undef;
+ }
+ }
+ close F;
+ $data = substr($data, 60, $len);
+ return Digest::MD5::md5_hex($data);
+}
+
+sub verscmp_part {
+ my ($s1, $s2) = @_;
+ return 0 if $s1 eq $s2;
+ $s1 =~ s/([0-9]+)/substr("00000000000000000000000000000000$1", -32, 32)/ge;
+ $s2 =~ s/([0-9]+)/substr("00000000000000000000000000000000$1", -32, 32)/ge;
+ $s1 .= "\0";
+ $s2 .= "\0";
+ $s1 =~ tr[\176\000-\037\060-\071\101-\132\141-\172\040-\057\072-\100\133-\140\173-\175][\000-\176];
+ $s2 =~ tr[\176\000-\037\060-\071\101-\132\141-\172\040-\057\072-\100\133-\140\173-\175][\000-\176];
+ return $s1 cmp $s2;
+}
+
+sub verscmp {
+ my ($s1, $s2) = @_;
+ my ($e1, $v1, $r1) = $s1 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $e1 = 0 unless defined $e1;
+ my ($e2, $v2, $r2) = $s2 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $e2 = 0 unless defined $e2;
+ if ($e1 ne $e2) {
+ my $r = verscmp_part($e1, $e2);
+ return $r if $r;
+ }
+ my $r = verscmp_part($v1, $v2);
+ return $r if $r;
+ $r1 = '' unless defined $r1;
+ $r2 = '' unless defined $r2;
+ return verscmp_part($r1, $r2);
+}
+
+1;
diff --git a/Build/Kiwi.pm b/Build/Kiwi.pm
new file mode 100644
index 0000000..96c58c9
--- /dev/null
+++ b/Build/Kiwi.pm
@@ -0,0 +1,311 @@
+package Build::Kiwi;
+
+use strict;
+
+our $bootcallback;
+
+# worst xml parser ever, just good enough to parse those kiwi files...
+# can't use standard XML parsers, unfortunatelly, as the build script
+# must not rely on external libraries
+#
+sub parsexml {
+ my ($xml) = @_;
+
+ my @nodestack;
+ my $node = {};
+ my $c = '';
+ $xml =~ s/^\s*\<\?.*?\?\>//s;
+ while ($xml =~ /^(.*?)\</s) {
+ if ($1 ne '') {
+ $c .= $1;
+ $xml = substr($xml, length($1));
+ }
+ if (substr($xml, 0, 4) eq '<!--') {
+ $xml =~ s/.*?-->//s;
+ next;
+ }
+ die("bad xml\n") unless $xml =~ /(.*?\>)/s;
+ my $tag = $1;
+ $xml = substr($xml, length($tag));
+ my $mode = 0;
+ if ($tag =~ s/^\<\///s) {
+ chop $tag;
+ $mode = 1; # end
+ } elsif ($tag =~ s/\/\>$//s) {
+ $mode = 2; # start & end
+ $tag = substr($tag, 1);
+ } else {
+ $tag = substr($tag, 1);
+ chop $tag;
+ }
+ my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag ");
+ $tag = shift @tag;
+ shift @tag;
+ push @tag, undef if @tag & 1;
+ my %atts = @tag;
+ for (values %atts) {
+ next unless defined $_;
+ s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s;
+ s/^=//s;
+ s/&lt;/</g;
+ s/&gt;/>/g;
+ s/&amp;/&/g;
+ s/&apos;/\'/g;
+ s/&quot;/\"/g;
+ }
+ if ($mode == 0 || $mode == 2) {
+ my $n = {};
+ push @{$node->{$tag}}, $n;
+ for (sort keys %atts) {
+ $n->{$_} = $atts{$_};
+ }
+ if ($mode == 0) {
+ push @nodestack, [ $tag, $node, $c ];
+ $c = '';
+ $node = $n;
+ }
+ } else {
+ die("element '$tag' closes without open\n") unless @nodestack;
+ die("element '$tag' closes, but I expected '$nodestack[-1]->[0]'\n") unless $nodestack[-1]->[0] eq $tag;
+ $c =~ s/^\s*//s;
+ $c =~ s/\s*$//s;
+ $node->{'_content'} = $c if $c ne '';
+ $node = $nodestack[-1]->[1];
+ $c = $nodestack[-1]->[2];
+ pop @nodestack;
+ }
+ }
+ $c .= $xml;
+ $c =~ s/^\s*//s;
+ $c =~ s/\s*$//s;
+ $node->{'_content'} = $c if $c ne '';
+ return $node;
+}
+
+sub unify {
+ my %h = map {$_ => 1} @_;
+ return grep(delete($h{$_}), @_);
+}
+
+sub findFallBackArchs {
+ my ($fallbackArchXML, $arch) = @_;
+ my @fa;
+
+ for my $a (@{$fallbackArchXML->{'arch'}||[]}) {
+ if ( $a->{'id'} eq $arch && $a->{'fallback'} ) {
+ @fa = unify( $a->{'fallback'}, findFallBackArchs($fallbackArchXML, $a->{'fallback'}));
+ }
+ }
+
+ return @fa
+}
+
+sub kiwiparse {
+ my ($xml, $arch, $count) = @_;
+ $count ||= 0;
+ die("kiwi config inclusion depth limit reached\n") if $count++ > 10;
+
+ my $ret = {};
+ my @types;
+ my @repos;
+ my @bootrepos;
+ my @packages;
+ my @extrasources;
+ my @requiredarch;
+ my $kiwi = parsexml($xml);
+ die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'};
+ $kiwi = $kiwi->{'image'}->[0];
+ $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'};
+ my $description = (($kiwi->{'description'} || [])->[0]) || {};
+ if ($description->{'specification'}) {
+ $ret->{'name'} = $description->{'specification'}->[0]->{'_content'};
+ }
+ # take default version setting
+ my $preferences = ($kiwi->{'preferences'} || []);
+ if ($preferences->[0]->{'version'}) {
+ $ret->{'version'} = $preferences->[0]->{'version'}->[0]->{'_content'};
+ }
+ for my $pref (@{$preferences || []}) {
+ for my $type (@{$pref->{'type'} || []}) {
+ next unless @{$pref->{'type'}} == 1 || !$type->{'optional'};
+ if (defined $type->{'image'}) {
+ # for kiwi 4.1 and 5.x
+ push @types, $type->{'image'};
+ } else {
+ # for kiwi 3.8 and before
+ push @types, $type->{'_content'};
+ }
+ push @packages, "kiwi-filesystem:$type->{'filesystem'}" if $type->{'filesystem'};
+ if (defined $type->{'boot'}) {
+ if ($type->{'boot'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/) {
+ next unless $bootcallback;
+ my ($bootxml, $xsrc) = $bootcallback->($1, $2);
+ next unless $bootxml;
+ push @extrasources, $xsrc if $xsrc;
+ my $bret = kiwiparse($bootxml, $arch, $count);
+ push @bootrepos, map {"$_->{'project'}/$_->{'repository'}"} @{$bret->{'path'} || []};
+ push @packages, @{$bret->{'deps'} || []};
+ push @extrasources, @{$bret->{'extrasource'} || []};
+ } else {
+ die("bad boot reference: $type->{'boot'}\n") unless $type->{'boot'} =~ /^([^\/]+)\/([^\/]+)$/;
+ push @packages, "kiwi-boot:$1";
+ }
+ }
+ }
+ }
+
+ my $instsource = ($kiwi->{'instsource'} || [])->[0];
+ if ($instsource) {
+ foreach my $repository(sort {$a->{priority} <=> $b->{priority}} @{$instsource->{'instrepo'} || []}) {
+ my $kiwisource = ($repository->{'source'} || [])->[0];
+ die("bad instsource path: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
+ push @repos, "$1/$2";
+ }
+ if ($instsource->{'productoptions'}) {
+ my $productoptions = $instsource->{'productoptions'}->[0] || {};
+ for my $po (@{$productoptions->{'productvar'} || []}) {
+ $ret->{'version'} = $po->{'_content'} if $po->{'name'} eq 'VERSION';
+ }
+ }
+ if ($instsource->{'architectures'}) {
+ my $a = $instsource->{'architectures'}->[0] || {};
+ for my $ra (@{$a->{'requiredarch'} || []}) {
+ push @requiredarch, $ra->{'ref'} if defined $ra->{'ref'};
+ }
+ }
+ }
+
+ my @repositories = sort {$a->{'priority'} <=> $b->{'priority'}} @{$kiwi->{'repository'} || []};
+ if ($preferences->[0]->{'packagemanager'}->[0]->{'_content'} eq 'smart') {
+ @repositories = reverse @repositories;
+ }
+ for my $repository (@repositories) {
+ my $kiwisource = ($repository->{'source'} || [])->[0];
+ next if $kiwisource->{'path'} eq '/var/lib/empty'; # grr
+ die("bad path using not obs:/ URL: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
+ push @repos, "$1/$2";
+ }
+
+ # Find packages and possible additional required architectures
+ my @additionalarchs;
+ my @pkgs;
+ push @pkgs, @{$kiwi->{'packages'}->[0]->{'package'}} if $kiwi->{'packages'};
+ if ($instsource) {
+ push @pkgs, @{$instsource->{'metadata'}->[0]->{'repopackage'} || []} if $instsource->{'metadata'};
+ push @pkgs, @{$instsource->{'repopackages'}->[0]->{'repopackage'} || []} if $instsource->{'repopackages'};
+ }
+ @pkgs = unify(@pkgs);
+ for my $package (@pkgs) {
+ # filter packages, which are not targeted for the wanted plattform
+ if ($package->{'arch'}) {
+ my $valid=undef;
+ if (@requiredarch) {
+ # this is a product
+ foreach my $ma(@requiredarch) {
+ foreach my $pa(split(",", $package->{'arch'})) {
+ $valid = 1 if $ma eq $pa;
+ }
+ }
+ } else {
+ # live appliance
+ my $ma = $arch;
+ $ma =~ s/i[456]86/i386/;
+ foreach my $pa(split(",", $package->{'arch'})) {
+ $pa =~ s/i[456]86/i386/;
+ $valid = 1 if $ma eq $pa;
+ }
+ }
+ next unless $valid;
+ }
+
+ # not nice, but optimizes our build dependencies
+ # FIXME: design a real blacklist option in kiwi
+ if ($package->{'onlyarch'} && $package->{'onlyarch'} eq "skipit") {
+ push @packages, "-".$package->{'name'};
+ next;
+ }
+
+ # we need this package
+ push @packages, $package->{'name'};
+
+ # find the maximal superset of possible required architectures
+ push @additionalarchs, split(',', $package->{'addarch'}) if $package->{'addarch'};
+ push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'};
+ }
+ @requiredarch = unify(@requiredarch, @additionalarchs);
+
+ #### FIXME: kiwi files have no informations where to get -32bit packages from
+ push @requiredarch, "i586" if grep {/^ia64/} @requiredarch;
+ push @requiredarch, "i586" if grep {/^x86_64/} @requiredarch;
+ push @requiredarch, "ppc" if grep {/^ppc64/} @requiredarch;
+ push @requiredarch, "s390" if grep {/^s390x/} @requiredarch;
+
+ my @fallbackarchs;
+ for my $arch (@requiredarch) {
+ push @fallbackarchs, findFallBackArchs($instsource->{'architectures'}[0], $arch) if $instsource->{'architectures'}[0];
+ }
+ @requiredarch = unify(@requiredarch, @fallbackarchs);
+
+ if (!$instsource) {
+ my $packman = $preferences->[0]->{'packagemanager'}->[0]->{'_content'};
+ push @packages, "kiwi-packagemanager:$packman";
+ } else {
+ push @packages, "kiwi-packagemanager:instsource";
+ }
+
+ $ret->{'exclarch'} = [ unify(@requiredarch) ] if @requiredarch;
+ $ret->{'deps'} = [ unify(@packages) ];
+ $ret->{'path'} = [ unify(@repos, @bootrepos) ];
+ $ret->{'imagetype'} = [ unify(@types) ];
+ $ret->{'extrasource'} = \@extrasources if @extrasources;
+ for (@{$ret->{'path'}}) {
+ my @s = split('/', $_, 2);
+ $_ = {'project' => $s[0], 'repository' => $s[1]};
+ }
+ return $ret;
+}
+
+sub parse {
+ my ($cf, $fn) = @_;
+
+ local *F;
+ open(F, '<', $fn) || die("$fn: $!\n");
+ my $xml = '';
+ 1 while sysread(F, $xml, 4096, length($xml)) > 0;
+ close F;
+ $cf ||= {};
+ my $d;
+ eval {
+ $d = kiwiparse($xml, ($cf->{'arch'} || ''));
+ };
+ if ($@) {
+ my $err = $@;
+ $err =~ s/^\n$//s;
+ return {'error' => $err};
+ }
+ return $d;
+}
+
+sub show {
+ my ($fn, $field, $arch) = @ARGV;
+ my $cf = {'arch' => $arch};
+ my $d = parse($cf, $fn);
+ die("$d->{'error'}\n") if $d->{'error'};
+ my $x = $d->{$field};
+ $x = [ $x ] unless ref $x;
+ print "@$x\n";
+}
+
+# not implemented yet.
+sub queryiso {
+ my ($handle, %opts) = @_;
+ return {};
+}
+
+
+sub queryhdrmd5 {
+ my ($bin) = @_;
+ die("Build::Kiwi::queryhdrmd5 unimplemented.\n");
+}
+
+1;
diff --git a/Build/Rpm.pm b/Build/Rpm.pm
new file mode 100644
index 0000000..667878f
--- /dev/null
+++ b/Build/Rpm.pm
@@ -0,0 +1,940 @@
+package Build::Rpm;
+
+use strict;
+
+use Digest::MD5;
+
+sub expr {
+ my $expr = shift;
+ my $lev = shift;
+
+ $lev ||= 0;
+ my ($v, $v2);
+ $expr =~ s/^\s+//;
+ my $t = substr($expr, 0, 1);
+ if ($t eq '(') {
+ ($v, $expr) = expr(substr($expr, 1), 0);
+ return undef unless defined $v;
+ return undef unless $expr =~ s/^\)//;
+ } elsif ($t eq '!') {
+ ($v, $expr) = expr(substr($expr, 1), 0);
+ return undef unless defined $v;
+ $v = 0 if $v && $v eq '\"\"';
+ $v =~ s/^0+/0/ if $v;
+ $v = !$v;
+ } elsif ($t eq '-') {
+ ($v, $expr) = expr(substr($expr, 1), 0);
+ return undef unless defined $v;
+ $v = -$v;
+ } elsif ($expr =~ /^([0-9]+)(.*?)$/) {
+ $v = $1;
+ $expr = $2;
+ } elsif ($expr =~ /^([a-zA-Z_0-9]+)(.*)$/) {
+ $v = "\"$1\"";
+ $expr = $2;
+ } elsif ($expr =~ /^(\".*?\")(.*)$/) {
+ $v = $1;
+ $expr = $2;
+ } else {
+ return;
+ }
+ while (1) {
+ $expr =~ s/^\s+//;
+ if ($expr =~ /^&&/) {
+ return ($v, $expr) if $lev > 1;
+ ($v2, $expr) = expr(substr($expr, 2), 1);
+ return undef unless defined $v2;
+ $v = 0 if $v && $v eq '\"\"';
+ $v =~ s/^0+/0/;
+ $v2 = 0 if $v2 && $v2 eq '\"\"';
+ $v2 =~ s/^0+/0/;
+ $v &&= $v2;
+ } elsif ($expr =~ /^\|\|/) {
+ return ($v, $expr) if $lev > 1;
+ ($v2, $expr) = expr(substr($expr, 2), 1);
+ return undef unless defined $v2;
+ $v = 0 if $v && $v eq '\"\"';
+ $v =~ s/^0+/0/;
+ $v2 = 0 if $v2 && $v2 eq '\"\"';
+ $v2 =~ s/^0+/0/;
+ $v ||= $v2;
+ } elsif ($expr =~ /^>=/) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 2), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v ge $v2 : $v >= $v2) ? 1 : 0;
+ } elsif ($expr =~ /^>/) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 1), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v gt $v2 : $v > $v2) ? 1 : 0;
+ } elsif ($expr =~ /^<=/) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 2), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v le $v2 : $v <= $v2) ? 1 : 0;
+ } elsif ($expr =~ /^</) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 1), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v lt $v2 : $v < $v2) ? 1 : 0;
+ } elsif ($expr =~ /^==/) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 2), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v eq $v2 : $v == $v2) ? 1 : 0;
+ } elsif ($expr =~ /^!=/) {
+ return ($v, $expr) if $lev > 2;
+ ($v2, $expr) = expr(substr($expr, 2), 2);
+ return undef unless defined $v2;
+ $v = (($v =~ /^\"/) ? $v ne $v2 : $v != $v2) ? 1 : 0;
+ } elsif ($expr =~ /^\+/) {
+ return ($v, $expr) if $lev > 3;
+ ($v2, $expr) = expr(substr($expr, 1), 3);
+ return undef unless defined $v2;
+ $v += $v2;
+ } elsif ($expr =~ /^-/) {
+ return ($v, $expr) if $lev > 3;
+ ($v2, $expr) = expr(substr($expr, 1), 3);
+ return undef unless defined $v2;
+ $v -= $v2;
+ } elsif ($expr =~ /^\*/) {
+ ($v2, $expr) = expr(substr($expr, 1), 4);
+ return undef unless defined $v2;
+ $v *= $v2;
+ } elsif ($expr =~ /^\//) {
+ ($v2, $expr) = expr(substr($expr, 1), 4);
+ return undef unless defined $v2 && 0 + $v2;
+ $v /= $v2;
+ } else {
+ return ($v, $expr);
+ }
+ }
+}
+
+sub adaptmacros {
+ my ($macros, $optold, $optnew) = @_;
+ for (keys %$optold) {
+ delete $macros->{$_};
+ }
+ for (keys %$optnew) {
+ $macros->{$_} = $optnew->{$_};
+ }
+ return $optnew;
+}
+
+sub grabargs {
+ my ($macname, $getopt, @args) = @_;
+ my %m;
+ $m{'0'} = $macname;
+ $m{'**'} = join(' ', @args);
+ my %go = split(/(:?)/, $getopt);
+ while (@args && $args[0] =~ s/^-//) {
+ my $o = shift @args;
+ last if $o eq '-';
+ while ($o =~ /^(.)(.*)$/) {
+ if ($go{$1}) {
+ my $arg = $2;
+ $arg = shift(@args) if @args && $arg eq '';
+ $m{"-$1"} = "-$1 $arg";
+ $m{"-$1*"} = $arg;
+ last;
+ }
+ $m{"-$1"} = "-$1";
+ $o = $2;
+ }
+ }
+ $m{'#'} = scalar(@args);
+ my $i = 1;
+ for (@args) {
+ $m{$i} = $_;
+ $i++;
+ }
+ $m{'*'} = join(' ', @args);
+ return \%m;
+}
+
+# xspec may be passed as array ref to return the parsed spec files
+# an entry in the returned array can be
+# - a string: verbatim line from the original file
+# - a two element array ref:
+# - [0] original line
+# - [1] undef: line unused due to %if
+# - [1] scalar: line after macro expansion. Only set if it's a build deps
+# line and build deps got modified or 'save_expanded' is set in
+# config
+sub parse {
+ my ($config, $specfile, $xspec) = @_;
+
+ my $packname;
+ my $exclarch;
+ my $badarch;
+ my @subpacks;
+ my @packdeps;
+ my @prereqs;
+ my $hasnfb;
+ my $nfbline;
+ my %macros;
+ my %macros_args;
+ my $ret = {};
+ my $ifdeps;
+
+ my $specdata;
+ local *SPEC;
+ if (ref($specfile) eq 'GLOB') {
+ *SPEC = *$specfile;
+ } elsif (ref($specfile) eq 'ARRAY') {
+ $specdata = [ @$specfile ];
+ } elsif (!open(SPEC, '<', $specfile)) {
+ warn("$specfile: $!\n");
+ $ret->{'error'} = "open $specfile: $!";
+ return $ret;
+ }
+ my @macros = @{$config->{'macros'}};
+ my $skip = 0;
+ my $main_preamble = 1;
+ my $preamble = 1;
+ my $inspec = 0;
+ my $hasif = 0;
+ my $lineno = 0;
+ while (1) {
+ my $line;
+ if (@macros) {
+ $line = shift @macros;
+ $hasif = 0 unless @macros;
+ } elsif ($specdata) {
+ $inspec = 1;
+ last unless @$specdata;
+ $line = shift @$specdata;
+ ++$lineno;
+ if (ref $line) {
+ $line = $line->[0]; # verbatim line
+ push @$xspec, $line if $xspec;
+ $xspec->[-1] = [ $line, undef ] if $xspec && $skip;
+ next;
+ }
+ } else {
+ $inspec = 1;
+ $line = <SPEC>;
+ last unless defined $line;
+ chomp $line;
+ ++$lineno;
+ }
+ push @$xspec, $line if $inspec && $xspec;
+ if ($line =~ /^#\s*neededforbuild\s*(\S.*)$/) {
+ if (defined $hasnfb) {
+ $xspec->[-1] = [ $xspec->[-1], undef ] if $inspec && $xspec;
+ next;
+ }
+ $hasnfb = $1;
+ $nfbline = \$xspec->[-1] if $inspec && $xspec;
+ next;
+ }
+ if ($line =~ /^\s*#/) {
+ next unless $line =~ /^#!BuildIgnore/;
+ }
+ my $expandedline = '';
+ if (!$skip && ($line =~ /%/)) {
+ my $tries = 0;
+ my @expandstack;
+ my $optmacros = {};
+ # newer perls: \{((?:(?>[^{}]+)|(?2))*)\}
+reexpand:
+ while ($line =~ /^(.*?)%(\{([^\}]+)\}|[\?\!]*[0-9a-zA-Z_]+|%|\*\*?|#|\()(.*?)$/) {
+ if ($tries++ > 1000) {
+ print STDERR "Warning: spec file parser ",($lineno?" line $lineno":''),": macro too deeply nested\n" if $config->{'warnings'};
+ $line = 'MACRO';
+ last;
+ }
+ $expandedline .= $1;
+ $line = $4;
+ my $macname = defined($3) ? $3 : $2;
+ my $macorig = $2;
+ my $macdata;
+ my $macalt;
+ if (defined($3)) {
+ if ($macname =~ /{/) { # {
+ while (($macname =~ y/{/{/) > ($macname =~ y/}/}/)) {
+ last unless $line =~ /^([^}]*)}(.*)$/;
+ $macname .= "}$1";
+ $macorig .= "$1}";
+ $line = $2;
+ }
+ }
+ $macdata = '';
+ if ($macname =~ /^([^\s:]+)([\s:])(.*)$/) {
+ $macname = $1;
+ if ($2 eq ':') {
+ $macalt = $3;
+ } else {
+ $macdata = $3;
+ }
+ }
+ }
+ my $mactest = 0;
+ if ($macname =~ /^\!\?/ || $macname =~ /^\?\!/) {
+ $mactest = -1;
+ } elsif ($macname =~ /^\?/) {
+ $mactest = 1;
+ }
+ $macname =~ s/^[\!\?]+//;
+ if ($macname eq '%') {
+ $expandedline .= '%';
+ next;
+ } elsif ($macname eq '(') {
+ print STDERR "Warning: spec file parser",($lineno?" line $lineno":''),": can't expand %(...)\n" if $config->{'warnings'};
+ $line = 'MACRO';
+ last;
+ } elsif ($macname eq 'define' || $macname eq 'global') {
+ if ($line =~ /^\s*([0-9a-zA-Z_]+)(\([^\)]*\))?\s*(.*?)$/) {
+ my $macname = $1;
+ my $macargs = $2;
+ my $macbody = $3;
+ if (defined $macargs) {
+ $macros_args{$macname} = $macargs;
+ } else {
+ delete $macros_args{$macname};
+ }
+ $macros{$macname} = $macbody;
+ }
+ $line = '';
+ last;
+ } elsif ($macname eq 'defined' || $macname eq 'with' || $macname eq 'undefined' || $macname eq 'without' || $macname eq 'bcond_with' || $macname eq 'bcond_without') {
+ my @args;
+ if ($macorig =~ /^\{(.*)\}$/) {
+ @args = split(' ', $1);
+ shift @args;
+ } else {
+ @args = split(' ', $line);
+ $line = '';
+ }
+ next unless @args;
+ if ($macname eq 'bcond_with') {
+ $macros{"with_$args[0]"} = 1 if exists $macros{"_with_$args[0]"};
+ next;
+ }
+ if ($macname eq 'bcond_without') {
+ $macros{"with_$args[0]"} = 1 unless exists $macros{"_without_$args[0]"};
+ next;
+ }
+ $args[0] = "with_$args[0]" if $macname eq 'with' || $macname eq 'without';
+ $line = ((exists($macros{$args[0]}) ? 1 : 0) ^ ($macname eq 'undefined' || $macname eq 'without' ? 1 : 0)).$line;
+ } elsif ($macname eq 'expand') {
+ $macalt = $macros{$macname} unless defined $macalt;
+ $macalt = '' if $mactest == -1;
+ push @expandstack, ($expandedline, $line, undef);
+ $line = $macalt;
+ $expandedline = '';
+ } elsif (exists($macros{$macname})) {
+ if (!defined($macros{$macname})) {
+ print STDERR "Warning: spec file parser",($lineno?" line $lineno":''),": can't expand '$macname'\n" if $config->{'warnings'};
+ $line = 'MACRO';
+ last;
+ }
+ if ($macros_args{$macname}) {
+ # macro with args!
+ if (!defined($macdata)) {
+ $line =~ /^\s*([^\n]*).*?$/;
+ $macdata = $1;
+ $line = $2;
+ }
+ push @expandstack, ($expandedline, $line, $optmacros);
+ $optmacros = adaptmacros(\%macros, $optmacros, grabargs($macname, $macros_args{$macname}, split(/ /, $macdata)));
+ $line = $macros{$macname};
+ $expandedline = '';
+ next;
+ }
+ $macalt = $macros{$macname} unless defined $macalt;
+ $macalt = '' if $mactest == -1;
+ $line = "$macalt$line";
+ } elsif ($mactest) {
+ $macalt = '' if !defined($macalt) || $mactest == 1;
+ $line = "$macalt$line";
+ } else {
+ $expandedline .= "%$macorig" unless $macname =~ /^-/;
+ }
+ }
+ $line = $expandedline . $line;
+ if (@expandstack) {
+ my $m = pop(@expandstack);
+ if ($m) {
+ $optmacros = adaptmacros(\%macros, $optmacros, $m);
+ $expandstack[-2] .= $line;
+ $line = '';
+ }
+ $line = $line . pop(@expandstack);
+ $expandedline = pop(@expandstack);
+ goto reexpand;
+ }
+ }
+ if ($line =~ /^\s*%else\b/) {
+ $skip = 1 - $skip if $skip < 2;
+ next;
+ }
+ if ($line =~ /^\s*%endif\b/) {
+ $skip-- if $skip;
+ next;
+ }
+ $skip++ if $skip && $line =~ /^\s*%if/;
+
+ if ($skip) {
+ $xspec->[-1] = [ $xspec->[-1], undef ] if $xspec;
+ $ifdeps = 1 if $line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i;
+ next;
+ }
+
+ if ($line =~ /^\s*%ifarch(.*)$/) {
+ my $arch = $macros{'_target_cpu'} || 'unknown';
+ my @archs = grep {$_ eq $arch} split(/\s+/, $1);
+ $skip = 1 if !@archs;
+ $hasif = 1;
+ next;
+ }
+ if ($line =~ /^\s*%ifnarch(.*)$/) {
+ my $arch = $macros{'_target_cpu'} || 'unknown';
+ my @archs = grep {$_ eq $arch} split(/\s+/, $1);
+ $skip = 1 if @archs;
+ $hasif = 1;
+ next;
+ }
+ if ($line =~ /^\s*%ifos(.*)$/) {
+ my $os = $macros{'_target_os'} || 'unknown';
+ my @oss = grep {$_ eq $os} split(/\s+/, $1);
+ $skip = 1 if !@oss;
+ $hasif = 1;
+ next;
+ }
+ if ($line =~ /^\s*%ifnos(.*)$/) {
+ my $os = $macros{'_target_os'} || 'unknown';
+ my @oss = grep {$_ eq $os} split(/\s+/, $1);
+ $skip = 1 if @oss;
+ $hasif = 1;
+ next;
+ }
+ if ($line =~ /^\s*%if(.*)$/) {
+ my ($v, $r) = expr($1);
+ $v = 0 if $v && $v eq '\"\"';
+ $v =~ s/^0+/0/ if $v;
+ $skip = 1 unless $v;
+ $hasif = 1;
+ next;
+ }
+ if ($main_preamble) {
+ if ($line =~ /^(Name|Version|Disttag|Release)\s*:\s*(\S+)/i) {
+ $ret->{lc $1} = $2;
+ $macros{lc $1} = $2;
+ } elsif ($line =~ /^(Source\d*|Patch\d*|Url)\s*:\s*(\S+)/i) {
+ $ret->{lc $1} = $2;
+ } elsif ($line =~ /^ExclusiveArch\s*:\s*(.*)/i) {
+ $exclarch ||= [];
+ push @$exclarch, split(' ', $1);
+ } elsif ($line =~ /^ExcludeArch\s*:\s*(.*)/i) {
+ $badarch ||= [];
+ push @$badarch, split(' ', $1);
+ }
+ }
+ if (@subpacks && $preamble && exists($ret->{'version'}) && $line =~ /^Version\s*:\s*(\S+)/i) {
+ $ret->{'multiversion'} = 1 if $ret->{'version'} ne $1;
+ }
+ if ($line =~ /^(?:Requires\(pre\)|Requires\(post\)|PreReq)\s*:\s*(\S.*)$/i) {
+ my $deps = $1;
+ my @deps = $deps =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
+ while (@deps) {
+ my ($pack, $vers, $qual) = splice(@deps, 0, 3);
+ next if $pack =~ /\//;
+ push @prereqs, $pack unless grep {$_ eq $pack} @prereqs;
+ }
+ next;
+ }
+ if ($preamble && ($line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i)) {
+ my $what = $1;
+ my $deps = $2;
+ $ifdeps = 1 if $hasif;
+ # XXX: weird syntax addition. can append arch or project to dependency
+ # BuildRequire: foo > 17 [i586,x86_64]
+ # BuildRequire: foo [home:bar]
+ # BuildRequire: foo [!home:bar]
+ my @deps = $deps =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
+ my $replace = 0;
+ my @ndeps = ();
+ while (@deps) {
+ my ($pack, $vers, $qual) = splice(@deps, 0, 3);
+ if (defined($qual)) {
+ $replace = 1;
+ my $arch = $macros{'_target_cpu'} || '';
+ my $proj = $macros{'_target_project'} || '';
+ $qual =~ s/^\s*\[//;
+ $qual =~ s/\]$//;
+ my $isneg = 0;
+ my $bad;
+ for my $q (split('[\s,]', $qual)) {
+ $isneg = 1 if $q =~ s/^\!//;
+ $bad = 1 if !defined($bad) && !$isneg;
+ if ($isneg) {
+ if ($q eq $arch || $q eq $proj) {
+ $bad = 1;
+ last;
+ }
+ } elsif ($q eq $arch || $q eq $proj) {
+ $bad = 0;
+ }
+ }
+ next if $bad;
+ }
+ $vers = '' unless defined $vers;
+ $vers =~ s/=(>|<)/$1=/;
+ push @ndeps, "$pack$vers";
+ }
+
+ $replace = 1 if grep {/^-/} @ndeps;
+ if (lc($what) ne 'buildrequires' && lc($what) ne 'buildprereq') {
+ push @packdeps, map {"-$_"} @ndeps;
+ next;
+ }
+ if (defined($hasnfb)) {
+ if ((grep {$_ eq 'glibc' || $_ eq 'rpm' || $_ eq 'gcc' || $_ eq 'bash'} @ndeps) > 2) {
+ # ignore old generated BuildRequire lines.
+ $xspec->[-1] = [ $xspec->[-1], undef ] if $xspec;
+ next;
+ }
+ }
+ push @packdeps, @ndeps;
+ next unless $xspec && $inspec;
+ if ($replace) {
+ my @cndeps = grep {!/^-/} @ndeps;
+ if (@cndeps) {
+ $xspec->[-1] = [ $xspec->[-1], "$what: ".join(' ', @cndeps) ];
+ } else {
+ $xspec->[-1] = [ $xspec->[-1], ''];
+ }
+ }
+ next;
+ }
+
+ if ($line =~ /^\s*%package\s+(-n\s+)?(\S+)/) {
+ if ($1) {
+ push @subpacks, $2;
+ } else {
+ push @subpacks, $ret->{'name'}.'-'.$2 if defined $ret->{'name'};
+ }
+ $preamble = 1;
+ $main_preamble = 0;
+ }
+
+ if ($line =~ /^\s*%(prep|build|install|check|clean|preun|postun|pretrans|posttrans|pre|post|files|changelog|description|triggerpostun|triggerun|triggerin|trigger|verifyscript)/) {
+ $main_preamble = 0;
+ $preamble = 0;
+ }
+
+ # do this always?
+ if ($xspec && @$xspec && $config->{'save_expanded'}) {
+ $xspec->[-1] = [ $xspec->[-1], $line ];
+ }
+ }
+ close SPEC unless ref $specfile;
+ if (defined($hasnfb)) {
+ if (!@packdeps) {
+ @packdeps = split(' ', $hasnfb);
+ } elsif ($nfbline) {
+ $$nfbline = [$$nfbline, undef ];
+ }
+ }
+ unshift @subpacks, $ret->{'name'};
+ $ret->{'subpacks'} = \@subpacks;
+ $ret->{'exclarch'} = $exclarch if defined $exclarch;
+ $ret->{'badarch'} = $badarch if defined $badarch;
+ $ret->{'deps'} = \@packdeps;
+ $ret->{'prereqs'} = \@prereqs if @prereqs;
+ $ret->{'configdependent'} = 1 if $ifdeps;
+ return $ret;
+}
+
+###########################################################################
+
+my %rpmstag = (
+ "SIGTAG_SIZE" => 1000, # /*!< internal Header+Payload size in bytes. */
+ "SIGTAG_MD5" => 1004, # /*!< internal MD5 signature. */
+ "NAME" => 1000,
+ "VERSION" => 1001,
+ "RELEASE" => 1002,
+ "EPOCH" => 1003,
+ "SUMMARY" => 1004,
+ "DESCRIPTION" => 1005,
+ "ARCH" => 1022,
+ "OLDFILENAMES" => 1027,
+ "SOURCERPM" => 1044,
+ "PROVIDENAME" => 1047,
+ "REQUIREFLAGS" => 1048,
+ "REQUIRENAME" => 1049,
+ "REQUIREVERSION" => 1050,
+ "NOSOURCE" => 1051,
+ "NOPATCH" => 1052,
+ "PROVIDEFLAGS" => 1112,
+ "PROVIDEVERSION" => 1113,
+ "DIRINDEXES" => 1116,
+ "BASENAMES" => 1117,
+ "DIRNAMES" => 1118,
+);
+
+sub rpmq {
+ my ($rpm, @stags) = @_;
+
+ my @sigtags = grep {/^SIGTAG_/} @stags;
+ @stags = grep {!/^SIGTAG_/} @stags;
+ my $dosigs = @sigtags && !@stags;
+ @stags = @sigtags if $dosigs;
+
+ my $need_filenames = grep { $_ eq 'FILENAMES' } @stags;
+ push @stags, 'BASENAMES', 'DIRNAMES', 'DIRINDEXES', 'OLDFILENAMES' if $need_filenames;
+ @stags = grep { $_ ne 'FILENAMES' } @stags if $need_filenames;
+
+ my %stags = map {0 + ($rpmstag{$_} || $_) => $_} @stags;
+
+ my ($magic, $sigtype, $headmagic, $cnt, $cntdata, $lead, $head, $index, $data, $tag, $type, $offset, $count);
+
+ local *RPM;
+ if (ref($rpm) eq 'ARRAY') {
+ ($headmagic, $cnt, $cntdata) = unpack('N@8NN', $rpm->[0]);
+ if ($headmagic != 0x8eade801) {
+ warn("Bad rpm\n");
+ return ();
+ }
+ if (length($rpm->[0]) < 16 + $cnt * 16 + $cntdata) {
+ warn("Bad rpm\n");
+ return ();
+ }
+ $index = substr($rpm->[0], 16, $cnt * 16);
+ $data = substr($rpm->[0], 16 + $cnt * 16, $cntdata);
+ } else {
+ if (ref($rpm) eq 'GLOB') {
+ *RPM = *$rpm;
+ } elsif (!open(RPM, '<', $rpm)) {
+ warn("$rpm: $!\n");
+ return ();
+ }
+ if (read(RPM, $lead, 96) != 96) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ ($magic, $sigtype) = unpack('N@78n', $lead);
+ if ($magic != 0xedabeedb || $sigtype != 5) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ if (read(RPM, $head, 16) != 16) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ ($headmagic, $cnt, $cntdata) = unpack('N@8NN', $head);
+ if ($headmagic != 0x8eade801) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ if (read(RPM, $index, $cnt * 16) != $cnt * 16) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ $cntdata = ($cntdata + 7) & ~7;
+ if (read(RPM, $data, $cntdata) != $cntdata) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ }
+
+ my %res = ();
+ if (@sigtags && !$dosigs) {
+ %res = &rpmq(["$head$index$data"], @sigtags);
+ }
+ if (ref($rpm) eq 'ARRAY' && !$dosigs && @$rpm > 1) {
+ my %res2 = &rpmq([ $rpm->[1] ], @stags);
+ %res = (%res, %res2);
+ return %res;
+ }
+ if (ref($rpm) ne 'ARRAY' && !$dosigs) {
+ if (read(RPM, $head, 16) != 16) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ ($headmagic, $cnt, $cntdata) = unpack('N@8NN', $head);
+ if ($headmagic != 0x8eade801) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ if (read(RPM, $index, $cnt * 16) != $cnt * 16) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ if (read(RPM, $data, $cntdata) != $cntdata) {
+ warn("Bad rpm $rpm\n");
+ close RPM unless ref($rpm);
+ return ();
+ }
+ }
+ close RPM unless ref($rpm);
+
+# return %res unless @stags;
+
+ while($cnt-- > 0) {
+ ($tag, $type, $offset, $count, $index) = unpack('N4a*', $index);
+ $tag = 0+$tag;
+ if ($stags{$tag} || !@stags) {
+ eval {
+ my $otag = $stags{$tag} || $tag;
+ if ($type == 0) {
+ $res{$otag} = [ '' ];
+ } elsif ($type == 1) {
+ $res{$otag} = [ unpack("\@${offset}c$count", $data) ];
+ } elsif ($type == 2) {
+ $res{$otag} = [ unpack("\@${offset}c$count", $data) ];
+ } elsif ($type == 3) {
+ $res{$otag} = [ unpack("\@${offset}n$count", $data) ];
+ } elsif ($type == 4) {
+ $res{$otag} = [ unpack("\@${offset}N$count", $data) ];
+ } elsif ($type == 5) {
+ $res{$otag} = [ undef ];
+ } elsif ($type == 6) {
+ $res{$otag} = [ unpack("\@${offset}Z*", $data) ];
+ } elsif ($type == 7) {
+ $res{$otag} = [ unpack("\@${offset}a$count", $data) ];
+ } elsif ($type == 8 || $type == 9) {
+ my $d = unpack("\@${offset}a*", $data);
+ my @res = split("\0", $d, $count + 1);
+ $res{$otag} = [ splice @res, 0, $count ];
+ } else {
+ $res{$otag} = [ undef ];
+ }
+ };
+ if ($@) {
+ warn("Bad rpm $rpm: $@\n");
+ return ();
+ }
+ }
+ }
+
+ if ($need_filenames) {
+ if ($res{'OLDFILENAMES'}) {
+ $res{'FILENAMES'} = [ @{$res{'OLDFILENAMES'}} ];
+ } else {
+ my $i = 0;
+ $res{'FILENAMES'} = [ map {"$res{'DIRNAMES'}->[$res{'DIRINDEXES'}->[$i++]]$_"} @{$res{'BASENAMES'}} ];
+ }
+ }
+
+ return %res;
+}
+
+sub add_flagsvers {
+ my $res = shift;
+ my $name = shift;
+ my $flags = shift;
+ my $vers = shift;
+
+ return unless $res;
+ my @flags = @{$res->{$flags} || []};
+ my @vers = @{$res->{$vers} || []};
+ for (@{$res->{$name}}) {
+ if (@flags && ($flags[0] & 0xe) && @vers) {
+ $_ .= ' ';
+ $_ .= '<' if $flags[0] & 2;
+ $_ .= '>' if $flags[0] & 4;
+ $_ .= '=' if $flags[0] & 8;
+ $_ .= " $vers[0]";
+ }
+ shift @flags;
+ shift @vers;
+ }
+}
+
+sub verscmp_part {
+ my ($s1, $s2) = @_;
+ if (!defined($s1)) {
+ return defined($s2) ? -1 : 0;
+ }
+ return 1 if !defined $s2;
+ return 0 if $s1 eq $s2;
+ while (1) {
+ $s1 =~ s/^[^a-zA-Z0-9~]+//;
+ $s2 =~ s/^[^a-zA-Z0-9~]+//;
+ if ($s1 =~ s/^~//) {
+ next if $s2 =~ s/^~//;
+ return -1;
+ }
+ return 1 if $s2 =~ /^~/;
+ if ($s1 eq '') {
+ return $s2 eq '' ? 0 : -1;
+ }
+ return 1 if $s2 eq '';
+ my ($x1, $x2, $r);
+ if ($s1 =~ /^([0-9]+)(.*?)$/) {
+ $x1 = $1;
+ $s1 = $2;
+ $s2 =~ /^([0-9]*)(.*?)$/;
+ $x2 = $1;
+ $s2 = $2;
+ return 1 if $x2 eq '';
+ $x1 =~ s/^0+//;
+ $x2 =~ s/^0+//;
+ $r = length($x1) - length($x2) || $x1 cmp $x2;
+ } elsif ($s1 ne '' && $s2 ne '') {
+ $s1 =~ /^([a-zA-Z]*)(.*?)$/;
+ $x1 = $1;
+ $s1 = $2;
+ $s2 =~ /^([a-zA-Z]*)(.*?)$/;
+ $x2 = $1;
+ $s2 = $2;
+ return -1 if $x1 eq '' || $x2 eq '';
+ $r = $x1 cmp $x2;
+ }
+ return $r > 0 ? 1 : -1 if $r;
+ }
+}
+
+sub verscmp {
+ my ($s1, $s2, $dtest) = @_;
+
+ return 0 if $s1 eq $s2;
+ my ($e1, $v1, $r1) = $s1 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $e1 = 0 unless defined $e1;
+ my ($e2, $v2, $r2) = $s2 =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $e2 = 0 unless defined $e2;
+ if ($e1 ne $e2) {
+ my $r = verscmp_part($e1, $e2);
+ return $r if $r;
+ }
+ return 0 if $dtest && ($v1 eq '' || $v2 eq '');
+ if ($v1 ne $v2) {
+ my $r = verscmp_part($v1, $v2);
+ return $r if $r;
+ }
+ $r1 = '' unless defined $r1;
+ $r2 = '' unless defined $r2;
+ return 0 if $dtest && ($r1 eq '' || $r2 eq '');
+ if ($r1 ne $r2) {
+ return verscmp_part($r1, $r2);
+ }
+ return 0;
+}
+
+sub query {
+ my ($handle, %opts) = @_;
+
+ my @tags = qw{NAME SOURCERPM NOSOURCE NOPATCH SIGTAG_MD5 PROVIDENAME PROVIDEFLAGS PROVIDEVERSION REQUIRENAME REQUIREFLAGS REQUIREVERSION};
+ push @tags, qw{EPOCH VERSION RELEASE ARCH};
+ push @tags, qw{FILENAMES} if $opts{'filelist'};
+ push @tags, qw{SUMMARY DESCRIPTION} if $opts{'description'};
+ my %res = rpmq($handle, @tags);
+ return undef unless %res;
+ my $src = $res{'SOURCERPM'}->[0];
+ $src = '' unless defined $src;
+ $src =~ s/-[^-]*-[^-]*\.[^\.]*\.rpm//;
+ add_flagsvers(\%res, 'PROVIDENAME', 'PROVIDEFLAGS', 'PROVIDEVERSION');
+ add_flagsvers(\%res, 'REQUIRENAME', 'REQUIREFLAGS', 'REQUIREVERSION');
+ my $data = {
+ name => $res{'NAME'}->[0],
+ hdrmd5 => unpack('H32', $res{'SIGTAG_MD5'}->[0]),
+ };
+ if ($opts{'alldeps'}) {
+ $data->{'provides'} = [ @{$res{'PROVIDENAME'} || []} ];
+ $data->{'requires'} = [ @{$res{'REQUIRENAME'} || []} ];
+ } else {
+ $data->{'provides'} = [ grep {!/^rpmlib\(/ && !/^\//} @{$res{'PROVIDENAME'} || []} ];
+ $data->{'requires'} = [ grep {!/^rpmlib\(/ && !/^\//} @{$res{'REQUIRENAME'} || []} ];
+ }
+
+ # rpm3 compatibility: retrofit missing self provides
+ my $haveselfprovides;
+ if (@{$data->{'provides'}}) {
+ if ($data->{'provides'}->[-1] =~ /^\Q$res{'NAME'}->[0]\E =/) {
+ $haveselfprovides = 1;
+ } elsif (@{$data->{'provides'}} > 1 && $data->{'provides'}->[-2] =~ /^\Q$res{'NAME'}->[0]\E =/) {
+ $haveselfprovides = 1;
+ }
+ }
+ if (!$haveselfprovides) {
+ my $evr = "$res{'VERSION'}->[0]-$res{'RELEASE'}->[0]";
+ $evr = "$res{'EPOCH'}->[0]:$evr" if $res{'EPOCH'} && $res{'EPOCH'}->[0];
+ push @{$data->{'provides'}}, "$res{'NAME'}->[0] = $evr";
+ }
+
+ $data->{'source'} = $src if $src ne '';
+ if ($opts{'evra'}) {
+ my $arch = $res{'ARCH'}->[0];
+ $arch = $res{'NOSOURCE'} || $res{'NOPATCH'} ? 'nosrc' : 'src' unless $src ne '';
+ $data->{'version'} = $res{'VERSION'}->[0];
+ $data->{'release'} = $res{'RELEASE'}->[0];
+ $data->{'arch'} = $arch;
+ $data->{'epoch'} = $res{'EPOCH'}->[0] if exists $res{'EPOCH'};
+ }
+ if ($opts{'filelist'}) {
+ $data->{'filelist'} = $res{'FILENAMES'};
+ }
+ if ($opts{'description'}) {
+ $data->{'summary'} = $res{'SUMMARY'}->[0];
+ $data->{'description'} = $res{'DESCRIPTION'}->[0];
+ }
+ return $data;
+}
+
+sub queryhdrmd5 {
+ my ($bin, $leadsigp) = @_;
+
+ local *F;
+ open(F, '<', $bin) || die("$bin: $!\n");
+ my $buf = '';
+ my $l;
+ while (length($buf) < 96 + 16) {
+ $l = sysread(F, $buf, 4096, length($buf));
+ if (!$l) {
+ warn("$bin: read error\n");
+ close(F);
+ return undef;
+ }
+ }
+ my ($magic, $sigtype) = unpack('N@78n', $buf);
+ if ($magic != 0xedabeedb || $sigtype != 5) {
+ warn("$bin: not a rpm (bad magic of header type)\n");
+ close(F);
+ return undef;
+ }
+ my ($headmagic, $cnt, $cntdata) = unpack('@96N@104NN', $buf);
+ if ($headmagic != 0x8eade801) {
+ warn("$bin: not a rpm (bad sig header magic)\n");
+ close(F);
+ return undef;
+ }
+ my $hlen = 96 + 16 + $cnt * 16 + $cntdata;
+ $hlen = ($hlen + 7) & ~7;
+ while (length($buf) < $hlen) {
+ $l = sysread(F, $buf, 4096, length($buf));
+ if (!$l) {
+ warn("$bin: read error\n");
+ close(F);
+ return undef;
+ }
+ }
+ close F;
+ $$leadsigp = Digest::MD5::md5_hex(substr($buf, 0, $hlen)) if $leadsigp;
+ my $idxarea = substr($buf, 96 + 16, $cnt * 16);
+ if ($idxarea !~ /\A(?:.{16})*\000\000\003\354\000\000\000\007(....)\000\000\000\020/s) {
+ warn("$bin: no md5 signature header\n");
+ return undef;
+ }
+ my $md5off = unpack('N', $1);
+ if ($md5off >= $cntdata) {
+ warn("$bin: bad md5 offset\n");
+ return undef;
+ }
+ $md5off += 96 + 16 + $cnt * 16;
+ return unpack("\@${md5off}H32", $buf);
+}
+
+1;
diff --git a/Build/Susetags.pm b/Build/Susetags.pm
new file mode 100644
index 0000000..cd0a103
--- /dev/null
+++ b/Build/Susetags.pm
@@ -0,0 +1,66 @@
+package Build::Susetags;
+
+use strict;
+use warnings;
+use Data::Dumper;
+
+sub addpkg {
+ my ($pkgs, $cur, $order, $cb, $cbdata, @arches) = @_;
+ if (defined($cur) && (!@arches || grep { /$cur->{'arch'}/ } @arches)) {
+ if(!$cb || &$cb($cur, $cbdata)) {
+ my $k = "$cur->{'name'}-$cur->{'version'}-$cur->{'release'}-$cur->{'arch'}";
+ $pkgs->{$k} = $cur;
+ # keep order (or should we use Tie::IxHash?)
+ push @{$order}, $k if defined $order;
+ }
+ }
+}
+
+sub parse {
+ # if @arches is empty take all arches
+ my ($file, $tmap, $order, @arches) = @_;
+ my $cb;
+ my $cbdata;
+ if (ref $order eq 'HASH') {
+ my $d = $order;
+ $order = undef;
+ $cb = $d->{'cb'} if (exists $d->{'cb'});
+ $cbdata = $d->{'data'} if (exists $d->{'data'});
+ }
+
+ # if @arches is empty take all arches
+ my @needed = keys %$tmap;
+ my $r = '(' . join('|', @needed) . '|Pkg):\s*(.*)';
+
+ if (!open(F, '<', $file)) {
+ if (!open(F, '-|', "gzip", "-dc", $file.'.gz')) {
+ die "$file: $!";
+ }
+ }
+
+ my $cur;
+ my $pkgs = {};
+ while (<F>) {
+ chomp;
+ next unless $_ =~ /([\+=])$r/;
+ my ($multi, $tag, $data) = ($1, $2, $3);
+ if ($multi eq '+') {
+ while (<F>) {
+ chomp;
+ last if $_ =~ /-$tag/;
+ push @{$cur->{$tmap->{$tag}}}, $_;
+ }
+ } elsif ($tag eq 'Pkg') {
+ addpkg($pkgs, $cur, $order, $cb, $cbdata, @arches);
+ $cur = {};
+ ($cur->{'name'}, $cur->{'version'}, $cur->{'release'}, $cur->{'arch'}) = split(' ', $data);
+ } else {
+ $cur->{$tmap->{$tag}} = $data;
+ }
+ }
+ addpkg($pkgs, $cur, $order, $cb, $cbdata, @arches);
+ close(F);
+ return $pkgs;
+}
+
+1;
diff --git a/Build/Zypp.pm b/Build/Zypp.pm
new file mode 100644
index 0000000..354adca
--- /dev/null
+++ b/Build/Zypp.pm
@@ -0,0 +1,33 @@
+package Build::Zypp;
+
+use strict;
+
+our $root = '';
+
+sub parsecfg($)
+{
+ my $file = shift;
+ my $repocfg = "$root/etc/zypp/repos.d/$file.repo";
+ local *REPO;
+ open(REPO, '<', $repocfg) or return undef;
+ my $name;
+ my $repo = {};
+ while (<REPO>) {
+ chomp;
+ if (/^\[(.+)\]/) {
+ $name = $1;
+ } else {
+ my ($key, $value) = split(/=/,$_,2);
+ $repo->{$key} = $value if defined $key;
+ }
+ }
+ close(REPO);
+ return undef unless $name;
+ $repo->{'description'} = $repo->{'name'} if exists $repo->{'name'};
+ $repo->{'name'} = $name;
+ return $repo;
+}
+
+1;
+
+# vim: sw=2
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cf7d470
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,98 @@
+VERSION=0.1
+SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi)
+DATE=$(shell date +%Y%m%d%H%M)
+BUILD=build
+
+ifeq ($(SCM),svn)
+SVNVER=_SVN$(shell LANG=C svnversion .)
+endif
+
+prefix=/usr
+bindir=$(prefix)/bin
+datadir=$(prefix)/share
+libdir=$(prefix)/lib
+pkglibdir=$(libdir)/$(BUILD)
+mandir=$(datadir)/man
+man1dir=$(mandir)/man1
+sysconfdir=/etc
+DESTDIR=
+
+all:
+
+install:
+ install -m755 -d \
+ $(DESTDIR)$(pkglibdir)/configs \
+ $(DESTDIR)$(pkglibdir)/Build \
+ $(DESTDIR)$(bindir) \
+ $(DESTDIR)$(man1dir)
+ install -m755 \
+ build \
+ build_kiwi.sh \
+ vc \
+ createrpmdeps \
+ order \
+ expanddeps \
+ computeblocklists \
+ extractbuild \
+ getbinaryid \
+ killchroot \
+ getmacros \
+ getoptflags \
+ gettype \
+ getchangetarget \
+ common_functions \
+ init_buildsystem \
+ initscript_qemu_vm \
+ substitutedeps \
+ debtransform \
+ debtransformbz2 \
+ debtransformzip \
+ mkbaselibs \
+ mkdrpms \
+ createarchdeps \
+ createrepomddeps \
+ createyastdeps \
+ changelog2spec \
+ spec2changelog \
+ download \
+ spec_add_patch \
+ spectool \
+ signdummy \
+ unrpm \
+ $(DESTDIR)$(pkglibdir)
+ install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
+ install -m644 qemu-reg $(DESTDIR)$(pkglibdir)
+ install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
+ install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 build.1 $(DESTDIR)$(man1dir)
+ ln -sf ../lib/build/build $(DESTDIR)$(bindir)/build
+ ln -sf ../lib/build//vc $(DESTDIR)$(bindir)/buildvc
+ ln -sf ../lib/build//unrpm $(DESTDIR)$(bindir)/unrpm
+
+# Allow initvm to be packaged seperately from the rest of build. This
+# is useful because it is distributed as a static binary package (e.g.
+# build-initvm-static) whereas the build scripts package is noarch.
+
+initvm: initvm.c
+ $(CC) -o $@ -static $(CFLAGS) initvm.c
+
+initvm-all: initvm
+
+initvm-build: initvm
+
+initvm-install: initvm
+ install -m755 -d $(DESTDIR)$(pkglibdir)
+ install -m755 initvm $(DESTDIR)$(pkglibdir)/initvm
+
+
+dist:
+ifeq ($(SCM),svn)
+ rm -rf $(BUILD)-$(VERSION)$(SVNVER)
+ svn export . $(BUILD)-$(VERSION)$(SVNVER)
+ tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
+ rm -rf $(BUILD)-$(VERSION)$(SVNVER)
+else
+ifeq ($(SCM),git)
+ git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
+endif
+endif
diff --git a/README b/README
index da404f4..3d758ae 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-This script is used for building SuSE Linux RPMs in
+This script is used for building SUSE Linux RPMs in
a clean and safe chroot'ed build environment.
-At first you need to copy your SuSE Linux CDs into a
+At first you need to copy your SUSE Linux CDs into a
path reachable by the build script, for example /home/suse-8.2-i386.
-If you have a DVD Drive and the SuSE Linux DVD, you can mount it
+If you have a DVD Drive and the SUSE Linux DVD, you can mount it
and use this as the source for the RPMs.
To build an RPM, change into the directory with the sources
diff --git a/baselibs_global-deb.conf b/baselibs_global-deb.conf
new file mode 100644
index 0000000..3a56a1a
--- /dev/null
+++ b/baselibs_global-deb.conf
@@ -0,0 +1,39 @@
+arch i586 targets x86_64:32bit ia64:x86
+arch i686 targets x86_64:32bit ia64:x86
+arch s390 targets s390x:32bit
+arch ppc targets ppc64:32bit
+arch ppc64 targets ppc:64bit
+
+configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
+targettype x86 extension -x86
+targettype 32bit extension 32
+targettype 64bit extension 64
+
+targetname <name>-<targettype>
+
++.*/lib(64)?/.*\.(so.*|o|a|la)$
+
+targettype 64bit -^(/usr)?/lib/lib
+targettype 32bit -/lib64/
+targettype x86 -/lib64/
+
+config +.*bin.*-config$
+config -/kde-config$
+
+targettype x86 requires "ia32el"
+targettype x86 prereq "glibc-x86"
+
+package /.(?<!-devel)$/
+post #!/bin/sh
+#post "/sbin/ldconfig"
+
+package /(.*)-devel$/
+targettype x86 block!
+requires "<name> = <version>"
+#requires "<match1>-<targettype> = <version>"
+
+package /(.*)-debuginfo$/
++/usr/lib(64)?/debug/.*/lib(64)?/.*\.(so.*|o|a|la)\.debug$
diff --git a/baselibs_global-sle.conf b/baselibs_global-sle.conf
new file mode 100644
index 0000000..96191bf
--- /dev/null
+++ b/baselibs_global-sle.conf
@@ -0,0 +1,45 @@
+arch i586 targets x86_64:32bit ia64:x86
+arch i686 targets x86_64:32bit ia64:x86
+arch s390 targets s390x:32bit
+arch ppc targets ppc64:32bit
+arch ppc64 targets ppc:64bit
+arch sparc targets sparc64:32bit
+arch sparcv8 targets sparc64:32bit
+arch sparcv9 targets sparc64:32bit
+arch sparcv9v targets sparc64v:32bit
+arch sparc64 targets sparcv9:64bit
+arch sparc64v targets sparcv9v:64bit
+
+configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
+targettype x86 extension -x86
+targettype 32bit extension 32
+targettype 64bit extension 64
+
+targetname <name>-<targettype>
+
++.*/lib(64)?/.*\.(so.*|o|a|la)$
+
+targettype 64bit -^(/usr)?/lib/lib
+targettype 32bit -/lib64/
+targettype x86 -/lib64/
+
+config +.*bin.*-config$
+config -/kde-config$
+
+targettype x86 requires "ia32el"
+targettype x86 prereq "glibc-x86"
+
+package /.(?<!-devel)$/
+post "/sbin/ldconfig"
+
+package /(.*)-devel$/
+targettype x86 block!
+requires "<name> = <version>"
+requires "<match1>-<targettype> = <version>"
+
+package /(.*)-debuginfo$/
++/usr/lib(64)?/debug/.*/lib(64)?/.*\.(so.*|o|a|la)\.debug$
++/usr/lib(64)?/debug/.build-id/.*
diff --git a/baselibs_global.conf b/baselibs_global.conf
index 15d997e..3de35f5 100644
--- a/baselibs_global.conf
+++ b/baselibs_global.conf
@@ -1,11 +1,19 @@
-arch i586 targets x86_64:32bit ia64:x86
-arch i686 targets x86_64:32bit ia64:x86
+arch i586 targets x86_64:32bit
+arch i686 targets x86_64:32bit
arch s390 targets s390x:32bit
arch ppc targets ppc64:32bit
arch ppc64 targets ppc:64bit
+arch sparc targets sparc64:32bit
+arch sparcv8 targets sparc64:32bit
+arch sparcv9 targets sparc64:32bit
+arch sparcv9v targets sparc64v:32bit
+arch sparc64 targets sparcv9:64bit
+arch sparc64v targets sparcv9v:64bit
-targettype x86 prefix /emul/ia32-linux
configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
targettype x86 extension -x86
targettype 32bit extension 32
targettype 64bit extension 64
@@ -24,7 +32,14 @@ config -/kde-config$
targettype x86 requires "ia32el"
targettype x86 prereq "glibc-x86"
+package /.(?<!-devel)$/
+post "/sbin/ldconfig"
+
package /(.*)-devel$/
targettype x86 block!
requires "<name> = <version>"
requires "<match1>-<targettype> = <version>"
+
+package /(.*)-debuginfo$/
++/usr/lib(64)?/debug/.*/lib(64)?/.*\.(so.*|o|a|la)\.debug$
++/usr/lib(64)?/debug/.build-id/.*
diff --git a/build b/build
index cf40394..43ae5f6 100755
--- a/build
+++ b/build
@@ -5,18 +5,102 @@
#
# BUILD_ROOT here the packages will be built
#
-# (c) 1997-2006 SuSE GmbH Nuernberg, Germany
+# (c) 1997-2008 SuSE GmbH Nuernberg, Germany
+test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/build-root
-test -z "$BUILD_RPMS" && BUILD_RPMS=/media/dvd/suse
-test -z "$BUILD_ARCH" && {
- BUILD_ARCH=`uname -m`
- test i686 = "$BUILD_ARCH" && BUILD_ARCH=i586
-}
-export BUILD_ARCH BUILD_ROOT BUILD_RPMS
+test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
+
+export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
+export BUILD_DIST
+
+ccache=0
+icecream=0
+shell=
+definesnstuff=()
+repos=()
+old_packages=()
+
+# defaults for vm_img_mkfs
+vm_img_mkfs_ext4='mkfs.ext4 -m 0 -q -F'
+vm_img_tunefs_ext4='tune2fs -c 0 -O ^has_journal'
+vm_img_mkfs_ext3='mkfs.ext3 -m 0 -q -F'
+vm_img_tunefs_ext3='tune2fs -c 0 -o journal_data_writeback'
+vm_img_mkfs_ext2='mkfs.ext2 -m 0 -q -F'
+vm_img_tunefs_ext2='tune2fs -c 0'
+vm_img_mkfs_reiserfs='mkreiserfs -q -f'
+vm_img_mkfs_btrfs='mkfs.btrfs'
+
+vm_kernel=/boot/vmlinuz
+vm_initrd=/boot/initrd
+qemu_bin=/usr/bin/qemu
+uml_kernel=/boot/vmlinux-um
+uml_initrd=/boot/initrd-um
+
+kvm_bin=/usr/bin/qemu-kvm
+# whether we have virtio support
+kvm_virtio=
+
+# guest visible console device name
+console=ttyS0
+
+# need to restore build root owner for non-root builds
+browner=
+
+# Default uid:gid for the build user
+ABUILD_UID=399
+ABUILD_GID=399
-export BUILD_DIR=/usr/lib/build
-export PATH=$BUILD_DIR:$PATH
+DO_INIT=true
+DO_LINT=
+DO_CHECKS=true
+SHORT_CIRCUIT=false
+CLEAN_BUILD=
+USE_SYSTEM_QEMU=
+SPECFILES=()
+SRCDIR=
+BUILD_JOBS=
+ABUILD_TARGET=
+CREATE_BASELIBS=
+USEUSEDFORBUILD=
+LIST_STATE=
+VM_IMAGE=
+VM_SWAP=
+VM_KERNEL=
+VM_INITRD=
+VMDISK_ROOTSIZE=4096
+VMDISK_SWAPSIZE=1024
+VMDISK_FILESYSTEM=ext3
+# settings are for speed and not data safety, we format anyway on next run
+VMDISK_MOUNT_OPTIONS=__default
+MEMSIZE=
+RUNNING_IN_VM=
+RPMLIST=
+RELEASE=
+REASON=
+NOROOTFORBUILD=
+LOGFILE=
+KILL=
+CHANGELOG=
+BUILD_DEBUG=
+PERSONALITY_SYSCALL=
+INCARNATION=
+DISTURL=
+LINKSOURCES=
+OVERLAY=
+RSYNCSRC=
+RSYNCDEST=
+RSYNCDONE=
+SIGNDUMMY=
+HOST_ARCH=
+
+# list of archs which need emulator initialization
+: ${EMULATOR_ARCHS:="armv4l armv5l armv6l armv7l armv5el armv6el armv7el armv7hl armv8el mips mipsel mips64 mips64el ppc ppc64 sh4 sparc sparc64 s390 s390x"}
+export EMULATOR_ARCHS
+
+# list of devices registered by binfmt handlers in /proc/sys/fs/binfmt_misc
+: ${EMULATOR_DEVS:="arm armeb mips mipsel mips64 mips64el ppc sh4 sh4eb sparc s390x"}
+export EMULATOR_DEVS
# This is for insserv
export YAST_IS_RUNNING=instsys
@@ -61,31 +145,150 @@ Known Parameters:
--help You already got it :)
+ --kill Instead of starting a build kill the one currently
+ running.
+
+ --shell Instead of starting a build start a root shell in
+ the build root.
+
--clean Delete old build root before initializing it
--no-init Skip initialization of build root and start with build
immediately.
+ --no-checks Do not run post-build checks
+
+ --lint Run rpmlint after build.
+
+ --logfile logfile
+ Capture build output to logfile. Defaults to
+ .build.log in the build root for non-VM builds.
+
+ --repository PATH
+ Use package repository at PATH. Supported formats are
+ rpm-md and yast2.
+ Alternatively zypp://NAME specifies the zypp
+ repository NAME. The repo must be refreshed with zypp
+ so package meta data is available locally. With emtpy
+ NAME all enabled repositories are used.
+ a url can specify a remote repo.
+
--rpms path1:path2:...
Specify path where to find the RPMs for the build system
--arch arch1:arch2:...
Specify what architectures to select from the RPMs
- --useusedforbuild
- Do not expand dependencies but search the specfile for
- usedforbuild lines.
-
--verify Run verify when initializing the build root
--extra-packs pack
+ -X pack
Also install package 'pack'
--root rootdir
Use 'rootdir' to setup chroot environment
+ --cachedir cachedir
+ Use 'cachedir' to cache remote repo's packages, the
+ default cache dir is /var/cache/build, every repo
+ given by --repository corresponds to a subdir named
+ as md5sum of its repo url, for example:
+ /var/cache/build/3e8ea9b47808629414a0cebc33ea285e
+
+ --oldpackages oldpackagesdir
+ Define a directory with a former build
+
--baselibs Create -32bit/-64bit/-x86 rpms for other architectures
+ --list-state
+ List rpms that would be used to create a fresh build root.
+ Does not create the build root or perform a build.
+
+ --dist dist
+ Distribution to use
+
+ --with X
+ Enable feature X for build
+
+ --without X
+ Disable feature X for build
+
+ --define 'X Y'
+ Define macro X with value Y
+
+ --release release
+ Override Release in spec file
+
+ --stage -bSTAGE
+ Set stage for rpmbuild. Defaults to -ba.
+
+ --target platform
+ Set target platform for rpmbuild
+
+ --jobs N Use N parallel processes during build.
+ Sets %jobs and %_smp_mflags macros and
+ defines the number of CPUs to use for
+ VMs.
+
+ --ccache
+ Use ccache to speed up rebuilds
+
+ --icecream N
+ Use N parallel build jobs with icecream
+
+ --overlay OVERLAY
+ Copy overlay filesystem to buildroot after installing
+ all RPMs. This must be a valid directory.
+
+ --rsync-src RSYNCSRC
+ Copy overlay folder (RSYNCSRC) to a folder (RSYNCDEST)
+ inside the buildroot using rsync.
+ It will "%define RSYNCDONE 1" for handling %setup in your
+ specfile. E.g.:
+ %prep
+ %if 0%{?RSYNCDONE}
+ %setup -n aaa_base -T -D -b 5 -b 7
+ %else
+ %setup -n aaa_base -b 5 -b 7
+ %endif
+
+ --rsync-dest RSYNCDEST
+ Copy overlay folder (RSYNCSRC) to a folder (RSYNCDEST)
+ inside the buildroot using rsync.
+
+ --uid uid:gid
+ Specify the uid and gid to use for the abuild user.
+ This is useful if you are hacking in the buildroot.
+ This must be set to the same value if the buildroot is re-used.
+
+ --vm-type TYPE
+ Use virtual machine instead of chroot
+ TYPE is one of xen|kvm|uml|qemu|lxc
+
+ --vm-disk FILE
+ Use FILE as disk for virtual machine.
+ Defaults to \$BUILD_ROOT.img if unset
+
+ --vm-swap FILE
+ Use FILE as swap space for virtual machine. The swap space is
+ also used for retrieving packages from the VM so its size must
+ be sufficiently large
+
+ --vm-disk-size SIZEINMB
+ --vm-swap-size SIZEINMB
+ --vm-disk-filesystem TYPE
+ Defaults for automatic setup of VM root/swap files
+
+ --vm-memory SIZEINMB
+ Set amount of RAM for VMs
+
+ --vm-kernel FILE
+ --vm-initrd FILE
+ Kernel and initrd to use for VM (kvm and qemu only)
+
+ --debug
+ Enable creation of a debuginfo package
+
Remember to have fun!
[*] Maximum RPM: http://www.rpm.org/max-rpm/
@@ -93,105 +296,548 @@ EOT
}
usage () {
echo "Usage: `basename $0` [--no-init|--clean|--rpms path|--verify|--help] [dir-to-build|spec-to-build]"
- cleanup_and_exit
-}
-
-function clean_build_root () {
- test -n "$BUILD_ROOT" && {
- umount -n $BUILD_ROOT/proc 2> /dev/null
- umount -n $BUILD_ROOT/dev/pts 2> /dev/null
- umount -n $BUILD_ROOT/mnt 2> /dev/null
- rm -rf $BUILD_ROOT/*
- }
+ cleanup_and_exit 1
}
#
# cleanup_and_exit
+# return values: 0 -> success, new packages built
+# 1 -> error, build failed
+# 2 -> successfull build, but no changes to former built packages
+# 3 -> something wrong with build host
#
cleanup_and_exit () {
- if test "$1" = 0 -o -z "$1" ; then
- exit 0
+ trap EXIT
+ test -z "$1" && set 0
+ rm -f $BUILD_ROOT/exit
+ if test "$1" -eq 1 -a -x /bin/df ; then
+ # okay, it failed, but maybe because disk space?
+ if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
+ set 3
+ fi
+ fi
+ if test -n "$RUNNING_IN_VM" ; then
+ test -n "$browner" && chown "$browner" $BUILD_ROOT
+ cd /
+ if test -n "$VM_SWAP" -a -e "$VM_SWAP" ; then
+ swapoff "$VM_SWAP" 2>/dev/null
+ echo -n "BUILDSTATUS$1" >"$VM_SWAP"
+ fi
+ exec >&0 2>&0 # so that the logging tee finishes
+ sleep 1 # wait till tee terminates
+ if test "$VM_TYPE" != lxc; then
+ kill -9 -1 # goodbye cruel world
+ if ! test -x /sbin/halt ; then
+ test -e /proc/sysrq-trigger || mount -n -tproc none /proc
+ sync
+ sleep 2 # like halt does
+ if test -e /proc/sysrq-trigger; then
+ echo o > /proc/sysrq-trigger
+ sleep 5 # wait for sysrq to take effect
+ else
+ echo "Warning: VM doesn't support sysrq and /sbin/halt not installed"
+ fi
+ else
+ halt -f -p
+ fi
+ echo "Warning: clean shut down of the VM didn't work"
+ fi
else
- exit $1
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
+ umount -n $BUILD_ROOT/proc 2>/dev/null || true
+ umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
+ test "$VM_IMAGE" = 1 && VM_IMAGE=
+ [ -n "$VM_IMAGE" ] && umount $BUILD_ROOT 2>/dev/null || true
fi
+# echo "pid $$ exit $1"
+ exit $1
+}
+
+fail_exit()
+{
+ cleanup_and_exit 1
}
-function create_baselibs {
- echo "... creating baselibs"
- BRPMS=
- for RPM in $BUILD_ROOT$TOPDIR/RPMS/*/*.rpm ; do
- BRPMS="$BRPMS ${RPM#$BUILD_ROOT}"
+shellquote()
+{
+ for arg; do
+ arg=${arg/\\/\\\\}
+ arg=${arg/\$/\\\$}
+ arg=${arg/\"/\\\"}
+ arg=${arg/\`/\\\`}
+ echo -n " \"$arg\""
done
+}
+
+# create a shell script from command line. Used for preserving arguments
+# through /bin/su -c
+toshellscript()
+{
+ echo "#!/bin/sh -x"
+ echo -n exec
+ shellquote "$@"
+ echo
+}
+
+setupccache()
+{
+ if [ "$ccache" = 1 ]; then
+ if mkdir -p $BUILD_ROOT/var/lib/build/ccache/bin; then
+ for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+])([-]?[234][.]?[0-9])*$'); do
+# ln -sf /usr/bin/ccache $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ rm -f $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ test -e $BUILD_ROOT/usr/bin/$i || continue
+ echo '#! /bin/sh' > $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ echo "test -e /usr/bin/$i || exit 1" >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ echo 'export PATH=/opt/icecream/bin:/usr/bin:$PATH' >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ echo "ccache $i \"\$@\"" >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ chmod 755 $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ echo "Installed ccache wrapper as $BUILD_ROOT/var/lib/build/ccache/bin/$i"
+ done
+ fi
+ mkdir -p "$BUILD_ROOT"/.ccache
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/.ccache"
+ echo "export CCACHE_DIR=/.ccache" > "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
+ echo 'export PATH=/var/lib/build/ccache/bin:$PATH' >> "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
+ else
+ rm -f "$BUILD_ROOT$builduserhome"/bin/{gcc,g++,cc,c++}
+ rm -f "$BUILD_ROOT"/var/lib/build/ccache/bin/{gcc,g++,cc,c++}
+ fi
+}
+
+setupicecream()
+{
+ if [ "$icecream" -eq 0 ]; then
+ rm -rf "$BUILD_ROOT"/var/run/icecream
+ rm -f "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
+ return
+ fi
+
+ if ! chroot "$BUILD_ROOT" rpm -q icecream >/dev/null 2>/dev/null; then
+ echo "*** icecream package not installed ***"
+ false
+ return
+ fi
+
+ echo "using icecream with $icecream jobs"
+
+ if [ "$ccache" -ne 1 ]; then
+ echo 'export PATH=/opt/icecream/bin:$PATH' > "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
+ else
+ echo 'export CCACHE_PATH=/opt/icecream/bin' > "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
+ fi
+
+ local icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
+ icecc_vers=${icecc_vers//$BUILD_ROOT/}
+
+ # XXX use changelog like autobuild does instead?
+ # only run create-env if compiler or glibc changed
+ if [ -z "$icecc_vers" \
+ -o ! -e "$BUILD_ROOT/$icecc_vers" \
+ -o "$BUILD_ROOT/usr/bin/gcc" -nt "$BUILD_ROOT/$icecc_vers" \
+ -o "$BUILD_ROOT/usr/bin/g++" -nt "$BUILD_ROOT/$icecc_vers" \
+ -o "$BUILD_ROOT/usr/bin/as" -nt "$BUILD_ROOT/$icecc_vers" \
+ -o "$BUILD_ROOT/lib/libc.so.6" -nt "$BUILD_ROOT/$icecc_vers" ]
+ then
+ rm -rf $BUILD_ROOT/var/run/icecream
+ mkdir -p $BUILD_ROOT/var/run/icecream
+ if [ -e "$BUILD_ROOT"/usr/bin/create-env ]; then
+ createenv=/usr/bin/create-env
+ elif [ -e "$BUILD_ROOT"/usr/lib/icecc/icecc-create-env ]; then
+ createenv="/usr/lib/icecc/icecc-create-env /usr/bin/gcc /usr/bin/g++" # XXX
+ elif [ -e "$BUILD_ROOT"/usr/lib64/icecc/icecc-create-env ]; then
+ createenv="/usr/lib64/icecc/icecc-create-env /usr/bin/gcc /usr/bin/g++" # XXX
+ else
+ echo "create-env not found"
+ false
+ return
+ fi
+ chroot $BUILD_ROOT bash -c "cd /var/run/icecream; $createenv" || cleanup_and_exit 1
+ icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
+ icecc_vers=${icecc_vers//$BUILD_ROOT/}
+ else
+ echo "reusing existing icecream environment $icecc_vers"
+ fi
+ if [ -n "$icecc_vers" ]; then
+ echo "export ICECC_VERSION=$icecc_vers" >> "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
+ fi
+}
+
+setmemorylimit()
+{
+ if [ -n "$VM_IMAGE" -o -n "$RUNNING_IN_VM" ]; then
+ return
+ fi
+ local mem
+ local limit
+ while read mem; do
+ case "$mem" in
+ MemTotal:*)
+ set -- $mem
+ eval "limit=\$(($2/3*4))"
+ ;;
+ SwapTotal:*)
+ set -- $mem
+ eval "limit=\$(($2/3*4+$limit))"
+ ;;
+ esac
+ done < <(cat /proc/meminfo) # cat for proc stuff
+
+ ulimit -v $limit
+ echo "Memory limit set to ${limit}KB"
+}
+
+create_baselibs()
+{
+ local pkgs=()
+ local line
+
BASELIBS_CFG=
- if test -e $BUILD_ROOT$TOPDIR/SOURCES/baselibs.conf ; then
- BASELIBS_CFG="-c $TOPDIR/SOURCES/baselibs.conf"
+
+ if test "$BUILDTYPE" == "arch" ; then
+ return
+ fi
+ if test "$BUILDTYPE" == "dsc" ; then
+ pkgs=($DEBS)
+ else # spec and kiwi
+ if test -e $BUILD_ROOT$TOPDIR/SOURCES/baselibs.conf ; then
+ BASELIBS_CFG="-c $TOPDIR/SOURCES/baselibs.conf"
+ fi
+ if test -e $BUILD_ROOT/usr/lib/build/baselibs_global.conf; then
+ BASELIBS_GLOBAL="-c /usr/lib/build/baselibs_global.conf"
+ fi
+ pkgs=($RPMS)
fi
- if test -f $BUILD_ROOT/usr/lib/build/mkbaselibs ; then
+
+ mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
+ # don't use -R as extracted sources, build root etc might be below $TOPDIR
+ chown "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"/* "$BUILD_ROOT$TOPDIR"/RPMS/* || true
+
+ local mkbaselibs="/usr/lib/build/mkbaselibs"
+ local whichone=''
+ # $BUILD_DIR is set to /.build when using a vm. So we need to
+ # hardcode /usr/lib/build instead of $BUILD_DIR to prefer
+ # mkbaselibs from the distro.
+ if test -f $BUILD_ROOT$mkbaselibs; then
if test -z "$BASELIBS_CFG" -a -e $BUILD_ROOT/usr/lib/build/baselibs.conf ; then
BASELIBS_CFG="-c /usr/lib/build/baselibs.conf"
fi
- chroot $BUILD_ROOT /usr/lib/build/mkbaselibs -c /usr/lib/build/baselibs_global.conf $BASELIBS_CFG $BRPMS || cleanup_and_exit 1
else
+ if test "$CREATE_BASELIBS" = 'internal'; then
+ echo "Warning: mkbaselibs missing in build root, skipping baselibs"
+ return
+ fi
# use external version
+ whichone=" (external)"
+ mkbaselibs="/.mkbaselibs/mkbaselibs"
rm -rf $BUILD_ROOT/.mkbaselibs
mkdir -p $BUILD_ROOT/.mkbaselibs
- cp -f $BUILD_DIR/mkbaselibs $BUILD_ROOT/.mkbaselibs
- cp -f $BUILD_DIR/baselibs_global.conf $BUILD_ROOT/.mkbaselibs
- if test -z "$BASELIBS_CFG" -a -e $BUILD_DIR/baselibs.conf ; then
- cp -f $BUILD_DIR/baselibs.conf $BUILD_ROOT/.mkbaselibs/baselibs.conf
- BASELIBS_CFG="-c /.mkbaselibs/baselibs.conf"
+ cp -f $BUILD_DIR/mkbaselibs $BUILD_ROOT/.mkbaselibs/
+ if test "$BUILDTYPE" == "dsc" ; then
+ cp -f $BUILD_DIR/baselibs_global-deb.conf $BUILD_ROOT/.mkbaselibs/baselibs_g.conf
+ cp -f $BUILD_ROOT$TOPDIR/SOURCES/baselibs-deb.conf $BUILD_ROOT/.mkbaselibs/baselibs-deb.conf
+ BASELIBS_CFG="-c /.mkbaselibs/baselibs-deb.conf"
+ else
+ cp -f $BUILD_DIR/baselibs_global.conf $BUILD_ROOT/.mkbaselibs/baselibs_g.conf
+ if test -z "$BASELIBS_CFG" -a -e $BUILD_DIR/baselibs.conf; then
+ cp -f $BUILD_DIR/baselibs.conf $BUILD_ROOT/.mkbaselibs/baselibs.conf
+ BASELIBS_CFG="-c /.mkbaselibs/baselibs.conf"
+ fi
+ fi
+ if test -e $BUILD_ROOT/.mkbaselibs/baselibs_g.conf; then
+ BASELIBS_GLOBAL="-c /.mkbaselibs/baselibs_g.conf"
fi
- chroot $BUILD_ROOT /.mkbaselibs/mkbaselibs -c /.mkbaselibs/baselibs_global.conf $BASELIBS_CFG $BRPMS || cleanup_and_exit 1
- rm -rf $BUILD_ROOT/.mkbaselibs
fi
+ echo "... creating baselibs$whichone"
+ while read line
+ do
+ chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
+ done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
+ rm -rf $BUILD_ROOT/.mkbaselibs
}
-DO_INIT=true
-CLEAN_BUILD=false
-SRCDIR=
-BUILD_JOBS=
-ABUILD_TARGET_ARCH=
-CREATE_BASELIBS=
-USEUSEDFORBUILD=
-XENIMAGE=
-XENSWAP=
-XENMEMORY=
-BUILD_INIT_BUILDSYSTEM=init_buildsystem
-RUNNING_IN_XEN=
-RPMLIST=
-RELEASE=
-REASON=
-NOROOTFORBUILD=
+copy_oldpackages()
+{
+ local i=0
+ local d
+ local dest
+ [ -z "$RUNNING_IN_VM" ] || return 0
+ if [ -z "$old_packages" ]; then
+ rm -rf "$BUILD_ROOT"/.build.oldpackages*
+ return 0
+ fi
+ for d in "${old_packages[@]}"; do
+ dest="$BUILD_ROOT/.build.oldpackages"
+ test "$i" = 0 || dest="$dest$i"
+ if [ -d "$d" -a "$d" != "$dest" ] ; then
+ rm -rf "$dest"
+ mkdir -p "$dest"
+ cp -L $d/* "$dest"
+ : $((++i))
+ fi
+ done
+}
+
+vm_img_mkfs()
+{
+ local fs="$1"
+ local img="$2"
+ local mkfs tunefs
+ eval "mkfs=\"\$vm_img_mkfs_${fs}\""
+ eval "tunefs=\"\$vm_img_tunefs_${fs}\""
+
+ if test -z "$mkfs"; then
+ echo "filesystem \"$fs\" isn't supported"
+ cleanup_and_exit 3
+ fi
+
+
+ echo "Creating $fs filesystem on $img"
+ $mkfs "$img"
+ if test -n "$tunefs" ; then
+ $tunefs "$img" || cleanup_and_exit 3
+ fi
+
+}
-if test "$0" = "/.build/build" ; then
+detect_vm_2nd_stage()
+{
+ if ! test "$0" = "/.build/build" ; then
+ return 1
+ fi
+ if test $$ -eq 1 ; then
+ # ignore special init signals if we're init
+ # we're using ' ' instead of '' so that the signal handlers
+ # are reset in the child processes
+ trap ' ' HUP TERM
+ $0 "$@"
+ cleanup_and_exit $?
+ fi
+ echo "2nd stage started in virtual machine"
BUILD_ROOT=/
BUILD_DIR=/.build
. $BUILD_DIR/build.data
- PATH=$BUILD_DIR:$PATH
- RUNNING_IN_XEN=true
- if test -n "$XENSWAP" ; then
+ echo "machine type: `uname -m`"
+ if test "$PERSONALITY" != 0 -a -z "$PERSONALITY_SET" ; then
+ export PERSONALITY_SET=true
+ echo "switching personality to $PERSONALITY..."
+ # this is 32bit perl/glibc, thus the 32bit syscall number
+ exec perl -e 'syscall(136, '$PERSONALITY') == -1 && warn("personality: $!\n");exec "/.build/build" || die("/.build/build: $!\n")'
+ fi
+ RUNNING_IN_VM=true
+ mount -orw -n -tproc none /proc
+ if test "$VM_TYPE" != 'lxc'; then
+ mount -n ${VMDISK_MOUNT_OPTIONS},remount,rw /
+ fi
+# qemu inside of xen does not work, check again with kvm later before enabling this
+# if [ -e /dev/kqemu ]; then
+# # allow abuild user to run qemu
+# chmod 0666 /dev/kqemu
+# fi
+ if test -n "$VM_SWAP" ; then
for i in 1 2 3 4 5 6 7 8 9 10 ; do
- test -e "$XENSWAP" && break
- test $i = 1 && echo "waiting for $XENSWAP to appear"
+ test -e "$VM_SWAP" && break
+ test $i = 1 && echo "waiting for $VM_SWAP to appear"
echo -n .
sleep 1
done
test $i = 1 || echo
- cp -a "$XENSWAP" /.build/swapdev
+ # recreate the swap device manually if it didn't exist for some
+ # reason, hardcoded to hda2 atm
+ if ! test -b "$VM_SWAP" ; then
+ rm -f "$VM_SWAP"
+ umask 027
+ mknod "$VM_SWAP" b 3 2
+ umask 022
+ fi
+ swapon -v "$VM_SWAP" || exit 1
+ fi
+ HOST="$MYHOSTNAME"
+
+ return 0
+}
+
+find_spec_files()
+{
+ local spec files
+ if [ -z "$SPECFILES" ]; then
+ set -- "`pwd`"
+ else
+ set -- "${SPECFILES[@]}"
+ fi
+ SPECFILES=()
+ for spec in "$@"; do
+ if [ "$spec" = "${spec#/}" ]; then
+ spec="`pwd`/$spec"
+ fi
+
+ if [ -d "$spec" ]; then
+ specs=("$spec"/*.spec)
+ if [ -n "$specs" ]; then
+ SPECFILES=("${SPECFILES[@]}" "${specs[@]}")
+ else
+ specs=("$spec"/*.spec)
+ if [ -n "$specs" ]; then
+ SPECFILES=("${SPECFILES[@]}" "${specs[@]}")
+ fi
+ fi
+ else
+ SPECFILES[${#SPECFILES[@]}]="$spec";
+ fi
+ done
+
+ if test -z "$SPECFILES"; then
+ echo no spec files or src rpms found in $@. exit...
+ cleanup_and_exit 1
fi
- umount -l /dev 2>/dev/null
- mount -orw -n -tproc none /proc 2>/dev/null
- if test -n "$XENSWAP" ; then
- rm -f "$XENSWAP"
- cp -a /.build/swapdev "$XENSWAP"
- swapon -v "$XENSWAP" || exit 1
+}
+
+become_root_or_fail()
+{
+ if [ ! -w /root ]; then
+ echo "You have to be root to use $0" >&2
+ exit 1
fi
+ cleanup_and_exit 1
+}
+
+mkdir_build_root()
+{
+ if [ -d "$BUILD_ROOT" ]; then
+ # check if it is owned by root
+ if [ -z "$RUNNING_IN_VM" -a \! -O "$BUILD_ROOT" -a "`stat -c %u $BUILD_ROOT`" -ne 0 ]; then
+ echo "BUILD_ROOT=$BUILD_ROOT must be owned by root. Exit..."
+ cleanup_and_exit 1
+ fi
+ else
+ test "$BUILD_ROOT" != "${BUILD_ROOT%/*}" && mkdir -p "${BUILD_ROOT%/*}"
+ if ! mkdir $BUILD_ROOT; then
+ echo "can not create BUILD_ROOT=$BUILD_ROOT. Exit..."
+ cleanup_and_exit 1
+ fi
+ fi
+
+ if [ ! -w "$BUILD_ROOT" ]; then
+ echo "Error: BUILD_ROOT=$BUILD_ROOT not writeable, try --clean."
+ cleanup_and_exit 3
+ fi
+
+ rm -rf "$BUILD_ROOT"/.build.packages
+ if [ -z "$VM_TYPE" -a -z "$RUNNING_IN_VM" ]; then
+ # don't touch this in VM
+ rm -rf "$BUILD_ROOT"/.build
+ mkdir -p "$BUILD_ROOT"/.build
+ fi
+}
+
+linux64()
+{
+ perl -e 'syscall('$PERSONALITY_SYSCALL', 0); exec(@ARGV) || die("$ARGV[0]: $!\n")' "$@"
+}
+
+
+hide_passwords()
+{
+ local i j
+ r=()
+ rm -f $HOME/.repo.config
+ for i in "${repos[@]}"; do
+ if [ "$i" == "--repo" -o "$i" == "--repository" ]; then
+ r=("${r[@]}" "$i")
+ else
+ echo $i |grep -E "^http[s]?:\/\/[^\/]*\/?" >/dev/null && echo $i >> $HOME/.repo.config
+ j=$(echo $i | sed -e "s#://[^@]*@#://#")
+ r=("${r[@]}" "$j")
+ fi
+ done
+ repos=("${r[@]}")
+ echo ${repos[@]}
+}
+
+
+check_for_ppc()
+{
+ local uname
+
+ uname=$(uname -m)
+
+ if [ "$uname" != "ppc" -a "$uname" != "ppc64" ]; then
+ return
+ fi
+
+ export HOST_ARCH=ppc
+
+ # XXX is this ok for ppc32 hosts? do we care?
+ export kvm_bin="/usr/bin/qemu-system-ppc64"
+ export console=hvc0
+ # XXX check host CPU and adjust guest CPU accordingly
+ export KVM_OPTIONS="-enable-kvm -M pseries -mem-path /hugetlbfs"
+ export VM_KERNEL=/boot/vmlinux
+ export VM_INITRD=/boot/initrd
+ if [ -z "$RUNNING_IN_VM" -a "$VM_TYPE" = "kvm" ];then
+ cat /proc/mounts | grep "/hugetlbfs" &>/dev/null
+ if [ "$?" != "0" ];then
+ echo "hugetlbfs is not mounted"
+ exit 1
+ fi
+ PAGES_FREE=$(cat /sys/kernel/mm/hugepages/hugepages-16384kB/free_hugepages)
+ PAGES_REQ=$(( $MEMSIZE / 16 ))
+ if [ "$PAGES_FREE" -lt "$PAGES_REQ" ];then
+ echo "please adjust nr_hugepages"
+ exit 1
+ fi
+ grep kvm_rma_count /proc/cmdline &>/dev/null
+ if [ "$?" != "0" ];then
+ echo "put kvm_rma_count=<VM number> to your boot options"
+ exit 1
+ fi
+ grep kvm_hpt_count /proc/cmdline &>/dev/null
+ if [ "$?" != "0" ];then
+ echo "put kvm_hpt_count=<VM number> to your boot options"
+ exit 1
+ fi
+ fi
+}
+
+#### main ####
+
+trap fail_exit EXIT
+
+archname=`perl -V:archname`
+archname="${archname#archname=?}"
+case "$archname" in
+ x86_64*) PERSONALITY_SYSCALL=135 ;;
+ alpha*) PERSONALITY_SYSCALL=324 ;;
+ sparc*) PERSONALITY_SYSCALL=191 ;;
+ i?86*|ppc*|arm*|sh4|cris|m68k|s390*|unicore32|microblaze) PERSONALITY_SYSCALL=136 ;;
+ *) echo "ARCHITECTURE PERSONALITY IS UNKNOWN"; exit 1;;
+esac
+
+shopt -s nullglob
+
+if detect_vm_2nd_stage ; then
set "/.build-srcdir/$SPECFILE"
+
fi
+export PATH=$BUILD_DIR:/sbin:/usr/sbin:$PATH
+
+. $BUILD_DIR/common_functions || exit 1
+
+export HOST
+
+needarg()
+{
+ if [ -z "$ARG" ]; then
+ echo "$PARAM needs an agrument" >&2
+ cleanup_and_exit 1
+ fi
+}
+
while test -n "$1"; do
PARAM="$1"
ARG="$2"
+ [ "$ARG" = "${ARG#-}" ] || ARG=""
shift
case $PARAM in
*-*=*)
@@ -201,300 +847,977 @@ while test -n "$1"; do
esac
case $PARAM in
*-help|-h)
- echo_help
- cleanup_and_exit
+ echo_help
+ cleanup_and_exit
;;
*-no*init)
- DO_INIT=false
+ DO_INIT=false
+ ;;
+ *-no*checks)
+ DO_CHECKS=false
;;
*-clean)
- CLEAN_BUILD=true
+ CLEAN_BUILD='--clean'
+ ;;
+ *-kill)
+ KILL=true
;;
*-rpms)
- BUILD_RPMS="$ARG"
- if [ -z "$BUILD_RPMS" ] ; then
- echo_help
- cleanup_and_exit
- fi
- shift
+ needarg
+ BUILD_RPMS="$ARG"
+ shift
;;
*-arch)
- BUILD_ARCH="$ARG"
- shift
+ needarg
+ BUILD_ARCH="$ARG"
+ shift
;;
*-verify)
- export VERIFY_BUILD_SYSTEM=true
+ export VERIFY_BUILD_SYSTEM=true
;;
*-target)
- ABUILD_TARGET_ARCH="$ARG"
+ needarg
+ ABUILD_TARGET="$ARG"
shift
;;
- *-jobs)
+ *-jobs)
+ needarg
BUILD_JOBS="$ARG"
shift
;;
*-extra*packs|-X)
- BUILD_EXTRA_PACKS="$BUILD_EXTRA_PACKS $ARG"
- shift
+ needarg
+ BUILD_EXTRA_PACKS="$BUILD_EXTRA_PACKS $ARG"
+ shift
;;
+ *-lint)
+ DO_LINT=true
+ ;;
*-baselibs)
- CREATE_BASELIBS=true
- ;;
+ CREATE_BASELIBS=true
+ ;;
+ *-baselibs-internal)
+ CREATE_BASELIBS=internal
+ ;;
+ *-use-system-qemu)
+ USE_SYSTEM_QEMU="--use-system-qemu"
+ ;;
*-root)
- BUILD_ROOT="$ARG"
- shift
+ needarg
+ BUILD_ROOT="$ARG"
+ shift
;;
- *-dist)
+ *-cachedir)
+ needarg
+ CACHE_DIR="$ARG"
+ shift
+ ;;
+ *-oldpackages)
+ needarg
+ old_packages=("${old_packages[@]}" "$ARG")
+ shift
+ ;;
+ *-dist)
+ needarg
BUILD_DIST="$ARG"
- export BUILD_DIST
shift
;;
- *-xen)
- XENIMAGE="$ARG"
- shift
+ *-xen|*-kvm|--uml|--qemu)
+ VM_TYPE=${PARAM##*-}
+ if [ -n "$ARG" ]; then
+ VM_IMAGE="$ARG"
+ shift
+ else
+ VM_IMAGE=1
+ fi
+ ;;
+ --lxc)
+ VM_TYPE=${PARAM##*-}
+ ;;
+ --vm-type)
+ needarg
+ VM_TYPE="$ARG"
+ case "$VM_TYPE" in
+ xen|kvm|uml|qemu|lxc)
+ test -z "$VM_IMAGE" && VM_IMAGE=1
+ ;;
+ none|chroot) VM_TYPE='' ;;
+ *)
+ echo "VM $VM_TYPE not supported"
+ cleanup_and_exit
+ ;;
+ esac
+ shift
+ ;;
+ --vm-disk)
+ needarg
+ VM_IMAGE="$ARG"
+ shift
+ ;;
+ *-xenswap|*-swap)
+ needarg
+ VM_SWAP="$ARG"
+ shift
;;
- *-xenswap)
- XENSWAP="$ARG"
- shift
+ *-xenmemory|*-memory)
+ needarg
+ MEMSIZE="$ARG"
+ shift
;;
- *-xenmemory)
- XENMEMORY="memory=$ARG"
- shift
+ *-vm-kernel)
+ needarg
+ VM_KERNEL="$ARG"
+ shift
+ ;;
+ *-vm-initrd)
+ needarg
+ VM_INITRD="$ARG"
+ shift
+ ;;
+ *-vmdisk-rootsize|--vm-disk-size)
+ needarg
+ VMDISK_ROOTSIZE="$ARG"
+ shift
+ ;;
+ *-vmdisk-swapsize|--vm-swap-size)
+ needarg
+ VMDISK_SWAPSIZE="$ARG"
+ shift
+ ;;
+ *-vmdisk-filesystem|--vm-disk-filesystem)
+ needarg
+ VMDISK_FILESYSTEM="$ARG"
+ shift
+ ;;
+ *-vmdisk-mount-options|--vm-disk-mount-options)
+ needarg
+ # options needs to be quoted to handle argument which might start with "-o ..."
+ VMDISK_MOUNT_OPTIONS=$(echo $ARG | sed 's/^\"\(.*\)\"$/\1/g')
+ shift
;;
*-rpmlist)
- RPMLIST="--rpmlist $ARG"
+ needarg
+ RPMLIST="--rpmlist $ARG"
BUILD_RPMS=
- shift
+ shift
;;
*-release)
- RELEASE="--release $ARG"
- shift
+ needarg
+ RELEASE="$ARG"
+ shift
+ ;;
+ *-logfile)
+ needarg
+ LOGFILE="$ARG"
+ shift
;;
*-reason)
- REASON="$ARG"
- shift
+ needarg
+ REASON="$ARG"
+ shift
;;
*-norootforbuild)
- NOROOTFORBUILD=true
+ NOROOTFORBUILD=true
;;
*-stage)
- BUILD_RPM_BUILD_STAGE="$ARG"
- shift
+ needarg
+ BUILD_RPM_BUILD_STAGE="$ARG"
+ shift
+ ;;
+ *-short-circuit)
+ SHORT_CIRCUIT=true
+ ;;
+ *-no-topdir-cleanup)
+ NO_TOPDIR_CLEANUP=true
;;
*-useusedforbuild)
- USEUSEDFORBUILD="--useusedforbuild"
+ USEUSEDFORBUILD="--useusedforbuild"
+ ;;
+ *-configdir)
+ CONFIG_DIR="$ARG"
+ ;;
+ *-list*state)
+ LIST_STATE=true
+ ;;
+ --define|--with|--without)
+ needarg
+ definesnstuff[${#definesnstuff[@]}]="$PARAM";
+ definesnstuff[${#definesnstuff[@]}]="$ARG";
+ shift
+ ;;
+ --repository|--repo)
+ needarg
+ repos[${#repos[@]}]="$PARAM";
+ repos[${#repos[@]}]="$ARG";
+ shift
+ ;;
+ --icecream)
+ needarg
+ icecream="$ARG"
+ if [ "$icecream" -gt 0 ]; then
+ BUILD_JOBS="$ARG"
+ fi
+ shift
+ ;;
+ --ccache)
+ ccache=1
+ ;;
+ --debug)
+ BUILD_DEBUG=1
+ ;;
+ --incarnation)
+ needarg
+ INCARNATION=$ARG
+ shift
+ ;;
+ --disturl)
+ needarg
+ DISTURL=$ARG
+ shift
+ ;;
+ --linksources)
+ LINKSOURCES=true
;;
----noarg)
- echo "$ARG does not take an argument"
- cleanup_and_exit
+ echo "$ARG does not take an argument"
+ cleanup_and_exit
+ ;;
+ *-changelog)
+ CHANGELOG=true
+ ;;
+ --overlay)
+ needarg
+ OVERLAY=$ARG
+ shift
+ ;;
+ --rsync-src)
+ needarg
+ RSYNCSRC=$ARG
+ shift
+ ;;
+ --rsync-dest)
+ needarg
+ RSYNCDEST=$ARG
+ shift
+ ;;
+ --uid)
+ needarg
+ ABUILD_ID="$ARG"
+ if test -n "${ABUILD_ID//[0-9:]/}"; then
+ echo "--uid argument must be uid:gid"
+ cleanup_and_exit
+ fi
+ ABUILD_UID=${ABUILD_ID%:*}
+ ABUILD_GID=${ABUILD_ID#*:}
+ shift
+ ;;
+ --shell)
+ shell=1
+ shift
+ ;;
+ --signdummy)
+ SIGNDUMMY=1
;;
-*)
- echo Unknown Option "$PARAM". Exit.
- cleanup_and_exit 1
+ echo Unknown Option "$PARAM". Exit.
+ cleanup_and_exit 1
;;
*)
- test -n "$SRCDIR" && usage
- SRCDIR="$PARAM"
+ SPECFILES[${#SPECFILES[@]}]="$PARAM";
;;
esac
done
-test $UID != 0 && {
- echo You have to be root to use $0. Exit.
+check_for_ppc
+hide_passwords
+if [ -n "$SHORT_CIRCUIT" -a -z "$BUILD_RPM_BUILD_STAGE" ]; then
+ echo "--short-circuit needs a stage (use --stage)"
cleanup_and_exit 1
-}
+fi
-case $BUILD_ARCH in
-i686) BUILD_ARCH="i686:i586:i486:i386" ;;
-i586) BUILD_ARCH="i586:i486:i386" ;;
-i486) BUILD_ARCH="i486:i386" ;;
-x86_64) BUILD_ARCH="x86_64:i686:i586:i486:i386" ;;
-esac
-if test "$BUILD_ARCH" != "${BUILD_ARCH#i686}" ; then
- cpuflags=`grep ^flags /proc/cpuinfo`
- cpuflags="$cpuflags "
- test "$cpuflags" = "${cpuflags/ cx8 /}" -o "$cpuflags" = "${cpuflags/ cmov /}" && {
- echo "Your cpu doesn't support i686 rpms. Exit."
- exit 1
- }
+if test "$VM_TYPE" = "lxc"; then
+ VM_IMAGE=''
+ VM_SWAP=''
fi
-if test "`echo $SRCDIR | cut -c 1`" != "/" ; then
- SRCDIR=`pwd`/$SRCDIR
+if test "$VMDISK_MOUNT_OPTIONS" = __default; then
+ if test "$VMDISK_FILESYSTEM" = reiserfs ; then
+ VMDISK_MOUNT_OPTIONS='-o data=writeback,commit=150,noatime'
+ else
+ VMDISK_MOUNT_OPTIONS='-o data=writeback,nobarrier,commit=150,noatime'
+ fi
fi
-if test -f $SRCDIR ; then
- SPECFILES=`basename $SRCDIR`
- SRCDIR=`dirname $SRCDIR`
-else
- SPECFILES=""
- for i in $SRCDIR/*.spec ; do
- SPECFILES="$SPECFILES `basename $i`"
- done
- test -z "$SPECFILES" && {
- for i in $SRCDIR/*.src.rpm ; do
- SPECFILES="$SPECFILES `basename $i`"
- done
- }
+if test -n "$KILL" ; then
+ test -z "$SRCDIR" || usage
+ if test -n "$VM_IMAGE" -a -n "$VM_SWAP" -a -n "$VM_TYPE"; then
+ # mark job as failed so that we don't extract packages
+ echo -n "BUILDSTATUS1" >"$VM_SWAP"
+ fi
+ (set -C; > "$BUILD_ROOT/exit" 2>/dev/null || true)
+ if test "$VM_TYPE" = 'lxc'; then
+ LXCID=${BUILD_ROOT##*/}
+ lxc-stop -n "$LXCID" || true
+ lxc-destroy -n "$LXCID"
+ elif test -z "$VM_IMAGE" ; then
+ if ! $BUILD_DIR/killchroot -s 9 $BUILD_ROOT ; then
+ echo "could not kill build in $BUILD_ROOT"
+ cleanup_and_exit 1
+ fi
+ elif test "$VM_TYPE" = 'xen'; then
+ XENID="${VM_IMAGE%/root}"
+ XENID="${XENID%/tmpfs}"
+ XENID="${XENID##*/}"
+ XENID="${XENID#root_}"
+ if xm list "build_$XENID" >/dev/null 2>&1 ; then
+ if ! xm destroy "build_$XENID" ; then
+ echo "could not kill xen build $XENID"
+ cleanup_and_exit 1
+ fi
+ fi
+ elif test -n "$VM_TYPE"; then
+ if ! fuser -k -TERM "$VM_IMAGE"; then
+ echo "could not kill build in $VM_IMAGE"
+ cleanup_and_exit 1
+ fi
+ else
+ echo "don't know how to kill this build job"
+ cleanup_and_exit 1
+ fi
+ cleanup_and_exit 0
fi
-test -z "$SPECFILES" && {
- echo no spec files and src rpms found in $SRCDIR. exit...
- cleanup_and_exit 1
-}
+if [ "$VM_TYPE" = 'xen' -a -z "$RUNNING_IN_VM" ]; then
+ # XXX: merge with kvm path?
+ if [ -n "$VM_KERNEL" ]; then
+ vm_kernel="$VM_KERNEL"
+ elif [ -e "/boot/vmlinuz-xen" ]; then
+ vm_kernel="/boot/vmlinuz-xen"
+ fi
+ if [ -n "$VM_INITRD" ]; then
+ vm_initrd="$VM_INITRD"
+ elif [ -e "/boot/initrd-xen" ]; then
+ vm_initrd="/boot/initrd-xen"
+ fi
+fi
-if test -z "$SRCDIR" -o ! -d "$SRCDIR" ; then
- echo Usage: $0 \<src-dirctory\>
- cleanup_and_exit 1
+if [ "$VM_TYPE" = 'kvm' -a -z "$RUNNING_IN_VM" ]; then
+ if [ ! -r /dev/kvm -o ! -x "$kvm_bin" ]; then
+ echo "host doesn't support kvm"
+ echo "either the kvm kernel-module is not loaded or kvm is not installed or hardware virtualization is deactivated in the BIOS."
+ cleanup_and_exit 3
+ fi
+ qemu_bin="$kvm_bin"
+ if [ -n "$VM_KERNEL" ]; then
+ vm_kernel="$VM_KERNEL"
+ fi
+
+ # check if a SUSE system with virtio initrd is running
+ if [ -z "$VM_INITRD" -a -e /etc/sysconfig/kernel ]; then
+ a=$( source /etc/sysconfig/kernel; echo $INITRD_MODULES )
+ have_virtio_pci=""
+ have_virtio_blk=""
+ for i in $a; do
+ [ "$i" == "virtio_pci" ] && have_virtio_pci="1"
+ [ "$i" == "virtio_blk" ] && have_virtio_blk="1"
+ done
+ [ -n "$have_virtio_pci" -a -n "$have_virtio_blk" ] && VM_INITRD="/boot/initrd"
+ fi
+
+ if [ -n "$VM_INITRD" ]; then
+ vm_initrd="$VM_INITRD"
+ kvm_virtio=1
+ elif [ -e "${vm_initrd}-build" ]; then
+ vm_initrd="${vm_initrd}-build"
+ kvm_virtio=1
+ else
+ if [ -L "$vm_initrd" ]; then
+ vm_initrd=`readlink -f "$vm_initrd"` || cleanup_and_exit 3
+ fi
+ vm_initrd_virtio="${vm_initrd}-virtio"
+
+ if [ ! -e ${vm_initrd_virtio} -o $vm_kernel -nt ${vm_initrd_virtio} ]; then
+ mkinitrd_virtio_cmd=(env rootfstype="$VMDISK_FILESYSTEM" \
+ mkinitrd -d /dev/null \
+ -m "ext3 ext4 btrfs reiserfs binfmt_misc virtio_pci virtio_blk" \
+ -k $vm_kernel \
+ -i ${vm_initrd_virtio})
+ if [ ! -w /root -o -n "$RPMLIST" ]; then
+ echo "No initrd that provides virtio support found. virtio accelleration disabled."
+ echo "Run the following command as root to enable virtio:"
+ shellquote "${mkinitrd_virtio_cmd[@]}"
+ echo
+ elif /sbin/modinfo virtio_pci >/dev/null 2>&1; then
+ echo "creating $vm_initrd_virtio"
+ "${mkinitrd_virtio_cmd[@]}" || cleanup_and_exit 1
+ kvm_virtio=1
+ vm_initrd="${vm_initrd_virtio}"
+ fi
+ else
+ kvm_virtio=1
+ vm_initrd="${vm_initrd_virtio}"
+ fi
+ fi
+
+ if [ "$HOST_ARCH" = ppc ]; then
+ # KVM on PPC can not run virtio yet, so we need to use the default vio
+ kvm_virtio=
+ fi
+
+ if [ "$kvm_virtio" = 1 ]; then
+ VM_SWAPDEV=/dev/vdb
+ qemu_rootdev=/dev/vda
+ else
+ VM_SWAPDEV=/dev/sdb
+ qemu_rootdev=/dev/sda
+ fi
fi
-if test -d "$BUILD_ROOT" ; then
- # check if it is owned by root
- test -O "$BUILD_ROOT" || {
- echo "BUILD_ROOT=$BUILD_ROOT must be owned by root. Exit..."
- cleanup_and_exit 1
- }
+if [ "$VM_TYPE" = 'qemu' ]; then
+ VM_SWAPDEV=/dev/sdb
+ qemu_rootdev=/dev/sda
+fi
+
+if [ -z "$RPMLIST" -a -z "$RUNNING_IN_VM" ]; then
+ if [ -z "$repos" -a -z "$BUILD_RPMS" ]; then
+ repos=(--repository 'zypp://')
+ fi
else
- test "$BUILD_ROOT" != "${BUILD_ROOT%/*}" && mkdir -p "${BUILD_ROOT%/*}"
- mkdir $BUILD_ROOT || {
- echo "can not create BUILD_ROOT=$BUILD_ROOT. Exit..."
- cleanup_and_exit 1
- }
+ repos=()
fi
-if test -n "$XENIMAGE" ; then
- umount -n $BUILD_ROOT/proc 2> /dev/null
- umount -n $BUILD_ROOT/dev/pts 2> /dev/null
- umount -t loop $BUILD_ROOT 2>/dev/null
- if test "$CLEAN_BUILD" = true ; then
- echo "Creating filesystem on $XENIMAGE"
- if ! echo y | mkfs -t reiserfs -f $XENIMAGE >/dev/null 2>&1 ; then
- if ! echo y | mkfs -t reiserfs -f $XENIMAGE ; then
- cleanup_and_exit 1
+set_build_arch
+
+if [ -n "$CLEAN_BUILD" ]; then
+ DO_INIT=true
+fi
+
+find_spec_files
+
+if test -n "$LIST_STATE" ; then
+ BUILD_ROOT=`mktemp -d /var/tmp/build-list-state-XXXXXX`
+ test -d "$BUILD_ROOT" || cleanup_and_exit 3
+ SPECFILE=$SPECFILES # only one specified anyways
+ if test "$SPECFILE" != "${SPECFILE%.src.rpm}" ; then
+ rm -rf $BUILD_ROOT/usr/src/packages
+ mkdir -p $BUILD_ROOT/usr/src/packages/SOURCES $BUILD_ROOT/usr/src/packages/SPECS
+ rpm -i --nodigest --nosignature --root $BUILD_ROOT $SPECFILE || {
+ echo "could not install $SPECFILE." 2>&1
+ rm -rf $BUILD_ROOT
+ cleanup_and_exit 3
+ }
+ for SPECFILE in $BUILD_ROOT/usr/src/packages/SPECS/*.spec ; do : ; done
+ fi
+ init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $SPECFILE $BUILD_EXTRA_PACKS
+ ERR=$?
+ rm -rf $BUILD_ROOT
+ cleanup_and_exit $ERR
+fi
+
+if test -z "$RUNNING_IN_VM" ; then
+ if test -n "$VM_IMAGE" ; then
+ if test "$VM_IMAGE" = 1 ; then
+ VM_IMAGE="$BUILD_ROOT.img"
+ echo "using $VM_IMAGE as vm image"
+ if test -z "$VM_SWAP"; then
+ VM_SWAP="$BUILD_ROOT.swap"
+ echo "using $VM_SWAP as vm swap"
+ fi
+ fi
+ if [ "$VM_TYPE" = 'xen' ]; then
+ # this should not be needed, but sometimes a xen instance got lost
+ XENID="${VM_IMAGE%/root}"
+ XENID="${XENID%/tmpfs}"
+ XENID="${XENID##*/}"
+ XENID="${XENID#root_}"
+ xm destroy "build_$XENID" >/dev/null 2>&1
+ fi
+ if test ! -e "$VM_IMAGE"; then
+ echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)"
+ mkdir -p "${VM_IMAGE%/*}"
+ dd if=/dev/zero of="$VM_IMAGE" bs=1M count=0 seek="$VMDISK_ROOTSIZE" || cleanup_and_exit 3
+ if test -z "$CLEAN_BUILD" ; then
+ vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3
fi
fi
+ if test -n "$VM_SWAP" -a ! -e "$VM_SWAP"; then
+ # setup VM_SWAP
+ echo "Creating $VM_SWAP (${VMDISK_SWAPSIZE}M)"
+ mkdir -p "${VM_SWAP%/*}"
+ dd if=/dev/zero of="$VM_SWAP" bs=1M count=0 seek="$VMDISK_SWAPSIZE" || cleanup_and_exit 3
+ fi
+ if test ! -e "$VM_IMAGE" ; then
+ echo "you need to create $VM_IMAGE first"
+ cleanup_and_exit 3
+ fi
+ if test -n "$CLEAN_BUILD" ; then
+ vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3
+ fi
+ mkdir_build_root
+ if [ -w /root ]; then
+ if [ -b $VM_IMAGE ]; then
+ # mount device directly
+ mount $VMDISK_MOUNT_OPTIONS $VM_IMAGE $BUILD_ROOT || cleanup_and_exit 3
+ else
+ mount ${VMDISK_MOUNT_OPTIONS},loop $VM_IMAGE $BUILD_ROOT || cleanup_and_exit 3
+ fi
+ else
+ if ! mount $BUILD_ROOT; then
+ echo "mounting the build root failed. An fstab entry is probably missing or incorrect."
+ echo "/etc/fstab should contain an entry like this:"
+ echo "$VM_IMAGE $BUILD_ROOT auto noauto,user,loop 0 0"
+ cleanup_and_exit 3
+ fi
+ fi
+ else
+ test -w /root || become_root_or_fail
fi
- mount -oloop $XENIMAGE $BUILD_ROOT || cleanup_and_exit 1
- if test -n "$XENSWAP" ; then
- mkswap "$XENSWAP"
+ if test -n "$VM_SWAP" ; then
+ dd if=/dev/zero of="$VM_SWAP" bs=12 count=1 conv=notrunc 2>/dev/null
+ echo "mkswap $VM_SWAP"
+ mkswap "$VM_SWAP"
fi
fi
+mkdir_build_root
+
+if [ "$BUILD_ROOT" = / ]; then
+ read dummy dummy browner dummy < <(ls -ld /)
+fi
+
rm -f $BUILD_ROOT/exit
-if test -z "$XENIMAGE" ; then
- echo logging output to $BUILD_ROOT/.build.log...
- rm -f $BUILD_ROOT/.build.log
- touch $BUILD_ROOT/.build.log
- exec 1> >(exec -a 'build logging tee' tee -a $BUILD_ROOT/.build.log) 2>&1
+if [ -w /root ]; then
+ mkdir -p $BUILD_ROOT/proc
+ mkdir -p $BUILD_ROOT/dev/pts
+ mount -n -tproc none $BUILD_ROOT/proc || true
+ mount -n -tdevpts none $BUILD_ROOT/dev/pts
+fi
+
+if test -z "$VM_IMAGE" -a -z "$LOGFILE"; then
+ LOGFILE="$BUILD_ROOT/.build.log"
+fi
+
+if test -n "$LOGFILE" -a -z "$shell" ; then
+ echo logging output to $LOGFILE...
+ rm -f $LOGFILE
+ touch $LOGFILE
+ if test -n "$VM_IMAGE" ; then
+ exec 1> >(exec -a 'build logging tee' perl -e 'open(F,">>",$ARGV[0])||die("$ARGV[0]: $!\n");$|=1;select(F);$|=1;while(<STDIN>){print STDOUT;s/^\r//s;s/\r\n/\n/gs;print F}' $LOGFILE) 2>&1
+ else
+ exec 1> >(exec -a 'build logging tee' tee -a $LOGFILE) 2>&1
+ fi
fi
+setmemorylimit
+
#
# say hello
#
-echo $HOST started \"build $SPECFILES\" at `date`.
-echo
-test -n "$REASON" && echo "$REASON"
-echo Using BUILD_ROOT=$BUILD_ROOT
-test -n "$BUILD_RPMS" && echo Using BUILD_RPMS=$BUILD_RPMS
-echo Using BUILD_ARCH=$BUILD_ARCH
-test -n "$XENIMAGE" && echo "Doing XEN build in $XENIMAGE"
-echo
+test -z "$HOST" && HOST=`hostname`
+
+if [ -z "$RUNNING_IN_VM" ]; then
+ echo Using BUILD_ROOT=$BUILD_ROOT
+ test -n "$BUILD_RPMS" && echo Using BUILD_RPMS=$BUILD_RPMS
+ echo Using BUILD_ARCH=$BUILD_ARCH
+ test -n "$VM_TYPE" && echo "Doing $VM_TYPE build${VM_IMAGE:+ in $VM_IMAGE}"
+ echo
+fi
test "$BUILD_ARCH" = all && BUILD_ARCH=
+BUILD_USER_ABUILD_USED=
-cd $SRCDIR
+for SPECFILE in "${SPECFILES[@]}" ; do
+
+ SRCDIR="${SPECFILE%/*}"
+ SPECFILE="${SPECFILE##*/}"
+
+ BUILDTYPE=
+ case $SPECFILE in
+ *.spec|*.src.rpm) BUILDTYPE=spec ;;
+ *.dsc) BUILDTYPE=dsc ;;
+ *.kiwi) BUILDTYPE=kiwi ;;
+ PKGBUILD) BUILDTYPE=arch ;;
+ esac
+ if test -z "$BUILDTYPE" ; then
+ echo "don't know how to build $SPECFILE"
+ cleanup_and_exit 1
+ fi
+
+ cd "$SRCDIR"
+
+ if [ -z "$RUNNING_IN_VM" ]; then
+ echo
+ echo "$HOST started \"build $SPECFILE\" at `date --utc`."
+ echo
+ test -n "$REASON" && echo "$REASON"
+ echo
+ fi
-for SPECFILE in $SPECFILES ; do
#
# first setup building directory...
#
- test -s $SPECFILE || {
- echo $SPECFILE is empty. This should not happen...
- continue
+ test -s "$SPECFILE" || {
+ echo "$SPECFILE" is empty. This should not happen...
+ cleanup_and_exit 1
}
if test "$SPECFILE" != "${SPECFILE%.src.rpm}" ; then
- echo processing src rpm `pwd`/$SPECFILE...
- TOPDIR=`chroot $BUILD_ROOT rpm --eval '%_topdir'`
- rm -rf $BUILD_ROOT$TOPDIR
- mkdir -p $BUILD_ROOT$TOPDIR/SOURCES $BUILD_ROOT$TOPDIR/SPECS
- rpm -i --nodigest --nosignature --root $BUILD_ROOT $SPECFILE || {
- echo "could not install $SPECFILE."
- continue
- }
- rm -rf $BUILD_ROOT/.build-srcdir
- mkdir -p $BUILD_ROOT/.build-srcdir
- mv $BUILD_ROOT$TOPDIR/SOURCES/* $BUILD_ROOT/.build-srcdir
- mv $BUILD_ROOT$TOPDIR/SPECS/* $BUILD_ROOT/.build-srcdir
+ echo processing src rpm $SRCDIR/$SPECFILE ...
MYSRCDIR=$BUILD_ROOT/.build-srcdir
+ rm -rf $MYSRCDIR
+ mkdir -p $MYSRCDIR
cd $MYSRCDIR || cleanup_and_exit 1
+ $BUILD_DIR/unrpm -q $SRCDIR/$SPECFILE || {
+ echo "could not install $SPECFILE."
+ cleanup_and_exit 1
+ }
for SPECFILE in *.spec ; do : ; done
else
- echo processing specfile `pwd`/$SPECFILE...
- MYSRCDIR=$SRCDIR
+ MYSRCDIR="$SRCDIR"
fi
- ADDITIONAL_PACKS=""
- test -n "$BUILD_EXTRA_PACKS" && ADDITIONAL_PACKS="$ADDITIONAL_PACKS $BUILD_EXTRA_PACKS"
- test -n "$CREATE_BASELIBS" && ADDITIONAL_PACKS="$ADDITIONAL_PACKS build"
+ # FIX to work with baselibs_$PROJ etc
+ if test "$BUILDTYPE" == "dsc" -a -e ${SRCDIR}/baselibs-deb.conf ; then
+ # Set CREATE_BASELIBS if not set
+ echo "dsc build and baselibs-deb.conf present: forcing --baselibs to true"
+ CREATE_BASELIBS=true
+ fi
+
+# Currently local osc build does not allow extra .deb packages to be
+# specified on the command line. Both init_buildsystem and expanddeps
+# need to handle .deb dependencies first
+# if test -n "$CREATE_BASELIBS" ; then
+# case $BUILDTYPE in
+# spec) ;;
+# dsc) BUILD_EXTRA_PACKS="$BUILD_EXTRA_PACKS libparse-debcontrol-perl" ;;
+# esac
+# fi
+
+ echo processing specfile $MYSRCDIR/$SPECFILE ...
- if test "$CLEAN_BUILD" = true ; then
- clean_build_root
- DO_INIT=true
+ ADDITIONAL_PACKS=""
+ test -z "$BUILD_EXTRA_PACKS" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS $BUILD_EXTRA_PACKS"
+ test -z "$CREATE_BASELIBS" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS build"
+ test "$ccache" = '0' || ADDITIONAL_PACKS="$ADDITIONAL_PACKS ccache"
+ test "$icecream" = 0 || ADDITIONAL_PACKS="$ADDITIONAL_PACKS icecream gcc-c++"
+ test -z "$DO_LINT" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS rpmlint-Factory"
+
+ if test -n "$CHANGELOG" -a -z "$RUNNING_IN_VM" ; then
+ rm -f $BUILD_ROOT/.build-changelog
+ case $SPECFILE in
+ *.dsc) CFFORMAT=debian ;;
+ *) CFFORMAT=rpm ;;
+ esac
+ echo "running changelog2spec --target $CFFORMAT --file $MYSRCDIR/$SPECFILE"
+ if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$MYSRCDIR/$SPECFILE" > $BUILD_ROOT/.build-changelog ; then
+ rm -f $BUILD_ROOT/.build-changelog
+ fi
fi
- if test -n "$XENIMAGE" ; then
- # do fist stage of init_buildsystem
- echo init_buildsystem $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
- init_buildsystem --prepare $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
- # start up xen, rerun ourself
+ if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM"; then
+ rm -rf $BUILD_ROOT/.build
mkdir -p $BUILD_ROOT/.build
+ if test "$DO_INIT" = true ; then
+ # do fist stage of init_buildsystem
+ rm -f $BUILD_ROOT/.build.success
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --prepare "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
+ echo "$* ..."
+ "$@" || cleanup_and_exit 1
+ check_exit
+ if [ ! -w /root ]; then
+ # remove setuid bit if files belong to user to make e.g. mount work
+ find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm +4000 -print0 | xargs -0 --no-run-if-empty chmod -s
+ fi
+ copy_oldpackages
+ fi
+ # start up xen, rerun ourself
cp -a $BUILD_DIR/. $BUILD_ROOT/.build
- if ! test $MYSRCDIR = $BUILD_ROOT/.build-srcdir ; then
+ if ! test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ rm -rf $BUILD_ROOT/.build-srcdir
mkdir $BUILD_ROOT/.build-srcdir
- cp -p $MYSRCDIR/* $BUILD_ROOT/.build-srcdir
+ if test "$BUILDTYPE" = kiwi ; then
+ cp -pRL "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
+ else
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
+ fi
MYSRCDIR=$BUILD_ROOT/.build-srcdir
+ else
+ # cwd is at $BUILD_ROOT/.build-srcdir which we want to
+ # umount later so step aside
+ cd "$SRCDIR"
fi
- echo "SPECFILE='${SPECFILE//\'/\'\\\'\'}'" > $BUILD_ROOT/.build/build.data
- echo "BUILD_JOBS='${BUILD_JOBS//\'/\'\\\'\'}'" >> $BUILD_ROOT/.build/build.data
- echo "BUILD_ARCH='${BUILD_ARCH//\'/\'\\\'\'}'" >> $BUILD_ROOT/.build/build.data
- echo "BUILD_RPMS='${BUILD_RPMS//\'/\'\\\'\'}'" >> $BUILD_ROOT/.build/build.data
+ Q="'\''"
+ echo "SPECFILE='${SPECFILE//"'"/$Q}'" > $BUILD_ROOT/.build/build.data
+ echo "BUILD_JOBS='${BUILD_JOBS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "BUILD_ARCH='${BUILD_ARCH//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "BUILD_RPMS='${BUILD_RPMS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ case $BUILD_DIST in
+ */*)
+ cp $BUILD_DIST $BUILD_ROOT/.build/build.dist
+ BUILD_DIST=/.build/build.dist
+ ;;
+ esac
+ echo "BUILD_DIST='${BUILD_DIST//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "RELEASE='${RELEASE//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "BUILD_DEBUG='${BUILD_DEBUG//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "SIGNDUMMY='${SIGNDUMMY//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "DO_LINT='${DO_LINT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "DO_CHECKS='${DO_CHECKS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "NOROOTFORBUILD='${NOROOTFORBUILD//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "CREATE_BASELIBS='$CREATE_BASELIBS'" >> $BUILD_ROOT/.build/build.data
- echo "REASON='${REASON//\'/\'\\\'\'}'" >> $BUILD_ROOT/.build/build.data
- test -n "$XENSWAP" && echo "XENSWAP='/dev/hda2'" >> $BUILD_ROOT/.build/build.data
- umount $BUILD_ROOT
- XMROOT=file:$XENIMAGE
- XMROOT=${XMROOT/#file:\/dev/phy:}
- XMROOT="disk=$XMROOT,hda1,w"
- XMSWAP=
- if test -n "$XENSWAP" ; then
- XMSWAP=file:$XENSWAP
- XMSWAP=${XMSWAP/#file:\/dev/phy:}
- XMSWAP="disk=$XMSWAP,hda2,w"
- fi
- xm create -c $BUILD_DIR/xen.conf name="build:${XENIMAGE##*/}" $XENMEMORY $XMROOT $XMSWAP extra="init=/.build/build panic=1"
- exit 0
+ echo "REASON='${REASON//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "CHANGELOG='${CHANGELOG//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "INCARNATION='${INCARNATION//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "DO_INIT='${DO_INIT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ # FIXME: this depends on the kernel and vm.
+ # could be hda2, sda2 for xen or hdb/sdb for qemu
+ test -n "$VM_SWAP" && echo "VM_SWAP='${VM_SWAPDEV:-/dev/hda2}'" >> $BUILD_ROOT/.build/build.data
+ test -n "$VMDISK_MOUNT_OPTIONS" && echo "VMDISK_MOUNT_OPTIONS='${VMDISK_MOUNT_OPTIONS}'" >> $BUILD_ROOT/.build/build.data
+ PERSONALITY=0
+ if test "$VM_TYPE" != 'lxc'; then
+ test -n "$PERSONALITY_SYSCALL" && PERSONALITY=`perl -e 'print syscall('$PERSONALITY_SYSCALL', 0)."\n"'`
+ fi
+ if test "$(uname -m)" = 'ppc'; then
+ # ppc kernel never tells us if a 32bit personality is active
+ PERSONALITY=8
+ fi
+ echo "PERSONALITY='$PERSONALITY'" >> $BUILD_ROOT/.build/build.data
+ echo "MYHOSTNAME='`hostname`'" >> $BUILD_ROOT/.build/build.data
+ echo -n "definesnstuff=(" >> $BUILD_ROOT/.build/build.data
+ shellquote "${definesnstuff[@]}" >> $BUILD_ROOT/.build/build.data
+ echo ")" >> $BUILD_ROOT/.build/build.data
+ echo -n "repos=(" >> $BUILD_ROOT/.build/build.data
+ shellquote "${repos[@]}" >> $BUILD_ROOT/.build/build.data
+ echo ")" >> $BUILD_ROOT/.build/build.data
+ echo "VM_TYPE='$VM_TYPE'" >> $BUILD_ROOT/.build/build.data
+ echo "shell='$shell'" >> $BUILD_ROOT/.build/build.data
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
+ umount -n $BUILD_ROOT/proc 2> /dev/null || true
+ umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
+ umount -n $BUILD_ROOT/mnt 2> /dev/null || true
+
+ if [ -n "$VM_IMAGE" ]; then
+ check_exit
+ # needs to work otherwise we have a corrupted file system
+ umount $BUILD_ROOT || cleanup_and_exit 1
+ fi
+
+ if check_use_emulator; then
+ if [ -x "$BUILD_DIR/initvm" -a -e "$BUILD_DIR/qemu-reg" ]; then
+ vm_init_script="/.build/initvm"
+ elif [ -e $BUILD_DIR/initscript_qemu_vm ]; then
+ vm_init_script="/.build/initscript_qemu_vm"
+ else
+ echo "Warning: can't find initscript to register binfmts"
+ fi
+ else
+ vm_init_script="/.build/build"
+ fi
+
+ if [ "$VM_TYPE" = 'xen' ]; then
+ XMROOT="file:$(readlink -f $VM_IMAGE)"
+ XMROOT=${XMROOT/#file:\/dev/phy:/dev}
+ XMROOT="disk=$XMROOT,hda1,w"
+ XMSWAP=
+ if test -n "$VM_SWAP" ; then
+ XMSWAP="file:$(readlink -f $VM_SWAP)"
+ XMSWAP=${XMSWAP/#file:\/dev/phy:/dev}
+ XMSWAP="disk=$XMSWAP,hda2,w"
+ fi
+ XENID="${VM_IMAGE%/root}"
+ XENID="${XENID%/tmpfs}"
+ XENID="${XENID##*/}"
+ XENID="${XENID#root_}"
+
+ echo "booting XEN kernel ..."
+ if xm list "build_$XENID" >/dev/null 2>&1 ; then
+ echo "Instance already exist, something really went wrong..."
+ echo "Please report to your server admin, there might be multiple services running for same domain"
+ cleanup_and_exit 3
+ fi
+ XEN_CONF_FILE=`mktemp /var/tmp/build.xen.conf-XXXXXXXXX` || cleanup_and_exit 3
+ echo "kernel = \"$vm_kernel\"" > $XEN_CONF_FILE
+ echo "ramdisk = \"$vm_initrd\"" >> $XEN_CONF_FILE
+ echo "memory = ${MEMSIZE:-64}" >> $XEN_CONF_FILE
+ echo "vcpus = $BUILD_JOBS" >> $XEN_CONF_FILE
+ echo "root = \"/dev/hda1 ro\"" >> $XEN_CONF_FILE
+ echo "extra = \"init=/bin/bash console=ttyS0 panic=1 udev_timeout=360\"" >> $XEN_CONF_FILE
+ echo "on_poweroff = 'destroy'" >> $XEN_CONF_FILE
+ echo "on_reboot = 'destroy'" >> $XEN_CONF_FILE
+ echo "on_crash = 'destroy'" >> $XEN_CONF_FILE
+ set -- xm create -c $XEN_CONF_FILE name="build_$XENID" $XMROOT $XMSWAP extra="quiet init="$vm_init_script" elevator=noop panic=1 console=ttyS0"
+ if test "$PERSONALITY" != 0 ; then
+ # have to switch back to PER_LINUX to make xm work
+ set -- linux64 "$@"
+ fi
+ echo "$@"
+ "$@" || cleanup_and_exit 3
+ rm "$XEN_CONF_FILE"
+ elif [ "$VM_TYPE" = 'uml' ]; then
+ echo "booting UML kernel ..."
+ set -- $uml_kernel initrd=$uml_initrd root=/ubda init="$vm_init_script" panic=1 elevator=noop quiet ubd0=$VM_IMAGE ${MEMSIZE:+mem=$MEMSIZE}
+ echo "$@"
+ "$@"
+ elif [ "$VM_TYPE" = 'qemu' -o "$VM_TYPE" = 'kvm' ]; then
+ echo "booting $VM_TYPE ..."
+ if [ "$VM_TYPE" = 'kvm' -a -b "$VM_IMAGE" ]; then
+ # speed optimization when using kvm with raw devices
+ CACHE=",cache=none"
+ else
+ # speed optimization when using kvm with raw files
+ CACHE=",cache=unsafe"
+ fi
+ if [ "$kvm_virtio" = 1 ]; then
+ qemu_args=(-drive file="$VM_IMAGE",if=virtio$CACHE -drive file="$VM_IMAGE",if=ide,index=0$CACHE)
+ if [ -n "$VM_SWAP" ]; then
+ qemu_args=("${qemu_args[@]}" "-drive")
+ qemu_args=("${qemu_args[@]}" "file=$VM_SWAP,if=virtio$CACHE")
+ fi
+ else
+ if [ "$HOST_ARCH" = "ppc" ];then
+ qemu_args=( "-drive" )
+ qemu_args=("${qemu_args[@]}" "file=$VM_IMAGE,if=scsi,cache=unsafe")
+ else
+ qemu_args=(-hda "$VM_IMAGE")
+ fi
+ if [ -n "$VM_SWAP" ]; then
+ qemu_args=("${qemu_args[@]}" "-drive")
+ if [ "$HOST_ARCH" = "ppc" ];then
+ DISK_IF=scsi
+ else
+ DISK_IF=ide
+ fi
+ qemu_args=("${qemu_args[@]}" "file=$VM_SWAP,if=$DISK_IF,index=1$CACHE")
+ fi
+ fi
+ if [ -n "$BUILD_JOBS" -a "$icecream" = 0 ]; then
+ qemu_args=("${qemu_args[@]}" "-smp" "$BUILD_JOBS")
+ fi
+ # cpuid is not set correctly in kvm without this
+ if [ "$HOST_ARCH" != "ppc" ]; then
+ KVM_OPTIONS=""
+ fi
+ if [ "$VM_TYPE" = 'kvm' ]; then
+ KVM_OPTIONS="$KVM_OPTIONS -cpu host"
+ fi
+
+ set -- $qemu_bin -no-reboot -nographic -net none $KVM_OPTIONS \
+ -kernel $vm_kernel \
+ -initrd $vm_initrd \
+ -append "root=$qemu_rootdev panic=1 quiet no-kvmclock nmi_watchdog=0 rw elevator=noop console=$console init=$vm_init_script" \
+ ${MEMSIZE:+-m $MEMSIZE} \
+ "${qemu_args[@]}"
+
+ if test "$PERSONALITY" != 0 ; then
+ # have to switch back to PER_LINUX to make qemu work
+ set -- linux64 "$@"
+ fi
+ echo "$@"
+ "$@"
+ elif [ "$VM_TYPE" = 'lxc' ]; then
+ echo "booting $VM_TYPE ..."
+ LXCCONF="$BUILD_ROOT/.build.lxc.conf"
+ rm -f "$LXCCONF"
+ cat $BUILD_DIR/lxc.conf > "$LXCCONF"
+ cat >> "$LXCCONF" <<-EOF
+ lxc.rootfs = $BUILD_ROOT
+ EOF
+ # XXX: do this always instead of leaking the hosts' one?
+ echo "rootfs / rootfs rw 0 0" > $BUILD_ROOT/etc/mtab
+ LXCID=${BUILD_ROOT##*/}
+ lxc-destroy -n "$LXCID" >/dev/null 2>&1 || true
+ lxc-create -n "$LXCID" -f "$LXCCONF" || cleanup_and_exit 1
+ lxc-start -n "$LXCID" "$vm_init_script"
+ BUILDSTATUS="$?"
+ test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
+ cleanup_and_exit "$BUILDSTATUS"
+ fi
+ if test -n "$VM_SWAP" ; then
+ BUILDSTATUS=`dd if="$VM_SWAP" bs=12 count=1 2>/dev/null`
+ case $BUILDSTATUS in
+ BUILDSTATUS[02])
+ mkdir -p $BUILD_ROOT/.build.packages
+ cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
+ echo "build_ extracting built packages..."
+ extractbuild --disk "$VM_IMAGE" --input "$VM_SWAP" --skip 512 -v || cleanup_and_exit 3
+ # create same layout as with plain chroot
+ if test "$BUILDTYPE" = spec ; then
+ mkdir -p SRPMS
+ for i in *src.rpm *.desktopfiles ; do
+ test -e "$i" || continue
+ mv "$i" SRPMS/
+ done
+ for i in *.rpm ; do
+ test -e "$i" || continue
+ arch=${i%.rpm}
+ arch=${i%.delta}
+ arch=${arch##*\.}
+ mkdir -p RPMS/$arch
+ mv "$i" RPMS/$arch/
+ done
+ elif test "$BUILDTYPE" = dsc ; then
+ mkdir -p DEBS
+ find . -type f | while read i; do mv "$i" DEBS/; done
+ elif test "$BUILDTYPE" = arch ; then
+ mkdir -p ARCHPKGS
+ find . -type f | while read i; do mv "$i" ARCHPKGS/; done
+ else
+ mkdir -p KIWI
+ find . -type f | while read i; do mv "$i" KIWI/; done
+ fi
+ for i in * ; do
+ test -f "$i" || continue
+ case $i in
+ _*|.*) ;;
+ *) mkdir -p OTHER ; mv $i OTHER/ ;;
+ esac
+ done
+ cleanup_and_exit ${BUILDSTATUS#BUILDSTATUS}
+ ;;
+ BUILDSTATUS*)
+ cleanup_and_exit ${BUILDSTATUS#BUILDSTATUS}
+ ;;
+ *)
+ echo "No buildstatus set, either the base system is broken (glibc/bash/perl)"
+ echo "or the build host has a kernel or hardware problem..."
+ cleanup_and_exit 3
+ ;;
+ esac
+ cleanup_and_exit 1
+ fi
+ cleanup_and_exit 0
fi
if test "$DO_INIT" = true ; then
- echo init_buildsystem $USEUSEDFORBUILD $RPMLIST $SPECFILE $ADDITIONAL_PACKS ...
- $BUILD_INIT_BUILDSYSTEM $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS || cleanup_and_exit 1
- fi
+ #
+ # create legacy .buildenv file
+ #
+ test -z "$INCARNATION" && INCARNATION=0
+ echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv
+ CREATE_BUILD_BINARIES=
+ egrep '^#[ ]*needsbinariesforbuild[ ]*$' >/dev/null <$MYSRCDIR/$SPECFILE && CREATE_BUILD_BINARIES=--create-build-binaries
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$SPECFILE" $ADDITIONAL_PACKS
+ echo "$* ..."
+ "$@" || cleanup_and_exit 1
+ check_exit
+ # arbitrary limit of 10MB
+ if test $((`stat -f -c "%a*%S/1024/1024" $BUILD_ROOT`)) -lt 10; then
+ df -h $BUILD_ROOT
+ echo "build does not work on a completely full filesystem"
+ cleanup_and_exit 1
+ fi
+ mount -n -tproc none $BUILD_ROOT/proc || true
+ mount -n -tdevpts none $BUILD_ROOT/dev/pts
- if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
- BUILD_DIST=`cat $BUILD_ROOT/.guessed_dist`
+ copy_oldpackages
fi
- if test "$SPECFILE" = "${SPECFILE%.dsc}" ; then
- TOPDIR=`chroot $BUILD_ROOT rpm --eval '%_topdir'`
- else
- TOPDIR=/usr/src/packages
- mkdir -p $BUILD_ROOT$TOPDIR
+ if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
+ read BUILD_DIST < $BUILD_ROOT/.guessed_dist
fi
- ln -f -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
-
#
# fix rpmrc if we are compiling for i686
#
@@ -505,126 +1828,507 @@ for SPECFILE in $SPECFILES ; do
fi
#
+ # install dummy sign program if needed
+ #
+ test -f $BUILD_ROOT/usr/bin/sign_installed && mv $BUILD_ROOT/usr/bin/sign_installed $BUILD_ROOT/usr/bin/sign
+ if test -n "$SIGNDUMMY" ; then
+ test -f $BUILD_ROOT/usr/bin/sign && mv $BUILD_ROOT/usr/bin/sign $BUILD_ROOT/usr/bin/sign_installed
+ cp $BUILD_DIR/signdummy $BUILD_ROOT/usr/bin/sign
+ chmod 755 $BUILD_ROOT/usr/bin/sign
+ fi
+
+ #
# check if we want to build with the abuild user
#
- BUILD_USER=root
- test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
- if egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$SPECFILE; then
- BUILD_USER=abuild
+ BUILD_USER=abuild
+ if test -x $BUILD_ROOT/bin/rpm ; then
+ SUSE_VERSION=`chroot $BUILD_ROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
+ if test -n "$SUSE_VERSION" && test "$SUSE_VERSION" -le 1020 ; then
+ BUILD_USER=root
+ fi
+ fi
+ if test "$BUILD_USER" = abuild ; then
+ egrep '^#[ ]*needsrootforbuild[ ]*$' >/dev/null <$SPECFILE && BUILD_USER=root
+ else
+ egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$SPECFILE && BUILD_USER=abuild
fi
+ test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
+
if test $BUILD_USER = abuild ; then
- if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
- echo 'abuild::99:99:Autobuild:/home/abuild:/bin/bash' >>$BUILD_ROOT/etc/passwd
- echo 'abuild::99:' >>$BUILD_ROOT/etc/group
- mkdir -p $BUILD_ROOT/home/abuild
- chown 99:99 $BUILD_ROOT/home/abuild
- fi
+ if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
+ echo "abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >>$BUILD_ROOT/etc/passwd
+ echo 'abuild:*:::::::' >>$BUILD_ROOT/etc/shadow # This is needed on Mandriva 2009
+ echo 'abuild:*::' >>$BUILD_ROOT/etc/gshadow # This is needed on Ubuntu
+ echo "abuild:x:${ABUILD_GID}:" >>$BUILD_ROOT/etc/group
+ mkdir -p $BUILD_ROOT/home/abuild
+ chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/home/abuild
+ else
+ if ! egrep "^abuild:x?:${ABUILD_UID}:${ABUILD_GID}" >/dev/null <$BUILD_ROOT/etc/passwd ; then
+ echo "abuild user present in the buildroot ($BUILD_ROOT) but uid:gid does not match"
+ echo "buildroot currently using:"
+ egrep "^abuild:" <$BUILD_ROOT/etc/passwd
+ echo "build script attempting to use:"
+ echo "abuild::${ABUILD_UID}:${ABUILD_GID}:..."
+ echo "build aborting"
+ cleanup_and_exit 1
+ fi
+ fi
+ if test -f $BUILD_ROOT/etc/shadow ; then
+ sed -e "s@^root::@root:*:@" < $BUILD_ROOT/etc/shadow > $BUILD_ROOT/etc/shadow.t && mv $BUILD_ROOT/etc/shadow.t $BUILD_ROOT/etc/shadow
+ fi
+ if test -f $BUILD_ROOT/etc/gshadow ; then
+ sed -e "s@^root::@root:*:@" < $BUILD_ROOT/etc/gshadow > $BUILD_ROOT/etc/gshadow.t && mv $BUILD_ROOT/etc/gshadow.t $BUILD_ROOT/etc/gshadow
+ fi
+ BUILD_USER_ABUILD_USED=true
else
- if egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
- egrep -v '^abuild:' <$BUILD_ROOT/etc/passwd >$BUILD_ROOT/etc/passwd.new
- mv $BUILD_ROOT/etc/passwd.new $BUILD_ROOT/etc/passwd
- egrep -v '^abuild:' <$BUILD_ROOT/etc/group >$BUILD_ROOT/etc/group.new
- mv $BUILD_ROOT/etc/group.new $BUILD_ROOT/etc/group
- rm -rf $BUILD_ROOT/home/abuild
- fi
+ # building as root
+ ABUILD_UID=0
+ ABUILD_GID=0
+ if egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
+ rm -rf $BUILD_ROOT/home/abuild
+ egrep -v '^abuild:' <$BUILD_ROOT/etc/passwd >$BUILD_ROOT/etc/passwd.new
+ mv $BUILD_ROOT/etc/passwd.new $BUILD_ROOT/etc/passwd
+ egrep -v '^abuild:' <$BUILD_ROOT/etc/group >$BUILD_ROOT/etc/group.new
+ mv $BUILD_ROOT/etc/group.new $BUILD_ROOT/etc/group
+ if test -f $BUILD_ROOT/etc/shadow ; then
+ egrep -v '^abuild:' <$BUILD_ROOT/etc/shadow >$BUILD_ROOT/etc/shadow.new
+ mv $BUILD_ROOT/etc/shadow.new $BUILD_ROOT/etc/shadow
+ fi
+ if test -f $BUILD_ROOT/etc/gshadow ; then
+ egrep -v '^abuild:' <$BUILD_ROOT/etc/gshadow >$BUILD_ROOT/etc/gshadow.new
+ mv $BUILD_ROOT/etc/gshadow.new $BUILD_ROOT/etc/gshadow
+ fi
+ fi
+ fi
+
+ if test "$BUILDTYPE" = spec ; then
+ TOPDIR=`chroot $BUILD_ROOT su -c "rpm --eval '%_topdir'" - $BUILD_USER`
+ if test -z "$TOPDIR"; then
+ echo "Error: TOPDIR empty"
+ cleanup_and_exit 1
+ fi
+ else
+ TOPDIR=/usr/src/packages
+ mkdir -p $BUILD_ROOT$TOPDIR
+ fi
+
+ rm -f $BUILD_ROOT/.build.packages
+ ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
+
+ mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
+ mount -n -tdevpts none $BUILD_ROOT/dev/pts 2> /dev/null
+
+ setupicecream
+
+ setupccache
+
+ # nasty hack to prevent rpath on known paths
+ # FIXME: do this only for suse
+ if test -d "$BUILD_ROOT/etc/profile.d" ; then
+ echo "export SUSE_IGNORED_RPATHS=/etc/ld.so.conf" > "$BUILD_ROOT/etc/profile.d/buildsystem.sh"
fi
#
# now clean up RPM building directories
- #
- rm -rf $BUILD_ROOT$TOPDIR
- for i in BUILD RPMS/`arch` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS ; do
- mkdir -p $BUILD_ROOT$TOPDIR/$i
- test BUILD_USER = abuild && chown 99:99 $BUILD_ROOT$TOPDIR/$i
- done
- test -e $BUILD_ROOT/exit && cleanup_and_exit
+ if [ -z "$NO_TOPDIR_CLEANUP" ]; then
+ rm -rf "$BUILD_ROOT$TOPDIR"
+ for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do
+ mkdir -p $BUILD_ROOT$TOPDIR/$i
+ done
+ fi
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ check_exit
+
mkdir -p $BUILD_ROOT$TOPDIR/SOURCES
- cp -p $MYSRCDIR/* $BUILD_ROOT$TOPDIR/SOURCES/
- test $MYSRCDIR = $BUILD_ROOT/.build-srcdir && rm -rf $MYSRCDIR
+ if test "$BUILDTYPE" = kiwi ; then
+ mkdir -p $BUILD_ROOT$TOPDIR/KIWI
+ if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ if test -z "$LINKSOURCES" ; then
+ cp -dLR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ cp -lR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+ if test "$?" != 0 ; then
+ echo "source copy failed"
+ cleanup_and_exit 1
+ fi
+ fi
+ else
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+ # strip prefix from autogenerated files of source services.
+ for i in $BUILD_ROOT$TOPDIR/SOURCES/_service\:*; do
+ mv "$i" "${i%/*}/${i##*:}"
+ done
+ SPECFILE="${SPECFILE##*:}"
- if test "$SPECFILE" = "${SPECFILE%.dsc}" ; then
+ test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir && rm -rf "$MYSRCDIR"
+ CHANGELOGARGS=
+ test -n "$CHANGELOG" -a -f "$BUILD_ROOT/.build-changelog" && CHANGELOGARGS="--changelog $BUILD_ROOT/.build-changelog"
+
+ if test "$BUILDTYPE" = spec ; then
# do buildrequires/release substitution
- substitutedeps $RELEASE --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$BUILD_DIR/configs" "$BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE" "$BUILD_ROOT/.spec.new" || cleanup_and_exit 1
+ args=()
+ if test -n "$RELEASE"; then
+ args=(--release "$RELEASE")
+ fi
+ substitutedeps "${args[@]}" --root "$BUILD_ROOT" --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" $CHANGELOGARGS "$BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE" "$BUILD_ROOT/.spec.new" || cleanup_and_exit 1
# extract macros from configuration
- getmacros --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" > $BUILD_ROOT/root/.rpmmacros
+ getmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/.rpmmacros
+ if test -n "$BUILD_DEBUG" ; then
+ echo '
+%prep %{?!_suse_insert_debug_package_seen:%?_suse_insert_debug_package}%%prep
+%package %{?!_suse_insert_debug_package_seen:%?_suse_insert_debug_package}%%package
+%suse_insert_debug_package \
+ %global _suse_insert_debug_package \\\
+ %%global _suse_insert_debug_package_seen 1 \\\
+ %%debug_package
+
+' >> $BUILD_ROOT/root/.rpmmacros
+ fi
+
+ if [ -n "$BUILD_JOBS" ]; then
+ cat >> $BUILD_ROOT/root/.rpmmacros <<-EOF
+ %jobs $BUILD_JOBS
+ %_smp_mflags -j$BUILD_JOBS
+ EOF
+ fi
test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmmacros $BUILD_ROOT/home/abuild/.rpmmacros
+ # extract optflags from configuration
+ getoptflags --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" ${BUILD_DEBUG:+--debug} > $BUILD_ROOT/root/.rpmrc
+ test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmrc $BUILD_ROOT/home/abuild/.rpmrc
+ if test -z "$ABUILD_TARGET"; then
+ ABUILD_TARGET=$(getchangetarget --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" )
+ test -z "$ABUILD_TARGET" || echo "build target is $ABUILD_TARGET"
+ fi
fi
if test -f $BUILD_ROOT/.spec.new ; then
if ! cmp -s $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE $BUILD_ROOT/.spec.new ; then
echo -----------------------------------------------------------------
echo I have the following modifications for $SPECFILE:
- diff $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE $BUILD_ROOT/.spec.new
+ sed -e "/^%changelog/q" $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE > $BUILD_ROOT/.spec.t1
+ sed -e "/^%changelog/q" $BUILD_ROOT/.spec.new > $BUILD_ROOT/.spec.t2
+ diff $BUILD_ROOT/.spec.t1 $BUILD_ROOT/.spec.t2
+ rm -f $BUILD_ROOT/.spec.t1 $BUILD_ROOT/.spec.t2
mv $BUILD_ROOT/.spec.new $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE
else
rm -f $BUILD_ROOT/.spec.new
fi
fi
- if test "$SPECFILE" != "${SPECFILE%.dsc}" ; then
+ if test "$BUILDTYPE" = dsc ; then
rm -rf $BUILD_ROOT$TOPDIR/BUILD
- test $BUILD_USER = abuild && chown 99:99 $BUILD_ROOT$TOPDIR
- chroot $BUILD_ROOT su -c "dpkg-source -x $TOPDIR/SOURCES/$SPECFILE $TOPDIR/BUILD" - $BUILD_USER
+ mkdir -p $BUILD_ROOT$TOPDIR/SOURCES.DEB
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ DEB_TRANSFORM=
+ DEB_SOURCEDIR=$TOPDIR/SOURCES
+ DEB_DSCFILE=$SPECFILE
+ for f in $BUILD_ROOT$TOPDIR/SOURCES/debian.* ; do
+ test -f $f && DEB_TRANSFORM=true
+ done
+ if test -n "$DEB_TRANSFORM" ; then
+ echo "running debian transformer..."
+ if ! debtransform $CHANGELOGARGS $BUILD_ROOT$TOPDIR/SOURCES $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE $BUILD_ROOT$TOPDIR/SOURCES.DEB ; then
+ echo "debian transforming failed."
+ cleanup_and_exit 1
+ fi
+ DEB_SOURCEDIR=$TOPDIR/SOURCES.DEB
+ for DEB_DSCFILE in $BUILD_ROOT/$DEB_SOURCEDIR/*.dsc ; do : ; done
+ DEB_DSCFILE="${DEB_DSCFILE##*/}"
+ fi
+ chroot $BUILD_ROOT su -c "dpkg-source -x $DEB_SOURCEDIR/$DEB_DSCFILE $TOPDIR/BUILD" - $BUILD_USER
fi
- if test $BUILD_USER = abuild ; then
- chown -R 99:99 $BUILD_ROOT$TOPDIR/*
- else
- chown -R root:root $BUILD_ROOT$TOPDIR/*
+
+ if test "$BUILDTYPE" = arch ; then
+ echo "Preparing sources..."
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && makepkg -s -o 2>&1 >/dev/null" - $BUILD_USER
+ mv $BUILD_ROOT/$TOPDIR/SOURCES/* -t $BUILD_ROOT/$TOPDIR/BUILD
fi
+
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
cd $BUILD_ROOT$TOPDIR/SOURCES || cleanup_and_exit 1
echo -----------------------------------------------------------------
if test "$BUILD_USER" = root ; then
- echo ----- building $SPECFILE
+ echo ----- building $SPECFILE
else
- echo ----- building $SPECFILE "(user $BUILD_USER)"
+ echo ----- building $SPECFILE "(user $BUILD_USER)"
fi
echo -----------------------------------------------------------------
echo -----------------------------------------------------------------
- sync
- mount -oro -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- mount -n -tdevpts none $BUILD_ROOT/dev/pts 2> /dev/null
+ if [ -n "$RUNNING_IN_VM" ]; then
+ if [ -x /sbin/ip ]; then
+ ip addr add 127.0.0.1/8 dev lo
+ ip link set lo up
+ else
+ ifconfig lo 127.0.0.1 up
+ fi
+ if [ -n "$MYHOSTNAME" ]; then
+ hostname "$MYHOSTNAME"
+ fi
+ fi
+
+ BUILD_SUCCEEDED=false
+
+ if test -n "$OVERLAY" ; then
+ if test -d "$OVERLAY"; then
+ pushd $OVERLAY
+ echo "Copying overlay to BUILD_ROOT"
+ tar -cpf - . | (cd $BUILD_ROOT ; tar -xvf -)
+ popd
+ else
+ echo "OVERLAY ($OVERLAY) is no directory - skipping"
+ fi
+ fi
- BUILD_SUCCEDED=false
+ if test -n "$RSYNCSRC" ; then
+ if test -n "$RSYNCDEST"; then
+ if test -d "$RSYNCSRC"; then
+ if ! test -d "$BUILD_ROOT/$RSYNCDEST"; then
+ echo "ATTENTION! Creating target directory ($BUILD_ROOT/$RSYNCDEST) as its not there."
+ mkdir -p $BUILD_ROOT/$RSYNCDEST
+ fi
+ echo "Running rsync ..."
+ rsync -av $RSYNCSRC/* $BUILD_ROOT/$RSYNCDEST/
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/$RSYNCDEST"
+ RSYNCDONE=true
+ echo "... done"
+ else
+ echo "RSYNCSRC is no directory - skipping"
+ fi
+ else
+ echo "RSYNCSRC given, but not RSYNCDEST - skipping"
+ fi
+ fi
- if test "$SPECFILE" = "${SPECFILE%.dsc}" ; then
+ if test "$BUILDTYPE" = spec ; then
test -z "$BUILD_RPM_BUILD_STAGE" && BUILD_RPM_BUILD_STAGE=-ba
- BUILD_PARAMETERS="$BUILD_RPM_BUILD_STAGE"
- test -n "$ABUILD_TARGET_ARCH" && BUILD_PARAMETERS="$BUILD_PARAMETERS --target=\"$ABUILD_TARGET_ARCH\""
- test -n "$BUILD_JOBS" && BUILD_PARAMETERS="$BUILD_PARAMETERS --eval \"%define jobs \\\"$BUILD_JOBS\\\"\""
- test root != "$BUILD_USER" && BUILD_PARAMETERS="$BUILD_PARAMETERS --eval \"%define _srcdefattr (-,root,root)\""
- RPMBUILD=rpmbuild
- test -x $BUILD_ROOT/usr/lib/rpm/rpmi || RPMBUILD=rpm
- chroot $BUILD_ROOT su -c "$RPMBUILD $BUILD_PARAMETERS $TOPDIR/SOURCES/$SPECFILE" - $BUILD_USER < /dev/null && BUILD_SUCCEDED=true
- else
- chroot $BUILD_ROOT su -c "cd $TOPDIR/BUILD && dpkg-buildpackage -us -uc -rfakeroot" - $BUILD_USER < /dev/null && BUILD_SUCCEDED=true
+ rpmbuild=rpmbuild
+ test -x $BUILD_ROOT/usr/bin/rpmbuild || rpmbuild=rpm
+
+ # XXX: move _srcdefattr to macro file?
+ rpmbopts=("--define" "_srcdefattr (-,root,root)")
+ if [ "$rpmbuild" == "rpmbuild" ]; then
+ # use only --nosignature for rpm v4
+ rpmbopts[${#rpmbopts[@]}]="--nosignature"
+ fi
+ if [ -n "$ABUILD_TARGET" ]; then
+ rpmbopts[${#rpmbopts[@]}]="--target=$ABUILD_TARGET"
+ fi
+ if [ -n "$DISTURL" ]; then
+ rpmbopts[${#rpmbopts[@]}]='--define'
+ rpmbopts[${#rpmbopts[@]}]="disturl $DISTURL"
+ fi
+ if test -s "$BUILD_ROOT/usr/lib/rpm/mandriva/macros" ; then
+ rpmbopts[${#rpmbopts[@]}]='--eval'
+ rpmbopts[${#rpmbopts[@]}]="%undefine _enable_debug_packages"
+ fi
+ if [ -n "$BUILD_DEBUG" ]; then
+ rpmbopts[${#rpmbopts[@]}]='--eval'
+ rpmbopts[${#rpmbopts[@]}]="%suse_insert_debug_package"
+ fi
+ if [ -n "$RSYNCDONE" ] ; then
+ rpmbopts[${#rpmbopts[@]}]='--define'
+ rpmbopts[${#rpmbopts[@]}]="RSYNCDONE 1"
+ fi
+
+ # su involves a shell which would require even more
+ # complicated quoting to bypass than this
+ if test "$SHORT_CIRCUIT" = false ; then
+ rpmbopts[${#rpmbopts[@]}]="$BUILD_RPM_BUILD_STAGE"
+ toshellscript $rpmbuild \
+ "${definesnstuff[@]}" \
+ "${rpmbopts[@]}" \
+ "$TOPDIR/SOURCES/$SPECFILE" \
+ > $BUILD_ROOT/.build.command
+ else
+ rpmbopts[${#rpmbopts[@]}]='--short-circuit'
+ buildopts="-bc -bi -bb -bs"
+ cmds=""
+ echo "#!/bin/sh -x" >$BUILD_ROOT/.build.command
+ for opt in $buildopts
+ do
+ shellquote $rpmbuild \
+ "${definesnstuff[@]}" \
+ "${rpmbopts[@]}" $opt \
+ "$TOPDIR/SOURCES/$SPECFILE" \
+ >> $BUILD_ROOT/.build.command
+ echo >>$BUILD_ROOT/.build.command
+ [ "$opt" == "$BUILD_RPM_BUILD_STAGE" ] && break
+ done
+ fi
+
+ chmod 755 $BUILD_ROOT/.build.command
+ check_exit
+ if test -n "$shell"; then
+ chroot $BUILD_ROOT su -
+ else
+ chroot $BUILD_ROOT su -c /.build.command - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ fi
+ fi
+
+ if test "$BUILDTYPE" = dsc ; then
+ # Checks to see if a build script should be used
+ # this allows the build environment to be manipulated
+ # and alternate build commands can be used
+# Debian policy requires to build with single CPU by default
+# if [ -n "$BUILD_JOBS" ]; then
+# DSC_BUILD_JOBS="-j$BUILD_JOBS"
+# fi
+ DSC_BUILD_CMD="dpkg-buildpackage -us -uc -rfakeroot-tcp $DSC_BUILD_JOBS"
+ if test -e $BUILD_ROOT/$TOPDIR/SOURCES/build.script ; then
+ echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc -rfakeroot-tcp'"
+ DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
+ chmod +x $BUILD_ROOT/$TOPDIR/SOURCES/build.script
+ fi
+
+ if test -n "$shell"; then
+ chroot $BUILD_ROOT su -
+ else
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ fi
+
mkdir -p $BUILD_ROOT/$TOPDIR/DEBS
for DEB in $BUILD_ROOT/$TOPDIR/*.deb ; do
test -e "$DEB" && mv "$DEB" "$BUILD_ROOT/$TOPDIR/DEBS"
done
+ # link sources over
+ ln $BUILD_ROOT/$DEB_SOURCEDIR/$DEB_DSCFILE $BUILD_ROOT/$TOPDIR/DEBS/
+ while read f ; do
+ ln $BUILD_ROOT/$DEB_SOURCEDIR/$f $BUILD_ROOT/$TOPDIR/DEBS/
+ done < <(sed -ne '/^Files:/,$s/^ ................................ [0-9][0-9]* //p' < $BUILD_ROOT/$DEB_SOURCEDIR/$DEB_DSCFILE)
+ fi
+
+ if test "$BUILDTYPE" = arch ; then
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/BUILD && makepkg -f" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ mkdir -p $BUILD_ROOT/$TOPDIR/ARCHPKGS
+ for PKG in $BUILD_ROOT/$TOPDIR/BUILD/*.pkg.tar.?z ; do
+ test -e "$PKG" && mv "$PKG" "$BUILD_ROOT/$TOPDIR/ARCHPKGS"
+ done
+ fi
+
+ if test "$BUILDTYPE" = kiwi ; then
+ . $BUILD_DIR/build_kiwi.sh
+ run_kiwi
fi
- umount -n $BUILD_ROOT/proc 2> /dev/null
- umount -n $BUILD_ROOT/mnt 2> /dev/null
- umount -n $BUILD_ROOT/dev/pts 2> /dev/null
- test "$BUILD_SUCCEDED" = true || cleanup_and_exit 1
+ test "$BUILD_SUCCEEDED" = true || cleanup_and_exit 1
test -d "$SRCDIR" && cd "$SRCDIR"
done
-if test -n "$CREATE_BASELIBS" ; then
- mount -oro -n -tproc none $BUILD_ROOT/proc 2> /dev/null
+RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
+DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
+
+if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
+ echo "... checking for files with abuild user/group"
+ BADFILE=
+ while read un gn fn ; do
+ if test "$un" = abuild -o "$gn" = abuild -o "$un" = ${ABUILD_UID} -o "$gn" = ${ABUILD_GID} ; then
+ echo " $un $gn $fn"
+ BADFILE=true
+ fi
+ done < <(rpm -qp --qf '[%{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]' $RPMS)
+ if test -n "$BADFILE" ; then
+ echo "please fix your filelist (e.g. add defattr)"
+ cleanup_and_exit 1
+ fi
+fi
+
+if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
+ export PNAME=""
+ export DO_RPM_REMOVE=true
+ for SRPM in $BUILD_ROOT/$TOPDIR/SRPMS/*src.rpm ; do
+ test -f "$SRPM" && PNAME=`rpm --nodigest --nosignature -qp --qf "%{NAME}" $SRPM`
+ done
+ for CHECKSCRIPT in $BUILD_ROOT/usr/lib/build/checks/* ; do
+ echo "... running `basename $CHECKSCRIPT`"
+ $CHECKSCRIPT || cleanup_and_exit 1
+ done
+fi
+
+RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
+DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
+
+if test -n "$RPMS" -a "$DO_CHECKS" != "false" -a -x "$BUILD_ROOT/opt/testing/bin/rpmlint" ; then
+ LINT_RPM_FILE_LIST=($(find $BUILD_ROOT/$TOPDIR/RPMS \
+ \( -name "*-debuginfo-*" -o -name "*-debugsource-*" \
+ -o -name "*-32bit-*" -o -name "*-64bit-*" \
+ -o -name "*-x86-*" -o -name "*-ia32-*" \) -prune \
+ -o -type f -name '*.rpm' -print))
+ SRPM_FILE_LIST=($(find $BUILD_ROOT/$TOPDIR/SRPMS -type f -name "*.rpm"))
+ echo
+ echo "RPMLINT report:"
+ echo "==============="
+ rpmlint_logfile=$TOPDIR/OTHER/rpmlint.log
+ rm -f "$BUILD_ROOT$rpmlint_logfile"
+ ret=0
+ chroot $BUILD_ROOT su -s /opt/testing/bin/rpmlint "$BUILD_USER" -- \
+ --info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} \
+ ${SRPM_FILE_LIST[*]#$BUILD_ROOT} > "$BUILD_ROOT$rpmlint_logfile" || ret=1
+ cat "$BUILD_ROOT$rpmlint_logfile"
+ echo
+ if test "$ret" = 1; then
+ cleanup_and_exit 1
+ fi
+fi
+
+if test \( -n "$RPMS" -o -n "$DEBS" \) -a -n "$CREATE_BASELIBS"; then
create_baselibs
- umount -n $BUILD_ROOT/proc 2> /dev/null
fi
-if test -n "$RUNNING_IN_XEN" ; then
- cd /
- test -n "$XENSWAP" && swapoff "$XENSWAP"
- exec >&0 2>&0 # so that the logging tee finishes
- sleep 1 # wait till tee terminates
- kill -9 -1 # goodbye cruel world
- exec /bin/bash -c 'mount -n -o remount,ro / ; halt -f'
- halt -f
+exitcode=0
+# post build scripts
+# TODO: don't hardcode. instead run scripts in a directory as it's done for the checks
+if test -n "$RPMS" \
+ -a -d "$BUILD_ROOT/$TOPDIR/RPMS" \
+ -a -d "$BUILD_ROOT/.build.oldpackages" \
+ ; then
+ if test -x "$BUILD_ROOT/usr/lib/build/same-build-result.sh" ; then
+ echo "... comparing built packages with the former built"
+ mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
+ if chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
+ chroot $BUILD_ROOT touch /.build/.same_result_marker
+ # XXX: dirty build service hack. fix bs_worker. Search for
+ # 'same_result_marker' for traces of a first try to get rid of this
+ if test -n "$REASON" -a -n "$DISTURL"; then
+ exitcode=2
+ fi
+ fi
+ fi
+ if test ! -e $BUILD_ROOT/.build/.same_result_marker \
+ -a -x "$BUILD_ROOT/usr/bin/makedeltarpm" \
+ -a -x $BUILD_ROOT/usr/lib/build/mkdrpms; then
+ echo "... creating delta rpms"
+ ds=("$BUILD_ROOT/$TOPDIR"/RPMS/* "$BUILD_ROOT$TOPDIR/SRPMS")
+ chroot $BUILD_ROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
+ fi
+fi
+
+if test -n "$RUNNING_IN_VM" -a -n "$VM_SWAP"; then
+ echo "... saving built packages"
+ swapoff "$VM_SWAP"
+ args="--padstart 512 --padend 512 -v"
+ case "$BUILDTYPE" in
+ spec)
+ computeblocklists $args $TOPDIR/RPMS/*/*.{d,}rpm $TOPDIR/SRPMS/* $TOPDIR/OTHER/* > "$VM_SWAP"
+ ;;
+ dsc)
+ computeblocklists $args $TOPDIR/DEBS/*.deb $TOPDIR/SOURCES.DEB/* $TOPDIR/OTHER/* > "$VM_SWAP"
+ ;;
+ kiwi)
+ computeblocklists $args $TOPDIR/KIWI/* $TOPDIR/OTHER/* > "$VM_SWAP"
+ ;;
+ arch)
+ computeblocklists $args $TOPDIR/ARCHPKGS/* $TOPDIR/OTHER/* > "$VM_SWAP"
+ ;;
+ esac || cleanup_and_exit 1
fi
-cleanup_and_exit 0
+echo
+echo "$HOST finished \"build $SPECFILE\" at `date --utc`."
+echo
+
+cleanup_and_exit "$exitcode"
diff --git a/build.1 b/build.1
index 5c69f97..53cfcea 100644
--- a/build.1
+++ b/build.1
@@ -1,4 +1,10 @@
-.TH build 1 "(c) 1997-2005 SuSE Linux AG Nuernberg, Germany"
+.de TQ \"follow a TP item with several TQ items to define several
+. \"entities with one shared description.
+.br
+.ns
+.TP \\$1
+..
+.TH build 1 "(c) 1997-2008 SuSE Linux AG Nuernberg, Germany"
.SH NAME
build \- build SuSE Linux RPMs in a chroot environment
.SH SYNOPSIS
@@ -43,6 +49,7 @@ automatically unpacks it for the build.
If neither is given,
.B build
will use all the specfiles in the current directory.
+.P
.SH OPTIONS
.TP
.B --clean
@@ -51,6 +58,10 @@ remove the build system and reinitialize it from scratch.
.B --no-init
skip the build system initialization and start with build immediately.
.TP
+.B --list-state
+list rpms that would be used to create a fresh build root.
+Does not create the build root or perform a build.
+.TP
.BI "\-\-rpms " path1 : path2 : path3\fR...\fP
Where build can find the SuSE Linux RPMs needed to create the
build system. This option overrides the BUILD_RPMS environment
@@ -62,22 +73,73 @@ What architectures to select from the RPMs.
automatically sets this to a sensible value for your host if you
don't specify this option.
.TP
+.BI "\-\-repo " url_or_dir
+Also use the specified repository to create the build system.
+The repositories may be either of type rpmmd, yast2 (susetags),
+or a simple directory. Multiple --repo options may be given.
+As a special form, 'zypp://reponame' can be used to specify
+a system repository. 'zypp://' selects all enabled system
+repositories. This is also the default if BUILD_RPMS is not
+set and no --rpms or --repo option is used.
+.TP
.BI "\-\-root " buildroot
Specifies where the build system is set up. Overrides the
BUILD_ROOT enviroment variable.
.TP
-.B "\-\-useusedforbuild"
+.B --useusedforbuild
Tell build not to do dependency expansion, but to extract the
-list of packages to install from "usedforbuild" lines or, if none
-are found, from all "BuildRequires" lines. This option is useful
+list of packages to install from "# usedforbuild" lines or, if none
+are found, from all "BuildRequires" lines. This option is useful
if you want to re-build a package from a srcrpm with exactly the
same packages used for the srcrpm build.
.TP
+.B --norootforbuild
+
+.TP
.B --help
Print a short help text.
.TP
.B --verify
verify the files in an existing build system.
+.TP
+.BI "\-\--dist " distribution
+Set the distribution. If this option is not given, build tries to
+calculate the distribution by looking at the rpm package used in the
+build.
+The specified distribution can either be a string
+like "11.2" or "sles9", or the pathname of the build configuration to
+use.
+
+.SH .spec FILE OPTIONS
+The
+.B build
+command interprets some special control comments in the specfile:
+.TP
+.B # norootforbuild
+.TQ
+.B # needsrootforbuild
+.B build
+uses either user
+.I root
+or user
+.I abuild
+in the build system to do the build. For non-SUSE distros as well as
+since SUSE 10.2, the default build user is
+.I abuild.
+For 10.2 and before, the default build user is
+.I root.
+These two flags in the spec file allow to deviate from the defaults
+and force-set the build user to
+.I abuild
+and
+.I root
+.RI "(for " "#\ norootforbuild" " and " "#\ needsrootforbuild" " respectively."
+.TP
+.B # needsbinariesforbuild
+provide the binary rpms that have been used to set up the build root
+in
+.I /.build.binaries
+within the build root.
.SH ENVIRONMENT
.TP
.B BUILD_ROOT
@@ -86,8 +148,7 @@ The directory where build should install the chrooted build system.
.TP
.B BUILD_RPMS
Where build can find the SuSE Linux RPMs. build needs them to create the
-build system. "/media/dvd/suse" is the default value which will do
-the trick if you have the SuSE Linux DVD mounted.
+build system.
.TP
.B BUILD_RPM_BUILD_STAGE
The rpm build stage (-ba, -bb, ...). This is just passed through to
@@ -96,7 +157,13 @@ rpm, check the rpm manpage for a complete list and descriptions.
You can use this to add more options to RPM.
.SH SEE ALSO
-.BR rpm (1),
+.BR rpm (8),
.TP
.BR "Maximum RPM":
.I http://www.rpm.org/max-rpm/
+.TP
+.BR "cross distribution packaging":
+.I http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
+.TP
+.BR "openSUSE packaging standards and guidelines":
+.I http://en.opensuse.org/Portal:Packaging
diff --git a/build_kiwi.sh b/build_kiwi.sh
new file mode 100644
index 0000000..3ee0a2a
--- /dev/null
+++ b/build_kiwi.sh
@@ -0,0 +1,270 @@
+#!/bin/bash
+run_kiwi()
+{
+ imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE imagetype)
+ imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE filename)
+ imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE version)
+ # prepare rpms as source and createrepo on the repositories
+ ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos
+ cd $BUILD_ROOT/$TOPDIR/SOURCES/repos
+ for r in */* ; do
+ test -L $r && continue
+ test -d $r || continue
+ repo="$TOPDIR/SOURCES/repos/$r/"
+ # create compatibility link for old kiwi versions
+ rc="${r//:/:/}"
+ if test "$rc" != "$r" ; then
+ rl="${rc//[^\/]}"
+ rl="${rl//?/../}"
+ mkdir -p "${rc%/*}"
+ ln -s $rl$r "${rc%/*}/${rc##*/}"
+ repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
+ fi
+ if test "$imagetype" != product ; then
+ echo "creating repodata for $repo"
+ if chroot $BUILD_ROOT createrepo --simple-md-filenames --help >/dev/null 2>&1 ; then
+ chroot $BUILD_ROOT createrepo --simple-md-filenames "$repo"
+ else
+ chroot $BUILD_ROOT createrepo "$repo"
+ fi
+ fi
+ done
+ # unpack root tar
+ for t in $BUILD_ROOT/$TOPDIR/SOURCES/root.tar* ; do
+ test -f $t || continue
+ mkdir -p $BUILD_ROOT/$TOPDIR/SOURCES/root
+ chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/root -xf "$TOPDIR/SOURCES/${t##*/}"
+ done
+ # fix script permissions
+ chmod a+x $BUILD_ROOT/$TOPDIR/SOURCES/*.sh 2>/dev/null
+ # unpack tar files in image directories
+ if test -d $BUILD_ROOT/$TOPDIR/SOURCES/images ; then
+ (
+ cd $BUILD_ROOT/$TOPDIR/SOURCES/images
+ for r in */* ; do
+ test -L $r && continue
+ test -d $r || continue
+ for t in $r/root.tar* ; do
+ test -f $t || continue
+ mkdir -p $r/root
+ chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/images/$r/root -xf "$TOPDIR/SOURCES/images/$r/${t##*/}"
+ done
+ # fix script permissions
+ chmod a+x $BUILD_ROOT/$TOPDIR/SOURCES/images/$r/*.sh 2>/dev/null
+ # create compatibility link for old kiwi versions
+ rc="${r//:/:/}"
+ if test "$rc" != "$r" ; then
+ rl="${rc//[^\/]}"
+ rl="${rl//?/../}"
+ mkdir -p "${rc%/*}"
+ ln -s $rl$r "${rc%/*}/${rc##*/}"
+ fi
+ done
+ )
+ fi
+ rm -f $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
+ ln -s $SPECFILE $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
+ if test "$imagetype" = product ; then
+ echo "running kiwi --create-instsource..."
+ # runs always as abuild user
+ mkdir -p "$BUILD_ROOT/$TOPDIR/KIWIROOT"
+ chroot "$BUILD_ROOT" chown -R abuild.abuild "$TOPDIR"
+ ver=`chroot "$BUILD_ROOT" su -c "/usr/sbin/kiwi --version | sed -n 's,.*kiwi version v\(.*\),\1,p'"`
+ if [ ${ver:0:1} == "3" ]; then
+ # old style kiwi 3 builds
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT -v --logfile terminal -p $TOPDIR/SOURCES --instsource-local --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ if [ ${ver:2:2} == "01" ]; then
+ ## This block is obsolete with current kiwi versions, only needed for kiwi 3.01 version
+ for i in $BUILD_ROOT/$TOPDIR/KIWIROOT/main/* ; do
+ test -d "$i" || continue
+ n="${i##*/}"
+ test "$n" = scripts && continue
+ test "$n" != "${n%0}" && continue
+ chroot $BUILD_ROOT su -c "suse-isolinux $TOPDIR/KIWIROOT/main/$n $TOPDIR/KIWI/$n.iso" - $BUILD_USER
+ done
+ fi
+ else
+ if [ ${ver:0:1} == "4" -a ${ver:2:2} -lt 90 ]; then
+ # broken kiwi version, not accepting verbose level
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT -v -v --logfile terminal -p $TOPDIR/SOURCES --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ else
+ # current default
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT -v 2 --logfile terminal -p $TOPDIR/SOURCES --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ fi
+ fi
+
+ # move created product to correct destination
+ for i in $BUILD_ROOT/$TOPDIR/KIWIROOT/main/* ; do
+ test -e "$i" || continue
+ f=${i##*/}
+ case $f in
+ *.iso) mv $i $BUILD_ROOT/$TOPDIR/KIWI/. ;;
+ scripts) ;;
+ *0) ;;
+ *) test -d $i && mv $i $BUILD_ROOT/$TOPDIR/KIWI/. ;;
+ esac
+ done
+ else
+ BUILD_SUCCEEDED=true
+ if [ -z "$RUNNING_IN_VM" ]; then
+ # NOTE: this must be done with the outer system, because it loads the dm-mod kernel modules, which needs to fit to the kernel.
+ echo "starting device mapper for kiwi..."
+ [ -x /etc/init.d/boot.device-mapper ] && /etc/init.d/boot.device-mapper start
+ fi
+ for imgtype in $imagetype ; do
+ echo "running kiwi --prepare for $imgtype..."
+ # Do not use $BUILD_USER here, since we always need root permissions
+ if chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype" - root < /dev/null ; then
+ echo "running kiwi --create for $imgtype..."
+ mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype" - root < /dev/null || cleanup_and_exit 1
+ else
+ cleanup_and_exit 1
+ fi
+ done
+
+ # create tar.gz of images, in case it makes sense
+ imagearch=`uname -m`
+ buildnum=""
+ if test -n "$RELEASE"; then
+ buildnum="-Build$RELEASE"
+ fi
+ imageout="$imagename.$imagearch-$imageversion"
+ for imgtype in $imagetype ; do
+ case "$imgtype" in
+ oem)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+echo "compressing oem images... "
+cd /$TOPDIR/KIWI-oem
+if [ -e "$imageout.iso" ]; then
+ echo "take iso file and create sha256..."
+ mv "$imageout.iso" "/$TOPDIR/KIWI/$imageout$buildnum.iso"
+ pushd /$TOPDIR/KIWI
+ if [ -x /usr/bin/sha256sum ]; then
+ /usr/bin/sha256sum "$imageout$buildnum.iso" > "$imageout$buildnum.iso.sha256"
+ fi
+ popd
+fi
+if [ -e "$imageout.raw" ]; then
+ compress_tool="bzip2"
+ compress_suffix="bz2"
+ if [ -x /usr/bin/xz ]; then
+ # take xz to get support for sparse files
+ compress_tool="xz -2"
+ compress_suffix="xz"
+ fi
+ mv "$imageout.raw" "/$TOPDIR/KIWI/$imageout$buildnum.raw"
+ pushd /$TOPDIR/KIWI
+ echo "\$compress_tool raw file..."
+ \$compress_tool "$imageout$buildnum.raw"
+ if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 file..."
+ /usr/bin/sha256sum "$imageout$buildnum.raw.\${compress_suffix}" > "$imageout$buildnum.raw.\${compress_suffix}.sha256"
+ fi
+ popd
+fi
+
+tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-raw.tar.bz2" \
+ --exclude="$imageout.iso" --exclude="$imageout.raw" *
+cd /$TOPDIR/KIWI
+if [ -x /usr/bin/sha256sum ]; then
+ /usr/bin/sha256sum "$imageout$buildnum-raw.tar.bz2" > "$imageout$buildnum-raw.tar.bz2.sha256"
+fi
+EOF
+ ;;
+ vmx)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+echo "compressing vmx images... "
+cd /$TOPDIR/KIWI-vmx
+# This option has a number of format parameters
+VMXFILES=""
+SHAFILES=""
+for i in "$imageout.vmx" "$imageout.vmdk" "$imageout-disk*.vmdk" "$imageout.ovf"; do
+ ls \$i >& /dev/null && VMXFILES="\$VMXFILES \$i"
+done
+if [ -n "\$VMXFILES" ]; then
+ tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-vmx.tar.bz2" \$VMXFILES
+ SHAFILES="\$SHAFILES $imageout$buildnum-vmx.tar.bz2"
+fi
+
+if [ -e "$imageout.xenconfig" ]; then
+ tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-vmx.tar.bz2" $imageout.xenconfig $imageout.raw initrd-*
+ SHAFILES="\$SHAFILES $imageout$buildnum-vmx.tar.bz2"
+fi
+# FIXME: do we need a single .raw file in any case ?
+
+cd /$TOPDIR/KIWI
+if [ -n "\$SHAFILES" -a -x /usr/bin/sha256sum ]; then
+ for i in \$SHAFILES; do
+ echo "Create sha256 file..."
+ /usr/bin/sha256sum "\$i" > "\$i.sha256"
+ done
+fi
+EOF
+ ;;
+ xen)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+echo "compressing xen images... "
+cd /$TOPDIR/KIWI-xen
+tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-xen.tar.bz2" \
+ `grep ^kernel $imageout.xenconfig | cut -d'"' -f2` \
+ `grep ^ramdisk $imageout.xenconfig | cut -d'"' -f2` \
+ initrd-* \
+ "$imageout.xenconfig" \
+ "$imageout"
+if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 file..."
+ cd $TOPDIR/KIWI
+ /usr/bin/sha256sum "$imageout$buildnum-xen.tar.bz2" > "$imageout$buildnum-xen.tar.bz2.sha256"
+fi
+EOF
+ ;;
+ pxe)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+echo "compressing pxe images... "
+cd /$TOPDIR/KIWI-pxe
+tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-pxe.tar.bz2" ${imageout}* initrd-*
+if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 file..."
+ cd $TOPDIR/KIWI
+ /usr/bin/sha256sum "$imageout$buildnum-pxe.tar.bz2" > "$imageout$buildnum-pxe.tar.bz2.sha256"
+fi
+EOF
+ ;;
+ iso)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+cd /$TOPDIR/KIWI-iso
+for i in *.iso; do
+ mv "\$i" "/$TOPDIR/KIWI/\${i%.iso}$buildnum.iso"
+done
+if [ -x /usr/bin/sha256sum ]; then
+ echo "creating sha256 sum for iso images... "
+ cd $TOPDIR/KIWI
+ for i in *.iso; do
+ /usr/bin/sha256sum "\$i" > "\$i.sha256"
+ done
+fi
+EOF
+ ;;
+ *)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+echo "compressing unkown images... "
+cd /$TOPDIR/KIWI-$imgtype
+tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-$imgtype.tar.bz2" *
+if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 file..."
+ cd /$TOPDIR/KIWI
+ /usr/bin/sha256sum "$imageout$buildnum-$imgtype.tar.bz2" > "$imageout$buildnum-$imgtype.tar.bz2.sha256"
+fi
+EOF
+ ;;
+ esac
+ chroot $BUILD_ROOT su -c "sh -e /kiwi_post.sh" || cleanup_and_exit 1
+ rm -f $BUILD_ROOT/kiwi_post.sh
+ done
+ fi
+ # Hook for running post kiwi build scripts like QA scripts if installed
+ if [ -x /usr/lib/build/kiwi_post_run ]; then
+ chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run || cleanup_and_exit 1
+ fi
+}
diff --git a/changelog2spec b/changelog2spec
new file mode 100755
index 0000000..0128ee7
--- /dev/null
+++ b/changelog2spec
@@ -0,0 +1,222 @@
+#!/usr/bin/perl -w
+
+#
+# Convert a SUSE or Debian changelog file to rpm format
+#
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Date::Parse;
+use Time::Zone;
+
+use strict;
+
+my @wday = qw{Sun Mon Tue Wed Thu Fri Sat};
+my @mon = qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec};
+
+my $ok;
+my $zone;
+my $test;
+my $printtype;
+my $input = '';
+my $target = 'rpm';
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--test') {
+ $test = 1;
+ shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--type') {
+ $printtype = 1;
+ shift @ARGV;
+ next;
+ }
+ if (@ARGV > 1 && $ARGV[0] eq '--target') {
+ shift @ARGV;
+ $target = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+if (@ARGV == 2 && $ARGV[0] eq '--file') {
+ die("bad --file arg\n") unless $ARGV[1] =~ /^(.*)\/([^\/]+)$/;
+ my ($dir, $file) = ($1, $2);
+ $file =~ s/\.(?:spec|dsc)$//;
+ opendir(D, $dir) || die("$dir: $!\n");
+ my @changes = grep {/\.changes$/} readdir(D);
+ closedir(D);
+ @changes = sort {length($a) <=> length($b) || $a cmp $b} @changes;
+ exit(1) unless @changes; # nothing to do
+ if (@changes > 1) {
+ while ($file ne '') {
+ my @c = grep {/\Q$file\E/} @changes;
+ if (@c) {
+ @changes = @c;
+ last;
+ }
+ last unless $file =~ s/[-.][^-.]*$//;
+ }
+ }
+ @ARGV = ("$dir/$changes[0]");
+}
+
+sub parse_suse {
+ $_ = $_[0];
+
+ my $dline;
+ die("bad changelog heading\n") unless /^(?:\* )?([A-Za-z]+\s+[A-Za-z]+\s+[0-9][^-]*[0-9][0-9][0-9][0-9])(.*\@.*$)/;
+ my $dt = $1;
+ my $who = $2;
+ $dt = lc($dt);
+ $who =~ s/^\s+//;
+ $who =~ s/^-\s*//;
+ $dt =~ /([0-9][0-9][0-9][0-9])/;
+ $dline = $_;
+ my $year = $1;
+ if (!defined($zone) && $dt =~ /\s([a-z]{3,4})(dst)?\s[0-9]{4}/) {
+ my $dst = $2;
+ $zone = tz_offset($1);
+ $zone += 3600 if defined($zone) && $dst;
+ }
+ my $tdt = str2time($dt);
+ $dt =~ /([0-9]+)/;
+ my $day = $1;
+ if (!$tdt) {
+ if ($dt =~ /([a-z]{3})\s+([a-z]{3})/) {
+ $tdt = str2time("$1 $2 $day $year");
+ }
+ }
+ if (!$tdt) {
+ if ($dt =~ /([a-z]{3})/) {
+ $tdt = str2time("$1 $day $year");
+ }
+ }
+ if (!$tdt) {
+ $tdt = str2time("$year-1-1");
+ }
+ $tdt += 12 * 3600 unless $dt =~ /\d:\d/; # 12:00 if not specified
+ $tdt += ($zone || 0);
+ my $ok = 1;
+ my $change = '';
+ while(<>) {
+ chomp;
+ last if /^(?:\* )?([A-Za-z]+\s+[A-Za-z]+\s+[0-9][^-]*[0-9][0-9][0-9][0-9])(.*\@.*$)/;
+ next if (/^--------------/);
+ next if (/^========================/);
+ s/\s+$//;
+ next if $_ eq '';
+ s/^\s*-/-/ if $ok == 1; # obsolete?
+ s/^\s*\*\s*/ * /;
+ if (!/^-/) {
+ s/^\s+-\s*/ - /;
+ s/^\s*/ / unless s/^ \s*/ /;
+ }
+ $change .= "$_\n";
+ $ok = 2;
+ }
+ return ($_, $tdt, $dline, $who, $change);
+}
+
+sub parse_debian {
+ $_ = $_[0];
+
+ die("bad line: $_\n") unless /^(\w[-+0-9a-z.]*) \(([^\(\) \t]+)\)((\s+[-+0-9a-z.]+)+)\;.*$/;
+ my $package = $1;
+ my $version = $2;
+ my $distribution = $3;
+ my $who;
+ my $date;
+ my $changes = "- version $version\n";
+ while(<>) {
+ chomp;
+ s/\s+$//;
+ next if $_ eq '';
+ if (/^ --/) {
+ die("bad maintainer line\n") unless /^ \-\- (.* <.*>) (.*)$/;
+ $who = $1;
+ $date = $2;
+ last;
+ }
+ die("bad change details line: $_\n") unless s/^ //;
+ s/^\*/-/;
+ s/\s*\(closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*\)//i;
+ s/\s+$//;
+ next if $_ eq '';
+ $changes .= "$_\n";
+ }
+ die("no maintainer line in last entry\n") unless defined $date;
+ if (!defined($zone) && ($date =~ /([-+])(\d\d)(\d\d)$/)) {
+ $zone = 60 * ($3 + 60 * $2);
+ $zone = -$zone if $1 eq '-';
+ }
+ my $tdt = str2time($date);
+ return ('', $tdt, $_, $who, $changes);
+}
+
+my $format;
+while (<>) {
+ chomp;
+ next if /^\s*$/;
+ next if (/^--------------/);
+ next if (/^========================/);
+ if (/^(?:\* )?([A-Za-z]+\s+[A-Za-z]+\s+[0-9][^-]*[0-9][0-9][0-9][0-9])(.*\@.*$)/) {
+ $format = 'suse';
+
+ } elsif (/^(\w[-+0-9a-z.]*) \(([^\(\) \t]+)\)((\s+[-+0-9a-z.]+)+)\;.*$/) {
+ $format = 'debian';
+ } else {
+ die("unknown changelog format\n");
+ }
+ last;
+}
+exit(0) unless $format;
+
+if ($printtype) {
+ print "$format\n";
+ exit(0);
+}
+
+if ($target eq $format) {
+ print "$_\n";
+ while (<>) {
+ print $_;
+ }
+ exit(0);
+}
+
+die("don't know how to convert changelog to format '$target'\n") if $target ne 'rpm';
+
+my ($lastt, $t, $dline, $who, $changes);
+while(defined($_)) {
+ if (/^\s*$/) {
+ $_ = <>;
+ last unless $_;
+ chomp;
+ next;
+ }
+ if ($format eq 'suse') {
+ ($_, $t, $dline, $who, $changes) = parse_suse($_);
+ } elsif ($format eq 'debian') {
+ ($_, $t, $dline, $who, $changes) = parse_debian($_);
+ }
+ if (defined($lastt) && $lastt < $t) {
+ die("changes file not incremental: $dline\n") if $test;
+ warn("changes file not incremental: $dline\n");
+ }
+ $lastt = $t;
+ my @gm = gmtime($t);
+ # silly rpm can't hande dates < 1997, so we fold everything to
+ # Thu Jan 02 1997
+ @gm = (0, 0, 0, 2, 0, 97, 4) if $gm[5] < 97 || ($gm[5] == 97 && $gm[4] == 0 && $gm[3] <= 1);
+ printf("* %s %s %2d %4d %s\n", $wday[$gm[6]], $mon[$gm[4]], $gm[3], $gm[5] + 1900, $who);
+ $changes =~ s/%/%%/g;
+ $changes =~ s/^(\s*)%%(\S*)/$1\[%%$2\]/;
+ $changes =~ s/^(\s*)(\#\d*)/$1\[$2\]/mg;
+ $changes =~ s/^\*/ */mg;
+ print $changes;
+}
+exit(0);
diff --git a/common_functions b/common_functions
new file mode 100755
index 0000000..192b7db
--- /dev/null
+++ b/common_functions
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+: ${CACHE_DIR:=/var/cache/build}
+
+set_build_arch()
+{
+ : ${BUILD_HOST_ARCH:=`uname -m`}
+
+ if [ -z "$BUILD_ARCH" ]; then
+ BUILD_ARCH="$BUILD_HOST_ARCH"
+ test i686 != "$BUILD_ARCH" || BUILD_ARCH=i586 # XXX: why?
+ fi
+
+ case $BUILD_ARCH in
+ i686) BUILD_ARCH="i686:i586:i486:i386" ;;
+ i586) BUILD_ARCH="i586:i486:i386" ;;
+ i486) BUILD_ARCH="i486:i386" ;;
+ i386) BUILD_ARCH="i386" ;;
+ x86_64) BUILD_ARCH="x86_64:i686:i586:i486:i386" ;;
+ sparc64v) BUILD_ARCH="sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc" ;;
+ sparc64) BUILD_ARCH="sparc64:sparcv9:sparcv8:sparc" ;;
+ sparcv9v) BUILD_ARCH="sparcv9v:sparcv9:sparcv8:sparc" ;;
+ sparcv9) BUILD_ARCH="sparcv9:sparcv8:sparc" ;;
+ sparcv8) BUILD_ARCH="sparcv8:sparc" ;;
+ sparc) BUILD_ARCH="sparc" ;;
+ esac
+ if test "$BUILD_ARCH" != "${BUILD_ARCH#i686}" ; then
+ cpuflags=`grep ^flags /proc/cpuinfo`
+ cpuflags="$cpuflags "
+ if test "$cpuflags" = "${cpuflags/ cx8 /}" -o "$cpuflags" = "${cpuflags/ cmov /}"; then
+ echo "Your cpu doesn't support i686 rpms. Exit."
+ cleanup_and_exit 1
+ fi
+ fi
+}
+
+check_exit()
+{
+ if test -e $BUILD_ROOT/exit; then
+ echo "exit ..."
+ cleanup_and_exit 1
+ fi
+}
+
+is_emulator_arch()
+{
+ local arch
+ for arch in $EMULATOR_ARCHS; do
+ if test "$BUILD_ARCH" != "${BUILD_ARCH/${arch}/}" -a "$BUILD_HOST_ARCH" != "$arch"; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+check_use_emulator()
+{
+ is_emulator_arch || return
+
+ if [ -z "$VM_TYPE" ]; then
+ return 0
+ fi
+
+ # to run the qemu initialization in the XEN chroot, we need to
+ # register it with a static program or shell script
+ case "$BUILD_HOST_ARCH" in
+ i?86|x86_64)
+ if test -e $BUILD_DIR/initvm && \
+ test -e $BUILD_DIR/qemu-reg; then
+ return 0 # prefer initvm to handle registration
+ elif test -e /bin/bash-static \
+ -a -e /bin/mount-static \
+ -a -e /usr/sbin/qemu-binfmt-conf.sh; then
+ return 0 # as backup use /usr/sbin/qemu-binfmt.conf.sh
+ else
+ # XXX: error?
+ echo "Warning: cross compile not possible due to missing static binaries"
+ fi
+ ;;
+ esac
+ return 1
+}
+
+# usage:
+# progress_setup LIST
+# for I in $LIST; do
+# progress_step LIST
+# action $I
+# done
+
+# $1 name of a textual list
+progress_setup() {
+ eval "$1__ARRAY__=(\$$1)"
+ eval "$1__INDEX__=1"
+ eval "$1__LENGTH__=\${#$1__ARRAY__[@]}"
+}
+
+# $1 name of a textual list
+# $2 optional, printf format for 2 numeric arguments (current, total)
+progress_step() {
+ local IDX=$1__INDEX__
+ local LEN=$1__LENGTH__
+ printf "${2-[%d/%d] }" $(($IDX++)) ${!LEN}
+}
diff --git a/computeblocklists b/computeblocklists
new file mode 100755
index 0000000..f9300d6
--- /dev/null
+++ b/computeblocklists
@@ -0,0 +1,100 @@
+#!/usr/bin/perl -w
+# compute the blocks used by a file
+# usage:
+# computeblocklists [options] <files...>
+# options:
+# --padstart NUM, --padend NUM, --verbose
+#
+# output:
+# <file base name> <size> <blocksize> <block numbers...>
+#
+# a block is either a number or a range (start-end)
+#
+# TODO: instead of printing zeroes for each block in a hole use
+# something like 0*num
+
+use strict;
+
+my ($opt_padstart, $opt_padend, $opt_verbose);
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--padstart') {
+ shift @ARGV;
+ $opt_padstart = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--padend') {
+ shift @ARGV;
+ $opt_padend = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--verbose' || $ARGV[0] eq '-v') {
+ shift @ARGV;
+ $opt_verbose = 1;
+ next;
+ }
+ last;
+}
+
+if($opt_padstart) {
+ print "\n"x$opt_padstart;
+}
+
+for my $file (@ARGV) {
+ next unless -f $file;
+ print STDERR "$file\n" if $opt_verbose;
+ my $n = $file;
+ $n =~ s/.*\///;
+
+ if(!open(F, '<', $file)) {
+ print STDERR "$file: $!";
+ next;
+ }
+
+ my $bsize = 'xxxx';
+ ioctl(F, 2, $bsize) || ioctl(F, 536870914, $bsize) || die("FIGETBSZ: $!\n");
+ $bsize = unpack("L", $bsize);
+
+ my @stat = stat(F);
+ my ($st_size, $st_blocks) = ($stat[7], $stat[11], $stat[12]);
+
+ my $blocks = int(($st_size+$bsize-1)/$bsize);
+
+ print "$n $st_size $bsize ";
+
+ my ($firstblock, $lastblock);
+ for ($b = 0; $b < $blocks; ++$b) {
+ my $block = pack('I', $b);
+ if(not defined ioctl(F, 1, $block)) {
+ if(not defined ioctl(F, 536870913, $block)) {
+ die "$file: $!";
+ }
+ }
+ $block = unpack('I', $block);
+ if($b == 0) {
+ print "$block";
+ $firstblock = $block;
+ } else {
+ # blocks are non-contiguous
+ if($lastblock+1 != $block) {
+ # check if we skipped some that form a range
+ if($firstblock != $lastblock) {
+ printf "-$lastblock";
+ }
+ print " $block";
+ $firstblock = $block;
+ }
+ # last block, check if contiguous
+ if($b+1==$blocks && $lastblock+1 == $block) {
+ print "-$block";
+ }
+ }
+ $lastblock = $block;
+ }
+ close F;
+ print "\n";
+}
+
+if($opt_padend) {
+ print "\n"x$opt_padend;
+}
diff --git a/configs/arch.conf b/configs/arch.conf
new file mode 100644
index 0000000..2b4b31d
--- /dev/null
+++ b/configs/arch.conf
@@ -0,0 +1,16 @@
+Repotype: arch
+
+Preinstall: glibc bash perl sed grep coreutils pacman pacman-mirrorlist
+Preinstall: gawk gzip filesystem curl acl gpgme libarchive
+Preinstall: openssl libssh2 zlib libassuan libgpg-error attr
+Preinstall: expat xz bzip2
+
+VMinstall: util-linux binutils readline ncurses pcre libcap
+
+Required: binutils gcc glibc libtool
+
+Support: acl autoconf automake zlib bzip2 filesystem curl
+Support: libtool ncurses perl gpgme libarchive openssl libssh2
+Support: libassuan libgpg-error attr expat xz pacman pacman-mirrorlist
+Support: fakeroot file sudo patch make net-tools
+
diff --git a/configs/debian.conf b/configs/debian.conf
index 988f9e6..c37b4c4 100644
--- a/configs/debian.conf
+++ b/configs/debian.conf
@@ -1,8 +1,14 @@
+Repotype: debian
+
Preinstall: bash perl-base sed grep coreutils debianutils
Preinstall: libc6 libncurses5 libacl1 libattr1
Preinstall: libreadline4 tar gawk dpkg
Preinstall: sysv-rc gzip base-files
+Runscripts: base-files
+
+VMinstall: util-linux binutils libblkid1 libuuid1 libdevmapper1.02 mount
+
Required: autoconf automake binutils bzip2 gcc gettext libc6
Required: libtool libncurses5 perl zlib1g dpkg
diff --git a/configs/sl10.0.conf b/configs/sl10.0.conf
index 1c4835f..e9de0b1 100644
--- a/configs/sl10.0.conf
+++ b/configs/sl10.0.conf
@@ -1,8 +1,14 @@
+Repotype: rpm-md suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -136,13 +142,17 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java-1_4_2-sun-devel jpackage-utils update-alternatives
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ppc
+Substitute: java2-devel-packages IBMJava2-JRE IBMJava2-SDK jpackage-utils update-alternatives
+ %endif
+ %ifarch s390 ia64
+Substitute: java2-devel-packages java-1_4_2-ibm-devel jpackage-utils update-alternatives
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit jpackage-utils update-alternatives
%endif
%endif
@@ -159,33 +169,34 @@ Substitute: glibc-devel-32bit
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um kernel-xen
%endif
%ifarch ia64
Substitute: kernel-binary-packages kernel-default kernel-debug
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-iseries64
%endif
%ifarch ppc64
Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
Substitute: kernel-binary-packages kernel-default
-%enidf
+%endif
Macros:
-%define insserv_prereq insserv sed
-%define fillup_prereq fillup coreutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 1000
-%define sles_version 0
-%define ul_version 0
-%define do_profiling 1
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 1000
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl10.1.conf b/configs/sl10.1.conf
index cf9f375..654ea3e 100644
--- a/configs/sl10.1.conf
+++ b/configs/sl10.1.conf
@@ -3,6 +3,10 @@ Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libnscd libxcrypt m4 ncurses pam
Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -137,12 +141,12 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java-1_4_2-sun-devel update-alternatives
%else
%ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
+Substitute: java2-devel-packages java-1_4_2-ibm-devel update-alternatives
%else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit update-alternatives
%endif
%endif
@@ -175,17 +179,18 @@ Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
Substitute: kernel-binary-packages kernel-default
-%enidf
+%endif
Macros:
-%define insserv_prereq insserv sed devs
-%define fillup_prereq fillup coreutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 1001
-%define sles_version 0
-%define ul_version 0
-%define do_profiling 1
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 1010
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl10.2.conf b/configs/sl10.2.conf
new file mode 100644
index 0000000..fdf5ec6
--- /dev/null
+++ b/configs/sl10.2.conf
@@ -0,0 +1,208 @@
+Preinstall: aaa_base acl attr bash bzip2 coreutils db diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libgcc41 libnscd libxcrypt m4 ncurses pam
+Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+
+Runscripts: aaa_base
+
+VMinstall: util-linux perl libvolume_id
+
+Required: autoconf automake binutils bzip2 db gcc gcc41
+Required: gdbm gettext glibc libtool ncurses perl rpm zlib
+
+Support: audit-libs bind-libs
+Support: bind-utils bison cpio cpp cpp41 cracklib cvs cyrus-sasl
+Support: e2fsprogs file findutils flex gawk gdbm-devel gettext-devel
+Support: glibc-devel glibc-locale gpm groff gzip info klogd less
+Support: libcom_err libltdl libmudflap41 libstdc++41 libzio
+Support: linux-kernel-headers make man mktemp module-init-tools
+Support: ncurses-devel net-tools netcfg openldap2-client openssl
+Support: pam-modules patch procinfo procps psmisc rcs strace sysvinit
+Support: tcpd texinfo timezone unzip util-linux vim zlib-devel
+
+Keep: binutils cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libstdc++ libunwind
+Keep: libunwind-devel libzio make mktemp pam-devel pam-modules
+Keep: patch perl rcs timezone
+
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun java-1_4_2-sun-jdbc gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend mDNSResponder-lib
+
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit libcdio-mini faac-min
+
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -crossover-office -java-1_5_0-ibm -java-1_5_0-ibm-jdbc
+Prefer: -java-1_4_2-gcj-compat -NX
+
+Conflict: ghostscript-library:ghostscript-mini
+
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release
+Ignore: gettext-devel:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,sgml-skel,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: kernel-um:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: mkinitrd:pciutils
+Ignore: libgcc:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+
+%ifnarch s390 s390x ppc ia64
+Substitute: java2-devel-packages java-1_4_2-sun-devel update-alternatives
+%else
+ %ifnarch s390 ppc
+Substitute: java2-devel-packages java-1_4_2-ibm-devel update-alternatives
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit update-alternatives
+ %endif
+ %ifarch ia64
+Substitute: java2-devel-packages java-1_5_0-bea-devel update-alternatives
+ %endif
+%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kernel-source kernel-syms
+%suse_version 1020
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl10.3.conf b/configs/sl10.3.conf
new file mode 100644
index 0000000..03b71c0
--- /dev/null
+++ b/configs/sl10.3.conf
@@ -0,0 +1,316 @@
+%define gcc_version 42
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 ncurses pam
+Preinstall: permissions popt libreadline5 rpm sed tar zlib
+
+Runscripts: aaa_base
+
+VMinstall: util-linux perl-base libdb-4_5 libvolume_id
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext glibc libtool ncurses perl rpm zlib
+
+Support: audit-libs cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-devel
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libltdl-3 libmudflap%{gcc_version} libstdc++%{gcc_version}
+Support: libvolume_id libxcrypt libzio
+Support: linux-kernel-headers make man mktemp netcfg
+Support: net-tools pam-modules patch perl-base sysvinit
+Support: texinfo timezone util-linux
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: audit-libs binutils bzip2 cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada
+Keep: libunwind libunwind-devel libzio make mktemp pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone
+Keep: cpp%{gcc_version} gcc%{gcc_version} gcc%{gcc_version}-ada libstdc++%{gcc_version}
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libltdl-3 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: java-1_5_0-sun java-1_5_0-sun-jdbc java-1_5_0-sun-devel java-1_5_0-bea-devel
+Prefer: gnome-panel desktop-data-SuSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version} libmudflap%{gcc_version}
+
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: saxon:java-1_4_2-cacao gjdoc:antlr
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm-devel
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf gnu-javamail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+%if ! 0%{?opensuse_bs}
+Prefer: -crossover-office -java-1_5_0-ibm -java-1_5_0-ibm-jdbc
+Prefer: -java-1_4_2-gcj-compat -java-1_4_2-gcj-compat-devel
+%endif
+Prefer: -java-1_4_2-cacao -java-1_4_2-cacao-devel -java-1_4_2-ibm -java-1_4_2-ibm-devel
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: -libgcc41 -libgcc41-32bit -libgcc41-64bit
+Prefer: -libffi41
+Prefer: -libgcc43 -libgcc43-32bit -libgcc43-64bit
+Prefer: -libffi43 -libgomp43
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini
+Prefer: -libcdio-mini -faac-mini
+
+Conflict: ghostscript-library:ghostscript-mini
+
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-devel:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+
+%if 0%{?opensuse_bs}
+Substitute: java2-devel-packages gcc-java java-1_4_2-gcj-compat-devel
+%else
+ %ifnarch s390 s390x ppc ppc64 ia64
+Substitute: java2-devel-packages java-1_5_0-sun-devel unzip update-alternatives
+ %else
+ %ifarch s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_5_0-ibm-devel unzip update-alternatives
+ %endif
+ %ifarch ia64
+Substitute: java2-devel-packages java-1_5_0-bea-devel unzip update-alternatives
+ %endif
+ %endif
+%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen kernel-xenpae
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+%ifarch ppc64
+Substitute: mono-devel mono-devel mono-biarchcompat
+Substitute: mono-basic mono-basic mono-biarchcompat
+Substitute: mono-tools mono-tools mono-biarchcompat
+%endif
+
+
+Optflags: i586 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: i686 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: x86_64 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: ppc -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: ppc64 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+
+Optflags: * -O2
+
+%define suse_version 1030
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kernel-source kernel-syms
+%suse_version 1030
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl11.0.conf b/configs/sl11.0.conf
new file mode 100644
index 0000000..3b1a048
--- /dev/null
+++ b/configs/sl11.0.conf
@@ -0,0 +1,377 @@
+%define gcc_version 43
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions popt libreadline5 rpm sed tar zlib
+
+Runscripts: aaa_base
+
+VMinstall: util-linux perl-base libdb-4_5 libvolume_id
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext-runtime glibc libtool perl rpm zlib libmpfr1 gmp
+Required: libncurses5
+
+Support: audit-libs cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libltdl-3 libmudflap%{gcc_version} libstdc++%{gcc_version}
+Support: libvolume_id libxcrypt libzio
+Support: linux-kernel-headers make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit
+Support: texinfo timezone util-linux login
+Support: terminfo-base libgomp43 libuuid1 psmisc
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: audit-libs binutils bzip2 cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone gmp libmpfr1
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libltdl-3 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: java-1_5_0-sun java-1_5_0-sun-jdbc java-1_5_0-sun-devel java-1_5_0-bea java-1_5_0-bea-devel
+Prefer: java-1_7_0-icedtea
+%ifarch ppc ppc64
+Prefer: java-1_5_0-ibm
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm
+%endif
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+Prefer: libstroke
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: saxon:java-1_4_2-cacao gjdoc:antlr
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm-devel
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf gnu-javamail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: xfce4-desktop:xfce4-desktop-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: OpenOffice_org:OpenOffice_org-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: glib2:glib2-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+%if ! 0%{?opensuse_bs}
+Prefer: -crossover-office
+%ifnarch s390 s390x
+Prefer: -java-1_6_0-ibm
+%endif
+%ifnarch ppc
+Prefer: -java-1_5_0-ibm -java-1_5_0-ibm-jdbc
+%endif
+Prefer: -java-1_4_2-gcj-compat -java-1_4_2-gcj-compat-devel
+%endif
+Prefer: -java-1_4_2-cacao -java-1_4_2-cacao-devel -java-1_4_2-ibm -java-1_4_2-ibm-devel
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel
+
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: yast2-casa-ats:CASA_auth_token_svc
+
+%if 0%{?opensuse_bs}
+Substitute: java2-devel-packages gcc-java java-1_4_2-gcj-compat-devel
+%else
+ %ifnarch s390 s390x ppc ppc64 ia64
+Substitute: java2-devel-packages java-1_5_0-sun-devel unzip update-alternatives
+ %else
+ %ifarch s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_5_0-ibm-devel unzip update-alternatives
+ %endif
+ %ifarch ia64
+Substitute: java2-devel-packages java-1_5_0-bea-devel unzip update-alternatives
+ %endif
+ %endif
+%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+%ifarch ppc64
+Substitute: mono-devel mono-devel mono-biarchcompat
+Substitute: mono-basic mono-basic mono-biarchcompat
+Substitute: mono-tools mono-tools mono-biarchcompat
+%endif
+
+
+Optflags: i586 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: i686 -march=i686 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: x86_64 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: ppc -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+Optflags: ppc64 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector
+
+Optflags: * -O2
+
+%define suse_version 1100
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kernel-source kernel-syms
+%kernel_module_package_buildreqs kernel-source kernel-syms
+%suse_version 1100
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl11.1.conf b/configs/sl11.1.conf
new file mode 100644
index 0000000..ef63de8
--- /dev/null
+++ b/configs/sl11.1.conf
@@ -0,0 +1,407 @@
+%define gcc_version 43
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions popt libreadline5 rpm sed tar zlib libselinux1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux perl-base libdb-4_5 libvolume_id1 libsepol1
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext-runtime glibc libtool perl rpm zlib libmpfr1 gmp
+Required: libncurses5
+
+Support: audit-libs cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libstdc++%{gcc_version}
+Support: libvolume_id1 libxcrypt libzio
+Support: linux-kernel-headers make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit
+Support: texinfo timezone util-linux login
+Support: libgomp43 libuuid1 psmisc
+Support: terminfo-base
+
+Support: build brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: audit-libs binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone gmp libmpfr1
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+Keep: libvolume_id libvolume_id1
+
+Prefer: -openSUSE-build-key
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+Prefer: libstroke
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: xfce4-desktop:xfce4-desktop-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: OpenOffice_org:OpenOffice_org-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner190-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: ant:xerces-j2
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: -libopenal0-soft -openal-soft -lsb-buildenv
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: OpenOffice_org:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-dvd9,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+
+%ifarch s390 s390x
+Ignore: yast2-all-packages:yast2-x11
+%endif
+
+%ifnarch ia64 s390 s390x ppc ppc64
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x ppc ppc64
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifnarch ia64 s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+%else
+ %ifarch s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+ %endif
+ %ifarch ia64
+Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+ %endif
+%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+%ifarch ppc64
+Substitute: mono-devel mono-devel mono-biarchcompat
+Substitute: mono-basic mono-basic mono-biarchcompat
+Substitute: mono-tools mono-tools mono-biarchcompat
+Substitute: mono-data-sqlite mono-data-sqlite libsqlite3-0-32bit
+%endif
+
+
+Optflags: i586 -march=i586 -mtune=i686 -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=i686 -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1110
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+
+%suse_version 1110
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl11.2.conf b/configs/sl11.2.conf
new file mode 100644
index 0000000..daa1bcb
--- /dev/null
+++ b/configs/sl11.2.conf
@@ -0,0 +1,452 @@
+%define gcc_version 44
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux
+Substitute: kiwi-filesystem:ext3 e2fsprogs procps psmisc reiserfs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot module-init-tools elfutils squashfs aufs aufs-kmp-default
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-xenboot ncurses-utils curl dhcpcd iputils nbd net-tools netcfg nfs-client parted grub mdadm
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot
+Substitute: kiwi-boot:usbboot kiwi-desc-usbboot
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot
+
+Substitute: build:debug vim strace gdb
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: liblzma0 libcap2 libpcre0
+Preinstall: libpopt0 libelf1 liblua5_1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux perl-base libdb-4_5 libsepol1 libblkid1 libuuid1
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext-runtime glibc libtool perl rpm zlib libmpfr1
+Required: libncurses5 libgmp3 libgmpxx4
+
+Support: audit-libs cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libstdc++%{gcc_version}
+Support: libxcrypt libzio
+Support: linux-kernel-headers make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit
+Support: texinfo timezone util-linux login
+Support: libgomp%{gcc_version} libuuid1 psmisc
+Support: terminfo-base
+
+# build tools packages
+Support: build brp-check-suse post-build-checks
+Support: rpmlint-Factory
+Keep: brp-check-suse
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: audit-libs binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libpcre0
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone libmpfr1 libcap2
+Keep: gmp libgmp3 libgmpxx4
+Keep: cpp44 gcc44 gcc44-ada libstdc++44
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel libcloog0 libppl7 libppl_c2
+Keep: libpopt0
+
+Prefer: -suse-build-key
+Prefer: krb5 krb5-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default preload-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+Prefer: libstroke
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: OpenOffice_org:OpenOffice_org-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: beagle-index:preload-kmp-default
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: OpenOffice_org:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+
+#Temporary hack to solve #442202
+Ignore: yast2-all-packages:yast2-boot-server,yast2-heartbeat,yast2-issleconfig,yast2-linux-user-mgmt,yast2-trans-am,yast2-trans-be,yast2-trans-he,yast2-trans-ms,yast2-trans-my,yast2-trans-tk
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre,libpcre0
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: OpenOffice_org:OpenOffice_org-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: pulseaudio:kernel
+
+%ifarch s390 s390x
+Ignore: yast2-all-packages:yast2-x11
+%endif
+
+%ifnarch ia64 s390 s390x
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1120
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+
+%suse_version 1120
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl11.3.conf b/configs/sl11.3.conf
new file mode 100644
index 0000000..4155315
--- /dev/null
+++ b/configs/sl11.3.conf
@@ -0,0 +1,489 @@
+%define gcc_version 45
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-11-3
+Substitute: kiwi-filesystem:ext3 e2fsprogs procps psmisc reiserfs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot module-init-tools elfutils squashfs clicfs e2fsprogs fribidi gfxboot-devel gawk gfxboot gfxboot-devel grub hdparm hwinfo iproute2 kiwi-tools lvm2 make memtest86+ netcfg psmisc
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-xenboot ncurses-utils curl dhcpcd iputils nbd net-tools netcfg nfs-client parted grub mdadm
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot
+Substitute: kiwi-boot:usbboot kiwi-desc-usbboot
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot
+
+Substitute: build:debug vim strace gdb
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: liblzma0 libcap2 libpcre0
+Preinstall: libpopt0 libelf1 liblua5_1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux perl-base libdb-4_5 libsepol1 libblkid1 libuuid1
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext-runtime glibc libtool perl rpm zlib libmpfr1
+Required: libncurses5 libgmp3 libgmpxx4
+
+Support: libaudit1
+Support: cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libstdc++%{gcc_version}
+Support: libxcrypt libzio
+Support: make man netcfg
+Support: linux-glibc-devel
+Support: net-tools pam-modules patch perl-base sysvinit-tools
+Support: texinfo timezone util-linux login
+Support: libgomp%{gcc_version} libuuid1 psmisc
+Support: terminfo-base update-alternatives pwdutils build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: libaudit1 binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libpcre0
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone libmpfr1 libcap2
+Keep: gmp libgmp3 libgmpxx4 libmpc2
+Keep: cpp45 gcc45 gcc45-ada libstdc++45
+Keep: cpp44 gcc44 gcc44-ada libstdc++44
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel libcloog0 libppl7 libppl_c2
+Keep: libpopt0 pkg-config
+
+Prefer: -suse-build-key
+Prefer: krb5 krb5-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default preload-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: OpenOffice_org:OpenOffice_org-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: beagle-index:preload-kmp-default
+Prefer: dummy-release
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libffi%{gcc_version}-devel libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: OpenOffice_org:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng14-compat-devel
+Prefer: -python3 -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+
+#Temporary hack to solve #442202
+Ignore: yast2-all-packages:yast2-boot-server,yast2-heartbeat,yast2-issleconfig,yast2-linux-user-mgmt,yast2-trans-am,yast2-trans-be,yast2-trans-he,yast2-trans-ms,yast2-trans-my,yast2-trans-tk
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre,libpcre0
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: OpenOffice_org:OpenOffice_org-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+
+%ifnarch ia64 s390 s390x
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+# We use always openjdk on openSUSE !
+#%ifnarch ia64 s390 s390x
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+#%else
+# %ifarch s390 s390x
+#Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+# %endif
+# %ifarch ia64
+#Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+# %endif
+#%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1130
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+
+%suse_version 1130
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl11.4.conf b/configs/sl11.4.conf
new file mode 100644
index 0000000..787b42b
--- /dev/null
+++ b/configs/sl11.4.conf
@@ -0,0 +1,600 @@
+%define gcc_version 45
+%define opensuse_bs 1
+
+Patterntype: rpm-md ymp
+%if "%_repository" == "images"
+Type: kiwi
+Repotype: none
+Patterntype: none
+Prefer: openSUSE-release
+%endif
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-11-3
+Substitute: kiwi-filesystem:ext3 e2fsprogs procps psmisc reiserfs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot module-init-tools elfutils squashfs fribidi gfxboot-devel gawk gfxboot gfxboot-devel grub hdparm hwinfo iproute2 kiwi-tools lvm2 make memtest86+ netcfg psmisc squashfs sysfsutils syslinux clicfs e2fsprogs
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot adaptec-firmware atftp bc bind-libs bind-utils bootsplash bootsplash-branding-openSUSE busybox bzip2 clicfs cryptsetup curl dhcpcd dialog e2fsprogs eject fbiterm file fribidi gettext-runtime gfxboot gfxboot-devel grub hwinfo kernel-default kernel-default-base kernel-desktop kexec-tools kiwi-tools lvm2 make module-init-tools netcfg net-tools parted pciutils psmisc squashfs sysconfig sysfsutils tar util-linux jing
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-xenboot ncurses-utils curl dhcpcd iputils nbd net-tools netcfg nfs-client parted grub mdadm
+Substitute: kiwi-boot:usbboot kiwi-desc-usbboot
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: liblzma5 libcap2 libpcre0
+Preinstall: libpopt0 libelf1 liblua5_1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: \.i686\.rpm$ i686
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+ExportFilter: ^blocxx-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^boost-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^bzip2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^curl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-glib-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^e2fsprogs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^expat-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^fontconfig-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^freetype2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc45-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc44-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc43-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glib2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glibc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hal-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hwinfo-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^icu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^jpeg-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kdelibs3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-default-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-desktop-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-pae-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libidn-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libpng12-0-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libqt4-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxcrypt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxml2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libzypp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^openssl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^pcre-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-gettext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^qt3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^rpm-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^sysfsutils-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^wireless-tools-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libICE-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libSM-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libX11-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXau-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXdmcp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXfixes-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXmu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXrender-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libfontenc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libxcb-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-server-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-core-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-hardware-detection-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-perl-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-pkg-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-qt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-xml-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^zlib-(?:debuginfo|debugsource)-.*\.rpm$ .
+#ExportFilter: -debuginfo-.*\.rpm$
+#ExportFilter: -debugsource-.*\.rpm$
+ExportFilter: ^master-boot-code.*\.i586.rpm$ . x86_64
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+ExportFilter: ^wine.*\.i586.rpm$ . x86_64
+
+#Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+#Required: gettext-runtime glibc libtool perl rpm zlib libmpfr4
+#Required: libncurses5 libgmp10 libgmpxx4 libppl9 libppl_c4
+Required: gcc gcc%{gcc_version} glibc perl rpm tar patch
+
+Support: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Support: gettext-runtime glibc libtool perl rpm zlib
+Support: libncurses5
+Support: libaudit1 cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_8
+Support: libstdc++%{gcc_version}
+# for boot.udev
+Support: udev
+Support: libxcrypt libzio
+Support: linux-glibc-devel make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit-tools
+Support: texinfo timezone util-linux libmount1 login
+Support: libgomp%{gcc_version} libuuid1 psmisc
+Support: terminfo-base update-alternatives pwdutils build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+
+# testing deltas (only for O:F for now!)
+#Support: build-mkdrpms deltarpm
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+Keep: libaudit1 binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libpcre0
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone libmpfr4 libcap2
+Keep: gmp libgmp10 libgmpxx4 libmpc2
+Keep: cpp45 gcc45 gcc45-ada libstdc++45
+Keep: cpp44 gcc44 gcc44-ada libstdc++44
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel libcloog0 libppl9 libppl_c4
+Keep: libpopt0 pkg-config libmount1
+
+Prefer: -suse-build-key
+Prefer: krb5 krb5-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default preload-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: beagle-index:preload-kmp-default
+Prefer: dummy-release
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libffi%{gcc_version}-devel libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng14-compat-devel
+Prefer: -python3 -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre,libpcre0
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+
+%ifnarch ia64 s390 s390x
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+# We use always openjdk on openSUSE !
+#%ifnarch ia64 s390 s390x
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+#%else
+# %ifarch s390 s390x
+#Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+# %endif
+# %ifarch ia64
+#Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+# %endif
+#%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1140
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+
+%suse_version 1140
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%opensuse_bs 1
+%_vendor suse
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sl12.1.conf b/configs/sl12.1.conf
new file mode 100644
index 0000000..e5f3abf
--- /dev/null
+++ b/configs/sl12.1.conf
@@ -0,0 +1,638 @@
+%define gcc_version 46
+%define opensuse_bs 1
+%define _with_aaa_base_malloc_debug 0
+
+Patterntype: rpm-md ymp
+%if "%_repository" == "images"
+Type: kiwi
+Repotype: none
+Patterntype: none
+Prefer: openSUSE-release
+%endif
+
+CiCntStart: 1.1
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-12-1 kiwi-instsource-plugins-openSUSE-11-3
+Substitute: kiwi-filesystem:ext3 e2fsprogs procps psmisc reiserfs
+Substitute: kiwi-filesystem:squashfs squashfs
+# cdrkit-cdrtools-compat should not be necessary - bnc#680148 (coolo)
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot module-init-tools elfutils squashfs fribidi gfxboot-devel gawk gfxboot gfxboot-devel grub hdparm hwinfo iproute2 kiwi-tools lvm2 make memtest86+ netcfg psmisc squashfs sysfsutils syslinux clicfs e2fsprogs cdrkit-cdrtools-compat
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot adaptec-firmware atftp bc bind-libs bind-utils bootsplash bootsplash-branding-openSUSE busybox bzip2 clicfs cryptsetup curl dhcpcd dialog e2fsprogs eject fbiterm file fribidi gettext-runtime gfxboot gfxboot-devel grub hwinfo kernel-default kernel-default-base kernel-desktop kexec-tools kiwi-tools lvm2 make module-init-tools netcfg net-tools parted pciutils psmisc squashfs sysconfig sysfsutils tar util-linux jing kernel-firmware
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-xenboot ncurses-utils curl dhcpcd iputils nbd net-tools netcfg nfs-client parted grub mdadm
+Substitute: kiwi-boot:usbboot kiwi
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot kernel-default kexec-tools
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: liblzma5 libcap2 libpcre0 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: \.i686\.rpm$ i686
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+ExportFilter: ^blocxx-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^boost-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^bzip2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^curl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-glib-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^e2fsprogs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^expat-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^fontconfig-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^freetype2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc46-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc45-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc44-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc43-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glib2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glibc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hal-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hwinfo-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^icu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^jpeg-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kdelibs3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-default-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-desktop-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-pae-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libidn-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libpng12-0-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libqt4-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxcrypt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxml2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libzypp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^openssl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^pcre-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-gettext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^qt3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^rpm-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^sysfsutils-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^wireless-tools-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libICE-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libSM-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libX11-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXau-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXdmcp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXfixes-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXmu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXrender-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libfontenc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libxcb-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-server-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-core-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-hardware-detection-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-perl-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-pkg-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-qt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-xml-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^zlib-(?:debuginfo|debugsource)-.*\.rpm$ .
+#ExportFilter: -debuginfo-.*\.rpm$
+#ExportFilter: -debugsource-.*\.rpm$
+ExportFilter: ^master-boot-code.*\.i586.rpm$ . x86_64
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+ExportFilter: ^wine.*\.i586.rpm$ . x86_64
+
+#Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+#Required: gettext-runtime glibc libtool perl rpm zlib libmpfr4
+#Required: libncurses5 libgmp10 libgmpxx4 libppl9 libppl_c4
+Required: gcc gcc%{gcc_version} glibc perl rpm tar patch
+
+Support: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Support: gettext-runtime glibc libtool perl rpm zlib
+Support: libncurses5
+Support: libaudit1 cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_8
+Support: libstdc++%{gcc_version}
+# for boot.udev
+Support: udev
+Support: libxcrypt libzio
+Support: linux-glibc-devel make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit-tools
+Support: texinfo timezone util-linux libmount1 login
+Support: libgomp%{gcc_version} libuuid1 psmisc
+Support: terminfo-base update-alternatives pwdutils build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+
+# testing deltas (only for O:F for now!)
+#Support: build-mkdrpms deltarpm
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+Keep: libaudit1 binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libpcre0
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone libmpfr4 libcap2
+Keep: gmp libgmp10 libgmpxx4 libmpc2
+Keep: cpp46 gcc46 gcc46-ada libstdc++46
+Keep: cpp45 gcc45 gcc45-ada libstdc++45
+Keep: cpp44 gcc44 gcc44-ada libstdc++44
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel libcloog0 libppl9 libppl_c4
+Keep: libpopt0 pkg-config libmount1
+Keep: libacl1 libattr1
+
+Prefer: -suse-build-key
+Prefer: krb5 krb5-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: rubygem-rack-1_1
+Prefer: wallpaper-branding-openSUSE
+
+# temporarly - already fix submitted
+Prefer: -kde3-kaffeine
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libffi%{gcc_version}-devel libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng14-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre,libpcre0
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: systemd:systemd-presets-branding
+Ignore: polkit:ConsoleKit
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+
+%ifnarch ia64 s390 s390x
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+# We use always openjdk on openSUSE !
+#%ifnarch ia64 s390 s390x
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+#%else
+# %ifarch s390 s390x
+#Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+# %endif
+# %ifarch ia64
+#Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+# %endif
+#%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1210
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+%_with_aaa_base_malloc_debug 0
+
+%suse_version 1210
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%opensuse_bs 1
+%_vendor suse
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sl12.2.conf b/configs/sl12.2.conf
new file mode 100644
index 0000000..ca3e297
--- /dev/null
+++ b/configs/sl12.2.conf
@@ -0,0 +1,637 @@
+%define gcc_version 46
+%define opensuse_bs 1
+%define _with_aaa_base_malloc_debug 1
+
+Patterntype: rpm-md ymp
+%if "%_repository" == "images"
+Type: kiwi
+Repotype: none
+Patterntype: none
+Prefer: openSUSE-release
+%endif
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-12-1
+Substitute: kiwi-filesystem:ext3 e2fsprogs procps psmisc reiserfs
+Substitute: kiwi-filesystem:squashfs squashfs
+# cdrkit-cdrtools-compat should not be necessary - bnc#680148 (coolo)
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot module-init-tools elfutils squashfs fribidi gfxboot-devel gawk gfxboot gfxboot-devel grub hdparm hwinfo iproute2 kiwi-tools lvm2 make memtest86+ netcfg psmisc squashfs sysfsutils syslinux clicfs e2fsprogs cdrkit-cdrtools-compat
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot adaptec-firmware atftp bc bind-libs bind-utils bootsplash bootsplash-branding-openSUSE busybox bzip2 clicfs cryptsetup curl dhcpcd dialog e2fsprogs eject fbiterm file fribidi gettext-runtime gfxboot gfxboot-devel grub hwinfo kernel-default kernel-default-base kernel-desktop kexec-tools kiwi-tools lvm2 make module-init-tools netcfg net-tools parted pciutils psmisc squashfs sysconfig sysfsutils tar util-linux jing kernel-firmware
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-xenboot ncurses-utils curl dhcpcd iputils nbd net-tools netcfg nfs-client parted grub mdadm
+Substitute: kiwi-boot:usbboot kiwi
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot kernel-default kexec-tools
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_1
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: \.i686\.rpm$ i686
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+ExportFilter: ^blocxx-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^boost-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^bzip2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^curl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^dbus-1-glib-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^e2fsprogs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^expat-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^fontconfig-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^freetype2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc46-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc45-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc44-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^gcc43-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glib2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^glibc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hal-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^hwinfo-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^icu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^jpeg-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kdelibs3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-default-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-desktop-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^kernel-pae-.*(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libidn-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libpng12-0-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libqt4-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxcrypt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libxml2-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^libzypp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^openssl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^pcre-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^perl-gettext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^qt3-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^rpm-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^sysfsutils-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^wireless-tools-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libICE-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libSM-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libX11-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXau-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXdmcp-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXext-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXfixes-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXmu-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libXrender-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libfontenc-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libs-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-libxcb-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^xorg-x11-server-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-core-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-hardware-detection-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-perl-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-pkg-bindings-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-qt-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^yast2-xml-(?:debuginfo|debugsource)-.*\.rpm$ .
+ExportFilter: ^zlib-(?:debuginfo|debugsource)-.*\.rpm$ .
+#ExportFilter: -debuginfo-.*\.rpm$
+#ExportFilter: -debugsource-.*\.rpm$
+ExportFilter: ^master-boot-code.*\.i586.rpm$ . x86_64
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+ExportFilter: ^wine.*\.i586.rpm$ . x86_64
+
+Required: gcc gcc%{gcc_version} glibc rpm tar patch
+
+Support: perl rpm-build
+Support: cpio
+Support: file findutils gawk
+Support: glibc-locale groff info less
+Support: libbz2-devel
+# for boot.udev
+Support: udev
+Support: man netcfg
+Support: net-tools pam-modules sysvinit-tools
+Support: texinfo timezone util-linux login psmisc
+Support: terminfo-base update-alternatives pwdutils build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+
+# trim the desktop files when building directly in factory
+%if "%_project" == "openSUSE:Factory"
+Support: brp-trim-desktopfiles
+%endif
+
+# testing deltas (only for O:F for now!)
+#Support: build-mkdrpms deltarpm
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+Keep: libaudit1 binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada libpcre1
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone libmpfr4 libcap2
+Keep: gmp libgmp10 libgmpxx4 libmpc2
+Keep: cpp46 gcc46 gcc46-ada libstdc++46
+Keep: cpp45 gcc45 gcc45-ada libstdc++45
+Keep: cpp44 gcc44 gcc44-ada libstdc++44
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel libcloog0 libppl9 libppl_c4
+Keep: libpopt0 pkg-config libmount1
+Keep: libacl1 libattr1 rpm-build
+
+Prefer: -suse-build-key
+Prefer: krb5 krb5-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+
+# temporarly - already fix submitted
+Prefer: -kde3-kaffeine
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libffi%{gcc_version}-devel libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng14-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: systemd:systemd-presets-branding
+Ignore: polkit:ConsoleKit
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+
+%ifnarch ia64 s390 s390x
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+# We use always openjdk on openSUSE !
+#%ifnarch ia64 s390 s390x
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+#%else
+# %ifarch s390 s390x
+#Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+# %endif
+# %ifarch ia64
+#Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+# %endif
+#%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1220
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+%_with_aaa_base_malloc_debug 1
+
+%suse_version 1220
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%opensuse_bs 1
+%_vendor suse
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sl8.1.conf b/configs/sl8.1.conf
index 0a48f3f..e1b095e 100644
--- a/configs/sl8.1.conf
+++ b/configs/sl8.1.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash db devs diffutils filesystem
Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
Preinstall: pam permissions readline rpm sed sh-utils shadow tar
Preinstall: textutils
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
Required: glibc libtool ncurses pam perl rpm zlib
@@ -135,54 +141,56 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64 s390
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils glibc-32bit baselibs-32bit
%endif
%endif
Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
%ifarch x86_64 ppc64 s390x sparc64
-Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit baselibs-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq aaa_base
-%define fillup_prereq fillup fileutils
-%define install_info_prereq texinfo
-%define suse_version 810
-%define sles_version 0
-%define ul_version 0
+%insserv_prereq aaa_base
+%fillup_prereq fillup fileutils
+%install_info_prereq texinfo
+%suse_version 810
+%sles_version 0
+%ul_version 0
+%_vendor suse
diff --git a/configs/sl8.2.conf b/configs/sl8.2.conf
index 1e170bb..a12fbce 100644
--- a/configs/sl8.2.conf
+++ b/configs/sl8.2.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libxcrypt m4 ncurses pam permissions readline
Preinstall: rpm sed shadow tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
Required: glibc libtool ncurses pam perl rpm zlib
@@ -135,13 +141,14 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64 s390
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils glibc-32bit baselibs-32bit
%endif
%endif
@@ -151,41 +158,42 @@ Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XM
Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv
-%define fillup_prereq fillup fileutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 820
-%define sles_version 0
-%define ul_version 0
-%define jds_version 0
-%define do_profiling 1
+%insserv_prereq insserv
+%fillup_prereq fillup fileutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 820
+%sles_version 0
+%ul_version 0
+%jds_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl9.0.conf b/configs/sl9.0.conf
index 01739ec..f5ab2b5 100644
--- a/configs/sl9.0.conf
+++ b/configs/sl9.0.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libxcrypt m4 ncurses pam permissions popt readline
Preinstall: rpm sed shadow tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
Required: glibc libtool ncurses perl rpm zlib
@@ -136,13 +142,14 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64 s390
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils glibc-32bit baselibs-32bit
%endif
%endif
@@ -152,41 +159,42 @@ Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XM
Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv
-%define fillup_prereq fillup fileutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 900
-%define sles_version 0
-%define ul_version 0
-%define jds_version 0
-%define do_profiling 1
+%insserv_prereq insserv
+%fillup_prereq fillup fileutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 900
+%sles_version 0
+%ul_version 0
+%jds_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl9.1.conf b/configs/sl9.1.conf
index 721df0b..24d4fcf 100644
--- a/configs/sl9.1.conf
+++ b/configs/sl9.1.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libselinux libxcrypt m4 ncurses pam permissions
Preinstall: popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -137,12 +143,16 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64
+Substitute: java2-devel-packages IBMJava2-JRE BEAJava2-JRE BEAJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390 ppc
+Substitute: java2-devel-packages IBMJava2-JRE IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-JRE IBMJava2-SDK jpackage-utils XFree86-libs-32bit
%endif
%endif
@@ -152,41 +162,42 @@ Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XM
Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv
-%define fillup_prereq fillup fileutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 910
-%define sles_version 0
-%define ul_version 0
-%define jds_version 0
-%define do_profiling 1
+%insserv_prereq insserv
+%fillup_prereq fillup fileutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 910
+%sles_version 0
+%ul_version 0
+%jds_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl9.2.conf b/configs/sl9.2.conf
index ca1390e..cd1902f 100644
--- a/configs/sl9.2.conf
+++ b/configs/sl9.2.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -137,12 +143,12 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java-1_4_2-sun-devel jpackage-utils update-alternatives
%else
%ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
+Substitute: java2-devel-packages java-1_4_2-ibm-devel jpackage-utils update-alternatives
%else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit jpackage-utils update-alternatives
%endif
%endif
@@ -159,33 +165,34 @@ Substitute: glibc-devel-32bit
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-iseries64
%endif
%ifarch ppc64
Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv sed devs
-%define fillup_prereq fillup coreutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 920
-%define sles_version 0
-%define ul_version 0
-%define do_profiling 1
+%insserv_prereq insserv sed devs
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 920
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sl9.3.conf b/configs/sl9.3.conf
index 1aad683..33c4256 100644
--- a/configs/sl9.3.conf
+++ b/configs/sl9.3.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libnscd libselinux libxcrypt m4 ncurses pam
Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -137,12 +143,12 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java-1_4_2-sun-devel jpackage-utils update-alternatives
%else
%ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
+Substitute: java2-devel-packages java-1_4_2-ibm-devel jpackage-utils update-alternatives
%else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit jpackage-utils update-alternatives
%endif
%endif
@@ -159,33 +165,34 @@ Substitute: glibc-devel-32bit
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-iseries64
%endif
%ifarch ppc64
Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv sed devs
-%define fillup_prereq fillup coreutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 930
-%define sles_version 0
-%define ul_version 0
-%define do_profiling 1
+%insserv_prereq insserv sed devs
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 930
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sles10.conf b/configs/sles10.conf
index 8731f5d..bdc5827 100644
--- a/configs/sles10.conf
+++ b/configs/sles10.conf
@@ -3,6 +3,10 @@ Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libnscd libxcrypt m4 ncurses pam
Preinstall: permissions popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -24,6 +28,7 @@ Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
Prefer: glib-sharp libzypp-zmd-backend mDNSResponder
+Prefer: novell-NLDAPsdk zaptel-kmp-default
Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
@@ -32,6 +37,7 @@ Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
Prefer: zmd:libzypp-zmd-backend
Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
@@ -137,12 +143,12 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java-1_4_2-sun-devel update-alternatives
%else
%ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
+Substitute: java2-devel-packages java-1_4_2-ibm-devel update-alternatives
%else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit update-alternatives
%endif
%endif
@@ -175,17 +181,20 @@ Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
Substitute: kernel-binary-packages kernel-default
-%enidf
+%endif
Macros:
-%define insserv_prereq insserv sed
-%define fillup_prereq fillup coreutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 1001
-%define sles_version 10
-%define ul_version 0
-%define do_profiling 1
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kernel-source kernel-syms
+%kernel_module_package_buildreqs kernel-source kernel-syms
+%suse_version 1010
+%sles_version 10
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sles11.conf b/configs/sles11.conf
new file mode 120000
index 0000000..87e994a
--- /dev/null
+++ b/configs/sles11.conf
@@ -0,0 +1 @@
+sl11.1.conf \ No newline at end of file
diff --git a/configs/sles11sp2.conf b/configs/sles11sp2.conf
new file mode 100644
index 0000000..e0c3a9a
--- /dev/null
+++ b/configs/sles11sp2.conf
@@ -0,0 +1,486 @@
+
+%define gcc_version 43
+
+Preinstall: aaa_base acl attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep insserv libacl libattr
+Preinstall: libbz2-1 libgcc%{gcc_version} libxcrypt m4 libncurses5 pam
+Preinstall: permissions popt libreadline5 rpm sed tar zlib libselinux1
+Preinstall: liblzma5
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+VMinstall: util-linux perl-base libdb-4_5 libblkid1 libuuid1 libsepol1
+
+Keep: libvolume_id
+
+Required: autoconf automake binutils bzip2 gcc gcc%{gcc_version}
+Required: gettext-runtime glibc libtool perl rpm zlib libmpfr1 gmp
+Required: libncurses5
+
+Support: audit-libs cpio cpp cpp%{gcc_version} cracklib cvs
+Support: file findutils gawk gdbm gettext-tools
+Support: glibc-devel glibc-locale groff gzip info less
+Support: libbz2-devel libdb-4_5
+Support: libstdc++%{gcc_version}
+Support: libxcrypt libzio
+Support: linux-kernel-headers make man netcfg
+Support: net-tools pam-modules patch perl-base sysvinit
+Support: texinfo timezone util-linux login
+Support: libgomp43 libuuid1 psmisc
+Support: terminfo-base
+
+Support: build brp-check-suse post-build-checks rpmlint-Factory
+Keep: brp-check-suse
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+%endif
+
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/msgfmt gettext
+FileProvides: /usr/sbin/useradd pwdutils
+FileProvides: /usr/sbin/groupadd pwdutils
+FileProvides: /usr/sbin/update-alternatives update-alternatives
+FileProvides: /usr/bin/host bind-utils
+
+Keep: audit-libs binutils bzip2 cpio cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel glibc-locale gzip libada
+Keep: libunwind libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl-base perl rcs timezone gmp libmpfr1
+Keep: cpp43 gcc43 gcc43-ada libstdc++43
+Keep: cpp42 gcc42 gcc42-ada libstdc++42
+Keep: cpp41 gcc41 gcc41-ada libstdc++41
+Keep: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+
+Prefer: -openSUSE-build-key
+Prefer: libreadline5
+Prefer: libdb_java-4_5 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta libpng fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript-library
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default
+Prefer: libstdc++%{gcc_version} libgcc%{gcc_version}
+Prefer: libstdc++%{gcc_version}-32bit libstdc++%{gcc_version}-64bit
+Prefer: libstroke
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: xfce4-desktop:xfce4-desktop-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: OpenOffice_org:OpenOffice_org-branding-upstream
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner190-32bit
+Prefer: mozilla-xulrunner190-devel:mozilla-xulrunner190
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: ant:xerces-j2
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: libsepol1
+Prefer: libexpat1 uuid-runtime
+Prefer: -x11-input-synaptics -kde4-marble
+Prefer: libdlm3
+Prefer: squid
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc%{gcc_version} libgcc%{gcc_version}-32bit libgcc%{gcc_version}-64bit
+Prefer: libgcc%{gcc_version}-x86 libffi%{gcc_version} libgcj_bc%{gcc_version}
+Prefer: libgomp%{gcc_version} libgomp%{gcc_version}-32bit libgomp%{gcc_version}-64bit
+Prefer: libmudflap%{gcc_version} libmudflap%{gcc_version}-32bit libmudflap%{gcc_version}-64bit
+Prefer: libobjc%{gcc_version} libgfortran%{gcc_version}
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini
+Prefer: -libcdio-mini -faac-mini
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libevoldap-2_4-2
+Conflict: ghostscript-library:ghostscript-mini
+Conflict: ghostscript-fonts-std:ghostscript-mini
+Prefer: -libopenal0-soft -openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: OpenOffice_org:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -java-1_7_0-icedtea-devel -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kdm:kdm-branding-upstream
+
+Prefer: libica-2_0_2
+Prefer: libxklavier12:libxklavier
+Prefer: webyast-base-ui:webyast-base-ui-branding-default
+Prefer: libpacemaker-devel:libglue-devel
+Prefer: libpacemaker3:libglue2
+Prefer: pacemaker:resource-agents
+
+# have choice for jaxen-bootstrap >= 1.1 needed by dom4j: jaxen-bootstrap jaxen
+Prefer: -jaxen-bootstrap
+# have choice for jaf >= 1.0.2
+Prefer: geronimo-jaf-1_0_2-api
+# have choice for javamail_1.3.1_api
+Prefer: excalibur-avalon-logkit:geronimo-javamail-1_3_1-api
+# have choice for jms_1.1_api
+Prefer: excalibur-avalon-logkit:geronimo-jms-1_1-api
+# have choice for jacc: geronimo-j2ee-1_4-apis geronimo-jacc-1_0-api
+Prefer: geronimo-jacc-1_0-api
+# have choice for antlr >= 2.7.1 needed by checkstyle: antlr antlr-bootstrap
+Prefer: checkstyle:antlr
+#have choice for antlr >= 2.7.6 needed by hibernate3: antlr antlr-bootstrap
+Prefer: hibernate3:antlr
+#have choice for antlr needed by jpam: antlr antlr-bootstrap
+Prefer: jpam:antlr
+#have choice for spacewalk-java-jdbc needed by spacewalk-java: spacewalk-java-postgresql spacewalk-java-oracle
+Prefer: spacewalk-java:spacewalk-java-oracle
+#have choice for jsp: geronimo-j2ee-1_4-apis geronimo-jsp-2_1-api geronimo-jsp-2_0-api
+Prefer: geronimo-jsp-2_0-api
+#have choice for jta: geronimo-j2ee-1_4-apis geronimo-jta-1_1-api java-1_5_0-gcj-compat
+Prefer: geronimo-jta-1_1-api
+#have choice for cglib >= 2.1.3 needed by jmock: cglib-nohook cglib
+Prefer: jmock:cglib
+#have choice for cglib >= 2.1.3 needed by hibernate3: cglib-nohook cglib
+Prefer: hibernate3:cglib
+# not wanted
+Prefer: -gnu-jaf
+
+# openoffice -> libreoffice
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: libreoffice:xerces-j2
+Prefer: -libreoffice
+Prefer: libreoffice:libreoffice-calc
+Prefer: libreoffice:mono-core
+
+Prefer: libservicelog:libservicelog-1_1-1
+
+
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-dvd9,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release,udev
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: OpenOffice_org:OpenOffice_org-i18n
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: beagle-index:sled-release
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kdelibs4:kdelibs4-branding
+
+Ignore: spacewalk-check:zypp-plugin-spacewalk
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: yast2-qt:yast2-branding
+
+%ifarch s390 s390x
+Ignore: yast2-all-packages:yast2-x11
+%endif
+
+%ifnarch ia64 s390 s390x ppc ppc64
+Prefer: java-1_6_0-openjdk java-1_6_0-openjdk-devel
+%endif
+%ifarch s390 s390x ppc ppc64
+Prefer: java-1_6_0-ibm java-1_6_0-ibm-devel
+%endif
+%ifarch ia64
+Prefer: java-1_6_0-bea java-1_6_0-bea-devel
+%endif
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%if 0
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+%else
+ %ifnarch ia64 s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_6_0-openjdk-devel
+ %else
+ %ifarch s390 s390x ppc ppc64
+Substitute: java2-devel-packages java-1_6_0-ibm-devel unzip update-alternatives
+ %endif
+ %ifarch ia64
+Substitute: java2-devel-packages java-1_6_0-bea-devel unzip update-alternatives
+ %endif
+ %endif
+%endif
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+Substitute: kde4-kwin kwin
+
+Optflags: i586 -march=i586 -mtune=i686 -fmessage-length=0
+Optflags: i686 -march=i686 -mtune=i686 -fmessage-length=0
+Optflags: x86_64 -fmessage-length=0
+Optflags: ppc -fmessage-length=0
+Optflags: ppc64 -fmessage-length=0
+Optflags: ia64 -fmessage-length=0
+Optflags: s390 -fmessage-length=0
+Optflags: s390x -fmessage-length=0
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1110
+%define sles_version 11
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq module-init-tools kernel-syms
+%kernel_module_package_buildreqs module-init-tools kernel-syms
+
+%suse_version 1110
+%sles_version 11
+%ul_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/sles8.conf b/configs/sles8.conf
index 1ccfcb7..12bbe19 100644
--- a/configs/sles8.conf
+++ b/configs/sles8.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash db devs diffutils filesystem
Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
Preinstall: pam permissions readline rpm sed sh-utils shadow tar
Preinstall: textutils
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
Required: glibc libtool ncurses pam perl rpm zlib
@@ -11,7 +17,7 @@ Support: findutils flex gawk gdbm-devel glibc-devel glibc-locale
Support: gpm groff gzip kbd less libstdc++ make man mktemp modutils
Support: ncurses-devel net-tools netcfg pam-devel pam-modules
Support: patch ps rcs sendmail strace syslogd sysvinit texinfo
-Support: timezone unitedlinux-release unzip util-linux vim zlib-devel
+Support: timezone unzip util-linux vim zlib-devel
Keep: binutils bzip2 cpp cracklib file findutils fpk gawk gcc
Keep: gcc-c++ gdbm glibc-devel glibc-locale gnat gnat-runtime
@@ -135,54 +141,56 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64 s390
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils glibc-32bit baselibs-32bit
%endif
%endif
Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
%ifarch x86_64 ppc64 s390x sparc64
-Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit baselibs-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq aaa_base
-%define fillup_prereq fillup fileutils
-%define install_info_prereq texinfo
-%define suse_version 810
-%define sles_version 8
-%define ul_version 0
+%insserv_prereq aaa_base
+%fillup_prereq fillup fileutils
+%install_info_prereq texinfo
+%suse_version 810
+%sles_version 8
+%ul_version 0
+%_vendor suse
diff --git a/configs/sles9.conf b/configs/sles9.conf
index 0680195..70ea7d6 100644
--- a/configs/sles9.conf
+++ b/configs/sles9.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash bzip2 coreutils db devs diffutils
Preinstall: filesystem fillup glibc grep insserv libacl libattr
Preinstall: libgcc libselinux libxcrypt m4 ncurses pam permissions
Preinstall: popt pwdutils readline rpm sed tar zlib
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 db gcc gdbm gettext glibc
Required: libtool ncurses perl rpm zlib
@@ -137,12 +143,16 @@ Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64
+Substitute: java2-devel-packages IBMJava2-JRE BEAJava2-JRE BEAJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390 ppc
+Substitute: java2-devel-packages IBMJava2-JRE IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-JRE IBMJava2-SDK jpackage-utils XFree86-libs-32bit
%endif
%endif
@@ -152,41 +162,42 @@ Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XM
Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq insserv
-%define fillup_prereq fillup fileutils
-%define suseconfig_fonts_prereq perl aaa_base
-%define install_info_prereq info
-%define suse_version 910
-%define sles_version 9
-%define ul_version 0
-%define jds_version 0
-%define do_profiling 1
+%insserv_prereq insserv
+%fillup_prereq fillup fileutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%suse_version 910
+%sles_version 9
+%ul_version 0
+%jds_version 0
+%do_profiling 1
+%_vendor suse
diff --git a/configs/spectool.conf b/configs/spectool.conf
new file mode 100644
index 0000000..39bac9e
--- /dev/null
+++ b/configs/spectool.conf
@@ -0,0 +1,4 @@
+%define spectool_version 1
+
+Macros:
+%spectool_version 1
diff --git a/configs/ul1.conf b/configs/ul1.conf
index 4ede7f0..a4ca28d 100644
--- a/configs/ul1.conf
+++ b/configs/ul1.conf
@@ -1,8 +1,14 @@
+Repotype: suse
+
Preinstall: aaa_base acl attr bash db devs diffutils filesystem
Preinstall: fileutils fillup glibc grep libgcc libxcrypt m4 ncurses
Preinstall: pam permissions readline rpm sed sh-utils shadow tar
Preinstall: textutils
+Runscripts: aaa_base
+
+VMinstall: util-linux perl
+
Required: autoconf automake binutils bzip2 cracklib db gcc gdbm gettext
Required: glibc libtool ncurses pam perl rpm zlib
@@ -11,7 +17,7 @@ Support: findutils flex gawk gdbm-devel glibc-devel glibc-locale
Support: gpm groff gzip kbd less libstdc++ make man mktemp modutils
Support: ncurses-devel net-tools netcfg pam-devel pam-modules
Support: patch ps rcs sendmail strace syslogd sysvinit texinfo
-Support: timezone unitedlinux-release unzip util-linux vim zlib-devel
+Support: timezone unzip util-linux vim zlib-devel
Keep: binutils bzip2 cpp cracklib file findutils fpk gawk gcc
Keep: gcc-c++ gdbm glibc-devel glibc-locale gnat gnat-runtime
@@ -135,54 +141,56 @@ Ignore: nautilus:gnome-themes
Ignore: gnome-panel:gnome-themes
Ignore: gnome-panel:tomboy
-%ifnarch s390 s390x ppc ia64
-Substitute: java2-devel-packages java-1_4_2-sun-devel
+%ifnarch s390 s390x ia64
+Substitute: java2-devel-packages java2 java2-jre jpackage-utils
%else
- %ifnarch s390x
-Substitute: java2-devel-packages java-1_4_2-ibm-devel
- %else
-Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %ifarch ia64 s390
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils
+ %endif
+ %ifarch s390x
+Substitute: java2-devel-packages IBMJava2-SDK jpackage-utils glibc-32bit baselibs-32bit
%endif
%endif
Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
%ifarch x86_64 ppc64 s390x sparc64
-Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit baselibs-32bit
%else
%ifarch ppc
-Substitute: glibc-devel-32bit glibc-devel-64bit
+Substitute: glibc-devel-32bit glibc-devel-64bit glibc-64bit
%else
Substitute: glibc-devel-32bit
%endif
%endif
%ifarch %ix86
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-um
%endif
%ifarch ia64
-Substitute: kernel-binary-packages kernel-default kernel-debug
+Substitute: kernel-binary-packages kernel-default kernel-sn2 kernel-64k-pagesize
%endif
%ifarch x86_64
-Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+Substitute: kernel-binary-packages kernel-default kernel-smp
%endif
%ifarch ppc
-Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-default kernel-pmac64_32bit kernel-power3 kernel-smp kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch ppc64
-Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+Substitute: kernel-binary-packages kernel-iseries64 kernel-pseries64 kernel-pmac64
%endif
%ifarch s390
Substitute: kernel-binary-packages kernel-s390
-%enidf
+%endif
%ifarch s390x
-Substitute: kernel-binary-packages kernel-default
-%enidf
+Substitute: kernel-binary-packages kernel-s390x
+%endif
Macros:
-%define insserv_prereq aaa_base
-%define fillup_prereq fillup fileutils
-%define install_info_prereq texinfo
-%define suse_version 810
-%define sles_version 0
-%define ul_version 1
+%insserv_prereq aaa_base
+%fillup_prereq fillup fileutils
+%install_info_prereq texinfo
+%suse_version 810
+%sles_version 0
+%ul_version 1
+%_vendor suse
diff --git a/createarchdeps b/createarchdeps
new file mode 100755
index 0000000..a97f762
--- /dev/null
+++ b/createarchdeps
@@ -0,0 +1,72 @@
+#!/usr/bin/perl -w
+
+# Archlinux support, based on the GSoC work of Nikolay Rysev <mad.f3ka@gmail.com>
+
+BEGIN {
+ unshift @INC, ($::ENV{"BUILD_DIR"} || "/usr/lib/build");
+}
+
+use strict;
+use Archive::Tar;
+use Build::Arch;
+use Digest::MD5;
+use File::Path;
+use Getopt::Long;
+
+Getopt::Long::Configure("no_ignore_case");
+
+my $cachedir = "/var/cache/build";
+
+sub getrepodb {
+ my ($url, $reponame, $dir) = @_;
+ File::Path::mkpath($dir);
+ system($INC[0]."/download", $dir, "$url$reponame.db");
+}
+
+sub getreponame {
+ my ($url) = @_;
+ return $1 if "/$url/" =~ /.*\/([^\/]+)\/os\//;
+ return undef;
+}
+
+sub printpkginfo {
+ my ($d, $repourl) = @_;
+ my $id = $d->{'name'} . "." . $d->{'arch'} . "-" . $d->{'buildtime'} . "/0/0";
+ my $pkgurl = $repourl . $d->{'filename'};
+ my $selfprovides = $d->{'name'};
+ $selfprovides .= "=$d->{'version'}" if defined $d->{'version'};
+ push @{$d->{'provides'}}, $selfprovides unless @{$d->{'provides'} || []} && $d->{'provides'}->[-1] eq $selfprovides;
+ print "F:$id: $pkgurl\n";
+ print "P:$id: " . join(' ', @{$d->{'provides'}}) . "\n" if $d->{'provides'};
+ print "R:$id: " . join(' ', @{$d->{'requires'}}) . "\n" if $d->{'requires'};
+ print "I:$id: $d->{name}-$d->{'version'} $d->{'buildtime'}\n";
+}
+
+GetOptions("cachedir=s" => \$cachedir) or exit(1);
+
+
+for my $url (@ARGV) {
+ die("Not an Archlinux repo") unless $url =~ /^(ht|f)tp:\/\/([^\/]*)\/?/;
+ my $reponame = getreponame($url);
+ my $repoid = Digest::MD5::md5_hex("arch\@$url");
+ my $dir = "$cachedir/$repoid";
+ $url .= '/' unless $url =~ /\/$/;
+ getrepodb($url, $reponame, $dir);
+
+ my $repodb = Archive::Tar->iter("$dir/$reponame.db", 1);
+ my $e;
+ my $lastfn = '';
+ my $d;
+ while ($e = $repodb->()) {
+ next unless $e->type() == Archive::Tar::Constant::FILE;
+ my $fn = $e->name();
+ next unless $fn =~ s/\/(?:depends|desc|files)$//s;
+ if ($lastfn ne $fn) {
+ printpkginfo($d, $url) if $d->{'name'};
+ $d = {};
+ $lastfn = $fn;
+ }
+ Build::Arch::parserepodata($d, $e->get_content());
+ }
+ printpkginfo($d, $url) if $d->{'name'};
+}
diff --git a/createrepomddeps b/createrepomddeps
new file mode 100755
index 0000000..cc9b2b0
--- /dev/null
+++ b/createrepomddeps
@@ -0,0 +1,495 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use strict;
+use XML::Parser;
+use Data::Dumper;
+use Getopt::Long;
+use Build::Rpm;
+use Digest::MD5 qw(md5 md5_hex md5_base64);
+use File::Path qw(mkpath rmtree);
+use File::Basename;
+use LWP::UserAgent;
+use URI;
+Getopt::Long::Configure("no_ignore_case");
+
+my @parent = [];
+my @primaryfiles = ();
+my @packages = ();
+
+my $baseurl; # current url
+
+my $opt_dump;
+my $opt_old;
+my $opt_nosrc;
+my $opt_bc;
+my $cachedir = "/var/cache/build";
+
+my $old_seen = ();
+
+my $repomdparser = {
+ repomd => {
+ data => {
+ _start => \&repomd_handle_data_start,
+ _end => \&repomd_handle_data_end,
+ location => {
+ _start => \&repomd_handle_location,
+ },
+ size => {
+ _text => \&repomd_handle_size,
+ },
+ },
+ },
+};
+
+my $primaryparser = {
+ metadata => {
+ 'package' => {
+ _start => \&primary_handle_package_start,
+ _end => \&primary_handle_package_end,
+ name => { _text => \&primary_collect_text, _end => \&primary_store_text },
+ arch => { _text => \&primary_collect_text, _end => \&primary_store_text },
+ version => { _start => \&primary_handle_version },
+ 'time' => { _start => \&primary_handle_time },
+ format => {
+ 'rpm:provides' => { 'rpm:entry' => { _start => \&primary_handle_package_provides }, },
+ 'rpm:requires' => { 'rpm:entry' => { _start => \&primary_handle_package_requires }, },
+ 'rpm:conflicts' => { 'rpm:entry' => { _start => \&primary_handle_package_conflicts }, },
+ 'rpm:obsoletes' => { 'rpm:entry' => { _start => \&primary_handle_package_obsoletes }, },
+ 'rpm:buildhost' => { _text => \&primary_collect_text, _end => \&primary_store_text },
+ 'rpm:sourcerpm' => { _text => \&primary_collect_text, _end => \&primary_store_text },
+### currently commented out, as we ignore file provides in createrpmdeps
+# file => {
+# _start => \&primary_handle_file_start,
+# _text => \&primary_collect_text,
+# _end => \&primary_handle_file_end
+# },
+ },
+ location => { _start => \&primary_handle_package_location },
+ },
+ },
+};
+
+# [ [tag, \%], ... ]
+my @cursor = ();
+
+my %datafile;
+sub repomd_handle_data_start
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ if($attr->{'type'} ne 'primary') {
+ pop @cursor;
+ }
+}
+
+sub repomd_handle_data_end
+{
+ my $p = shift;
+ my $el = shift;
+ push @primaryfiles, {%datafile};
+}
+
+
+sub repomd_handle_location
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ if(exists $attr->{'href'}) {
+ $datafile{location} = $attr->{'href'};
+ }
+}
+sub repomd_handle_size
+{
+ my $p = shift;
+ my $el = shift;
+ $datafile{size} = $el;
+}
+
+
+sub generic_handle_start
+{
+ my $p = shift;
+ my $el = shift;
+
+ if(exists $cursor[-1]->[1]->{$el})
+ {
+ my $h = $cursor[-1]->[1]->{$el};
+ push @cursor, [$el, $h];
+ if(exists $h->{'_start'}) {
+ &{$h->{'_start'}}($p, $el, @_);
+ }
+ }
+}
+
+sub generic_handle_char
+{
+ my $p = shift;
+ my $text = shift;
+
+ my $h = $cursor[-1]->[1];
+
+ if(exists $h->{'_text'}) {
+ &{$h->{'_text'}}($p, $text);
+ }
+}
+
+sub generic_handle_end
+{
+ my $p = shift;
+ my $el = shift;
+
+ if(!defined $cursor[-1]->[0] || $cursor[-1]->[0] eq $el)
+ {
+ my $h = $cursor[-1]->[1];
+
+ if(exists $h->{'_end'}) {
+ &{$h->{'_end'}}($p, $el);
+ }
+
+ pop @cursor;
+ }
+}
+
+sub map_attrs
+{
+ my %h;
+ while(@_) {
+ my $k = shift;
+ $h{$k} = shift;
+ }
+
+ return \%h;
+}
+
+# expat does not guarantee that character data doesn't get split up
+# between multiple calls
+my $textbuf = '';
+sub primary_collect_text
+{
+ my $p = shift;
+ my $text = shift;
+
+ $textbuf .= $text;
+}
+
+sub primary_store_text
+{
+ my $p = shift;
+ my $el = shift;
+
+ $packages[-1]->{$cursor[-1]->[0]} = $textbuf;
+ $textbuf = '';
+}
+
+sub primary_handle_package_start
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+
+ push @packages, { type => $attr->{'type'}, baseurl => $baseurl };
+}
+
+sub primary_handle_package_end
+{
+ my $p = shift;
+ my $el = shift;
+
+ if($opt_bc) {
+ printasbuildcachefile(@packages);
+ shift @packages;
+ } elsif ($opt_old) {
+ foreach my $pkg (@packages) {
+ my $arch = $pkg->{'arch'};
+ $arch = 'src' if $pkg->{'arch'} eq 'nosrc';
+ next if ($arch eq 'src' && $opt_nosrc);
+ if(exists($old_seen->{$pkg->{'name'}}->{$arch})) {
+ my $pv = $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'};
+ my $rv = $pkg->{'ver'}.'-'.$pkg->{'rel'};
+ my $vv = Build::Rpm::verscmp($pv, $rv, 0);
+ if($vv < 0)
+ {
+ print $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'}."\n";
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'} = $pkg->{'ver'}.'-'.$pkg->{'rel'};
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'} = $pkg->{'baseurl'} . $pkg->{'location'};
+ } else {
+ print $pkg->{'baseurl'} . $pkg->{'location'}."\n";
+ }
+ } else {
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'} = $pkg->{'ver'}.'-'.$pkg->{'rel'};
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'} = $pkg->{'baseurl'} . $pkg->{'location'};
+ }
+ }
+ shift @packages;
+ }
+}
+
+sub primary_handle_version
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ $packages[-1]->{'ver'} = $attr->{'ver'};
+ $packages[-1]->{'rel'} = $attr->{'rel'};
+}
+
+sub primary_handle_time
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ $packages[-1]->{'filetime'} = $attr->{'file'};
+ $packages[-1]->{'buildtime'} = $attr->{'build'};
+}
+
+sub primary_handle_package_location
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ $packages[-1]->{'location'} = $attr->{'href'};
+}
+
+sub primary_handle_file_start
+{
+ my $p = shift;
+ my $el = shift;
+
+ my $attr = map_attrs(@_);
+ if(exists $attr->{'type'}) {
+ pop @cursor;
+ }
+}
+
+sub primary_handle_file_end
+{
+ my $p = shift;
+ my $text = shift;
+
+ primary_handle_package_deps('provides', 'name', $textbuf);
+ $textbuf = '';
+}
+
+my %flagmap = (
+ EQ => '=',
+ LE => '<=',
+ GE => '>=',
+ GT => '>',
+ LT => '<',
+ NE => '!=',
+);
+
+sub primary_handle_package_deps
+{
+ my $dep = shift;
+ my $attr = map_attrs(@_);
+
+ if(exists $attr->{'flags'}) {
+ if(!exists($flagmap{$attr->{'flags'}})) {
+ print STDERR "bogus relation: ", $attr->{'flags'}, "\n";
+ return;
+ }
+ $attr->{'flags'} = $flagmap{$attr->{'flags'}};
+ }
+ return if($attr->{'name'} =~ /^rpmlib\(/);
+ push @{$packages[-1]->{$dep}}, $attr;
+
+}
+
+sub primary_handle_package_conflicts
+{
+ shift;shift; primary_handle_package_deps('conflicts', @_);
+}
+
+sub primary_handle_package_obsoletes
+{
+ shift;shift; primary_handle_package_deps('obsoletes', @_);
+}
+
+sub primary_handle_package_requires
+{
+ shift;shift; primary_handle_package_deps('requires', @_);
+}
+sub primary_handle_package_provides
+{
+ shift;shift; primary_handle_package_deps('provides', @_);
+}
+
+sub deps2string
+{
+ return join(' ', map {
+ my $s = $_->{'name'};
+ if(exists $_->{'flags'}) {
+ $s .= ' '.$_->{'flags'}.' ';
+ $s .= $_->{'epoch'}.':' if(exists $_->{'epoch'} && $_->{'epoch'} != 0);
+ $s .= $_->{'ver'};
+ $s .= '-'.$_->{'rel'} if exists $_->{'rel'};
+ }
+ $s
+ } @_);
+}
+
+sub printasbuildcachefile(@)
+{
+ foreach my $pkg (@_) {
+ next if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
+ my $id = sprintf("%s.%s-%d/%d/%d: ",
+ $pkg->{'name'},
+ $pkg->{'arch'},
+ $pkg->{'buildtime'},
+ $pkg->{'filetime'},
+ 0);
+ print "F:".$id. $pkg->{'baseurl'} . $pkg->{'location'} . "\n";
+
+ my $deps = deps2string(@{$pkg->{'provides'}});
+ print "P:$id$deps\n";
+
+ $deps = deps2string(@{$pkg->{'requires'}});
+ print "R:$id$deps\n";
+
+ my $tag = sprintf("%s-%s-%s %s",
+ $pkg->{'name'},
+ $pkg->{'ver'},
+ $pkg->{'rel'},
+# $pkg->{'rpm:buildhost'},
+ $pkg->{'buildtime'});
+ print "I:$id$tag\n";
+ }
+}
+
+sub getmetadata
+{
+ my $url = $_[0];
+ my $dir = $_[1];
+
+ my $dest = $dir . "repodata";
+ mkpath($dest);
+ system($INC[0].'/download', $dest, $url . "repodata/repomd.xml");
+}
+
+### main
+
+GetOptions (
+ "nosrc" => \$opt_nosrc,
+ "dump" => \$opt_dump,
+ "old" => \$opt_old,
+ "cachedir=s" => \$cachedir,
+ ) or exit(1);
+
+$opt_bc = 1 unless ($opt_dump || $opt_old);
+
+my $p = new XML::Parser(
+ Handlers => {
+ Start => \&generic_handle_start,
+ End => \&generic_handle_end,
+ Char => \&generic_handle_char
+ });
+
+#my $url = '/mounts/mirror/SuSE/ftp.suse.com/pub/suse/update/10.1/';
+for my $url (@ARGV) {
+ my $dir;
+ if ($url =~ /^zypp:\/\/([^\/]*)\/?/) {
+ use Build::Zypp;
+ my $repo = Build::Zypp::parsecfg($1);
+ die "can't parse $1\n" unless $repo;
+ my $type = $repo->{'type'};
+ if($type eq 'rpm-md') {
+ my $name = $repo->{'name'};
+ $dir = "/var/cache/zypp/raw/$name/";
+ $baseurl = $url;
+ $baseurl .= '/' unless $baseurl =~ /\/$/;
+ } elsif ($type eq 'yast2') {
+ # XXX
+ exec ($INC[0].'/createyastdeps', $url);
+ } else {
+ die "unsupported repo type: $type\n";
+ }
+ } elsif ($url =~ /^http[s]?:\/\/([^\/]*)\/?/) {
+ my $repoid = md5_hex($url);
+ $dir = "$cachedir/$repoid/";
+ $baseurl = $url;
+ $baseurl .= '/' unless $baseurl =~ /\/$/;
+ getmetadata($baseurl, $dir);
+ } elsif ($url =~ /^arch\@/) {
+ exec ("$INC[0]/createarchdeps", "--cachedir=$cachedir", substr($url, 5));
+ } else {
+ $dir = $url;
+ $dir .= '/' unless $dir =~ /\/$/;
+ $baseurl = $dir;
+ }
+
+ @primaryfiles = ();
+ @cursor = ([undef, $repomdparser]);
+
+ $p->parsefile($dir . 'repodata/repomd.xml');
+
+# print Dumper(\@primaryfiles);
+
+ foreach my $f (@primaryfiles) {
+ @cursor = ([undef, $primaryparser]);
+
+ my $u = $dir . $f->{'location'};
+ my $size = 0;
+ my $cached = 0;
+ if ( -e $u ) {
+ $size = (stat($u))[7];
+ $cached = 1 if ($f->{'size'} == $size);
+ }
+ if ($url =~ /^http[s]?:\/\/([^\/]*)\/?/ and !$cached) {
+ if (system($INC[0].'/download', $dir . "repodata/", $baseurl . "repodata/" . basename($u))) {
+ die("download failed\n");
+ }
+ }
+ if ($] > 5.007) {
+ require Encode;
+ utf8::downgrade($u);
+ }
+ my $fh;
+ open($fh, '<', $u) or die "Error opening $u: $!\n";
+ if ($u =~ /\.gz$/) {
+ use IO::Uncompress::Gunzip qw($GunzipError);
+ $fh = new IO::Uncompress::Gunzip $fh or die "Error opening $u: $GunzipError\n";
+ }
+ $p->parse($fh);
+ close($fh);
+ }
+}
+
+if ($opt_dump) {
+ print Data::Dumper->Dump([\@packages], ['packages']); # caution: excessive memory consumption!
+}
+
+#if($rpmdepdump) {
+# my %amap = map { $_ => 1 } @archs;
+# my $packages = do $rpmdepdump or die $!;
+#
+# foreach my $pkg (@$packages) {
+# next if exists $packs{$pkg->{'name'}};
+# next unless exists $amap{$pkg->{'arch'}};
+# next if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
+# next if $pkg->{'location'} =~ /\.(?:patch|delta)\.rpm$/;
+#
+# my $pa = $pkg->{'name'}.'.'.$pkg->{'arch'};
+# $packs{$pkg->{'name'}} = $pa;
+# $fn{$pa} = $pkg->{'baseurl'}.$pkg->{'location'};
+# my $r = {};
+# # flags and version ignored
+# my @pr = map { $_->{'name'} } @{$pkg->{'provides'}};
+# my @re = map { $_->{'name'} } @{$pkg->{'requires'}};
+# $r->{'provides'} = \@pr;
+# $r->{'requires'} = \@re;
+# $repo{$pkg->{'name'}} = $r;
+# }
+#}
diff --git a/createrpmdeps b/createrpmdeps
index 84348d5..c8c796d 100755
--- a/createrpmdeps
+++ b/createrpmdeps
@@ -11,6 +11,8 @@ use strict;
my $rpmdepfile = $ARGV[0];
+my %tag;
+
my %oldp;
my %oldr;
if (defined($rpmdepfile) && open(F, '<', $rpmdepfile)) {
@@ -26,27 +28,21 @@ if (defined($rpmdepfile) && open(F, '<', $rpmdepfile)) {
}
my $redo = 1;
-while ($redo) {
+foreach my $dir (@ARGV) {
$redo = 0;
- my $packages;
my @known;
my %known2fn;
my %known2path;
my %fnsize2id;
- while (<STDIN>) {
+ my $cmd = "find $dir -follow -type f \\( -name \"*.rpm\" -o -name \"*.deb\" \\) -a ! -name \"*src.rpm\" -printf '\%T@/\%s/\%i \%p\\n'";
+ open(F, '-|', $cmd) or next;
+ while (<F>) {
chomp;
- if ($_ eq '') {
- # next block;
- $redo = 1;
- last;
- }
- if (/\/packages$/) {
- $packages = $_;
- next;
- }
- next unless /^(\d+\/\d+\/\d+) (.*)$/;
+ next unless /^([\d\.]+\/\d+\/\d+) (.*)$/;
my $id = $1;
my $path = $2;
+ # new find added a fraction part to %T@, ignore it
+ $id =~ s/^(\d+)\.\d+/$1/;
next unless $path =~ /\.(?:rpm|deb)$/;
my $fn = $path;
$fn =~ s/.*\///;
@@ -74,6 +70,8 @@ while ($redo) {
$fnsize2id{"$fn-$size"} = $id;
}
+ close F;
+
my %newp;
my %newr;
for (@known) {
@@ -82,100 +80,43 @@ while ($redo) {
}
my @todo = grep {!($newp{$_} && $newr{$_})} @known;
- if (@todo && $packages && open(F, '<', $packages)) {
- my ($pack, $vers, $rel, $btime, $arch, $loc, $id, $size);
- my ($req, $prv);
- while (<F>) {
- chomp;
- next unless /^[=+]/;
- my ($tag, $data);
- if (/^\+(.*)$/) {
- $tag = $1;
- $data = '';
- while (<F>) {
- chomp;
- last if $_ eq "-$tag";
- $data .= "$_\n";
- }
- chop $data;
- } else {
- ($tag, $data) = split(' ', $_, 2);
- $tag = substr($tag, 1);
- }
- if ($tag eq 'Pkg:') {
- if ($pack && $loc && $size) {
- my $id = $fnsize2id{"$loc-$size"};
- if ($id && $known2path{"$pack.$arch-$id"}) {
- $prv = "$pack = $vers-$rel" unless defined $prv;
- $req = '' unless defined $req;
- $newp{"$pack.$arch-$id"} = "P:$pack.$arch-$id: $prv";
- $newr{"$pack.$arch-$id"} = "R:$pack.$arch-$id: $req";
- }
- }
- ($pack, $vers, $rel, $arch) = split(' ', $data);
- undef $req;
- undef $prv;
- undef $btime;
- undef $size;
- undef $loc;
- undef $pack if $arch && ($arch eq 'src' || $arch eq 'nosrc');
- } elsif ($tag eq 'Req:') {
- next unless $pack;
- $data =~ s/\n/ /gs;
- $req = $data;
- } elsif ($tag eq 'Prv:') {
- next unless $pack;
- # add self provides for old rpm versions
- $data = "$pack = $vers-$rel\n$data" unless "\n$data" =~ /\n\Q$pack\E =/s;
- $data =~ s/\n/ /gs;
- $prv = $data;
- } elsif ($tag eq 'Tim:') {
- $btime = $data;
- } elsif ($tag eq 'Loc:') {
- my @data = split(' ', $data);
- $loc = $data[1];
- } elsif ($tag eq 'Siz:') {
- my @data = split(' ', $data);
- $size = $data[0];
- }
- }
- close F;
- if ($pack && $loc && $size) {
- my $id = $fnsize2id{"$loc-$size"};
- if ($id && $known2path{"$pack.$arch-$id"}) {
- $newp{"$pack.$arch-$id"} = "P:$pack.$arch-$id: $prv";
- $newr{"$pack.$arch-$id"} = "R:$pack.$arch-$id: $req";
- }
- }
- @todo = grep {!($newp{$_} && $newr{$_})} @known;
- }
if (@todo) {
for my $known (@todo) {
my $path = $known2path{$known};
if ($path =~ /\.rpm$/) {
- my %res = Build::rpmq($path, 1000, 1022, 1047, 1049, 1048, 1050, 1112, 1113);
- next unless %res;
- Build::rpmq_add_flagsvers(\%res, 1047, 1112, 1113);
- Build::rpmq_add_flagsvers(\%res, 1049, 1048, 1050);
- my $id = $known;
- $id =~ s/.*-//;
- if ($known ne "$res{1000}->[0].$res{1022}->[0]-$id") {
+ my %res = Build::Rpm::rpmq($path, 1000, 1001, 1002, 1006, 1022, 1047, 1049, 1048, 1050, 1112, 1113);
+ next unless %res;
+ Build::Rpm::add_flagsvers(\%res, 1047, 1112, 1113);
+ Build::Rpm::add_flagsvers(\%res, 1049, 1048, 1050);
+ my $id = $known;
+ $id =~ s/.*-//;
+ if ($known ne "$res{1000}->[0].$res{1022}->[0]-$id") {
$known = "$res{1000}->[0].$res{1022}->[0]-$id";
if (!$known2path{$known}) {
push @known, $known;
$known2path{$known} = $path;
}
- }
- $newp{$known} = "P:$known: ".join(' ', @{$res{1047} || []});
- $newr{$known} = "R:$known: ".join(' ', @{$res{1049} || []});
+ }
+ # rpm3 compatibility: retrofit missing self provides
+ my $name = $res{1000}->[0];
+ if (!@{$res{1047} || []} || $res{1047}->[-1] !~ /^\Q$name\E =/) {
+ my $evr = "$res{1001}->[0]-$res{1002}->[0]";
+ $evr = "$res{1003}->[0]:$evr" if $res{1003} && $res{1003}->[0];
+ push @{$res{1047}}, "$name = $evr";
+ }
+
+ $newp{$known} = "P:$known: ".join(' ', @{$res{1047} || []});
+ $newr{$known} = "R:$known: ".join(' ', @{$res{1049} || []});
+ #$tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1007}->[0]."-".$res{1006}->[0];
+ $tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1006}->[0];
} else {
- my %res = Build::debq($path);
- next unless %res;
+ my %res = Build::Deb::debq($path);
+ next unless %res;
my ($dn, $da) = ($res{'PACKAGE'}, $res{'ARCHITECTURE'});
$da = 'noarch' if $da eq 'all';
- my $id = $known;
- $id =~ s/.*-//;
- if ($known ne "$dn.$da-$id") {
+ my $id = $known;
+ $id =~ s/.*-//;
+ if ($known ne "$dn.$da-$id") {
$known = "$dn.$da-$id";
if (!$known2path{$known}) {
push @known, $known;
@@ -190,8 +131,8 @@ while ($redo) {
s/\s.*// for @predepends; #for now
push @depends, @predepends;
push @provides, $res{'PACKAGE'};
- $newp{$known} = "P:$known: ".join(' ', @provides);
- $newr{$known} = "R:$known: ".join(' ', @depends);
+ $newp{$known} = "P:$known: ".join(' ', @provides);
+ $newr{$known} = "R:$known: ".join(' ', @depends);
}
}
}
@@ -200,5 +141,6 @@ while ($redo) {
print "F:$_: $known2path{$_}\n";
print "$newp{$_}\n";
print "$newr{$_}\n";
+ print "I:$_: $tag{$_}\n" if exists $tag{$_};
}
}
diff --git a/createyastdeps b/createyastdeps
new file mode 100755
index 0000000..a17bd74
--- /dev/null
+++ b/createyastdeps
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use Build::Susetags;
+use strict;
+
+sub print_pkg($)
+{
+ my $pkg = shift;
+
+ return if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
+ my $id = sprintf("%s.%s-%d/%d/%d: ",
+ $pkg->{'name'},
+ $pkg->{'arch'},
+ $pkg->{'buildtime'},
+ 0,
+ 0);
+ print sprintf('F:%s%ssuse/%s/%s',$id,$pkg->{'baseurl'},
+ $pkg->{'arch'}, $pkg->{'location'}), "\n";
+
+ print "P:$id".$pkg->{'provides'}."\n";
+ print "R:$id".$pkg->{'requires'}."\n";
+
+ my $tag = sprintf("%s-%s-%s %s",
+ $pkg->{'name'},
+ $pkg->{'version'},
+ $pkg->{'release'},
+# $pkg->{'rpm:buildhost'},
+ $pkg->{'buildtime'});
+ print "I:$id$tag\n";
+}
+
+sub callback
+{
+ my ($pkg, $url) = @_;
+ $pkg->{'provides'} = [] unless exists $pkg->{'provides'};
+ # add self provides (rpm3 misses that)
+ my $n = $pkg->{'name'};
+ if(substr($pkg->{'arch'}, -3) ne 'src' && !scalar grep(/^\Q$n\E( =.*)?$/,@{$pkg->{'provides'}}))
+ {
+ push @{$pkg->{'provides'}}, sprintf("%s = %s-%s", $pkg->{'name'}, $pkg->{'version'}, $pkg->{'release'});
+ }
+ $pkg->{'provides'} = join(' ', @{$pkg->{'provides'}});
+ $pkg->{'requires'} = join(' ', @{$pkg->{'requires'}}) if $pkg->{'requires'};
+ $pkg->{'baseurl'} = $url;
+ my @data = split(' ', $pkg->{'location'});
+ # multi cd support hack
+ my $num = $data[0];
+ if($pkg->{'baseurl'} =~ /1\/$/ && $num ne 0) {
+ $pkg->{'baseurl'} =~ s/1\/$/$num\//;
+ }
+ $pkg->{'location'} = $data[1];
+
+ print_pkg($pkg);
+
+ return 0;
+}
+
+for my $url (@ARGV) {
+ my $dir;
+ if ($url =~ /^zypp:\/\/([^\/]*)\/?/) {
+ use Build::Zypp;
+ my $repo = Build::Zypp::parsecfg($1);
+ die "can't parse $1\n" unless $repo;
+ die "only yast2 repos supported\n" unless $repo->{'type'} eq 'yast2';
+ my $name = $repo->{'name'};
+ $dir = "/var/cache/zypp/raw/$name/";
+ } else {
+ $dir = $url;
+ }
+
+# a really fucked up system
+# if (-e $url."/yast/order") {
+# if(open(F, '<', $url."/yast/order")) {
+# my $found_products;
+# while(<F>) {
+# chomp;
+# my ($a, $b) = split(/ /);
+# $a =~ s/^\///;
+# if(-e $url.$a)
+# {
+# push @ARGV, $url.$a;
+# $found_products = 1;
+# print STDERR "$url -> $url$a\n";
+# }
+# }
+# close(F);
+# next if $found_products;
+# }
+# }
+ # XXX: location is actually defined in content file
+ my $packages = $dir.'/suse/setup/descr/packages';
+
+ $url .= '/' unless $url =~ /\/$/;
+
+ my @order = ();
+ my $pkgs = Build::Susetags::parse($packages,
+ { 'Loc' => 'location', 'Prv' => 'provides', 'Req' => 'requires', 'Tim' => 'buildtime' },
+ { cb => \&callback, data => $url });
+}
diff --git a/debtransform b/debtransform
new file mode 100755
index 0000000..031b744
--- /dev/null
+++ b/debtransform
@@ -0,0 +1,306 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Digest::MD5;
+
+sub parsedsc {
+ my ($fn) = @_;
+ my @control;
+ local *F;
+ open(F, '<', $fn) || die("$fn: $!\n");
+ @control = <F>;
+ close F;
+ chomp @control;
+ splice(@control, 0, 3) if @control > 3 && $control[0] =~ /^-----BEGIN/;
+ my @seq = ();
+ my %tag;
+ while (@control) {
+ my $c = shift @control;
+ last if $c eq ''; # new paragraph
+ my ($tag, $data) = split(':', $c, 2);
+ next unless defined $data;
+ push @seq, $tag;
+ $tag = uc($tag);
+ while (@control && $control[0] =~ /^\s/) {
+ $data .= "\n".substr(shift @control, 1);
+ }
+ $data =~ s/^\s+//s;
+ $data =~ s/\s+$//s;
+ $tag{$tag} = $data;
+ }
+ $tag{'__seq'} = \@seq;
+ return \%tag;
+}
+
+sub writedsc {
+ my ($fn, $tags) = @_;
+ open(F, '>', $fn) || die("$fn: $!\n");
+ my @seq = @{$tags->{'__seq'} || []};
+ my %seq = map {uc($_) => 1} @seq;
+ for (sort keys %$tags) {
+ push @seq, ucfirst(lc($_)) unless $seq{$_};
+ }
+ for my $seq (@seq) {
+ my $ucseq = uc($seq);
+ my $d = $tags->{$ucseq};
+ next unless defined $d;
+ $d =~ s/\n/\n /sg;
+ print F "$seq: $d\n";
+ }
+ print F "\n";
+ close F;
+}
+
+sub listtar {
+ my ($tar) = @_;
+ local *F;
+ my @c;
+ open(F, '-|', 'tar', '--numeric-owner', '-tvf', $tar) || die("tar: $!\n");
+ while(<F>) {
+ next unless /^([-dlbcp])(.........)\s+\d+\/\d+\s+(\S+) \d\d\d\d-\d\d-\d\d \d\d:\d\d(?::\d\d)? (.*)$/;
+ my ($type, $mode, $size, $name) = ($1, $2, $3, $4);
+ next if $type eq 'd';
+ die("debian tar contains link: $name\n") if $type eq 'l';
+ die("debian tar contains unexpected file type: $name\n") if $type ne '-';
+ $name =~ s/^\.\///;
+ $name =~ s/^debian\///;
+ push @c, {'name' => $name, 'size' => $size};
+ }
+ close(F) || die("tar: $!\n");
+ return @c;
+}
+
+sub dotar {
+ my ($tar, $tardir, $origin, @c) = @_;
+ local *F;
+ open(F, '-|', 'tar', '-xOf', $tar) || die("tar: $!\n");
+ for my $c (@c) {
+ my $s = $c->{'size'};
+ my $file = '';
+ while ($s > 0) {
+ my $l = sysread(F, $file, $s, length($file));
+ die("tar read error\n") unless $l;
+ $s -= $l;
+ }
+ next if $origin && $origin->{$c->{'name'}} ne $tar;
+ my @file = split("\n", $file);
+ print DIFF "--- $tardir.orig/debian/$c->{'name'}\n";
+ print DIFF "+++ $tardir/debian/$c->{'name'}\n";
+ next unless @file;
+ print DIFF "\@\@ -0,0 +1,".scalar(@file)." \@\@\n";
+ print DIFF "+$_\n" for @file;
+ }
+ close(F);
+}
+
+sub dofile {
+ my ($file, $tardir, $dfile) = @_;
+ local *F;
+ open(F, '<', $file) || die("$file: $!\n");
+ my @file = <F>;
+ close F;
+ chomp(@file);
+ print DIFF "--- $tardir.orig/$dfile\n";
+ print DIFF "+++ $tardir/$dfile\n";
+ return unless @file;
+ print DIFF "\@\@ -0,0 +1,".scalar(@file)." \@\@\n";
+ print DIFF "+$_\n" for @file;
+}
+
+sub doseries {
+ my ($series, $tardir) = @_;
+ my $dir = $series;
+ $dir =~ s/[^\/]+$//;
+ $dir =~ s/\/+$//;
+ $dir = '.' if $dir eq '';
+ local *F;
+ open(F, '<', $series) || die("$series: $!\n");
+ my @series = <F>;
+ close F;
+ chomp(@series);
+ for my $patch (@series) {
+ $patch =~ s/(^|\s+)#.*//;
+ next if $patch =~ /^\s*$/;
+ my $level = 1;
+ $level = $1 if $patch =~ /\s.*-p\s*(\d+)/;
+ $patch =~ s/\s.*//;
+ open(F, '<', "$dir/$patch") || die("$dir/$patch: $!\n");
+ while(<F>) {
+ chomp;
+ if ((/^--- ./ || /^\+\+\+ ./) && !/^... \/dev\/null/) {
+ my $start = substr($_, 0, 4);
+ $_ = substr($_, 4);
+ my $l = $level;
+ while ($l > 0) {
+ last unless s/.*?\///;
+ $l--;
+ }
+ if ($start eq '--- ') {
+ print DIFF "$start$tardir.orig/$_\n";
+ } else {
+ print DIFF "$start$tardir/$_\n";
+ }
+ next;
+ }
+ print DIFF "$_\n";
+ }
+ close F;
+ }
+}
+
+sub addfile {
+ my ($file) = @_;
+ my $base = $file;
+ $base =~ s/.*\///;
+ local *F;
+ open(F, '<', $file) || die("$file: $!\n");
+ my $size = -s F;
+ my $ctx = Digest::MD5->new;
+ $ctx->addfile(*F);
+ close F;
+ my $md5 = $ctx->hexdigest();
+ return "$md5 $size $base";
+}
+
+my $changelog;
+
+if (@ARGV > 1 && $ARGV[0] eq '--changelog') {
+ shift @ARGV;
+ $changelog = shift @ARGV;
+}
+die("usage: debtransform [--changelog <changelog>] <srcdir> <dscfile> <outdir>\n") unless @ARGV == 3;
+
+my $dir = $ARGV[0];
+my $dsc = $ARGV[1];
+my $out = $ARGV[2];
+
+die("$out: $!\n") unless -d $out;
+
+my $tags = parsedsc($dsc);
+
+opendir(D, $dir) || die("$dir: $!\n");
+my @dir = grep {$_ ne '.' && $_ ne '..'} readdir(D);
+closedir(D);
+my %dir = map {$_ => 1} @dir;
+
+my $tarfile = $tags->{'DEBTRANSFORM-TAR'};
+my @debtarfiles;
+if ($tags->{'DEBTRANSFORM-FILES-TAR'}) {
+ @debtarfiles = split(' ', $tags->{'DEBTRANSFORM-FILES-TAR'});
+}
+
+if (!$tarfile || !@debtarfiles) {
+ my @tars = grep {/\.tar(?:\.gz|\.bz2)?$/} @dir;
+ my @debtars = grep {/^debian\.tar(?:\.gz|\.bz2)?$/} @tars;
+ if (!$tarfile) {
+ @tars = grep {!/^debian\.tar(?:\.gz|\.bz2)?$/} @tars;
+ if (@debtarfiles) {
+ my %debtarfiles = map {$_ => 1} @debtarfiles;
+ @tars = grep {!$debtarfiles{$_}} @tars;
+ }
+ die("package contains no tar file\n") unless @tars;
+ die("package contains more than one tar file: @tars\n") if @tars > 1;
+ $tarfile = $tars[0];
+ }
+ if (@debtars && !exists($tags->{'DEBTRANSFORM-FILES-TAR'})) {
+ die("package contains more than one debian tar file\n") if @debtars > 1;
+ @debtarfiles = ($debtars[0]);
+ }
+}
+
+my $name = $tags->{'SOURCE'};
+die("dsc file contains no source\n") unless defined($name);
+my $version = $tags->{'VERSION'};
+die("dsc file contains no version\n") unless defined($version);
+$version =~ s/^\d+://; # no epoch in version, please
+
+# transform
+my $tmptar;
+if ($tarfile =~ /\.tar\.bz2/) {
+ my $old = $tarfile;
+ $tarfile =~ s/\.tar\.bz2/\.tar\.gz/;
+ $tmptar = "$out/$tarfile";
+ print "converting $dir/$old to $tarfile\n";
+ system( ( "debtransformbz2", "$dir/$old", "$tmptar" )) == 0 || die("cannot transform .tar.bz2 to .tar.gz");
+}
+if ($tarfile =~ /\.zip/) {
+ my $old = $tarfile;
+ $tarfile =~ s/\.zip/\.tar\.gz/;
+ $tmptar = "$out/$tarfile";
+ print "converting $dir/$old to $tarfile\n";
+ system( ( "debtransformzip", "$dir/$old", "$tmptar" )) == 0 || die("cannot transform .zip to .tar.gz");
+}
+
+my $tardir = $tarfile;
+$tardir =~ s/\.orig\.tar/\.tar/;
+$tardir =~ s/\.tar.*?$//;
+
+my @files;
+my $v = $version;
+$v =~ s/-[^-]*$//;
+$tarfile =~ /.*(\.tar.*?)$/;
+my $ntarfile = "${name}_$v.orig$1";
+if( $tmptar ) {
+ link("$tmptar", "$out/$ntarfile") || die("link $dir/$tarfile $out/$ntarfile: $!\n");
+ unlink("$tmptar");
+} else {
+ link("$dir/$tarfile", "$out/$ntarfile") || die("link $dir/$tarfile $out/$ntarfile: $!\n");
+}
+push @files, addfile("$out/$ntarfile");
+
+open(DIFF, '>', "$out/${name}_$version.diff") || die("$out/${name}_$version.diff: $!\n");
+
+undef $changelog if $dir{'debian.changelog'};
+
+my %debtarorigin;
+my %debtarcontent;
+for my $debtarfile (@debtarfiles) {
+ my @c = listtar("$dir/$debtarfile");
+ $debtarcontent{$debtarfile} = \@c;
+ for (@c) {
+ die("debian tar and directory both contain '$_->{'name'}'\n") if $dir{"debian.$_->{'name'}"};
+ undef $changelog if $_->{'name'} eq 'changelog';
+ $debtarorigin{$_->{'name'}} = "$dir/$debtarfile";
+ }
+}
+
+dofile($changelog, $tardir, 'debian/changelog') if defined $changelog;
+
+for my $debtarfile (@debtarfiles) {
+ dotar("$dir/$debtarfile", $tardir, \%debtarorigin, @{$debtarcontent{$debtarfile} });
+}
+
+for my $file (grep {/^debian\./} @dir) {
+ next if $file eq 'debian.series';
+ next if $file =~ /\.tar$/;
+ next if $file =~ /\.tar\./;
+ dofile("$dir/$file", $tardir, 'debian/'.substr($file, 7));
+}
+
+if ($tags->{'DEBTRANSFORM-SERIES'}) {
+ doseries("$dir/$tags->{'DEBTRANSFORM-SERIES'}", $tardir);
+} elsif ($dir{"debian.series"}) {
+ doseries("$dir/debian.series", $tardir);
+} elsif ($dir{"patches.series"}) {
+ doseries("$dir/patches.series", $tardir);
+}
+
+close(DIFF);
+
+if (! -s "$out/${name}_$version.diff") {
+ unlink("$out/${name}_$version.diff");
+} else {
+ system('gzip', '-9', "$out/${name}_$version.diff");
+ if (-f "$out/${name}_$version.diff.gz") {
+ push @files, addfile("$out/${name}_$version.diff.gz");
+ } else {
+ push @files, addfile("$out/${name}_$version.diff");
+ }
+}
+
+$tags->{'FILES'} = "\n".join("\n", @files);
+delete $tags->{'DEBTRANSFORM-SERIES'};
+delete $tags->{'DEBTRANSFORM-TAR'};
+delete $tags->{'DEBTRANSFORM-FILES-TAR'};
+writedsc("$out/${name}_$version.dsc", $tags);
+exit(0);
diff --git a/debtransformbz2 b/debtransformbz2
new file mode 100755
index 0000000..01c1e9d
--- /dev/null
+++ b/debtransformbz2
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+if test $# -ne 2; then
+ exit 1
+fi
+
+bz="$1"
+tar="$2"
+
+bzcat "$bz" | gzip -f - >"$tar" || exit 1
+exit 0
diff --git a/debtransformzip b/debtransformzip
new file mode 100755
index 0000000..2054c12
--- /dev/null
+++ b/debtransformzip
@@ -0,0 +1,14 @@
+#! /bin/bash
+
+if test $# -ne 2; then
+ exit 1
+fi
+
+zip="$1"
+tar="$2"
+
+tmp=$(mktemp -d)
+unzip -q -d "$tmp" -- "$zip" || exit 1
+( cd "$tmp" && tar czO * ) >"$tar" || exit 1
+rm -r "$tmp"
+exit 0
diff --git a/download b/download
new file mode 100755
index 0000000..9383156
--- /dev/null
+++ b/download
@@ -0,0 +1,71 @@
+#!/usr/bin/perl -w
+
+use Net::SSL ();
+BEGIN {
+ $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0,
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use LWP::UserAgent;
+use URI;
+use File::Path;
+use File::Basename;
+
+use strict;
+
+die "USAGE: $0 DIR URLS..." unless $#ARGV >= 1;
+
+my $dir = shift @ARGV;
+
+my $ua = LWP::UserAgent->new(
+ agent => "openSUSE build script",
+ timeout => 42);
+
+for my $url (@ARGV) {
+ my $original = $url;
+ if ($url =~ /^zypp:\/\/([^\/]*)\/?/) {
+ use Build::Zypp;
+ my $repo = Build::Zypp::parsecfg($1);
+ die "can't parse $1\n" unless $repo;
+ die "missing url in repo ".$repo->{'name'}."\n" unless exists $repo->{'baseurl'};
+ my $u = $repo->{'baseurl'};
+ $u .= '/' unless substr($u, -1, 1) eq '/';
+ $url =~ s/^zypp:\/\/[^\/]*\/*//;
+ $url = URI->new($u.$url)
+ } else {
+ my $found = 0;
+ if ( -e $ENV{HOME} . "/.repo.config" ) {
+ open FILE, "<", $ENV{HOME} . "/.repo.config" or die $!;
+ while (<FILE>) {
+ next if ($_ !~ /^http[s]?:\/\/([^\/]*)\/?/);
+ chomp($_);
+ my $hidden = URI->new($_);
+ my $ui = $hidden->userinfo;
+ $hidden->userinfo(undef);
+ if ( $url =~ m/^$hidden/ ) {
+ $url = URI->new($url);
+ $url->userinfo($ui);
+ $found = 1;
+ last;
+ }
+ }
+ close FILE;
+ }
+ if ($found == 0 ) {
+ $url = URI->new($url);
+ }
+ }
+ $ua->env_proxy if $url->scheme ne 'https';
+ my $dest = "$dir/".basename($url->path);
+ unlink($dest); # just in case
+ my $retry = 3;
+ while ($retry--) {
+ my $res = $ua->mirror($url, $dest);
+ last if $res->is_success;
+ # if it's a redirect we probably got a bad mirror and should just retry
+ die "reqesting $original failed: ".$res->status_line."\n" unless $retry && $res->previous;
+ warn "retrying $original\n";
+ }
+}
+
+# vim:sw=2
diff --git a/expanddeps b/expanddeps
index b75712f..b34b2ee 100755
--- a/expanddeps
+++ b/expanddeps
@@ -36,88 +36,177 @@ while (@ARGV) {
$useusedforbuild = 1;
next;
}
+ if ($ARGV[0] eq '--define') {
+ shift @ARGV;
+ my $def = shift @ARGV;
+ Build::define($def);
+ next;
+ }
+ if ($ARGV[0] eq '--with') {
+ shift @ARGV;
+ my $def = shift @ARGV;
+ Build::define("_with_$def --with-$def");
+ next;
+ }
+ if ($ARGV[0] eq '--without') {
+ shift @ARGV;
+ my $def = shift @ARGV;
+ Build::define("_without_$def --without-$def");
+ next;
+ }
last;
}
$configdir = '.' unless defined $configdir;
$archs = '' unless defined $archs;
die("you must specfiy a depfile!\n") unless defined $rpmdeps;
-my @extradeps = grep {!/\.(?:spec|dsc)$/} @ARGV;
-my @specs = grep {/\.(?:spec|dsc)$/} @ARGV;
+my @extradeps = grep {!/(^|\/)PKGBUILD$/ && !/\.(?:spec|dsc|kiwi)$/} @ARGV;
+my @specs = grep {/(^|\/)PKGBUILD$/ || /\.(?:spec|dsc|kiwi)$/} @ARGV;
die("can only work with at most one spec\n") if @specs > 1;
my $spec = $specs[0];
my @archs = split(':', $archs);
-push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
+if ($spec =~ /(^|\/)PKGBUILD$/) {
+ push @archs, 'any' unless grep {$_ eq 'any'} @archs;
+} else {
+ push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
+}
my (%fn, %prov, %req);
-open(F, '<', $rpmdeps) || die("$rpmdeps: $!\n");
+my %packs;
+my %repo;
+my %ids;
+
my %packs_arch;
+my %packs_done;
+open(F, '<', $rpmdeps) || die("$rpmdeps: $!\n");
+# WARNING: the following code assumes that the 'I' tag comes last
+my ($pkgF, $pkgP, $pkgR);
while(<F>) {
chomp;
if (/^F:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgF = $2;
next if $fn{$1};
$fn{$1} = $2;
my $pack = $1;
$pack =~ /^(.*)\.([^\.]+)$/ or die;
push @{$packs_arch{$2}}, $1;
} elsif (/^P:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgP = $2;
next if $prov{$1};
$prov{$1} = $2;
} elsif (/^R:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgR = $2;
next if $req{$1};
$req{$1} = $2;
+ } elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ if ($ids{$1} && $packs_done{$1} && defined($pkgF) && defined($pkgP) && defined($pkgR)) {
+ my $i = $1;
+ my $oldid = $ids{$1};
+ my $newid = $2;
+ if (Build::Rpm::verscmp($oldid, $newid) < 0) {
+ $ids{$i} = $newid;
+ $fn{$i} = $pkgF;
+ $prov{$i} = $pkgP;
+ $req{$i} = $pkgR;
+ }
+ } else {
+ next if $ids{$1};
+ $ids{$1} = $2;
+ }
+ undef $pkgF;
+ undef $pkgP;
+ undef $pkgR;
+ } elsif ($_ eq 'D:') {
+ %packs_done = %ids;
}
}
close F;
-my %packs;
for my $arch (@archs) {
$packs{$_} ||= "$_.$arch" for @{$packs_arch{$arch} || []};
}
+# XXX: move to separate tool
if (!defined($dist) || $dist eq '') {
my $rpmarch = (grep {$fn{"rpm.$_"}} @archs)[0];
if (!$rpmarch) {
$dist = 'default';
} else {
my $rpmfn = $fn{"rpm.$rpmarch"};
- my $rpmdist = `rpm -qp --nodigest --nosignature --qf '%{DISTRIBUTION}' $rpmfn`;
- chomp $rpmdist;
- $rpmdist = lc($rpmdist);
- $rpmdist =~ s/-/_/g;
- my $rpmdista = $rpmdist;
- $rpmdista =~ s/.*\(//;
- $rpmdista =~ s/\).*//;
- $rpmdista =~ s/i[456]86/i386/;
- $rpmdist = '' unless $rpmdista =~ /^(i386|x86_64|ia64|ppc|ppc64|s390|s390x)$/;
- if ($rpmdist =~ /unitedlinux 1\.0.*/) {
- $dist = "ul1-$rpmdista";
- } elsif ($rpmdist =~ /suse sles_(\d+)/) {
- $dist = "sles$1-$rpmdista";
- } elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
- # alpha version
- $dist = "$1.".($2 + 1)."-$rpmdista";
- } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
- $dist = "$1-$rpmdista";
- } else {
- $dist = 'default';
+ if ($rpmfn =~ /^[a-z]+:\/\//) {
+ require File::Temp;
+ my $tmpdir = File::Temp::tempdir('CLEANUP' => 1);
+ $rpmfn =~ s/.*\//$tmpdir\// unless system("$INC[0]/download", $tmpdir, $rpmfn);
+ }
+ my $rpmdist = '';
+ if ($rpmfn =~ /^\// && -e $rpmfn) {
+ my %res = Build::Rpm::rpmq($rpmfn, 1010);
+ $rpmdist = $res{1010}->[0] || '';
+ }
+ $dist = Build::dist_canon($rpmdist, $archs[0]);
+ # need some extra work for sles11 :(
+ if ($dist =~ /^sles11-/) {
+ my %res = Build::Rpm::rpmq($rpmfn, 1049);
+ $dist =~ s/^sles11-/sles11sp2-/ if grep {/^liblzma/} @{$res{1049} || []};
}
}
+ print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n";
}
-my $cdist = $dist;
-$cdist =~ s/-.*//;
-$cdist = "sl$cdist" if $cdist =~ /^\d/;
-my $cf = Build::read_config($archs[0], "$configdir/$cdist.conf");
-if (!$cf) {
- $cf = Build::read_config($archs[0], "$configdir/default.conf");
- die("default config not found\n") unless $cf;
+my $cf = Build::read_config_dist($dist, $archs[0], $configdir);
+$cf->{'warnings'} = 1;
+
+my $dofileprovides = %{$cf->{'fileprovides'}};
+
+for my $pack (keys %packs) {
+ my $r = {};
+ my (@s, $s, @pr, @re);
+ @s = split(' ', $prov{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ if ($s =~ /^rpmlib\(/) {
+ splice(@s, 0, 2);
+ next;
+ }
+ push @pr, $s;
+ splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
+ }
+ @s = split(' ', $req{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ if ($s =~ /^rpmlib\(/) {
+ splice(@s, 0, 2);
+ next;
+ }
+ push @re, $s;
+ splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
+ }
+ $r->{'provides'} = \@pr;
+ $r->{'requires'} = \@re;
+ $repo{$pack} = $r;
}
+
#######################################################################
+sub print_rpmlist
+{
+ for (@_) {
+ print "$_ $fn{$packs{$_}}\n";
+ print "rpmid: $_:$ids{$packs{$_}}\n" if exists $ids{$packs{$_}};
+ }
+ print "preinstall: @{$cf->{'preinstall'} || []}\n";
+ print "vminstall: @{$cf->{'vminstall'} || []}\n";
+ print "cbpreinstall: @{$cf->{'cbpreinstall'} || []}\n"; # preinstall if is_emulator_arch
+ print "cbinstall: @{$cf->{'cbinstall'} || []}\n"; # install if is_emulator_arch
+ print "runscripts: @{$cf->{'runscripts'} || []}\n";
+ print "dist: $dist\n" if defined $dist;
+}
+
if ($useusedforbuild) {
die("Need a specfile/dscfile for --usedforbuild\n") unless defined $spec;
local *F;
@@ -145,11 +234,7 @@ if ($useusedforbuild) {
print STDERR " $_\n" for @errors;
exit(1);
}
- for (@usedforbuild) {
- print "$_ $fn{$packs{$_}}\n";
- }
- print "preinstall: @{$cf->{'preinstall'} || []}\n";
- print "dist: $dist\n" if defined $dist;
+ print_rpmlist(@usedforbuild);
exit(0);
}
@@ -159,44 +244,24 @@ my ($packname, $packvers, $subpacks, @packdeps);
$subpacks = [];
if ($spec) {
- if ($spec =~ /\.dsc$/) {
- ($packname, $packvers, $subpacks, @packdeps) = Build::read_dsc($cf, $spec);
+ my $d;
+ if ($spec =~ /\.kiwi$/) {
+ # just set up kiwi root for now
+ $d = {
+ 'deps' => [ 'kiwi', 'zypper', 'createrepo', 'squashfs' ],
+ 'subpacks' => [],
+ };
} else {
- ($packname, $packvers, $subpacks, @packdeps) = Build::read_spec($cf, $spec);
+ $d = Build::parse($cf, $spec);
}
+ $packname = $d->{'name'};
+ $packvers = $d->{'version'};
+ $subpacks = $d->{'subpacks'};
+ @packdeps = @{$d->{'deps'} || []};
+ push(@packdeps, @{$d->{'prereqs'}}) if $d->{'prereqs'};
}
-my %repo;
-for my $pack (keys %packs) {
- my $r = {};
- my (@s, $s, @pr, @re);
- @s = split(' ', $prov{$packs{$pack}});
- while (@s) {
- $s = shift @s;
- next if $s =~ /^\//;
- if ($s =~ /^rpmlib\(/) {
- splice(@s, 0, 2);
- next;
- }
- push @pr, $s;
- splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
- }
- @s = split(' ', $req{$packs{$pack}});
- while (@s) {
- $s = shift @s;
- next if $s =~ /^\//;
- if ($s =~ /^rpmlib\(/) {
- splice(@s, 0, 2);
- next;
- }
- push @re, $s;
- splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
- }
- $r->{'provides'} = \@pr;
- $r->{'requires'} = \@re;
- $repo{$pack} = $r;
-}
-Build::readrpmdeps($cf, undef, \%repo);
+Build::readdeps($cf, undef, \%repo);
#######################################################################
@@ -208,8 +273,4 @@ if (!shift @bdeps) {
exit(1);
}
-for (@bdeps) {
- print "$_ $fn{$packs{$_}}\n";
-}
-print "preinstall: @{$cf->{'preinstall'} || []}\n";
-print "dist: $dist\n" if defined $dist;
+print_rpmlist(@bdeps);
diff --git a/extractbuild b/extractbuild
index 115e423..f46ffc1 100755
--- a/extractbuild
+++ b/extractbuild
@@ -1,99 +1,101 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
use strict;
-$ENV{'PATH'} = "/bin:/usr/bin:/sbin:/usr/sbin";
+# buffer size for reading
+my $bufsize = 4*1024*1024;
-$| = 1;
+my ($opt_skip, $opt_disk, $opt_input, $opt_verbose);
-sub ls {
- local *D;
- opendir(D, $_[0]) || return ();
- my @r = grep {$_ ne '.' && $_ ne '..'} readdir(D);
- closedir D;
- return @r;
-}
-
-open(F, '</.build/build.data') || die("/.build/build.data: $!\n");
-my (%vars, $var, $val);
-my $l = '';
-while (<F>) {
- chomp;
- $l .= $_;
- my $q = $l =~ tr/\'/\'/;
- if ($q < 2 || ($q - 2) % 3 != 0) {
- $l .= "\n";
+while (@ARGV) {
+ if ($ARGV[0] eq '--skip') {
+ shift @ARGV;
+ $opt_skip = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--disk') {
+ shift @ARGV;
+ $opt_disk = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--input') {
+ shift @ARGV;
+ $opt_input = shift @ARGV;
next;
}
- if ($l =~ /^([a-zA-Z0-9]*)=\'(.*)\'$/s) {
- $var = $1;
- $val = $2;
- $val =~ s/\'\\\'\'/\'/gs;
- $vars{$var} = $val;
+ if ($ARGV[0] eq '--verbose' || $ARGV[0] eq '-v') {
+ shift @ARGV;
+ $opt_verbose = 1;
+ next;
}
- $l = '';
+ last;
}
-close F;
-my $xenswap = $vars{'XENSWAP'};
-die("need XENSWAP for swapout operation\n") unless $xenswap;
-system("umount -l /dev 2>/dev/null");
-die("$xenswap: $!\n") unless -e $xenswap;
-open(S, '>', $xenswap) || die("$xenswap: $!\n");
+die "need to specify disk image\n" unless $opt_disk;
-my $specfile = $vars{'SPECFILE'};
-die("no specfile/dscfile\n") unless $specfile;
-my $topdir = '/usr/src/packages';
-my $psuf = 'deb';
-my @dirs = ($topdir);
-if ($specfile =~ /\.spec$/) {
- $topdir = `rpm --eval '%_topdir'`;
- chomp $topdir;
- die("rpm returned no topdir\n") unless $topdir;
- die("rpm returned bad topdir\n") unless -d $topdir;
- @dirs = map {"$topdir/RPMS/$_"} ls("$topdir/RPMS");
- unshift @dirs, "$topdir/SRPMS";
- $psuf = 'rpm';
+open(F, '<', $opt_disk) || die "$opt_disk: $!\n";
+
+if($opt_input) {
+ open(S, '<', $opt_input) || die "$opt_input: $!\n";
+} else {
+ open(S, '<&STDIN') || die "can't dup stdin: $!\n";
}
-my @packs;
-for my $dir (@dirs) {
- push @packs, map {"$dir/$_"} grep {/$psuf$/} ls($dir);
+
+# skip build status
+if($opt_skip) {
+ seek(S, $opt_skip, 0) || die "$!\n";
}
-unshift @packs, '/.build.log';
-my $cpio = '';
-for my $pack (@packs) {
- print "$pack\n";
- my @s = stat($pack);
- my $n = $pack;
- $n =~ s/.*\///;
- $n = 'logfile' if $n eq '.build.log';
- die("$pack: $!\n") unless @s;
- $cpio .= "07070100000000000081a4000000000000000000000001";
- $cpio .= sprintf("%08x%08x", $s[9], $s[7]);
- $cpio .= "00000000000000000000000000000000";
- $cpio .= sprintf("%08x", length($n) + 1);
- $cpio .= "00000000";
- $cpio .= "$n\0";
- $cpio .= substr("\0\0\0\0", (length($cpio) & 3)) if length($cpio) & 3;
- open(F, '<', $pack) || die("$pack: $!\n");
- my $l = $s[7];
- while ($l) {
- my $ll = sysread(F, $cpio, $l > 8192 ? 8192 : $l, length($cpio));
- die("$pack: $!\n") unless $ll;
- die if $ll > $l;
- $l -= $ll;
- if (length($cpio) > 4096) {
- (syswrite(S, $cpio, 4096) || 0) == 4096 || die("swap write: $!\n");
- $cpio = substr($cpio, 4096);
+while(<S>) {
+ chomp;
+ last unless length $_;
+ my ($file, $filesize, $blksize, @blocks) = split(/ /);
+ if($#blocks == -1 && $filesize) {
+ die "invalid input '$_'\n";
+ }
+ $filesize = int($filesize);
+ $blksize = int($blksize);
+ die "invalid block size" unless ($blksize > 0 && $blksize <= $bufsize);
+ my $maxblocks = int($bufsize/$blksize);
+ $file =~ s/.*\///; # ensure basename, also stops directory traversal
+ $file =~ s/[^[:print:]]/_/g; # no binary junk in file names
+ print "$file\n" if $opt_verbose;
+ open (O, '>', $file) or die "$file: $!";
+ for my $block (@blocks) {
+ my ($block, $end) = split(/-/, $block);
+ $block = int($block);
+
+ if($block == 0) { # a hole!
+ seek(O, $blksize, 1);
+ $filesize -= $blksize;
+ next;
+ }
+
+ $end = $block unless $end;
+ $end = int($end);
+ seek(F, $block*$blksize, 0) || die "$file: seek: $!\n";
+ while($block <= $end && $filesize) {
+ my $size;
+ if($end == $block) {
+ $size = $blksize;
+ ++$block;
+ } elsif($maxblocks >= $end-$block) {
+ $size = ($end-$block)*$blksize;
+ $block += $end-$block;
+ } else {
+ $size = $maxblocks*$blksize;
+ $block += $maxblocks;
+ }
+ $size = $filesize if $size > $filesize;
+ my $buf;
+ if((sysread(F, $buf, $size) || 0) != $size) {
+ die "$file: read: $!\n";
+ }
+ $filesize -= $size;
+ print O $buf;
}
}
- $cpio .= substr("\0\0\0\0", (length($cpio) & 3)) if length($cpio) & 3;
-}
-$cpio .= "07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!\0\0\0\0";
-$cpio .= "\0" x (4096 - length($cpio) % 4096) if length($cpio) % 4096;
-while (length($cpio)) {
- (syswrite(S, $cpio, 4096) || 0) == 4096 || die("swap write: $!\n");
- $cpio = substr($cpio, 4096);
+ close O;
+ # sanity check
+ die "$file: invalid file size ($filesize byes left)\n" if $filesize != 0;
}
-exec('halt -f');
diff --git a/getbinaryid b/getbinaryid
new file mode 100755
index 0000000..55c57f6
--- /dev/null
+++ b/getbinaryid
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use strict;
+
+my $createmeta;
+my $manifest;
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--createmeta')
+ {
+ shift @ARGV;
+ $createmeta = 1;
+ next;
+ }
+ if ($ARGV[0] eq '--manifest')
+ {
+ shift @ARGV;
+ $manifest = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+my @files;
+if ($manifest) {
+ if ($manifest eq '-') {
+ @files = <STDIN>;
+ } else {
+ local *F;
+ open(F, '<', $manifest) || die("$manifest: $!\n");
+ @files = <F>;
+ close F;
+ }
+ chomp @files;
+}
+push @files, @ARGV;
+
+for my $file (@files) {
+ my $sig = Build::queryhdrmd5($file);
+ die("$file: no signature available\n") unless $sig;
+ if ($createmeta) {
+ local *F;
+ my $mf = $file;
+ $mf =~ s/\.[^\.]*$//;
+ $mf .= ".meta";
+ open(F, '>', $mf) || die("$mf: $!\n");
+ print F "$sig sigmd5\n";
+ close(F) || die("$mf: $!\n");
+ } else {
+ print "$sig\n";
+ }
+}
diff --git a/getchangetarget b/getchangetarget
new file mode 100755
index 0000000..c9e51a1
--- /dev/null
+++ b/getchangetarget
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use strict;
+
+use Build;
+
+my ($dist, $archs, $configdir);
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--dist') {
+ shift @ARGV;
+ $dist = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+die("Usage: getchangetarget --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
+
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+print "$cf->{'target'}\n" if $cf->{'target'};
diff --git a/getmacros b/getmacros
index 76429b9..d15af57 100755
--- a/getmacros
+++ b/getmacros
@@ -1,8 +1,13 @@
#!/usr/bin/perl -w
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
use strict;
-my ($dist, $configdir);
+my ($dist, $configdir, $archs);
while (@ARGV) {
if ($ARGV[0] eq '--dist') {
@@ -10,6 +15,11 @@ while (@ARGV) {
$dist = shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
if ($ARGV[0] eq '--configdir') {
shift @ARGV;
$configdir = shift @ARGV;
@@ -17,23 +27,7 @@ while (@ARGV) {
}
last;
}
-$configdir = '.' unless defined $configdir;
-$dist = '' unless defined $dist;
-
-die("Usage: getmacros --dist <dist> [--configdir <configdir>]\n") if !defined($dist) || @ARGV;
-local *F;
-if ($dist =~ /\//) {
- open(F, '<', $dist) || die("$dist: $!\n");
-} else {
- $dist =~ s/-.*//;
- $dist = "sl$dist" if $dist =~ /^\d/;
- open(F, '<', "$configdir/$dist.conf") || open(F, '<', "$configdir/default.conf") || die("config not found\n");
-}
-my $inmacro = 0;
-while(<F>) {
- if (!$inmacro) {
- $inmacro = 1 if /^\s*macros:/i;
- next;
- }
- print;
-}
+die("Usage: getmacros --dist <dist> [--configdir <configdir>]\n") if @ARGV;
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+print $cf->{'rawmacros'} if exists $cf->{'rawmacros'};
+exit(0);
diff --git a/getoptflags b/getoptflags
new file mode 100755
index 0000000..8031bf9
--- /dev/null
+++ b/getoptflags
@@ -0,0 +1,47 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use strict;
+
+use Build;
+
+my ($dist, $archs, $configdir, $debug);
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--dist') {
+ shift @ARGV;
+ $dist = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--debug') {
+ shift @ARGV;
+ $debug = 1;
+ next;
+ }
+ last;
+}
+
+die("Usage: getoptflags --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
+
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+exit 0 unless $cf->{'optflags'};
+my $all = $cf->{'optflags'}->{'*'};
+$all = defined($all) && $all ne '' ? " $all" : '';
+$all .= " -g" if $debug;
+for (sort keys %{$cf->{'optflags'}}) {
+ next if $_ eq '*';
+ print "optflags: $_ $cf->{'optflags'}->{$_}$all\n";
+}
diff --git a/gettype b/gettype
new file mode 100755
index 0000000..e07483a
--- /dev/null
+++ b/gettype
@@ -0,0 +1,36 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use strict;
+
+use Build;
+
+my ($dist, $archs, $configdir, $debug);
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--dist') {
+ shift @ARGV;
+ $dist = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+die("Usage: gettype --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
+
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+exit 0 unless $cf->{'type'};
+print "$cf->{'type'}\n";
diff --git a/init_buildsystem b/init_buildsystem
index fe53f06..4c9c80c 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -17,162 +17,263 @@ export YAST_IS_RUNNING="instsys"
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
export BUILD_DIR=${BUILD_DIR:-/usr/lib/build}
-PROC_IS_MOUNTED=
+# need to restore build root owner for non-root builds
+browner=0
+definesnstuff=()
+repos=()
+
+. $BUILD_DIR/common_functions || exit 1
# should RPMs be installed with --force ?
USE_FORCE=false
BUILD_IS_RUNNING=$BUILD_ROOT/not-ready
TMPFILE=$BUILD_ROOT/tmpfile
-RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDHOST}-%{BUILDTIME}\n"
+#buildhost removed so that id can be generated from repo files
+#RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDHOST}-%{BUILDTIME}\n"
+RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDTIME}\n"
-PREPARE_XEN=
+PREPARE_VM=
+USE_SYSTEM_QEMU=
USEUSEDFORBUILD=
+LIST_STATE=
RPMLIST=
+CLEAN_BUILD=
+CREATE_BUILD_BINARIES=
while test -n "$1" ; do
- case $1 in
+ case "$1" in
--prepare)
shift
- PREPARE_XEN=true
+ PREPARE_VM=true
+ ;;
+ --use-system-qemu)
+ shift
+ USE_SYSTEM_QEMU=true
+ ;;
+ --create-build-binaries)
+ shift
+ CREATE_BUILD_BINARIES=true
;;
--useusedforbuild)
shift
USEUSEDFORBUILD=--useusedforbuild
;;
+ --list-state)
+ shift
+ LIST_STATE=true
+ ;;
--rpmlist)
shift
RPMLIST=$1
shift
;;
+ --define|--with|--without)
+ definesnstuff[${#definesnstuff[@]}]="$1";
+ definesnstuff[${#definesnstuff[@]}]="$2";
+ shift 2
+ ;;
+ --repository|--repo)
+ repos[${#repos[@]}]="$2";
+ shift 2;
+ ;;
+ --clean)
+ CLEAN_BUILD="$1"
+ shift
+ ;;
+ --cachedir)
+ CACHE_DIR="$2"
+ shift 2
+ ;;
+ --configdir)
+ CONFIG_DIR=$2
+ shift 2
+ ;;
*)
break
;;
esac
done
-PKGS="$*"
+PKGS=("$@")
#
# needed functions
#
-function cleanup_and_exit {
- test -n "$PROC_IS_MOUNTED" && umount -n $BUILD_ROOT/proc 2>/dev/null
+cleanup_and_exit()
+{
+ trap EXIT
+ [ "$BUILD_ROOT" != / ] || chown $browner $BUILD_ROOT
+ # umount so init_buildsystem can be used standalone
+# XXX: use stat -f /dev/pts/ -c %T to check whether it's mounted and not suppress errors then?
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
+ umount -n $BUILD_ROOT/proc 2> /dev/null || true
+ umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
+ umount -n $BUILD_ROOT/mnt 2> /dev/null || true
exit ${1:-0}
}
-function clean_build_root () {
- test -n "$BUILD_ROOT" && {
- umount -n $BUILD_ROOT/proc 2> /dev/null
- umount -n $BUILD_ROOT/dev/pts 2> /dev/null
- umount -n $BUILD_ROOT/mnt 2> /dev/null
- rm -rf $BUILD_ROOT/*
- }
+clean_build_root()
+{
+ test -n "$BUILD_ROOT" && {
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
+ umount -n $BUILD_ROOT/proc 2> /dev/null || true
+ umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
+ umount -n $BUILD_ROOT/mnt 2> /dev/null || true
+ rm -rf -- $BUILD_ROOT/*
+ rm -rf -- $BUILD_ROOT/.build
+ rm -rf -- $BUILD_ROOT/.root
+ rm -rf -- $BUILD_ROOT/.init_b_cache
+ mkdir -p $BUILD_ROOT/proc
+ mkdir -p $BUILD_ROOT/dev/pts
+ if [ "$UID" = '0' ]; then
+ mount -n -tproc none $BUILD_ROOT/proc
+ mount -n -tdevpts none $BUILD_ROOT/dev/pts
+ fi
+ }
}
-function preinstall {
- if test -n "$1" ; then
- echo "preinstalling $1..."
- cd $BUILD_ROOT || cleanup_and_exit 1
- if test -e "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" ; then
- rpm2cpio "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" | cpio --extract --unconditional --preserve-modification-time --make-directories --no-absolute-filenames --quiet
- rpm -qp --nodigest --nosignature --qf "%{PREIN}" "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" > .init_b_cache/scripts/$1.pre
- rpm -qp --nodigest --nosignature --qf "%{POSTIN}" "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" > .init_b_cache/scripts/$1.post
+preinstall()
+{
+ check_exit
+ echo "preinstalling $1..."
+ cd $BUILD_ROOT || cleanup_and_exit 1
+ if test -x /usr/bin/bsdtar ; then
+ CPIO="/usr/bin/bsdtar --chroot -o --numeric-owner -x -f-"
+ TAR="/usr/bin/bsdtar --chroot -o --numeric-owner -x"
+ else
+ # cpio isn't safe so we require bsdtar for VMs. chroot is
+ # unsafe anyways so it's ok for that.
+ if [ -n "$PREPARE_VM" ]; then
+ echo "Error: setting up a VM requires bsdtar for security reasons."
+ echo "Please install bsdtar"
+ cleanup_and_exit 1
+ fi
+ CPIO="cpio --extract --unconditional --preserve-modification-time --make-directories --no-absolute-filenames --quiet"
+ TAR="tar -x"
+ fi
+ if test -e "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" ; then
+ PAYLOADDECOMPRESS=cat
+ case `rpm -qp --nodigest --nosignature --qf "%{PAYLOADCOMPRESSOR}\n" "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm"` in
+ lzma) rpm --showrc | grep PayloadIsLzma > /dev/null || PAYLOADDECOMPRESS="lzma -d" ;;
+ xz) rpm --showrc | grep PayloadIsXz > /dev/null || PAYLOADDECOMPRESS="xz -d" ;;
+ esac
+ if test "$PAYLOADDECOMPRESS" = "lzma -d" ; then
+ if ! lzma </dev/null >/dev/null 2>&1 ; then
+ test -f "$BUILD_DIR/lzmadec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/lzmadec.sh"
+ fi
+ fi
+ if test "$PAYLOADDECOMPRESS" = "xz -d" ; then
+ if ! xz </dev/null >/dev/null 2>&1 ; then
+ test -f "$BUILD_DIR/xzdec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/xzdec.sh"
+ fi
+ fi
+ if test "$PAYLOADDECOMPRESS" = cat ; then
+ rpm2cpio "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" | $CPIO
+ else
+ rpm2cpio "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" | $PAYLOADDECOMPRESS | $CPIO
+ fi
+ if test -e ".init_b_cache/scripts/$1.run" ; then
+ rpm -qp --nodigest --nosignature --qf "%{PREIN}" "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" > ".init_b_cache/scripts/$1.pre"
+ rpm -qp --nodigest --nosignature --qf "%{POSTIN}" "$BUILD_ROOT/.init_b_cache/rpms/$1.rpm" > ".init_b_cache/scripts/$1.post"
echo -n '(none)' > .init_b_cache/scripts/.none
- cmp -s .init_b_cache/scripts/$1.pre .init_b_cache/scripts/.none && rm -f .init_b_cache/scripts/$1.pre
- cmp -s .init_b_cache/scripts/$1.post .init_b_cache/scripts/.none && rm -f .init_b_cache/scripts/$1.post
+ cmp -s ".init_b_cache/scripts/$1.pre" .init_b_cache/scripts/.none && rm -f ".init_b_cache/scripts/$1.pre"
+ cmp -s ".init_b_cache/scripts/$1.post" .init_b_cache/scripts/.none && rm -f ".init_b_cache/scripts/$1.post"
rm -f .init_b_cache/scripts/.none
- else
- ar x "$BUILD_ROOT/.init_b_cache/rpms/$1.deb" control.tar.gz data.tar.gz
- mkdir -p .init_b_cache/scripts/control
- tar -C .init_b_cache/scripts/control -xzf control.tar.gz
- tar xzf data.tar.gz
- test -e .init_b_cache/scripts/control/preinst && mv .init_b_cache/scripts/control/preinst .init_b_cache/scripts/$1.pre
- test -e .init_b_cache/scripts/control/postinst && mv .init_b_cache/scripts/control/postinst .init_b_cache/scripts/$1.post
- rm -rf .init_b_cache/scripts/control control.tar.gz data.tar.gz
fi
+ elif test -e "$BUILD_ROOT/.init_b_cache/rpms/$1.deb" ; then
+ ar x "$BUILD_ROOT/.init_b_cache/rpms/$1.deb" control.tar.gz data.tar.gz
+ mkdir -p .init_b_cache/scripts/control
+ $TAR -C .init_b_cache/scripts/control -z -f control.tar.gz
+ $TAR -z -f data.tar.gz
+ if test -e ".init_b_cache/scripts/$1.run" ; then
+ test -e .init_b_cache/scripts/control/preinst && mv .init_b_cache/scripts/control/preinst ".init_b_cache/scripts/$1.pre"
+ test -e .init_b_cache/scripts/control/postinst && mv .init_b_cache/scripts/control/postinst ".init_b_cache/scripts/$1.post"
+ fi
+ rm -rf .init_b_cache/scripts/control control.tar.gz data.tar.gz
+ elif test -e "$BUILD_ROOT/.init_b_cache/rpms/$1.arch" ; then
+ $TAR -z -f "$BUILD_ROOT/.init_b_cache/rpms/$1.arch"
+ if test -f .INSTALL ; then
+ cat .INSTALL > ".init_b_cache/scripts/$1.post"
+ echo 'type post_install >/dev/null 2>&1 && post_install' >> ".init_b_cache/scripts/$1.post"
+ fi
+ rm -f .PKGINFO .INSTALL
+ else
+ echo "warning: package $1 does not exist"
fi
- if test -n "$2" ; then
- for PKG in $PACKAGES_TO_PREINSTALL ; do
- if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
- echo "running $PKG preinstall script"
- if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" ; then
- chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0
- else
- chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.pre" install < /dev/null
- fi
- rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
- fi
- if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
- echo "running $PKG postinstall script"
- if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" ; then
- chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1
- else
- chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" configure '' < /dev/null
- fi
- rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
- fi
- done
- fi
}
-function init_db {
+run_pkg_scripts()
+{
+ chroot $BUILD_ROOT /sbin/ldconfig 2>/dev/null
+ for PKG in $PACKAGES_TO_RUNSCRIPTS ; do
+ if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
+ echo "running $PKG preinstall script"
+ if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" ; then
+ chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0
+ else
+ chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.pre" install < /dev/null
+ fi
+ rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
+ fi
+ if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
+ echo "running $PKG postinstall script"
+ if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" ; then
+ chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1
+ else
+ chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" configure '' < /dev/null
+ fi
+ rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
+ fi
+ check_exit
+ done
+}
+
+init_db()
+{
if test $PSUF = rpm ; then
echo initializing rpm db...
- chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1
- else
+ if ! test -e $BUILD_ROOT/usr/lib/rpm/cpuinfo.yaml; then
+ # rpm v5 does not have initdb
+ chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1
+ fi
+ # hack: add nofsync to db config to speed up install
+ mkdir -p $BUILD_ROOT/root
+ echo '%__dbi_perms perms=0644 nofsync' > $BUILD_ROOT/.rpmmacros
+ echo '%__dbi_perms perms=0644 nofsync' > $BUILD_ROOT/root/.rpmmacros
+ elif test $PSUF = deb ; then
# force dpkg into database to make epoch test work
if ! test "$BUILD_ROOT/.init_b_cache/rpms/dpkg.deb" -ef "$BUILD_ROOT/.init_b_cache/dpkg.deb" ; then
rm -f $BUILD_ROOT/.init_b_cache/dpkg.deb
cp $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb $BUILD_ROOT/.init_b_cache/dpkg.deb || cleanup_and_exit 1
fi
chroot $BUILD_ROOT dpkg -i --force all .init_b_cache/dpkg.deb >/dev/null 2>&1
+ elif test $PSUF = arch ; then
+ mkdir -p $BUILD_ROOT/var/lib/pacman/sync
+ touch $BUILD_ROOT/var/lib/pacman/sync/core.db
+ touch $BUILD_ROOT/var/lib/pacman/sync/extra.db
+ touch $BUILD_ROOT/var/lib/pacman/sync/community.db
fi
}
-function reorder {
- REORDER_HAVE=
- if test $PSUF = deb ; then
- $BUILD_DIR/debsort $BUILD_ROOT/.init_b_cache/rpms "$@"
- return
- fi
- rm -rf $BUILD_ROOT/.reorder
- mkdir -p $BUILD_ROOT/.reorder/.db
- rpm --initdb --dbpath $BUILD_ROOT/.reorder/.db
+reorder()
+{
+ test -z "$*" && return
+ rm -f $BUILD_ROOT/.init_b_cache/order.manifest
for PKG in "$@" ; do
- touch $BUILD_ROOT/.reorder/$PKG
- test -e $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG && continue
- test -f $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm && REORDER_HAVE="$REORDER_HAVE
-$PKG.rpm"
- done
- if test -z "$REORDER_HAVE"; then
- rm -rf $BUILD_ROOT/.reorder
- echo "$@"
- return
- fi
- # manifest must be at least 96 bytes...
- echo "################################################################################################" "$REORDER_HAVE" > $BUILD_ROOT/.reorder/MANIFEST.rpm
- bash -c "cd $BUILD_ROOT/.init_b_cache/rpms && rpm -Uvv --dbpath $BUILD_ROOT/.reorder/.db --nosuggest --nodigest --nosignature --ignoresize --force --nodeps --test $BUILD_ROOT/.reorder/MANIFEST.rpm" 2>&1 | sed -n -e 's/-[^- ]*-[^- ]* / /' -e 's/^D: install: \([^ ]*\) .*/\1/p' > $BUILD_ROOT/.reorder/.list
- rm -f $BUILD_ROOT/.reorder/MANIFEST.rpm
- REORDER_HAVE=
- for PKG in `cat $BUILD_ROOT/.reorder/.list`; do
- test -e $BUILD_ROOT/.reorder/$PKG || continue
- REORDER_HAVE="$REORDER_HAVE $PKG"
- rm $BUILD_ROOT/.reorder/$PKG
+ echo "$PKG" >> $BUILD_ROOT/.init_b_cache/order.manifest
done
- for PKG in "$@" ; do
- test -e $BUILD_ROOT/.reorder/$PKG || continue
- REORDER_HAVE="$REORDER_HAVE $PKG"
- REORDER_MISSED="$REORDER_MISSED $PKG"
- rm $BUILD_ROOT/.reorder/$PKG
- done
- echo $REORDER_HAVE
+ $BUILD_DIR/order --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR --manifest $BUILD_ROOT/.init_b_cache/order.manifest $BUILD_ROOT/.init_b_cache/rpms
+ rm -f $BUILD_ROOT/.init_b_cache/order.manifest
}
-function create_devs {
+create_devs()
+{
local com file mode arg
mkdir -m 755 -p $BUILD_ROOT/dev/pts
+ test -f $BUILD_ROOT/dev/shm && rm -f $BUILD_ROOT/dev/shm
+ mkdir -m 755 -p $BUILD_ROOT/dev/shm
while read com file mode arg ; do
rm -f $BUILD_ROOT/dev/$file
if test $com = ln ; then
@@ -199,58 +300,295 @@ function create_devs {
DEVLIST
}
-function validate_cache_file {
- test "$BUILD_RPMS" != "$(cat $CACHE_FILE.id 2>/dev/null)" && rm -f $CACHE_FILE.id
- test -f $CACHE_FILE || rm -f $CACHE_FILE.id
- for SRC in ${BUILD_RPMS//:/ } ; do
- test -z "$SRC" && SRC=.
- test $SRC -nt $CACHE_FILE && rm -f $CACHE_FILE.id
+# check whether the repo list contains a plain "zypp://". Add all
+# enabled zypp repos in this case
+maybe_add_all_zypp_repos()
+{
+ local i j
+ r=()
+ for i in "${repos[@]}"; do
+ if [ "$i" = "zypp://" ]; then
+ while read j; do
+ j="${j#/etc/zypp/repos.d/}"
+ r=("${r[@]}" "zypp://${j%.repo}")
+ done < <(grep -l enabled=1 /etc/zypp/repos.d/*.repo)
+ else
+ r=("${r[@]}" "$i")
+ fi
done
+ repos=("${r[@]}")
+}
+
+validate_cache_file()
+{
+ local findonly=''
+ maybe_add_all_zypp_repos
+ if ! test -f $CACHE_FILE || ! test -f $CACHE_FILE.id || \
+ test "${repos[*]} ${BUILD_RPMS//:/ /}" != "$(cat $CACHE_FILE.id 2>/dev/null)"; then
+ rm -f $CACHE_FILE.id
+ else
+ for SRC in "${repos[@]}" ${BUILD_RPMS//:/ /}; do
+ test -n "$SRC" || SRC=.
+ if [ "${SRC#zypp://}" != "$SRC" ]; then
+ SRC="/var/cache/zypp/raw" # XXX can't use name here as we'd need to parse the file
+ fi
+ if test "$SRC" -nt $CACHE_FILE; then
+ rm -f $CACHE_FILE.id
+ break
+ fi
+ done
+ fi
if ! test -f $CACHE_FILE.id ; then
- echo initializing $CACHE_FILE with find command...
- for SRC in ${BUILD_RPMS//:/ } ; do
- test -z "$SRC" && SRC=.
- find $SRC -type f -name packages -print -o -follow -type f \( -name "*.rpm" -o -name "*.deb" \) -a ! -name "*src.rpm" -printf '%T@/%s/%i %p\n'
- echo
- done | createrpmdeps $CACHE_FILE > $CACHE_FILE.new
+ test -z "$LIST_STATE" && echo initializing $CACHE_FILE ...
+ for SRC in "${repos[@]}" -- ${BUILD_RPMS//:/ /}; do
+ if test "$SRC" = '--' ; then
+ findonly=1
+ continue
+ fi
+ test -z "$SRC" && SRC=`pwd`
+ if [ "${SRC#zypp://}" != "$SRC" ]; then
+ set -- $BUILD_DIR/createrepomddeps "$SRC"
+ elif [ "${SRC#http://}" != "$SRC" -o "${SRC#https://}" != "$SRC" -o "${SRC#ftp://}" != "$SRC" -o "${SRC#ftps://}" != "$SRC" ]; then
+ mkdir -p "$(getcachedir "$SRC")"
+ set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
+ elif [ "${SRC#arch@http://}" != "$SRC" -o "${SRC#arch@https://}" != "$SRC" -o "${SRC#arch@ftp://}" != "$SRC" -o "${SRC#arch@ftps://}" != "$SRC" ]; then
+ mkdir -p "$(getcachedir "$SRC")"
+ set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
+ elif [ ! -e "$SRC" ]; then
+ echo "*** $SRC does not exist" >&2
+ cleanup_and_exit 1
+ elif [ -z "$findonly" -a \( -e "$SRC"/suse/setup/descr/packages -o -e "$SRC"/suse/setup/descr/packages.gz \) ]; then
+ set -- $BUILD_DIR/createyastdeps "$SRC"
+ elif [ -z "$findonly" -a -e "$SRC"/repodata/repomd.xml ]; then
+ set -- $BUILD_DIR/createrepomddeps "$SRC"
+ else
+ set -- $BUILD_DIR/createrpmdeps "$SRC"
+ fi
+ echo "$@" >&2
+ "$@" || cleanup_and_exit 1
+ echo D:
+ done > $CACHE_FILE.new
+
mv $CACHE_FILE.new $CACHE_FILE
- echo "$BUILD_RPMS" > $CACHE_FILE.id
+ echo "${repos[*]} ${BUILD_RPMS//:/ /}" > $CACHE_FILE.id
fi
}
#
+# Copy qemu static binaries for cross-build emulation mode.
+# Preferentially install from $BUILD_DIR (potentially provided by build
+# server) in preference to build worker's /usr/bin (fallback).
+# If initvm is available it will be in $BUILD_DIR; otherwise prepare to
+# fall back to initscript_qemu_vm shell script with corresponding static
+# bash and mount programs.
+#
+
+check_copy_qemu()
+{
+ local arch
+
+ for arch in $EMULATOR_DEVS; do
+ if test -e $BUILD_DIR/qemu-$arch; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+copy_qemu()
+{
+ local path dest
+
+ echo "copying qemu"
+
+ mkdir -p $BUILD_ROOT/usr/bin
+
+ if check_copy_qemu; then
+
+ for path in $BUILD_DIR/qemu-*; do
+ if file $path | grep -q static; then
+ dest="$BUILD_ROOT/usr/bin/${path##*/}"
+ if [ -f "$path" -a ! -x "$dest" ]; then
+ echo -n " $path" # report copy
+ #echo install -m755 "$path" "$dest"
+ install -m755 "$path" "$dest"
+ fi
+ fi
+ done
+
+ else
+
+ for path in /usr/bin/qemu-*; do
+ if file $path | grep -q static; then
+ dest="$BUILD_ROOT/usr/bin/${path##*/}"
+ if [ -f "$path" -a ! -x "$dest" ]; then
+ echo -n " $path" # report copy
+ #echo install -m755 "$path" "$dest"
+ install -m755 "$path" "$dest"
+ fi
+ fi
+ done
+
+ if [ -e /usr/sbin/qemu-binfmt-conf.sh \
+ -a ! -e $BUILD_ROOT/usr/sbin/qemu-binfmt-conf.sh ]; then
+ echo " /usr/sbin/qemu-binfmt-conf.sh" # report copy
+ mkdir -p $BUILD_ROOT/usr/sbin
+ install -m755 /usr/sbin/qemu-binfmt-conf.sh $BUILD_ROOT/usr/sbin
+ fi
+
+ fi
+ echo ""
+
+ # Below for backward compatibility when /.build/initvm is not present
+
+ if [ -n "$PREPARE_VM" ]; then
+ if [ -x /bin/bash-static -a -x /bin/mount-static ]; then
+ echo " /bin/bash-static /bin/mount-static" # report copy
+ mkdir -p $BUILD_ROOT/bin
+ install -m755 /bin/bash-static $BUILD_ROOT/bin
+ install -m755 /bin/mount-static $BUILD_ROOT/bin
+ fi
+ fi
+}
+
+check_binfmt_registered()
+{
+ local arch
+ for arch in $EMULATOR_DEVS; do
+ if test -e /proc/sys/fs/binfmt_misc/$arch; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+fail_exit()
+{
+ cleanup_and_exit 1
+}
+
+# modify $SRC
+downloadpkg()
+{
+ local url="$1"
+ local cachedir
+
+ if [ "${url:0:7}" == "zypp://" ] ; then
+ cachedir="/var/cache/zypp/packages/"
+ SRC="$cachedir${url#zypp://}"
+ mkdir -p "${SRC%/*}" || cleanup_and_exit 1
+ elif [ "${url:0:7}" == "http://" -o "${url:0:8}" == "https://" -o "${url:0:6}" == "ftp://" -o "${url:0:7}" == "ftps://" ] ; then
+ cachedir="$(getcachedir "$url")"
+ local name="$(basename "$url")"
+ name=${name/%.pkg.tar.?z/.arch}
+ SRC="$cachedir/$name"
+ else
+ echo "Invalid url: $url"
+ cleanup_and_exit 1
+ fi
+
+ if [ ! -e "$SRC" ]; then
+ local destdir="$cachedir/tmp"
+ mkdir -p "$destdir"
+ echo "downloading $url ... ";
+ $BUILD_DIR/download "$destdir" "$url" || cleanup_and_exit 1
+ local destfile="$destdir/${url##*/}"
+ if [ ! -e "$destfile" ]; then
+ echo "expected $destfile after download but it's missing" >&2
+ cleanup_and_exit 1
+ fi
+ case $destfile in
+ *.rpm)
+ rpm -K "$destfile" > $destfile.v || { echo "rpm verify failed" >&2; rm -rf "$destdir"; cleanup_and_exit 1; }
+ if grep "NOT OK" $destfile.v; then
+ rm -rf "$destdir"
+ cleanup_and_exit 1
+ fi
+ rm -f "$destfile.v"
+ ;;
+ esac
+ mv "$destfile" "$SRC" || cleanup_and_exit 1
+ fi
+}
+
+getcachedir()
+{
+ url=$1
+ case $url in
+ *.pkg.tar.?z) url="arch@$url" ;;
+ esac
+ for repo in "${repos[@]}" ; do
+ if [ "${url:0:${#repo}}" == "$repo" -o "${url:0:${#repo}}" == "$repo" ] ; then
+ read repoid dummy < <(echo -n "$repo" | md5sum)
+ echo "$CACHE_DIR/$repoid"
+ break
+ fi
+ done
+}
+
+get_pkg_filename()
+{
+ local url="$1"
+ local name=$(basename $url)
+ local cachedir=$(getcachedir $url)
+ local destfile="$cachedir/$name"
+ echo $destfile
+}
+
+set_build_arch
+
+trap fail_exit EXIT
+
+if [ "$BUILD_ROOT" = / ]; then
+ browner="$(stat -c %U /)"
+fi
+
+if [ -n "$CLEAN_BUILD" ]; then
+ clean_build_root
+fi
+
+#
# now test if there was an incomplete run
#
if test -e $BUILD_IS_RUNNING ; then
echo It seems that there was an incomplete setup of $BUILD_ROOT.
echo To be sure, we will build it again completely...
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
umount -n $BUILD_ROOT/proc 2> /dev/null
umount -n $BUILD_ROOT/dev/pts 2> /dev/null
umount -n $BUILD_ROOT/mnt 2> /dev/null
echo "Your build system is broken!! Shall I execute"
echo
- echo " rm -rf $BUILD_ROOT"
+ echo " rm -rf -- $BUILD_ROOT/*"
echo
- echo -n "[y/N] "
+ echo "y - yes, cleanup the build root"
+ echo "N - No, abort build (default on enter)"
+ echo "c - Continue anyway with this build root"
+ echo -n "[y/N/c] "
read ANSWER
- test "$ANSWER" != y && {
- exit
- }
- clean_build_root
+ case "$ANSWER" in
+ c|C) rm -f $BUILD_IS_RUNNING ;;
+ y|Y) clean_build_root ;;
+ *) cleanup_and_exit 1 ;;
+ esac
fi
#
# store that we start to build system
#
mkdir -p $BUILD_ROOT
+mkdir -p $BUILD_ROOT/.build
touch $BUILD_IS_RUNNING
+if test -n "$PREPARE_VM" ; then
+ rm -f $BUILD_ROOT/.build/init_buildsystem.data
+fi
if test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
- # xen continuation
+ # vm continuation
. $BUILD_ROOT/.build/init_buildsystem.data
if ! test -e $BUILD_ROOT/.init_b_cache/preinstall_finished ; then
# finish preinstall
- preinstall '' true
+ run_pkg_scripts
init_db
touch $BUILD_ROOT/.init_b_cache/preinstall_finished
fi
@@ -272,12 +610,61 @@ else
# select and expand packages
#
RPMLIST=$BUILD_ROOT/.init_b_cache/rpmlist
- echo "expanding package dependencies..."
- if ! expanddeps $USEUSEDFORBUILD --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $BUILD_DIR/configs $PKGS > $RPMLIST ; then
+ test -z "$LIST_STATE" && echo "expanding package dependencies..."
+ if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
+ rm -f $BUILD_IS_RUNNING
cleanup_and_exit 1
fi
fi
+
+ if test -n "$LIST_STATE" ; then
+ rm -f $BUILD_IS_RUNNING
+ while read PKG SRC ; do
+ test "$PKG" = "preinstall:" && continue
+ test "$PKG" = "runscripts:" && continue
+ test "$PKG" = "cbpreinstall:" && continue
+ test "$PKG" = "vminstall:" && continue
+ test "$PKG" = "dist:" && continue
+ test "$PKG" = "rpmid:" && continue
+ echo "${SRC##*/}"
+ done < $BUILD_ROOT/.init_b_cache/rpmlist
+ rm -rf $BUILD_ROOT/.init_b_cache
+ cleanup_and_exit 0
+ fi
+
+ #
+ # copy the QEMU emulator
+ #
+ if check_use_emulator; then
+ [ -n "$USE_SYSTEM_QEMU" ] && copy_qemu && /usr/sbin/qemu-binfmt-conf.sh
+ if [ -z "$PREPARE_VM" ]; then
+ if ! check_binfmt_registered; then
+ echo "registering binfmt handlers"
+ if [ -x "$BUILD_DIR/initvm" -a -e "$BUILD_DIR/qemu-reg" ]; then
+ $BUILD_DIR/initvm
+ elif [ -x /usr/sbin/qemu-binfmt-conf.sh ]; then
+ /usr/sbin/qemu-binfmt-conf.sh
+ else
+ echo "Warning: could not register binfmt handlers"
+ fi
+ fi
+ if [ -n "$PREPARE_VM" ]; then
+ echo 0 > /proc/sys/vm/mmap_min_addr
+ fi
+ read mmap_min_addr < /proc/sys/vm/mmap_min_addr
+ if [ "$mmap_min_addr" != 0 ]; then
+ echo "Warning: mmap_min_addr is != 0. If programs fail at mmap this could be the reason"
+ fi
+ fi
+ fi
+
PACKAGES_TO_INSTALL=
+ PACKAGES_TO_PREINSTALL=
+ PACKAGES_TO_RUNSCRIPTS=
+ PACKAGES_TO_VMINSTALL=
+ PACKAGES_TO_CBPREINSTALL=
+ PACKAGES_TO_CBINSTALL=
+ RUNSCRIPTS_SEEN=
GUESSED_DIST=unknown
mkdir -p $BUILD_ROOT/.init_b_cache/rpms
while read PKG SRC ; do
@@ -285,74 +672,177 @@ else
PACKAGES_TO_PREINSTALL=$SRC
continue
fi
+ if test "$PKG" = "vminstall:" ; then
+ PACKAGES_TO_VMINSTALL=$SRC
+ continue
+ fi
+ # these additional preinstall / install values are only set for
+ # emulated "CrossBuild" setups - thus CB(pre)install
+ if test "$PKG" = "cbpreinstall:" ; then
+ if is_emulator_arch ; then
+ PACKAGES_TO_CBPREINSTALL=$SRC
+ fi
+ continue
+ fi
+ if test "$PKG" = "cbinstall:" ; then
+ if is_emulator_arch ; then
+ PACKAGES_TO_CBINSTALL=$SRC
+ fi
+ continue
+ fi
+ if test "$PKG" = "runscripts:" ; then
+ RUNSCRIPTS_SEEN=true
+ PACKAGES_TO_RUNSCRIPTS=$SRC
+ continue
+ fi
if test "$PKG" = "dist:" ; then
GUESSED_DIST=$SRC
continue
fi
- ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRC##*.}"
+ if test "$PKG" = "rpmid:" ; then
+ echo "${SRC#*:}" > $BUILD_ROOT/.init_b_cache/rpms/${SRC%%:*}.id
+ continue
+ fi
+ if test "$PKG" != "${PKG%:}"; then
+ echo "Warning: ignoring unsupported tag '$PKG'" >&2
+ continue
+ fi
+ if [ "${SRC#/}" = "$SRC" ]; then
+ url="$SRC"
+ case "$url" in
+ zypp://* | http://* | https://* | ftp://* | ftps://*)
+ downloadpkg "$url"
+ ;;
+ *)
+ echo "unsupported url for '$PKG': $url" >&2
+ cleanup_and_exit 1
+ ;;
+ esac
+ # downloadpkg modified $SRC, so it has a right name for use
+ fi
+ SRCSUF=${SRC/%.pkg.tar.?z/.arch}
+ ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PKG"
done < $RPMLIST
+
+ test -n "$PACKAGES_TO_CBPREINSTALL" && echo "cbpreinstall: $PACKAGES_TO_CBPREINSTALL"
+ test -n "$PACKAGES_TO_CBINSTALL" && echo "cbinstall : $PACKAGES_TO_CBINSTALL"
+ # compatibility...
+ test -z "$RUNSCRIPTS_SEEN" && PACKAGES_TO_RUNSCRIPTS="$PACKAGES_TO_PREINSTALL"
+
echo "$GUESSED_DIST" > $BUILD_ROOT/.guessed_dist
- PSUF=rpm
- test -L $BUILD_ROOT/.init_b_cache/rpms/rpm.rpm || PSUF=deb
- if test -n "$PREPARE_XEN" ; then
- # add util-linux/binutils/mount to preinstall list
- test "$PACKAGES_TO_PREINSTALL" = "${PACKAGES_TO_PREINSTALL/util-linux}" && PACKAGES_TO_PREINSTALL="$PACKAGES_TO_PREINSTALL util-linux"
- test $PSUF = deb -a "$PACKAGES_TO_PREINSTALL" = "${PACKAGES_TO_PREINSTALL/binutils}" && PACKAGES_TO_PREINSTALL="$PACKAGES_TO_PREINSTALL binutils"
- test $PSUF = deb -a "$PACKAGES_TO_PREINSTALL" = "${PACKAGES_TO_PREINSTALL/mount}" && PACKAGES_TO_PREINSTALL="$PACKAGES_TO_PREINSTALL mount"
- fi
+ test -n "$BUILD_DIST" || BUILD_DIST="$GUESSED_DIST"
+ DIST_TYPE=`gettype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"`
+ case "$DIST_TYPE" in
+ spec) PSUF=rpm ;;
+ dsc) PSUF=deb ;;
+ arch) PSUF=arch ;;
+ *)
+ # auto detect from packages
+ PSUF=rpm
+ test -L $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
+ test -L $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
+ ;;
+ esac
fi
#
# now test if there is already a build dir.
#
-if test ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages ; then
+if test ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages -a ! -e $BUILD_ROOT/.build/init_buildsystem.data ; then
mkdir -p $BUILD_ROOT/var/lib/rpm || cleanup_and_exit 1
mkdir -p $BUILD_ROOT/usr/src/packages/SOURCES || cleanup_and_exit 1
mkdir -p $BUILD_ROOT/etc || cleanup_and_exit 1
+ mkdir -p $BUILD_ROOT/proc || cleanup_and_exit 1
test -f $BUILD_ROOT/etc/HOSTNAME || hostname -f > $BUILD_ROOT/etc/HOSTNAME
if test $PSUF = deb ; then
mkdir -p $BUILD_ROOT/var/lib/dpkg
mkdir -p $BUILD_ROOT/var/log
- mkdir -p $BUILD_ROOT/etc
+ mkdir -p $BUILD_ROOT/etc/default
:> $BUILD_ROOT/var/lib/dpkg/status
:> $BUILD_ROOT/var/lib/dpkg/available
:> $BUILD_ROOT/var/log/dpkg.log
:> $BUILD_ROOT/etc/ld.so.conf
+ :> $BUILD_ROOT/etc/default/rcS
fi
+ for PKG in $PACKAGES_TO_RUNSCRIPTS ; do
+ : > $BUILD_ROOT/.init_b_cache/scripts/$PKG.run
+ done
+ progress_setup PACKAGES_TO_PREINSTALL
for PKG in $PACKAGES_TO_PREINSTALL ; do
+ progress_step PACKAGES_TO_PREINSTALL
preinstall ${PKG##*/}
done
- test -c $BUILD_ROOT/dev/null || create_devs
- if test -z "$PREPARE_XEN" ; then
- preinstall '' true
+ if test -n "$PREPARE_VM" ; then
+ progress_setup PACKAGES_TO_VMINSTALL
+ for PKG in $PACKAGES_TO_VMINSTALL ; do
+ progress_step PACKAGES_TO_VMINSTALL
+ preinstall ${PKG##*/}
+ done
+ fi
+ # add cbpreinstall if cross HOST != TARGET
+ progress_setup PACKAGES_TO_CBPREINSTALL
+ for PKG in $PACKAGES_TO_CBPREINSTALL ; do
+ progress_step PACKAGES_TO_CBPREINSTALL
+ preinstall ${PKG##*/}
+ done
+ if [ -w /root ]; then
+ test -c $BUILD_ROOT/dev/null || create_devs
+ fi
+ test -e $BUILD_ROOT/etc/fstab || touch $BUILD_ROOT/etc/fstab
+ test ! -e $BUILD_ROOT/etc/ld.so.conf -a -e $BUILD_ROOT/etc/ld.so.conf.in && cp $BUILD_ROOT/etc/ld.so.conf.in $BUILD_ROOT/etc/ld.so.conf
+ if test -z "$PREPARE_VM" ; then
+ run_pkg_scripts
init_db
touch $BUILD_ROOT/.init_b_cache/preinstall_finished
fi
fi
-if test -n "$PREPARE_XEN" ; then
- mkdir -p $BUILD_ROOT/.build
- echo "PACKAGES_TO_INSTALL='${PACKAGES_TO_INSTALL//\'/\'\\\'\'}'" > $BUILD_ROOT/.build/init_buildsystem.data
- echo "PACKAGES_TO_PREINSTALL='${PACKAGES_TO_PREINSTALL//\'/\'\\\'\'}'" >> $BUILD_ROOT/.build/init_buildsystem.data
- echo "PSUF='$PSUF'" >> $BUILD_ROOT/.build/init_buildsystem.data
+if test -n "$PREPARE_VM" ; then
echo "copying packages..."
for PKG in $PACKAGES_TO_INSTALL ; do
rm -f $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF $BUILD_ROOT/.init_b_cache/$PKG.$PSUF || cleanup_and_exit 1
ln -s -f ../$PKG.$PSUF $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF
+ check_exit
done
+ # alreadyinstalled check will not work, but we have to live with
+ # that...
+ echo -n 'reordering...'
+ PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
+ echo 'done'
+ Q="'\''"
+ echo "PACKAGES_TO_INSTALL='${PACKAGES_TO_INSTALL//"'"/$Q}'" > $BUILD_ROOT/.build/init_buildsystem.data
+ echo "PACKAGES_TO_RUNSCRIPTS='${PACKAGES_TO_RUNSCRIPTS//"'"/$Q}'" >> $BUILD_ROOT/.build/init_buildsystem.data
+ # needed for continuation in xen/kvm with rpm-x86
+ echo "PACKAGES_TO_PREINSTALL='${PACKAGES_TO_PREINSTALL//"'"/$Q}'" >> $BUILD_ROOT/.build/init_buildsystem.data
+ echo "PACKAGES_TO_CBPREINSTALL='${PACKAGES_TO_CBPREINSTALL//"'"/$Q}'" >> $BUILD_ROOT/.build/init_buildsystem.data
+ echo "PSUF='$PSUF'" >> $BUILD_ROOT/.build/init_buildsystem.data
rm -f $BUILD_IS_RUNNING
- exit 0
+ cleanup_and_exit 0
fi
mkdir -p $BUILD_ROOT/proc
-mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
-PROC_IS_MOUNTED=true
+mkdir -p $BUILD_ROOT/dev/pts
+mount -n -tproc none $BUILD_ROOT/proc 2>/dev/null || true
+mount -n -tdevpts none $BUILD_ROOT/dev/pts 2>/dev/null || true
-test -e $BUILD_ROOT/etc/ld.so.conf || \
- cp $BUILD_ROOT/etc/ld.so.conf.in $BUILD_ROOT/etc/ld.so.conf
-chroot $BUILD_ROOT /sbin/ldconfig 2> /dev/null
+#
+# create .build.binaries directory if requested
+#
+rm -rf $BUILD_ROOT/.build.binaries
+if test -n "$CREATE_BUILD_BINARIES" ; then
+ echo "creating .build.binaries directory..."
+ mkdir -p "$BUILD_ROOT/.build.binaries"
+ for PKG in $PACKAGES_TO_INSTALL ; do
+ test -L "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" || continue
+ LPKG=`readlink -f "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF"`
+ ln "$LPKG" "$BUILD_ROOT/.build.binaries/$PKG.$PSUF" 2>/dev/null
+ test -f "$BUILD_ROOT/.build.binaries/$PKG.$PSUF" && continue
+ cp "$LPKG" "$BUILD_ROOT/.build.binaries/$PKG.$PSUF"
+ check_exit
+ done
+fi
#
# get list and ids of already installed rpms
@@ -367,46 +857,81 @@ if test -f $BUILD_ROOT/var/lib/rpm/packages.rpm -o -f $BUILD_ROOT/var/lib/rpm/Pa
fi
#
-# reorder packages
+# reorder packages (already done in vm continuation)
#
-echo -n 'reordering...'
-REORDER_MISSED=
-PACKAGES_TO_INSTALL_FIRST=`reorder $PACKAGES_TO_INSTALL_FIRST`
-PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
-echo 'done'
-test -n "$REORDER_MISSED" && echo "WARNING: reorder missed$REORDER_MISSED"
+if ! test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
+ echo -n 'reordering...'
+ PACKAGES_TO_INSTALL_FIRST=`reorder $PACKAGES_TO_INSTALL_FIRST`
+ PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
+ echo 'done'
+fi
+
+rpm_e()
+{
+ chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | \
+ while read line; do
+ case "$line" in
+
+ r*failed:\ No\ such\ file\ or\ directory) ;;
+ error:\ failed\ to\ stat\ *:\ No\ such\ file\ or\ directory) ;;
+ error:\ *scriptlet\ failed*)
+ echo "$line"
+ echo "re-try deleting $PKG using --noscripts"
+ chroot $BUILD_ROOT rpm --nodeps --noscripts -e $PKG || true
+ ;;
+ *) echo "$line" ;;
+ esac
+ done
+}
#
# delete all packages we don't want
#
-cp -a $BUILD_ROOT/.init_b_cache/alreadyinstalled $BUILD_ROOT/.init_b_cache/todelete
-for PKG in $PACKAGES_TO_INSTALL_FIRST $PACKAGES_TO_INSTALL ; do
+mkdir -p $BUILD_ROOT/.init_b_cache/todelete
+for PKG in $BUILD_ROOT/.init_b_cache/alreadyinstalled/* ; do
+ PKG=${PKG##*/}
+ test "$PKG" = "*" && continue
+ ln $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG $BUILD_ROOT/.init_b_cache/todelete/$PKG
+done
+for PKG in $PACKAGES_TO_INSTALL_FIRST $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL ; do
rm -f $BUILD_ROOT/.init_b_cache/todelete/$PKG
done
for PKG in $BUILD_ROOT/.init_b_cache/todelete/* ; do
PKG=${PKG##*/}
test "$PKG" = "*" && continue
- echo deleting `sed -e 's/ .*//' < $BUILD_ROOT/.init_b_cache/todelete/$PKG`
- chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | \
- grep -v "^r.*failed: No such file or directory"
+ echo "deleting $PKG"
+ rpm_e "$PKG"
+ check_exit
done
rm -rf $BUILD_ROOT/.init_b_cache/todelete
+rm -rf $BUILD_ROOT/.init_b_cache/preinstalls
+mkdir -p $BUILD_ROOT/.init_b_cache/preinstalls
+for PKG in $PACKAGES_TO_PREINSTALL $PACKAGES_TO_CBPREINSTALL; do
+ touch "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG"
+done
+
rm -rf $BUILD_ROOT/installed-pkg
mkdir -p $BUILD_ROOT/installed-pkg
RPMCHECKOPTS=
RPMCHECKOPTS_HOST=
-test -x $BUILD_ROOT/usr/lib/rpm/rpmi && RPMCHECKOPTS="--nodigest --nosignature"
-test -x /usr/lib/rpm/rpmi && RPMCHECKOPTS_HOST="--nodigest --nosignature"
+# on Fedora 10 rpmbuild is in a separate package so we need something else to
+# detect rpm4
+test -x $BUILD_ROOT/usr/bin/rpmsign && RPMCHECKOPTS="--nodigest --nosignature"
+test -x /usr/bin/rpmsign && RPMCHECKOPTS_HOST="--nodigest --nosignature"
-for PKG in $PACKAGES_TO_INSTALL_FIRST RUN_LDCONFIG $PACKAGES_TO_INSTALL ; do
+MAIN_LIST="$PACKAGES_TO_INSTALL_FIRST $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL"
+progress_setup MAIN_LIST
+for PKG in $PACKAGES_TO_INSTALL_FIRST RUN_LDCONFIG $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL; do
case $PKG in
RUN_LDCONFIG)
- test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1
- continue
+ test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1
+ continue
;;
esac
+ progress_step MAIN_LIST
+
test -f $BUILD_ROOT/installed-pkg/$PKG && continue
if test $PSUF = deb ; then
@@ -420,57 +945,126 @@ for PKG in $PACKAGES_TO_INSTALL_FIRST RUN_LDCONFIG $PACKAGES_TO_INSTALL ; do
PKGID="${PKGID##*/}"
PKGID="${PKGID%.deb}"
echo "installing ${PKGID%_*}"
- ( chroot $BUILD_ROOT dpkg -i --force all .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
+ ( chroot $BUILD_ROOT dpkg --install --force all .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg)/||/^$/||print'
- test -e $BUILD_ROOT/exit && cleanup_and_exit 1
+ check_exit
echo "$PKGID debian" > $BUILD_ROOT/installed-pkg/$PKG
+ # ugly workaround for upstart system. some packages (procps) try
+ # to start a service in their configure phase. As we don't have
+ # a running upstart, we just link the start binary to /bin/true
+ if test -e "$BUILD_ROOT/sbin/start"; then
+ if test "$BUILD_ROOT/sbin/start" -ef "$BUILD_ROOT/sbin/initctl" ; then
+ echo "linking /sbin/start to /bin/true"
+ mv "$BUILD_ROOT/sbin/start" "$BUILD_ROOT/sbin/start.disabled"
+ ln -s "/bin/true" "$BUILD_ROOT/sbin/start"
+ fi
+ fi
+ # another workaround, see bug bnc#733699
+ rm -f "$BUILD_ROOT/var/run/init.upgraded"
+ continue
+ fi
+
+ if test $PSUF = arch ; then
+ test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF || continue
+ if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" -ef "$BUILD_ROOT/.init_b_cache/$PKG.$PSUF" ; then
+ rm -f $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
+ cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF $BUILD_ROOT/.init_b_cache/$PKG.$PSUF || cleanup_and_exit 1
+ fi
+ PKGID=`readlink $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
+ PKGID="${PKGID##*/}"
+ PKGID="${PKGID/%.pkg.tar.?z/.arch}"
+ PKGID="${PKGID%.$PSUF}"
+ echo "installing ${PKGID%_*}"
+ # -d -d disables deps checking
+ ( chroot $BUILD_ROOT pacman -Uf -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
+ perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print'
+ check_exit
+ echo "$PKGID $PSUF" > $BUILD_ROOT/installed-pkg/$PKG
continue
fi
test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm || continue
+ if test -f $BUILD_ROOT/.init_b_cache/rpms/$PKG.id -a -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then
+ read PKGID < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id
+ read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG
+ if test "$PKGID" = "$OLDPKGID" ; then
+ #echo "keeping ${PKGID%% *}"
+ echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+ continue
+ fi
+ fi
+
PKGID=`rpm -qp --qf "$RPMIDFMT" $RPMCHECKOPTS_HOST $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm`
if test -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then
- if test "$PKGID" != "`cat $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG`" ; then
- echo deleting unwanted `sed -e 's/ .*//' < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG`
- chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | \
- grep -v "^r.*failed: No such file or directory"
+ read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG
+ if test "$PKGID" != "$OLDPKGID" ; then
+ echo deleting unwanted ${OLDPKGID%% *}
+ rpm_e "$PKG"
elif test "$VERIFY_BUILD_SYSTEM" = true ; then
chroot $BUILD_ROOT rpm --verify $PKG 2>&1 | tee $TMPFILE
if grep ^missing $TMPFILE > /dev/null ; then
echo deleting incomplete ${PKGID%% *}
- chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | \
- grep -v "^r.*failed: No such file or directory"
+ rpm_e "$PKG"
else
- echo "keeping ${PKGID%% *}"
+ #echo "keeping ${PKGID%% *}"
echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
continue
fi
else
- echo "keeping ${PKGID%% *}"
+ #echo "keeping ${PKGID%% *}"
echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
continue
fi
+ if test -e "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG" ; then
+ preinstall "$PKG"
+ # call for rpm-4.x and not rpm-devel
+ test -z "${PKG##rpm-[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
+ # also exec for exchanged rpm ! naming is rpm-x86-<target>-<ver>
+ test -z "${PKG##rpm-x86-*[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
+ fi
fi
export ADDITIONAL_PARAMS=
if test "$USE_FORCE" = true ; then
- export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force"
+ export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force"
+ fi
+ # work around for cross-build installs, we must not overwrite the running rpm
+ if test "$PKG" = rpm ; then
+ for i in $BUILD_ROOT/.init_b_cache/preinstalls/rpm-x86-* ; do
+ test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
+ done
fi
echo "installing ${PKGID%% *}"
if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" -ef "$BUILD_ROOT/.init_b_cache/$PKG.rpm" ; then
rm -f $BUILD_ROOT/.init_b_cache/$PKG.rpm
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm $BUILD_ROOT/.init_b_cache/$PKG.rpm || cleanup_and_exit 1
fi
- ( chroot $BUILD_ROOT rpm --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
+ ( chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
$ADDITIONAL_PARAMS .init_b_cache/$PKG.rpm 2>&1 || \
touch $BUILD_ROOT/exit ) | \
grep -v "^warning:.*saved as.*rpmorig$"
+ # delete link so package is only installed once
rm -f $BUILD_ROOT/.init_b_cache/$PKG.rpm
- test -e $BUILD_ROOT/exit && cleanup_and_exit 1
+ check_exit
echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+
done
+if test $PSUF = deb ; then
+ echo "configure all installed packages..."
+ # configure all packages after complete installation, not for each package like rpm does
+ # We need to run this twice, because of cyclic dependencies as it does not succeed on most
+ # debian based distros in the first attempt.
+ if ! chroot $BUILD_ROOT dpkg --configure --pending 2>&1; then
+ echo "first configure attempt failed, trying again..."
+ chroot $BUILD_ROOT dpkg --configure --pending 2>&1 || touch $BUILD_ROOT/exit
+ fi
+fi
+
+# devices can vanish if devs got uninstalled
+test -c $BUILD_ROOT/dev/null || create_devs
+
cd $BUILD_ROOT || cleanup_and_exit 1
#
@@ -536,37 +1130,40 @@ chmod 644 $BUILD_ROOT/etc/mtab
test -e $BUILD_ROOT/etc/nsswitch.conf && {
echo removing nis flags from $BUILD_ROOT/etc/nsswitch.conf...
cat $BUILD_ROOT/etc/nsswitch.conf | sed -e"s:nis::g" > \
- $BUILD_ROOT/etc/nsswitch.conf.tmp
+ $BUILD_ROOT/etc/nsswitch.conf.tmp
mv $BUILD_ROOT/etc/nsswitch.conf.tmp $BUILD_ROOT/etc/nsswitch.conf
}
#
# creating some default directories
for DIR in /usr/share/doc/packages \
- /usr/X11R6/include/X11/pixmaps \
- /usr/X11R6/include/X11/bitmaps ; do
+ /usr/X11R6/include/X11/pixmaps \
+ /usr/X11R6/include/X11/bitmaps ; do
mkdir -p $BUILD_ROOT/$DIR
done
for FILE in /var/run/utmp /var/log/wtmp /etc/fstab ; do
+ mkdir -p $BUILD_ROOT/${FILE%/*}
touch $BUILD_ROOT/$FILE
done
echo now finalizing build dir...
-CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
-case "$CHROOT_RETURN" in
- *warning:*)
- chroot $BUILD_ROOT /sbin/ldconfig
- echo
- echo chroot $BUILD_ROOT /sbin/ldconfig
- echo
- echo "$CHROOT_RETURN"
- echo
- echo "Problem with ldconfig. It's better to reinit the build system..."
- echo
- cleanup_and_exit 1
- ;;
-esac
+if test -x $BUILD_ROOT/sbin/ldconfig ; then
+ CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
+ case "$CHROOT_RETURN" in
+ *warning:*)
+ chroot $BUILD_ROOT /sbin/ldconfig
+ echo
+ echo chroot $BUILD_ROOT /sbin/ldconfig
+ echo
+ echo "$CHROOT_RETURN"
+ echo
+ echo "Problem with ldconfig. It's better to reinit the build system..."
+ echo
+ cleanup_and_exit 1
+ ;;
+ esac
+fi
test -x $BUILD_ROOT/usr/sbin/Check && chroot $BUILD_ROOT /usr/sbin/Check
mkdir -p $BUILD_ROOT/var/adm/packages
@@ -585,9 +1182,25 @@ fi
for PROG in /usr/bin/TeX/texhash /usr/bin/texhash ; do
test -x $BUILD_ROOT/$PROG && \
- chroot $BUILD_ROOT bash -c ". /etc/profile ; $PROG"
+ chroot $BUILD_ROOT bash -c ". /etc/profile ; $PROG"
done
+if test -e $BUILD_ROOT/usr/share/zoneinfo/UTC ; then
+ for PROG in /usr/sbin/zic /usr/bin/zic /bin/zic /sbin/zic ; do
+ test -x $BUILD_ROOT/$PROG && chroot $BUILD_ROOT $PROG -l UTC
+ done
+fi
+
+test -e $BUILD_ROOT/.build/init_buildsystem.data || HOST=`hostname`
+test -e $BUILD_ROOT/etc/hosts || echo "127.0.0.1 localhost" > $BUILD_ROOT/etc/hosts
+if ! grep -F "127.0.0.1 $HOST" $BUILD_ROOT/etc/hosts > /dev/null ; then
+ # this makes a reverse lookup on 127.0.0.1 return the host name,
+ # which is bad, but 127.0.0.2 does not work on all unix systems
+ echo "127.0.0.1 $HOST" > $BUILD_ROOT/etc/hosts.new
+ test -f $BUILD_ROOT/etc/hosts && cat $BUILD_ROOT/etc/hosts >> $BUILD_ROOT/etc/hosts.new
+ mv $BUILD_ROOT/etc/hosts.new $BUILD_ROOT/etc/hosts
+fi
+
if test -x $BUILD_ROOT/bin/rpm -a ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages ; then
echo "initializing rpm db..."
chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1
@@ -595,10 +1208,15 @@ if test -x $BUILD_ROOT/bin/rpm -a ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a !
chroot $BUILD_ROOT rpm -q --whatprovides rpm >/dev/null 2>&1
fi
-rm -rf $BUILD_ROOT/.init_b_cache
+# create modules.dep in kvm/xen
+# This can not work, until we use the native repository kernel
+#if [ $BUILD_ROOT = "/" -a -x /sbin/depmod ]; then
+# /sbin/depmod -a
+#fi
+rm -f $BUILD_ROOT/.rpmmacros $BUILD_ROOT/root/.rpmmacros
+rm -rf $BUILD_ROOT/.init_b_cache
rm -f $BUILD_IS_RUNNING
-
rm -f $TMPFILE
cleanup_and_exit 0
diff --git a/initscript_qemu_vm b/initscript_qemu_vm
new file mode 100755
index 0000000..be8d8b5
--- /dev/null
+++ b/initscript_qemu_vm
@@ -0,0 +1,28 @@
+#!/bin/bash-static
+
+# from /usr/sbin/qemu-binfmt-conf.sh
+if [ ! -f /proc/sys ]; then
+ mount-static -n proc -t proc /proc
+fi
+if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
+ mount-static -n binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
+fi
+# register arm, ppc, mips
+
+echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
+echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
+
+echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
+
+echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
+echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
+#echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register
+#echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
+#echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
+#echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
+
+echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
+echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
+
+#exec /.build/build
+/bin/bash-static /.build/build
diff --git a/initvm.c b/initvm.c
new file mode 100644
index 0000000..f878174
--- /dev/null
+++ b/initvm.c
@@ -0,0 +1,329 @@
+/*
+ * NAME
+ * initvm - init for qemu, setup binfmt_misc launch build
+ *
+ * SYNOPSIS
+ * initvm
+ *
+ * DESCRIPTION
+ * This is the kernel init script for virtual machines which will
+ * be running executables for an embedded (non-native)
+ * architecture. It registers binfmt_misc handlers for qemu and
+ * executes the build script, and tests many assumptions.
+ *
+ * FILES
+ * /.build/qemu-reg
+ * text file with lines to stuff into the binfmt_misc
+ * filesystem registration file
+ * /.build/build
+ * build script to execute once binfmts are set up
+ *
+ * AUTHOR
+ * James Perkins <james.perkins@linuxfoundation.org>
+ */
+
+#include <sys/mount.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+/* to enable debugging, compile with -DDEBUG */
+#ifdef DEBUG
+#define DBG(x) do { x; } while(0)
+#else
+#define DBG(x)
+#endif
+
+/* function return codes */
+enum okfail { FAIL=0, OK=1 };
+
+/* qemu registration fields, see kernel/Documentation/binfmt_misc.txt */
+enum fields { ignore=0, name, type, offset, magic, mask, interpreter, flags };
+const char * const fieldnames[] = {
+ "ignore", "name", "type", "offset",
+ "magic", "mask", "interpreter", "flags"
+};
+const int n_fields = 8;
+
+/* files in useful places */
+#define SYSFS_BINFMT_MISC "/proc/sys/fs/binfmt_misc"
+#define SYSFS_BINFMT_MISC_REG "/proc/sys/fs/binfmt_misc/register"
+#define SYSFS_BINFMT_MISC_STAT "/proc/sys/fs/binfmt_misc/status"
+
+/* /usr/lib/build/x paths are copied to /.build inside a virtual machine */
+#define BINFMT_REGF_0 "/.build/qemu-reg"
+#define BINFMT_REGF_1 "/usr/lib/build/qemu-reg"
+#define BUILD "/.build/build"
+
+/* useful constant arrays */
+static char *rx_files[] = { "/proc", "/proc/sys", "/proc/sys/fs",
+ SYSFS_BINFMT_MISC, NULL };
+static char *w_files[] = { SYSFS_BINFMT_MISC_REG, NULL };
+
+static char* const args[] = { BUILD, NULL };
+
+/* test access modes for files, return OK or FAIL */
+enum okfail test_access_files(char *files[], int mode, const char *errstr)
+{
+ int i;
+
+ for (i = 0; files[i] != NULL; i++) {
+ if (access(files[i], mode) != 0) {
+ fprintf(stderr, "%s: %s: fails test\n",
+ files[i], errstr);
+ return FAIL;
+ }
+ }
+
+ return OK;
+}
+
+/* find a string in the given file, return OK or FAIL */
+enum okfail strfile(const char *filename, const char *string)
+{
+ char buf[BUFSIZ];
+ FILE *fp;
+ enum okfail found = FAIL;
+
+ fp = fopen(filename, "r");
+ if (fp == NULL)
+ {
+ perror(filename);
+ return FAIL;
+ }
+ while (fgets(buf, sizeof(buf), fp) != NULL)
+ {
+ if (strcmp(buf, string) == 0) {
+ found = OK;
+ break;
+ }
+
+ }
+ (void)fclose(fp);
+
+ return found;
+}
+
+/* write the file with given string, return OK or FAIL */
+enum okfail write_file_string(const char *filename, const char *string)
+{
+ int fd;
+
+ if ((fd = open(filename, O_WRONLY)) == -1)
+ {
+ perror(filename);
+ return FAIL;
+ }
+
+ if (write(fd, string, strlen(string)) == -1)
+ {
+ perror("write");
+ fprintf(stderr, "%s: write failed\n", filename);
+ close(fd);
+ return FAIL;
+ }
+
+ close(fd);
+ return OK;
+}
+
+#ifdef DEBUG
+/* dump contents of the file to stderr, return OK or FAIL */
+enum okfail dump_file(char *path)
+{
+ FILE *fp;
+ char buf[BUFSIZ];
+
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ perror(path);
+ return FAIL;
+ }
+
+ while (fgets(buf, sizeof(buf), fp) != NULL)
+ {
+ fputs(buf, stderr);
+ }
+
+ fclose(fp);
+ return OK;
+}
+#endif /* DEBUG */
+
+/* parse datafile and register (to regfile) all binary formats found */
+enum okfail binfmt_register(char *datafile, char *regfile)
+{
+ char buf[BUFSIZ];
+ FILE *fp;
+ int line;
+
+ fp = fopen(datafile, "r");
+ if (fp == NULL)
+ {
+ perror(datafile);
+ return FAIL;
+ }
+
+ for (line = 1; fgets(buf, sizeof(buf), fp) != NULL; line++)
+ {
+ char tokens[BUFSIZ];
+ char *s = tokens;
+ char *f[n_fields]; /* field content pointers */
+ int n; /* current field */
+ char path[BUFSIZ];
+
+ if (buf[0] != ':') /* non-data input line */
+ {
+ goto skip;
+ }
+
+ /* copy buf and tokenize :-seperated fields into f[] */
+ strcpy(tokens, buf);
+ for (n = 0; s != NULL && n < n_fields; n++)
+ {
+ f[n] = strsep(&s, ":");
+ }
+
+#ifdef DEBUG
+ int i;
+ fprintf(stderr, "DEBUG: line %d, fields %d:\n", line, n);
+ for (i = name; i < n; i++)
+ {
+ fprintf(stderr, " %s %s\n", fieldnames[i], f[i]);
+ }
+#endif /* DEBUG */
+
+ if (n == n_fields && s != NULL)
+ {
+ fprintf(stderr, "%s: line %d: extra fields, ignoring."
+ " Content: %s", datafile, line, buf);
+ goto skip;
+ }
+
+ if (n < n_fields)
+ {
+ fprintf(stderr, "%s: line %d: missing fields, ignoring."
+ " Content: %s", datafile, line, buf);
+ goto skip;
+ }
+
+
+ if (access(f[interpreter], X_OK) != 0) {
+ fprintf(stderr,
+ "%s: line %d: interpreter '%s' not found,"
+ " ignoring\n", datafile, line, f[interpreter]);
+ goto skip;
+ }
+
+ if (!write_file_string(regfile, buf)) {
+ fprintf(stderr, "%s: line %d: write failed."
+ " Content: %s\n", datafile, line, buf);
+ (void)fclose(fp);
+ return FAIL;
+ }
+
+ /* verify registration completed correctly */
+ snprintf(path, sizeof(path), SYSFS_BINFMT_MISC "/%s", f[name]);
+
+ if (access(path, R_OK) != 0) {
+ fprintf(stderr,
+ "%s: line %d: binfmt path not created, content '%s'\n",
+ path, line, buf);
+ (void)fclose(fp);
+ return FAIL;
+ }
+
+ DBG(fprintf(stderr, "dumping: %s\n", path));
+ DBG(dump_file(path));
+
+skip:
+ ;
+ }
+
+
+ (void)fclose(fp);
+
+ return OK;
+}
+
+/* set up/verify binfmt FS support, program more binfmts, and launch build */
+int main(int argc, char* argv[], char* env[])
+{
+ int retval;
+
+ /* mount proc filesystem if it isn't already */
+ if (mount("proc", "/proc", "proc", MS_MGC_VAL, NULL) == -1) {
+ if (errno != EBUSY) {
+ perror("mount: /proc");
+ exit(1);
+ }
+ }
+
+ /* try to load binfmt module if present, no big deal if it fails */
+ if ((retval = system("/sbin/modprobe binfmt_misc")) != 0) {
+ DBG(fprintf(stderr, "modprobe binfmt_misc exit code %d\n",
+ retval));
+ }
+
+ /* mount binfmt filesystem */
+ if (mount("binfmt_misc", SYSFS_BINFMT_MISC, "binfmt_misc", MS_MGC_VAL,
+ NULL) == -1) {
+ if (errno != EBUSY) {
+ perror("mount: binfmt_misc, " SYSFS_BINFMT_MISC);
+ }
+ }
+
+ /* verify all paths resulting from this are OK */
+ if (!test_access_files(rx_files, R_OK|X_OK, "read/search")) {
+ exit(1);
+ }
+ if (!test_access_files(w_files, W_OK, "write")) {
+ exit(1);
+ }
+
+ if (!strfile("/proc/filesystems", "nodev\tbinfmt_misc\n")) {
+ fprintf(stderr,
+ "/proc/filesystems: binfmt_misc support missing\n");
+ exit(1);
+ }
+
+ if (!strfile(SYSFS_BINFMT_MISC_STAT, "enabled\n")) {
+ fprintf(stderr,
+ "%s: binfmt_misc filesystem support not enabled\n",
+ SYSFS_BINFMT_MISC_STAT);
+ exit(1);
+ }
+
+ /* setup all done, do the registration */
+ if (!binfmt_register(BINFMT_REGF_0, SYSFS_BINFMT_MISC_REG)) {
+ fprintf(stderr, "%s: failed. Trying alternate binfmt file\n",
+ BINFMT_REGF_0);
+ if (!binfmt_register(BINFMT_REGF_1, SYSFS_BINFMT_MISC_REG)) {
+ fprintf(stderr, "%s: binfmt registration failed\n",
+ BINFMT_REGF_1);
+ exit(1);
+ }
+ }
+
+ /* if we are the init process, start build */
+ if (getpid() == 1)
+ {
+ if (access(BUILD, F_OK) != 0) {
+ fprintf(stderr, "%s: build executable missing\n",
+ BUILD);
+ exit(1);
+ }
+ if (access(BUILD, X_OK) != 0) {
+ fprintf(stderr, "%s: not executable\n", BUILD);
+ exit(1);
+ }
+ execve(BUILD, args, env);
+ perror("execve");
+ exit(1);
+ }
+
+ /* success! */
+ exit(0);
+}
diff --git a/killchroot b/killchroot
new file mode 100755
index 0000000..2b71f6c
--- /dev/null
+++ b/killchroot
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+my $sig = 15;
+my $verbose = 0;
+my $msg = '';
+my $doit = 1;
+
+while (@ARGV) {
+ if ($ARGV[0] eq '-s' || $ARGV[0] eq '--signal') {
+ die("$ARGV[0]: argument required") unless @ARGV > 1;
+ $sig = $ARGV[1];
+ shift @ARGV;
+ shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '-v' || $ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '-n') {
+ $doit = 0;
+ $verbose = 1;
+ shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '-m' || $ARGV[0] eq '--message') {
+ die("$ARGV[0]: argument required") unless @ARGV > 1;
+ $msg = $ARGV[1];
+ shift @ARGV;
+ shift @ARGV;
+ next;
+ }
+ last;
+}
+
+die("usage: killchroot [-s sig] <rootdir>") unless @ARGV == 1 && $ARGV[0] ne '';
+my $dir = $ARGV[0];
+chdir($dir) || die("$dir: $!\n");
+
+$dir = readlink('/proc/self/cwd');
+die("readlink /proc/self/cwd: $!\n") unless defined $dir;
+
+my %pids;
+my $pid;
+my $path;
+
+opendir(D, "/proc") || die("/proc: $!\n");
+for $pid (readdir(D)) {
+ next unless $pid =~ /^\d+$/;
+ $path = readlink("/proc/$pid/root");
+ next unless defined $path;
+ if ($path =~ /^\Q$dir\E(\/.*)?$/) {
+ $pids{$pid} = 1;
+ }
+ $path = readlink("/proc/$pid/exe");
+ if ($path =~ /^\Q$dir\E(\/.*)?$/) {
+ $pids{$pid} = 1;
+ }
+}
+closedir(D);
+
+my @pids = sort keys %pids;
+exit 0 unless @pids;
+
+print "$msg\n" if $msg ne '';
+
+if ($verbose) {
+ my @pidsv = ();
+ for $pid (@pids) {
+ open(F, "</proc/$pid/cmdline");
+ my $cmd = '';
+ sysread(F, $cmd, 128);
+ close F;
+ $cmd =~ s/\0.*//;
+ #$cmd =~ s/ .*//;
+ push @pidsv, "$pid($cmd)";
+ }
+ if (@pids > 1) {
+ print "sending signal $sig to processes @pidsv\n";
+ } else {
+ print "sending signal $sig to process @pidsv\n";
+ }
+}
+exit 0 unless $doit;
+kill $sig => @pids;
+kill CONT => @pids if $sig eq 9;
+exit 0;
diff --git a/lxc.conf b/lxc.conf
new file mode 100644
index 0000000..d95924a
--- /dev/null
+++ b/lxc.conf
@@ -0,0 +1,15 @@
+lxc.cgroup.devices.deny = a
+# null
+lxc.cgroup.devices.allow = c 1:3 rw
+# zero
+lxc.cgroup.devices.allow = c 1:5 rw
+# full
+lxc.cgroup.devices.allow = c 1:7 rw
+# random
+lxc.cgroup.devices.allow = c 1:8 rw
+# urandom
+lxc.cgroup.devices.allow = c 1:9 rw
+# tty
+lxc.cgroup.devices.allow = c 5:0 rw
+# ptmx
+lxc.cgroup.devices.allow = c 5:2 rw
diff --git a/mkbaselibs b/mkbaselibs
index 7690321..1446ff0 100755
--- a/mkbaselibs
+++ b/mkbaselibs
@@ -2,126 +2,148 @@
use POSIX;
use strict;
+use File::Temp qw/tempfile tempdir/;
+# See: http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html#S3-RPM-FILE-FORMAT-HEADER-TAG-LISTING
+# cf http://search.cpan.org/~davecross/Parse-RPM-Spec-0.01/lib/Parse/RPM/Spec.pm
my %STAG = (
- "NAME" => 1000,
- "VERSION" => 1001,
- "RELEASE" => 1002,
- "EPOCH" => 1003,
- "SERIAL" => 1003,
- "SUMMARY" => 1004,
- "DESCRIPTION" => 1005,
- "BUILDTIME" => 1006,
- "BUILDHOST" => 1007,
- "INSTALLTIME" => 1008,
- "SIZE" => 1009,
- "DISTRIBUTION" => 1010,
- "VENDOR" => 1011,
- "GIF" => 1012,
- "XPM" => 1013,
- "LICENSE" => 1014,
- "COPYRIGHT" => 1014,
- "PACKAGER" => 1015,
- "GROUP" => 1016,
- "SOURCE" => 1018,
- "PATCH" => 1019,
- "URL" => 1020,
- "OS" => 1021,
- "ARCH" => 1022,
- "PREIN" => 1023,
- "POSTIN" => 1024,
- "PREUN" => 1025,
- "POSTUN" => 1026,
- "OLDFILENAMES" => 1027,
- "FILESIZES" => 1028,
- "FILESTATES" => 1029,
- "FILEMODES" => 1030,
- "FILERDEVS" => 1033,
- "FILEMTIMES" => 1034,
- "FILEMD5S" => 1035,
- "FILELINKTOS" => 1036,
- "FILEFLAGS" => 1037,
- "FILEUSERNAME" => 1039,
- "FILEGROUPNAME" => 1040,
- "ICON" => 1043,
- "SOURCERPM" => 1044,
- "FILEVERIFYFLAGS" => 1045,
- "ARCHIVESIZE" => 1046,
- "PROVIDENAME" => 1047,
- "PROVIDES" => 1047,
- "REQUIREFLAGS" => 1048,
- "REQUIRENAME" => 1049,
- "REQUIREVERSION" => 1050,
- "NOSOURCE" => 1051,
- "NOPATCH" => 1052,
- "CONFLICTFLAGS" => 1053,
- "CONFLICTNAME" => 1054,
- "CONFLICTVERSION" => 1055,
- "EXCLUDEARCH" => 1059,
- "EXCLUDEOS" => 1060,
- "EXCLUSIVEARCH" => 1061,
- "EXCLUSIVEOS" => 1062,
- "RPMVERSION" => 1064,
- "TRIGGERSCRIPTS" => 1065,
- "TRIGGERNAME" => 1066,
- "TRIGGERVERSION" => 1067,
- "TRIGGERFLAGS" => 1068,
- "TRIGGERINDEX" => 1069,
- "VERIFYSCRIPT" => 1079,
- "CHANGELOGTIME" => 1080,
- "CHANGELOGNAME" => 1081,
- "CHANGELOGTEXT" => 1082,
- "PREINPROG" => 1085,
- "POSTINPROG" => 1086,
- "PREUNPROG" => 1087,
- "POSTUNPROG" => 1088,
- "BUILDARCHS" => 1089,
- "OBSOLETENAME" => 1090,
- "OBSOLETES" => 1090,
- "VERIFYSCRIPTPROG" => 1091,
- "TRIGGERSCRIPTPROG" => 1092,
- "COOKIE" => 1094,
- "FILEDEVICES" => 1095,
- "FILEINODES" => 1096,
- "FILELANGS" => 1097,
- "PREFIXES" => 1098,
- "INSTPREFIXES" => 1099,
- "SOURCEPACKAGE" => 1106,
- "PROVIDEFLAGS" => 1112,
- "PROVIDEVERSION" => 1113,
- "OBSOLETEFLAGS" => 1114,
- "OBSOLETEVERSION" => 1115,
- "DIRINDEXES" => 1116,
- "BASENAMES" => 1117,
- "DIRNAMES" => 1118,
- "OPTFLAGS" => 1122,
- "DISTURL" => 1123,
- "PAYLOADFORMAT" => 1124,
- "PAYLOADCOMPRESSOR" => 1125,
- "PAYLOADFLAGS" => 1126,
- "INSTALLCOLOR" => 1127,
- "INSTALLTID" => 1128,
- "REMOVETID" => 1129,
- "RHNPLATFORM" => 1131,
- "PLATFORM" => 1132,
- "PATCHESNAME" => 1133,
- "PATCHESFLAGS" => 1134,
- "PATCHESVERSION" => 1135,
- "CACHECTIME" => 1136,
- "CACHEPKGPATH" => 1137,
- "CACHEPKGSIZE" => 1138,
- "CACHEPKGMTIME" => 1139,
- "FILECOLORS" => 1140,
- "FILECLASS" => 1141,
- "CLASSDICT" => 1142,
- "FILEDEPENDSX" => 1143,
- "FILEDEPENDSN" => 1144,
- "DEPENDSDICT" => 1145,
- "SOURCEPKGID" => 1146,
+ "NAME" => 1000,
+ "VERSION" => 1001,
+ "RELEASE" => 1002,
+ "EPOCH" => 1003,
+ "SERIAL" => 1003,
+ "SUMMARY" => 1004,
+ "DESCRIPTION" => 1005,
+ "BUILDTIME" => 1006,
+ "BUILDHOST" => 1007,
+ "INSTALLTIME" => 1008,
+ "SIZE" => 1009,
+ "DISTRIBUTION" => 1010,
+ "VENDOR" => 1011,
+ "GIF" => 1012,
+ "XPM" => 1013,
+ "LICENSE" => 1014,
+ "COPYRIGHT" => 1014,
+ "PACKAGER" => 1015,
+ "GROUP" => 1016,
+ "SOURCE" => 1018,
+ "PATCH" => 1019,
+ "URL" => 1020,
+ "OS" => 1021,
+ "ARCH" => 1022,
+ "PREIN" => 1023,
+ "POSTIN" => 1024,
+ "PREUN" => 1025,
+ "POSTUN" => 1026,
+ "OLDFILENAMES" => 1027,
+ "FILESIZES" => 1028,
+ "FILESTATES" => 1029,
+ "FILEMODES" => 1030,
+ "FILERDEVS" => 1033,
+ "FILEMTIMES" => 1034,
+ "FILEMD5S" => 1035,
+ "FILELINKTOS" => 1036,
+ "FILEFLAGS" => 1037,
+ "FILEUSERNAME" => 1039,
+ "FILEGROUPNAME" => 1040,
+ "ICON" => 1043,
+ "SOURCERPM" => 1044,
+ "FILEVERIFYFLAGS" => 1045,
+ "ARCHIVESIZE" => 1046,
+ "PROVIDENAME" => 1047,
+ "PROVIDES" => 1047,
+ "REQUIREFLAGS" => 1048,
+ "REQUIRENAME" => 1049,
+ "REQUIREVERSION" => 1050,
+ "NOSOURCE" => 1051,
+ "NOPATCH" => 1052,
+ "CONFLICTFLAGS" => 1053,
+ "CONFLICTNAME" => 1054,
+ "CONFLICTVERSION" => 1055,
+ "EXCLUDEARCH" => 1059,
+ "EXCLUDEOS" => 1060,
+ "EXCLUSIVEARCH" => 1061,
+ "EXCLUSIVEOS" => 1062,
+ "RPMVERSION" => 1064,
+ "TRIGGERSCRIPTS" => 1065,
+ "TRIGGERNAME" => 1066,
+ "TRIGGERVERSION" => 1067,
+ "TRIGGERFLAGS" => 1068,
+ "TRIGGERINDEX" => 1069,
+ "VERIFYSCRIPT" => 1079,
+ "CHANGELOGTIME" => 1080,
+ "CHANGELOGNAME" => 1081,
+ "CHANGELOGTEXT" => 1082,
+ "PREINPROG" => 1085,
+ "POSTINPROG" => 1086,
+ "PREUNPROG" => 1087,
+ "POSTUNPROG" => 1088,
+ "BUILDARCHS" => 1089,
+ "OBSOLETENAME" => 1090,
+ "OBSOLETES" => 1090,
+ "VERIFYSCRIPTPROG" => 1091,
+ "TRIGGERSCRIPTPROG" => 1092,
+ "COOKIE" => 1094,
+ "FILEDEVICES" => 1095,
+ "FILEINODES" => 1096,
+ "FILELANGS" => 1097,
+ "PREFIXES" => 1098,
+ "INSTPREFIXES" => 1099,
+ "SOURCEPACKAGE" => 1106,
+ "PROVIDEFLAGS" => 1112,
+ "PROVIDEVERSION" => 1113,
+ "OBSOLETEFLAGS" => 1114,
+ "OBSOLETEVERSION" => 1115,
+ "DIRINDEXES" => 1116,
+ "BASENAMES" => 1117,
+ "DIRNAMES" => 1118,
+ "OPTFLAGS" => 1122,
+ "DISTURL" => 1123,
+ "PAYLOADFORMAT" => 1124,
+ "PAYLOADCOMPRESSOR" => 1125,
+ "PAYLOADFLAGS" => 1126,
+ "INSTALLCOLOR" => 1127,
+ "INSTALLTID" => 1128,
+ "REMOVETID" => 1129,
+ "RHNPLATFORM" => 1131,
+ "PLATFORM" => 1132,
+ "PATCHESNAME" => 1133,
+ "PATCHESFLAGS" => 1134,
+ "PATCHESVERSION" => 1135,
+ "CACHECTIME" => 1136,
+ "CACHEPKGPATH" => 1137,
+ "CACHEPKGSIZE" => 1138,
+ "CACHEPKGMTIME" => 1139,
+ "FILECOLORS" => 1140,
+ "FILECLASS" => 1141,
+ "CLASSDICT" => 1142,
+ "FILEDEPENDSX" => 1143,
+ "FILEDEPENDSN" => 1144,
+ "DEPENDSDICT" => 1145,
+ "SOURCEPKGID" => 1146,
+ "PRETRANS" => 1151,
+ "POSTTRANS" => 1152,
+ "PRETRANSPROG" => 1153,
+ "POSTTRANSPROG" => 1154,
+ "DISTTAG" => 1155,
+ "SUGGESTSNAME" => 1156,
+ "SUGGESTSVERSION" => 1157,
+ "SUGGESTSFLAGS" => 1158,
+ "ENHANCESNAME" => 1159,
+ "ENHANCESVERSION" => 1160,
+ "ENHANCESFLAGS" => 1161,
+ "PRIORITY" => 1162,
+ "CVSID" => 1163,
);
# do not mix numeric tags with symbolic tags.
# special symbolic tag 'FILENAME' exists.
+
+# This function seems to take a set of tags and populates a global
+# hash-table (%res) with data obtained by doing a binary unpack() on
+# the raw package
+# http://www.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html
+
sub rpmq_many {
my $rpm = shift;
my @stags = @_;
@@ -223,7 +245,7 @@ sub rpmq_many {
$tag = 0+$tag;
if ($stags{$tag}) {
eval {
- my $otag = $stags{$tag};
+ my $otag = $stags{$tag};
if ($type == 0) {
$res{$otag} = [ '' ];
} elsif ($type == 1) {
@@ -250,11 +272,11 @@ sub rpmq_many {
};
if ($@) {
warn("Bad rpm $rpm: $@\n");
- return ();
+ return ();
}
}
}
-
+
if ($need_filenames) {
if ($res{'OLDFILENAMES'}) {
$res{'FILENAMES'} = [ @{$res{'OLDFILENAMES'}} ];
@@ -290,7 +312,7 @@ sub rpmq_add_flagsvers {
my @preamble = qw{
Name Version Release Epoch Summary Copyright License Distribution
- Disturl Vendor Group Packager Url Icon Prefixes
+ Disturl Vendor Group Packager Url Icon Prefixes
};
my $rpm;
@@ -304,6 +326,7 @@ my $prefix;
my $extension;
my $configdir;
my $targetname;
+my $legacyversion;
my @baselib;
my @config;
@@ -313,12 +336,21 @@ my @obsoletes;
my @requires;
my @prerequires;
my @conflicts;
+my @recommends;
+my @supplements;
+my @suggests;
my @prein;
my @postin;
my @preun;
my @postun;
+my $autoreqprov;
+my $verbose;
+my %target_matched;
+my @filesystem;
+
+# Used for each package by
sub parse_config {
my $target = shift;
my $pkgname = shift;
@@ -328,6 +360,7 @@ sub parse_config {
my $pkgmatches = 1;
$prefix = '';
+ $legacyversion = '';
$extension = '';
$configdir = '';
$targetname = '';
@@ -337,12 +370,16 @@ sub parse_config {
@provides = ();
@obsoletes = ();
@requires = ();
+ @recommends = ();
+ @supplements = ();
+ @suggests = ();
@prerequires = ();
@conflicts = ();
@prein = ();
@postin = ();
@preun = ();
@postun = ();
+ $autoreqprov = 'on';
my $match1 = '';
for (split("\n", $config)) {
@@ -376,6 +413,7 @@ sub parse_config {
next unless s/^targetarch\s+\Q$targetarch\E\s+//;
}
if (/^prefix\s+(.*?)$/) { $prefix = $1; next; }
+ if (/^legacyversion\s+(.*?)$/) { $legacyversion = $1; next; }
if (/^extension\s+(.*?)$/) { $extension = $1; next; }
if (/^configdir\s+(.*?)$/) { $configdir= $1; next; }
if (/^targetname\s+(.*?)$/) { $targetname = $1; next; }
@@ -386,6 +424,7 @@ sub parse_config {
my $pm = $1;
$pkgmatches = $pkgname =~ /$pm/;
$match1 = $1 if defined $1;
+ $pkghasmatched |= $pkgmatches if $pkgname =~ /-debuginfo$/ && $target_matched{$target};
next;
}
if (/^package\s+(.*?)$/) {
@@ -397,6 +436,9 @@ sub parse_config {
return 0 if $_ eq 'block!';
if (/^provides\s+(.*?)$/) { push @provides, $1; next; }
if (/^requires\s+(.*?)$/) { push @requires, $1; next; }
+ if (/^recommends\s+(.*?)$/) { push @recommends, $1; next; }
+ if (/^supplements\s+(.*?)$/) { push @supplements, $1; next; }
+ if (/^suggests\s+(.*?)$/) { push @suggests, $1; next; }
if (/^prereq\s+(.*?)$/) { push @prerequires, $1; next; }
if (/^obsoletes\s+(.*?)$/) { push @obsoletes, $1; next; }
if (/^conflicts\s+(.*?)$/) { push @conflicts, $1; next; }
@@ -406,6 +448,7 @@ sub parse_config {
if (/^post(in)?\s+(.*?)$/) { push @postin, $2; next; }
if (/^preun\s+(.*?)$/) { push @preun, $1; next; }
if (/^postun\s+(.*?)$/) { push @preun, $1; next; }
+ if (/^autoreqprov\s+(.*?)$/) {$autoreqprov = $1; next; }
die("bad line: $_\n");
}
return $pkghasmatched;
@@ -422,10 +465,12 @@ sub read_config {
}
sub get_targets {
+ my $architecture = shift;
+ my $conf = shift;
my %targets;
- for (split("\n", $config)) {
+ for (split("\n", $conf)) {
if (/^arch\s+/) {
- next unless s/^arch\s+\Q$arch\E\s+//;
+ next unless s/^arch\s+\Q$architecture\E\s+//;
}
if (/^targets\s+(.*?)$/) {
$targets{$_} = 1 for split(' ', $1);
@@ -435,72 +480,54 @@ sub get_targets {
return @targets;
}
+# Packages listed in config file
sub get_pkgnames {
my %rpms;
for (split("\n", $config)) {
- if (/^(.*\s+)?package\s+([-+_a-zA-Z0-9]+)\s*$/) {
+ if (/^(.*\s+)?package\s+([-+_a-zA-Z0-9]+)\s*$/) { # eg : arch ppc package libnuma-devel
$rpms{$2} = 1;
- } elsif (/^\s*([-+_a-zA-Z0-9]+)\s*$/) {
+ } elsif (/^\s*([-+_a-zA-Z0-9]+)\s*$/) { # eg: readline-devel
$rpms{$1} = 1;
}
}
return sort keys %rpms;
}
-my $verbose;
-
-die("Usage: mkbaselibs <rpms>\n") unless @ARGV;
-
-if ($ARGV[0] eq '-v') {
- $verbose = 1;
- shift @ARGV;
-}
-while ($ARGV[0] eq '-c') {
- shift @ARGV;
- read_config($ARGV[0]);
- shift @ARGV;
-}
-
-my %goodpkgs = map {$_ => 1} get_pkgnames();
-my @rpms = @ARGV;
-for my $rpm (splice @rpms) {
- my $rpmn = $rpm;
- next if $rpm =~ /\.(no)?src\.rpm$/;
- next if $rpm =~ /\.spm$/;
- $rpmn =~ s/.*\///;
- $rpmn =~ s/-[^-]+-[^-]+\.[^\.]+\.rpm$/\.rpm/;
- $rpmn =~ s/\.rpm$//;
- push @rpms, $rpm if $goodpkgs{$rpmn};
-}
-for (@rpms) {
- die("$_: need absolute path to rpm\n") unless /^\//;
+# Packages listed in config file - debian variant (can have "." in package names)
+sub get_debpkgnames {
+ my %debs;
+ for (split("\n", $config)) {
+ if (/^(.*\s+)?package\s+([-+_a-zA-Z0-9.]+)\s*$/) { # eg : arch ppc package libnuma-devel
+ $debs{$2} = 1;
+ } elsif (/^\s*([-+_a-zA-Z0-9.]+)\s*$/) { # eg: readline-devel
+ $debs{$1} = 1;
+ }
+ }
+ return sort keys %debs;
}
-exit 0 unless @rpms;
-
-my @filesystem = split("\n", `rpm -ql filesystem 2>/dev/null`);
-die("filesystem rpm is not installed\n") unless @filesystem;
-
-for $rpm (@rpms) {
+sub handle_rpms {
+ for $rpm (@_) {
my @stags = map {uc($_)} @preamble;
push @stags, 'DESCRIPTION';
push @stags, 'FILENAMES', 'FILEMODES', 'FILEUSERNAME', 'FILEGROUPNAME', 'FILEFLAGS', 'FILEVERIFYFLAGS';
push @stags, 'CHANGELOGTIME', 'CHANGELOGNAME', 'CHANGELOGTEXT';
push @stags, 'ARCH', 'SOURCERPM', 'RPMVERSION';
+ push @stags, 'BUILDTIME';
my %res = rpmq_many($rpm, @stags);
die("$rpm: bad rpm\n") unless $res{'NAME'};
my $rname = $res{'NAME'}->[0];
my $sname = $res{'SOURCERPM'}->[0];
die("$rpm is a sourcerpm\n") unless $sname;
- die("bad sourcerpm: $sname\n") unless $sname =~ /^(.*)-([^-]+)-([^-]+)$/;
+ die("bad sourcerpm: $sname\n") unless $sname =~ /^(.*)-([^-]+)-([^-]+)\.(no)?src\.rpm$/;
$sname = $1;
my $sversion = $2;
my $srelease = $3;
$arch = $res{'ARCH'}->[0];
- my @targets = get_targets();
+ my @targets = get_targets($arch, $config);
if (!@targets) {
print "no targets for arch $arch, nothing to do\n";
exit(0);
@@ -509,6 +536,7 @@ for $rpm (@rpms) {
next unless parse_config($target, $res{'NAME'}->[0], $res{'VERSION'}->[0]);
die("targetname not set\n") unless $targetname;
+ $target_matched{$target} = 1;
my %ghosts;
my @rpmfiles = @{$res{'FILENAMES'}};
@@ -538,7 +566,7 @@ for $rpm (@rpms) {
} elsif (substr($r, 0, 1) eq '-') {
delete $files{$_} for grep {/$rr/} keys %files;
} elsif (substr($r, 0, 1) eq '"') {
- $rr =~ s/\"$//;
+ $rr =~ s/\"$//;
if ($rr =~ /^(.*?)\s*->\s*(.*?)$/) {
$symlinks{$1} = $2;
} else {
@@ -587,11 +615,11 @@ for $rpm (@rpms) {
my $fn = $_;
if ($moves{$fn}) {
$fn = $moves{$fn};
- next unless $fn =~ s/\/[^\/]+$//;
- $alldirs{$fn} = 1;
+ next unless $fn =~ s/\/[^\/]+$//;
+ $alldirs{$fn} = 1;
} else {
- next unless $fn =~ s/\/[^\/]+$//;
- $alldirs{"$prefix$fn"} = 1;
+ next unless $fn =~ s/\/[^\/]+$//;
+ $alldirs{"$prefix$fn"} = 1;
}
}
$alldirs{$_} = 1 for keys %symlinks;
@@ -604,9 +632,9 @@ for $rpm (@rpms) {
next if $cfiles{$_};
my $fn = $_;
if ($moves{$fn}) {
- delete $alldirs{$moves{$fn}};
+ delete $alldirs{$moves{$fn}};
} else {
- delete $alldirs{"$prefix$fn"};
+ delete $alldirs{"$prefix$fn"};
}
}
$ad = $prefix;
@@ -614,10 +642,9 @@ for $rpm (@rpms) {
delete $alldirs{$ad} while $ad =~ s/\/[^\/]+$//;
delete $alldirs{$_} for @filesystem;
- my $specfile = "/usr/src/packages/SPECS/mkbaselibs$$.spec";
- unlink($specfile);
print "$rname($target): writing specfile...\n";
- open(SPEC, ">$specfile") || die("$specfile: $!\n");
+ my ($fh, $specfile) = tempfile(SUFFIX => ".spec");
+ open(SPEC, ">&=", $fh) || die("open: $!\n");
for my $p (@preamble) {
my $pt = uc($p);
next unless $res{$pt};
@@ -643,7 +670,6 @@ for $rpm (@rpms) {
}
print SPEC "Source: $rpm\n";
print SPEC "NoSource: 0\n" if $res{'SOURCERPM'}->[0] =~ /\.nosrc\.rpm$/;
- print SPEC "Autoreqprov: on\n";
print SPEC "BuildRoot: %{_tmppath}/baselibs-%{name}-%{version}-build\n";
print SPEC "%define _target_cpu $targetarch\n";
print SPEC "%define __os_install_post %{nil}\n";
@@ -655,17 +681,28 @@ for $rpm (@rpms) {
next unless $res{$pt};
my $d = $res{$pt}->[0];
$d =~ s/%/%%/g;
+ if ($pt eq 'VERSION' && $legacyversion) {
+ $d = $legacyversion;
+ } elsif ($pt eq 'RELEASE' && $legacyversion) {
+ my @bt = localtime($res{'BUILDTIME'}->[0]);
+ $bt[5] += 1900;
+ $bt[4] += 1;
+ $d = sprintf("%04d%02d%02d%02d%02d\n", @bt[5,4,3,2,1]);
+ }
print SPEC "$p: $d\n";
}
+ print SPEC "Autoreqprov: $autoreqprov\n";
for my $ar ([\@provides, 'provides'],
- [\@prerequires, 'prereq'],
- [\@requires, 'requires'],
- [\@obsoletes, 'obsoletes'],
- [\@conflicts, 'conflicts']) {
+ [\@prerequires, 'prereq'],
+ [\@requires, 'requires'],
+ [\@recommends, 'recommends'],
+ [\@supplements, 'supplements'],
+ [\@obsoletes, 'obsoletes'],
+ [\@conflicts, 'conflicts']) {
my @a = @{$ar->[0]};
- my @na = ();
- for (@a) {
+ my @na = ();
+ for (@a) {
if (substr($_, 0, 1) eq '"') {
die("bad $ar->[1] rule: $_\n") unless /^\"(.*)\"$/;
push @na, $1;
@@ -682,6 +719,9 @@ for $rpm (@rpms) {
$cpiopre = './' if $res{'RPMVERSION'}->[0] !~ /^3/;
my $d = $res{'DESCRIPTION'}->[0];
$d =~ s/%/%%/g;
+ if ($legacyversion) {
+ $d = "This rpm was re-packaged from $res{'NAME'}->[0]-$res{'VERSION'}->[0]-$res{'RELEASE'}->[0]\n\n$d";
+ }
print SPEC "\n%description -n $targetname\n";
print SPEC "$d\n";
print SPEC "%prep\n";
@@ -704,7 +744,7 @@ for $rpm (@rpms) {
print SPEC "rm .filelist\n";
if (%ghosts) {
for my $fn (grep {$ghosts{$_}} @cfl) {
- my $fnm = $fn;
+ my $fnm = $fn;
$fnm = '.' unless $fnm =~ s/\/[^\/]+$//;
print SPEC "mkdir -p \$RPM_BUILD_ROOT$prefix$fnm\n";
print SPEC "touch \$RPM_BUILD_ROOT$prefix$fn\n";
@@ -723,8 +763,8 @@ for $rpm (@rpms) {
print SPEC "rpm2cpio $rpm | cpio -i -d -v -E .filelist\n";
print SPEC "popd\n";
if (%cfiles) {
- print SPEC "mkdir -p \$RPM_BUILD_ROOT$configdir\n";
- print SPEC "mv .cfiles$_ \$RPM_BUILD_ROOT$configdir\n" for sort keys %cfiles;
+ print SPEC "mkdir -p \$RPM_BUILD_ROOT$configdir\n";
+ print SPEC "mv .cfiles$_ \$RPM_BUILD_ROOT$configdir\n" for sort keys %cfiles;
}
for my $fn (sort keys %moves) {
my $fnm = $moves{$fn};
@@ -749,32 +789,32 @@ for $rpm (@rpms) {
print SPEC "%pre -n $targetname";
print SPEC $prein[0] =~ /^\"-p/ ? " " : "\n";
for (@prein) {
- die("bad prein rule: $_\n") unless /^\"(.*)\"$/;
- print SPEC "$1\n";
+ die("bad prein rule: $_\n") unless /^\"(.*)\"$/;
+ print SPEC "$1\n";
}
}
if (@postin) {
print SPEC "%post -n $targetname";
print SPEC $postin[0] =~ /^\"-p/ ? " " : "\n";
for (@postin) {
- die("bad postin rule: $_\n") unless /^\"(.*)\"$/;
- print SPEC "$1\n";
+ die("bad postin rule: $_\n") unless /^\"(.*)\"$/;
+ print SPEC "$1\n";
}
}
if (@preun) {
print SPEC "%preun -n $targetname";
print SPEC $preun[0] =~ /^\"-p/ ? " " : "\n";
for (@preun) {
- die("bad preun rule: $_\n") unless /^\"(.*)\"$/;
- print SPEC "$1\n";
+ die("bad preun rule: $_\n") unless /^\"(.*)\"$/;
+ print SPEC "$1\n";
}
}
if (@postun) {
print SPEC "%postun -n $targetname";
print SPEC $postun[0] =~ /^\"-p/ ? " " : "\n";
for (@postun) {
- die("bad postun rule: $_\n") unless /^\"(.*)\"$/;
- print SPEC "$1\n";
+ die("bad postun rule: $_\n") unless /^\"(.*)\"$/;
+ print SPEC "$1\n";
}
}
@@ -850,14 +890,14 @@ for $rpm (@rpms) {
my @wdays = qw{Sun Mon Tue Wed Thu Fri Sat};
my @months = qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec};
for my $cc (@{$res{'CHANGELOGTEXT'}}) {
- my @lt = localtime($ct[0]);
- my $cc2 = $cc;
- my $cn2 = $cn[0];
- $cc2 =~ s/%/%%/g;
- $cn2 =~ s/%/%%/g;
- printf SPEC "* %s %s %02d %04d %s\n%s\n", $wdays[$lt[6]], $months[$lt[4]], $lt[3], 1900 + $lt[5], $cn2, $cc2;
- shift @ct;
- shift @cn;
+ my @lt = localtime($ct[0]);
+ my $cc2 = $cc;
+ my $cn2 = $cn[0];
+ $cc2 =~ s/%/%%/g;
+ $cn2 =~ s/%/%%/g;
+ printf SPEC "* %s %s %02d %04d %s\n%s\n", $wdays[$lt[6]], $months[$lt[4]], $lt[3], 1900 + $lt[5], $cn2, $cc2;
+ shift @ct;
+ shift @cn;
}
}
@@ -871,4 +911,229 @@ for $rpm (@rpms) {
}
unlink($specfile);
}
+ }
+}
+
+################################################################
+
+sub handle_debs {
+
+ eval {
+ require Parse::DebControl;
+ };
+ if ($@){
+ print "mkbaselibs needs the perl module Parse::DebControl\n".
+ "Error. baselibs-deb.conf specified but mkbaselibs can't run\n".
+ "Please ensure that 'osc meta prjconf' contains the following line:\n".
+ " Support: libparse-debcontrol-perl\n";
+ return;
+ };
+
+
+ # for each deb:
+ # look in the config file to see if we should be doing anything
+ #
+ # Unpack the deb control data using dpkg-deb
+ # for each target
+ # Unpack the deb control data *and* file data using dpkg-deb
+ # process the config file for this package modifying control and moving files
+ # repackage the target deb
+
+ for my $deb (@_) {
+ # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-binarycontrolfiles
+ # unpack the outer loop control file - this gives us eg: the arch
+ my $base = tempdir() || die("tempdir: $!\n");
+ system "dpkg -e $deb ${base}/DEBIAN" || die "dpkg -e failed on $deb";
+ my $controlParser = new Parse::DebControl;
+ $controlParser->DEBUG();
+ my $keys = $controlParser->parse_file("${base}/DEBIAN/control");
+# print Dumper($keys);
+ # DebControl supports multiple paragraphs of control data but
+ # debian/control in a .deb only has one (whereas a debian/control
+ # in a build root contains many)
+ # So extract the ref to the first one.
+ my %control = %{@{$keys}[0]};
+
+ # Validate this is a binary deb and get the control data
+ my $d_name = $control{'Package'};
+ my $d_version = $control{'Version'};
+
+ $arch = $control{'Architecture'}; # set global $arch
+
+ # examine the
+ # arch <arch> targets <target_arch>[:<target_type>] [<target_arch>[:<target_type>]...]
+ # line and get a list of target_arch-es
+ my @targets = get_targets($arch, $config);
+ if (!@targets) {
+ print "no targets for arch $arch, nothing to do\n";
+ return; # there may be more debs to handle
+ }
+
+ for my $target (@targets) {
+ next unless parse_config($target, $d_name, $d_version);
+ die("targetname not set\n") unless $targetname; # set in the global_conf
+ $target_matched{$target} = 1;
+
+ my $baseTarget = "${base}/$target";
+ # Unpack a .deb to work on. We have to do this each time as we
+ # manipulate the unpacked files.
+ system "mkdir ${base}/$target";
+ system "dpkg -e $deb ${baseTarget}/DEBIAN" || die "dpkg -e failed on $deb";
+ # Note that extracting to $prefix does the clever move to /lib-x86/ or whatever
+ system "dpkg -x $deb ${baseTarget}/$prefix" || die "dpkg -x failed on $deb";
+
+ # Reset the control data
+ $keys = $controlParser->parse_file("${baseTarget}/DEBIAN/control");
+ %control = %{@{$keys}[0]};
+
+ # Force the architecture
+ $control{'Architecture'} = $targetarch;
+
+ # Currently this script does not manipulate any files
+ # If needed they are all unpacked in ${baseTarget}
+
+ # we don't need a dsc/spec file.. all done by just moving files around
+ # and running dpkg -b ${base} $NEW_DEB
+ #
+ # my $dscfile = "/usr/src/packages/DSCS/mkbaselibs$$.dsc";
+
+ print "$d_name($target): writing dscfile...\n";
+ # We can Use Parse::DebControl write_file to create the new control file
+ # just modify tags in there
+
+ # We'll use requires -> Depends:
+ map s/^"(.*)"$/$1/, @requires; # remove leading/trailing "s
+ $control{"Depends"} = @requires ? join(", ", @requires) : ""; # join array if exists or reset it to ""
+
+ map s/^"(.*)"$/$1/, @prerequires;
+ $control{"Pre-Depends"} = @prerequires ? join(", ", @prerequires) : "";
+
+ map s/^"(.*)"$/$1/, @provides;
+ $control{"Provides"} = @provides ? join(", ", @provides) : "";
+
+ map s/^"(.*)"$/$1/, @recommends;
+ $control{"Recommends"} = @recommends ? join(", ", @recommends) : "";
+
+ map s/^"(.*)"$/$1/, @suggests;
+ $control{"Suggests"} = @suggests ? join(", ", @suggests) : "";
+
+ map s/^"(.*)"$/$1/, @obsoletes;
+ $control{"Replaces"} = @obsoletes ? join(", ", @obsoletes) : "";
+
+ map s/^"(.*)"$/$1/, @conflicts;
+ $control{"Conflicts"} = @conflicts ? join(", ", @conflicts) : "";
+
+ map s/^"(.*)"$/$1/, @supplements;
+ $control{"Enhances"} = @supplements ? join(", ", @supplements) : "";
+
+
+ # Tidy up the various control files.
+ # the md5sums are regenerated by dpkg-deb when building
+ foreach my $c_file ( qw(conffiles postins postrm preinst prerm) ) {
+ unlink "${baseTarget}/DEBIAN/$c_file";
+ }
+ # Create them if needed
+ if (@prein) {
+ map s/^"(.*)"$/$1/, @prein; # remove leading/trailing "s
+ open(my $SCRIPT, ">${baseTarget}/DEBIAN/preinst");
+ print $SCRIPT join("\n", @prein) ;
+ chmod(0755, $SCRIPT);
+ close($SCRIPT);
+ }
+ if (@postin) {
+ map s/^"(.*)"$/$1/, @postin;
+ open(my $SCRIPT, ">${baseTarget}/DEBIAN/postinst");
+ print $SCRIPT join("\n", @postin) ;
+ chmod(0755, $SCRIPT);
+ close($SCRIPT);
+ }
+ if (@preun) {
+ map s/^"(.*)"$/$1/, @preun;
+ open(my $SCRIPT, ">${baseTarget}/DEBIAN/prerm");
+ print $SCRIPT join("\n", @preun) ;
+ chmod(0755, $SCRIPT);
+ close($SCRIPT);
+ }
+ if (@postun) {
+ map s/^"(.*)"$/$1/, @postun;
+ open(my $SCRIPT, ">${baseTarget}/DEBIAN/postrm");
+ print $SCRIPT join("\n", @postun) ;
+ chmod(0755, $SCRIPT);
+ close($SCRIPT);
+ }
+
+ # Don't forget to rename the package - or it will replace/uninstall the /-based one
+ $control{"Package"} = "${d_name}-${targettype}";
+
+ $controlParser->write_file("${baseTarget}/DEBIAN/control", \%control, {clobberFile => 1, addNewline=>1 } );
+ system "dpkg -b ${baseTarget} /usr/src/packages/DEBS/${d_name}-${targettype}_${d_version}_${targetarch}.deb" || die "dpkg -b failed on $deb";
+ system "rm -rf ${baseTarget}";
+ }
+ system "rm -rf ${base}";
+ }
+}
+
+# args is a list of full pathnames to rpm/deb files
+die("Usage: mkbaselibs <rpms>\n") unless @ARGV;
+
+if ($ARGV[0] eq '-v') {
+ $verbose = 1;
+ shift @ARGV;
+}
+while ($ARGV[0] eq '-c') {
+ shift @ARGV;
+ read_config($ARGV[0]);
+ shift @ARGV;
+}
+
+my %goodpkgs = map {$_ => 1} get_pkgnames(); # These are packages named in the config file
+my @pkgs = @ARGV;
+my @rpms;
+my @debugrpms;
+for my $rpm (@pkgs) {
+ my $rpmn = $rpm;
+ unless (-f $rpm) {
+ warn ("$rpm does not exist, skipping\n");
+ next;
+ }
+ next if $rpm =~ /\.(no)?src\.rpm$/; # ignore source rpms
+ next if $rpm =~ /\.spm$/;
+ $rpmn =~ s/.*\///; # Remove leading path info
+ $rpmn =~ s/-[^-]+-[^-]+\.[^\.]+\.rpm$/\.rpm/; # remove all version info
+ $rpmn =~ s/\.rpm$//; # remove extension
+ push @rpms, $rpm if $goodpkgs{$rpmn};
+ if ($rpmn =~ s/-debuginfo$//) {
+ push @debugrpms, $rpm if $goodpkgs{$rpmn};
+ }
+}
+for (@rpms) {
+ die("$_: need absolute path to package\n") unless /^\//;
+}
+
+my %debs_to_process = map {$_ => 1} get_debpkgnames(); # These are packages named in the config file
+my @debs;
+for my $deb (@pkgs) {
+ my $debn = $deb;
+ next unless $debn =~ /\.deb$/;
+ $debn =~ s/.*\///; # Remove leading path info
+ $debn =~ s/_[^_]+_[^_]+\.deb$//; # remove all version info and extension
+ push @debs, $deb if $debs_to_process{$debn};
+ print "ignoring $deb as $debn not in baselibs.conf\n" if !$debs_to_process{$debn};
+}
+for (@debs) {
+ die("$_: need absolute path to package\n") unless /^\//;
+}
+
+exit 0 unless @rpms or @debs;
+
+if (@rpms) {
+ @filesystem = split("\n", `rpm -ql filesystem 2>/dev/null`);
+ die("filesystem rpm is not installed\n") unless @filesystem;
+
+ handle_rpms(@rpms);
+ handle_rpms(@debugrpms);
+}
+
+if (@debs) {
+ handle_debs(@debs);
}
diff --git a/mkdrpms b/mkdrpms
new file mode 100755
index 0000000..932fafb
--- /dev/null
+++ b/mkdrpms
@@ -0,0 +1,135 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use strict;
+
+my $limit = 80; # throw away deltas bigger than this percentage of the reference
+my %oldpkgs;
+
+sub query {
+ my ($file) = @_;
+
+ return undef if $file =~ /\.(?:patch|delta)\.rpm$/; # XXX: rpmtags?
+ my %res = Build::Rpm::rpmq($file, qw/NAME EPOCH VERSION RELEASE ARCH SOURCERPM NOSOURCE NOPATCH 1124/);
+ return undef unless %res;
+ return undef if $res{'1124'}->[0] && $res{'1124'}->[0] eq 'drpm';
+ my $arch;
+ if ($res{'SOURCERPM'}->[0]) {
+ $arch = $res{'ARCH'}->[0];
+ } else {
+ # no src rpm deltas for now
+# if ($res{'NOSOURCE'}->[0] || $res{'NOPATCH'}->[0]) {
+# $arch = 'nosrc';
+# } else {
+# $arch = 'src';
+# }
+ return undef;
+ }
+ return { file => $file, name => $res{'NAME'}->[0], epoch => $res{'EPOCH'} ? $res{'EPOCH'}->[0] : '', version => $res{'VERSION'}->[0], release => $res{'RELEASE'}->[0], arch => $arch};
+}
+
+sub lsrpms {
+ local *D;
+ if (-f "$_[0]") {
+ return ($_[0]) if $_[0] =~ /\.rpm$/;
+ return ();
+ }
+ opendir(D, $_[0]) || return ();
+ my @r = grep {$_ ne '.' && $_ ne '..'} readdir(D);
+ closedir D;
+ return map {"$_[0]/$_"} grep {/\.rpm$/} sort(@r);
+}
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--limit') {
+ shift @ARGV;
+ die("--limit needs an argument\n") unless @ARGV;
+ $limit = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+my $prevbuild = shift @ARGV || die "USAGE: $0 <oldpkgdir> <directories...>";
+my @prevbuild = ($prevbuild);
+my $i = 1;
+while (-d $prevbuild.$i) {
+ push @prevbuild, $prevbuild.$i;
+ ++$i;
+}
+for my $dir (@prevbuild) {
+ for my $file (lsrpms($dir)) {
+ my $q = query($file);
+ next unless $q;
+ my $n = $q->{'name'}.'.'.$q->{'arch'};
+ push @{$oldpkgs{$n}}, $q;
+ }
+}
+
+my $sysret = 0;
+for my $dir (@ARGV) {
+ for my $file (lsrpms($dir)) {
+ my $q = query($file);
+ next unless $q;
+ my $n = $q->{'name'}.'.'.$q->{'arch'};
+ for my $oq (@{$oldpkgs{$n} || []}) {
+ my $v = $oq->{'version'};
+ my $r = $oq->{'release'};
+ if ($v eq $q->{'version'} && $r eq $q->{'release'}) {
+ # skip if same version and release
+ next;
+ }
+ $v .= '_'.$q->{'version'} unless $v eq $q->{'version'};
+ $r .= '_'.$q->{'release'} unless $r eq $q->{'release'};
+ my $dn = sprintf("%s-%s-%s.%s.drpm", $q->{'name'}, $v, $r, $q->{'arch'});
+ my $sn = sprintf("%s-%s-%s.%s.dseq", $q->{'name'}, $v, $r, $q->{'arch'});
+ print "$dn ... ";
+ my $dndir = $q->{'file'};
+ $dndir =~ s/[^\/]+$//s;
+ $dn = "$dndir$dn";
+ my $ret = system('makedeltarpm', '-s', $sn, $oq->{'file'}, $q->{'file'}, $dn);
+ if ($ret || ! -e $dn) {
+ unlink($dn);
+ unlink($sn);
+ print "FAILED\n";
+ $sysret = 1;
+ } else {
+ my $ns = (stat($dn))[7] || 1;
+ my $os = (stat($q->{'file'}))[7] || 1;
+ my $factor = int($ns / $os * 100);
+ if ($factor > $limit) {
+ print "too big ($factor%), removed\n";
+ unlink($dn);
+ unlink($sn);
+ } else {
+ local *F;
+ my $seq = '';
+ if (!open(F, '<', $sn)) {
+ print "missing sequence file, removed\n";
+ unlink($dn);
+ unlink($sn);
+ next;
+ }
+ 1 while sysread(F, $seq, 8192, length($seq));
+ close F;
+ chomp $seq;
+ unlink($sn);
+ $seq = "Name: $q->{'name'}\nEpoch: $q->{'epoch'}\nVersion: $q->{'version'}\nRelease: $q->{'release'}\nArch: $q->{'arch'}\nOldName: $oq->{'name'}\nOldEpoch: $oq->{'epoch'}\nOldVersion: $oq->{'version'}\nOldRelease: $oq->{'release'}\nOldArch: $oq->{'arch'}\nSeq: $seq\n";
+ if (!open(F, '>', $sn) || syswrite(F, $seq) != length($seq) || !close(F)) {
+ print "sequence file write error, removed\n";
+ unlink($dn);
+ unlink($sn);
+ next;
+ }
+ print "ok ($factor%)\n";
+ }
+ }
+ }
+ }
+}
+
+exit $sysret;
diff --git a/order b/order
new file mode 100755
index 0000000..17c483d
--- /dev/null
+++ b/order
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use strict;
+
+my ($dist, $archs, $configdir, $manifest);
+
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--dist') {
+ shift @ARGV;
+ $dist = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
+ if (@ARGV && $ARGV[0] eq '--manifest') {
+ shift @ARGV;
+ $manifest = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+die("usage: order [--manifest manifest] cachedir [packages...]\n") unless @ARGV;
+my $cachedir = shift @ARGV;
+
+my @p;
+if ($manifest) {
+ if ($manifest eq '-') {
+ @p = <STDIN>;
+ } else {
+ local *F;
+ open(F, '<', $manifest) || die("$manifest: $!\n");
+ @p = <F>;
+ close F;
+ }
+ chomp @p;
+}
+
+push @p, @ARGV;
+
+my $config = Build::read_config_dist($dist, $archs, $configdir);
+
+my %deps;
+my %bins;
+
+for my $p (@p) {
+ my $q;
+ for my $suf ('rpm', 'deb', 'arch') {
+ next unless -f "$cachedir/$p.$suf";
+ $q = Build::query("$cachedir/$p.$suf", 'filelist' => 1, 'alldeps' => 1);
+ die("bad binary: $p.$suf\n") unless $q;
+ push @{$q->{'provides'}}, @{$q->{'filelist'}} if $suf eq 'rpm' && $q->{'filelist'};
+ delete $q->{'filelist'};
+ last;
+ }
+ die("binary not found: $p\n") unless $q;
+ $deps{$p} = $q;
+}
+
+Build::readdeps($config, undef, \%deps);
+@p = Build::order($config, @p);
+print "@p\n";
diff --git a/qemu-reg b/qemu-reg
new file mode 100644
index 0000000..2ae911e
--- /dev/null
+++ b/qemu-reg
@@ -0,0 +1,19 @@
+# register qemu binfmts
+# - used by initvm, build common_functions and init_buildsystem
+# derived from /usr/sbin/qemu-binfmt-conf.sh
+
+# NOTE: this requires a qemu with the binfmt misc handler binary
+
+:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P
+:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P
+:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P
+:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P
+:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P
+#:mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32-binfmt:P
+#:mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el-binfmt:P
+#:mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64-binfmt:P
+#:mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el-binfmt:P
+
+:sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P
+:sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P
+
diff --git a/signdummy b/signdummy
new file mode 100755
index 0000000..4951454
--- /dev/null
+++ b/signdummy
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+# simple "sign" replacement that does nothing but
+# write a 2048 byte file with a fixed signature.
+# sign is used in kiwi builds to sign repositories
+
+my $mode;
+
+while (@ARGV) {
+ if ($ARGV[0] =~ /^-([cdr])$/) {
+ $mode = $1;
+ shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--') {
+ shift @ARGV;
+ last;
+ }
+ if ($ARGV[0] =~ /^-/) {
+ die("unsupported option $ARGV[0]\n");
+ }
+ last;
+}
+die("only detached mode possible\n") if !$mode || $mode ne 'd';
+die("filter mode not supported\n") unless @ARGV;
+
+for my $file (@ARGV) {
+ local *F;
+ open(F, '<', $file) || die("$file: $!\n");
+ my $buf = '';
+ 1 while sysread(F, $buf, 16384, length($buf));
+ close(F) || die("$file: $!\n");
+ my $block = "sIGnMe!\n";
+ $block .= sprintf("%08x%08x\n", length($buf), unpack("%32C*", $buf));
+ $block .= "\0" x (2048 - length($block));
+ open(F, '>', "$file.asc") || die("$file.asc: $!\n");
+ (syswrite(F, $block) || 0) == 2048 || die("$file.asc: $!\n");
+ close(F) || die("$file.asc: $!\n");
+}
diff --git a/spec2changelog b/spec2changelog
new file mode 100755
index 0000000..4ac2b0a
--- /dev/null
+++ b/spec2changelog
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+#
+# Tiny perl script that parses a .spec file (STDIN), extracts
+# its %changelog entries and prints (STDOUT) them in the
+# format of a .changes file, ordered.
+#
+# Usage: cat foo.spec | spec2changes.pl > foo.changes
+#
+# Copyright 2009 by Pascal Bleser <pascal.bleser@opensuse.org>
+# This script is licensed under the GNU General Public License version 2
+# http://www.gnu.org/licenses/gpl-2.0.html
+#
+
+use warnings;
+use strict;
+use Date::Language;
+use POSIX qw(strftime setlocale LC_ALL);
+
+# make sure date printed in correct locale
+$ENV{'TZ'} = 'UTC';
+setlocale(LC_ALL, 'C');
+
+my $sep = "-" x 67;
+my @days = qw{Mon Tue Wed Thu Fri Sat Sun};
+my @months = qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec};
+
+#----------------------------------------------------------------------
+#
+my %dh = map { $_ => 1 } @days;
+my %mh = map { $_ => 1 } @months;
+
+my $date_parser = Date::Language->new('English');
+
+my %items = ();
+my $current_block = undef;
+my $time = undef;
+while (<>) {
+ if (/^%changelog/ .. eof()) {
+ next if /^%/;
+ next if /^\s*#/;
+
+ chomp;
+ s/\s+$//;
+
+ if (/^\*\s+(([A-Z][a-z]{2})\s+([A-Z][a-z]{2})\s+\d{1,2}\s+\d{4})(\s+(.*)\s*)$/ and exists $dh{$2} and exists $mh{$3}) {
+ $items{$time} = $current_block if defined $current_block and defined $time;
+ $time = $date_parser->str2time($1);
+ $current_block = [];
+ $_ = $4;
+ } elsif (/^\*/) {
+ warn("not matching a headline: \"$_\"\n");
+ }
+ push(@$current_block, $_);
+ }
+}
+$items{$time} = $current_block if defined $current_block and defined $time;
+
+foreach my $time (sort { $b <=> $a } (keys(%items))) {
+ print $sep, "\n";
+ my $item = $items{$time};
+ my $head = shift(@$item);
+ $head =~ s/^\s+//;
+ $head =~ s/^\-\s+//;
+ if ($head =~ m/^(.+?)\s*<(.+?\@.+?\..+?)>(\s*.*)$/) {
+ $head = $2;
+ } elsif ($head =~ m/^<(.+?\@.+?\..+?)>(\s*.*)$/) {
+ $head = $1;
+ }
+ if ($head =~ m/^\s*-\s*(.+)$/) {
+ $head = $1;
+ }
+
+ print strftime("%a %b %e %H:%M:%S %Z %Y", localtime($time)), " - ", $head, "\n";
+ my $first = shift(@$item);
+ print "\n" unless defined($first) && ($first eq '');
+ print $first, "\n";
+ print join("\n", @$item), "\n" if @$item;
+ print "\n";
+}
diff --git a/spec_add_patch b/spec_add_patch
new file mode 100755
index 0000000..fd62753
--- /dev/null
+++ b/spec_add_patch
@@ -0,0 +1,143 @@
+#!/usr/bin/perl -w
+# vim:sw=4:et
+# Author: Dirk Mueller
+
+use strict;
+
+sub helpexit {
+ print "$0: <patches...> [file.spec]\n";
+ exit 1;
+}
+
+my $specname;
+my %diffs;
+
+for my $arg (@ARGV) {
+ if ($arg =~ /\.spec$/) {
+ helpexit() if $specname;
+ $specname = $arg;
+ next;
+ }
+ $diffs{$arg} = 1;
+}
+
+sub find_specfile()
+{
+ opendir(D, ".");
+ my @specs = grep { /\.spec$/ } readdir(D);
+ closedir(D);
+
+ # choose the one with the shortest name (heuristic)
+ $specname = ( sort { length($a) - length($b) } @specs)[0];
+
+}
+
+if (!defined($specname) || ! -f $specname) {
+ &find_specfile();
+}
+
+
+open(S, '<', $specname) or die;
+
+my $ifdef_level = 0;
+my $in_prep = 0;
+my $in_global = 1;
+my $last_patch_in_prep_index = 0;
+my $last_patch_in_global_index = 0;
+my @c = ();
+my $index = 0;
+
+# first read the specfile, parse useful information
+while(<S>)
+{
+
+ if(/^\s*%\s*endif/) {
+ $ifdef_level--;
+ $last_patch_in_prep_index = $index if ($in_prep && $ifdef_level == 0);
+ }
+ die if ($ifdef_level < 0);
+ $ifdef_level++ if(/^\s*%\s*if/);
+
+ if ($ifdef_level == 0 && !$in_prep && $in_global
+ && /^\%(?:prep|build|install|package|description|doc)/) {
+ $in_global = 0;
+ }
+
+ if (!$in_prep && /^%prep/i) {
+ $in_prep = 1;
+ die if ($in_global);
+ }
+
+ if ($in_prep
+ && /^%setup\b/) {
+ $last_patch_in_prep_index = $index;
+ }
+
+ if ($in_prep
+ && /^\%(?:build|install|package|description|doc)/) {
+ $in_prep = 0;
+ }
+
+ die if (($in_prep + $in_global) > 1);
+
+ if ($in_global && /^Patch(?:\d+)?:\s+(.+)/) {
+ $last_patch_in_global_index = $index;
+ if ($diffs{$1}) {
+ print "$1 already in, skipped.";
+ delete $diffs{$1};
+ }
+ }
+
+ if ($in_global && $ifdef_level == 0 && /^Source(?:\d+)?:/) {
+ $last_patch_in_global_index = $index;
+ }
+
+ if ($in_prep && $ifdef_level == 0 && /^\%patch/) {
+ $last_patch_in_prep_index = $index;
+ }
+ push(@c, $_);
+ $index++;
+}
+close(S);
+
+die if ($ifdef_level > 0);
+die if ($in_global || $in_prep);
+die if ($last_patch_in_prep_index == 0);
+die if ($last_patch_in_global_index == 0);
+
+#print "adding Patch: $diffname to line $last_patch_in_global_index\n";
+#print "adding %patch to line $last_patch_in_prep_index\n";
+
+# determine patch number
+my $patchnum = 0;
+$patchnum = $1+1 if ($c[$last_patch_in_global_index] =~ /Patch(\d+):/);
+$patchnum = 1 if ($c[$last_patch_in_global_index] =~ /Patch:/);
+
+for my $diffname (keys %diffs) {
+ # determine strip level
+ my $striplevel = "";
+ open(P, '<', $diffname) or die "$diffname: $!\n";
+ while(<P>) {
+ $striplevel = " -p1" if (m/^--- a/ or m/^--- [^\/]+-\d+\./);
+ last if (/^--- /);
+
+ }
+ close(P);
+
+ print "Adding patch$striplevel $diffname to $specname\n";
+
+
+ splice @c, $last_patch_in_prep_index+1, 0, ("\%patch$patchnum$striplevel\n");
+ splice @c, $last_patch_in_global_index+1, 0,
+ (sprintf "Patch%s:%s%s\n", $patchnum, ' ' x (10-length($patchnum)), $diffname);
+ ++$last_patch_in_global_index;
+ $last_patch_in_prep_index+=2; # actually line number
+ ++$patchnum;
+}
+
+open(O, '>', "$specname.new") or die;
+print O @c;
+close(O);
+
+system("diff", "-u", $specname, "$specname.new");
+rename("$specname.new", $specname);
diff --git a/spectool b/spectool
new file mode 100755
index 0000000..ef05859
--- /dev/null
+++ b/spectool
@@ -0,0 +1,406 @@
+#!/usr/bin/perl -w
+
+=head1 spectool
+
+spectool - tool to work with rpm spec files
+
+=head1 SYNOPSIS
+
+spectool [options] specfiles...
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--help>
+
+display help as manpage
+
+=item B<--dist>=I<STRING>
+
+set distribution, e.g. "11.1-i586" or path to config
+
+=item B<--archpath>=I<STRING>
+
+compatible architecture separated by colon, e.g. C<i586:i486:i386>.
+Autotected if missing.
+
+=item B<--configdir>=I<STRING>
+
+path to config files if B<--dist> didn't specify a full path
+
+=item B<--define>=I<STRING>
+
+=item B<--with>=I<STRING>
+
+=item B<--without>=I<STRING>
+
+same meaning as in rpmbuild
+
+=item B<--tag>=I<STRING>
+
+print tag from spec file, e.g. C<version>. Regexp is also possible,
+e.g. C</source[01]/>
+
+=item B<--sources>
+
+print package source files. If a file C<sources> or
+C<I<packagename>.sources> is present verify the checksums against
+that.
+
+=over 4
+
+=item B<--update>
+
+update the checksums
+
+=item B<--download>
+
+download missing sources
+
+=back
+
+=back
+
+=head1 DESCRIPTION
+
+The B<--sources> option allows to manage a sources file in a way
+similar to Fedora. The sources file lists the check sums and file
+names of the binary files specified in the spec file.
+
+B<--sources> without further options compares the check sums of all
+files and prints a report consisting of a character that describes
+the status of the file and the file name. Meaning of the characters
+is as follows:
+
+=over 4
+
+=item B<.> check sum matches
+
+=item B<!> check sum broken
+
+=item B<d> file is missing, checksum known. Can be verified after download
+
+=item B<-> file is missing and checksum unknown
+
+=item B<_> file is present but checksum unknown
+
+=item B<t> text file, will be skipped for check sums
+
+=item B<?> check sum known but not referenced from spec file
+
+=back
+
+Additionally specifying B<--update> recomputes all check sums and
+updates the sources file.
+
+With B<--download> all missing files are downloaded if the spec file
+has an http or ftp url.
+
+=head2 FORMAT OF THE SOURCES FILE
+
+Lines of the form
+<checksum> <whitespace> <filename>
+
+=head2 NAME OF THE SOURCES FILE
+
+A file named C<sources> is preferred if present for compatibility
+with Fedora. It only contains md5 sums. If that file is not present
+the C<.spec> suffix of the spec file is replaced with C<.sources>
+and the this name used as sources file (e.g. C<foo.spec> ->
+C<foo.sources>). In this file sha1 is preferred. Also, the name of
+the algorithm is prepended with colon to the check sum.
+
+=cut
+
+my $builddir;
+
+BEGIN {
+ $builddir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+ unshift @INC, $builddir;
+}
+
+use strict;
+
+use Build;
+use Pod::Usage;
+use Getopt::Long;
+Getopt::Long::Configure("no_ignore_case");
+
+my (@opt_showtag, $opt_sources, $opt_update, $opt_download);
+
+sub parse_depfile;
+
+my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild);
+my %options;
+
+GetOptions (
+ \%options,
+ "help" => sub { pod2usage(-exitstatus => 0, -verbose => 2) },
+
+ "dist=s" => \$dist,
+ "archpath=s" => \$archs,
+ "configdir=s" => \$configdir,
+ "define=s" => sub { Build::define($_[1]) },
+ "with=s" => sub { Build::define("_with_".$_[1]." --with-".$_[1]) },
+ "without=s" => sub { Build::define("_without_".$_[1]." --without-".$_[1]) },
+
+ "tag=s" => \@opt_showtag,
+ "sources" => \$opt_sources,
+ "update" => \$opt_update,
+ "download" => \$opt_download,
+ "download-force",
+ "download-recompress=s",
+ "download-outdir=s",
+ "download-compare=s",
+ "download-delete-identical",
+) or pod2usage(1);
+
+pod2usage(1) unless @ARGV;
+
+my $ua;
+
+my @specs = @ARGV;
+
+die "--download must be used together with --sources\n" if ($opt_download && !$opt_sources);
+die "--update must be used together with --sources\n" if ($opt_update && !$opt_sources);
+
+$options{'download-recompress'} ||= 'auto';
+$options{'download-outdir'}.='/' if ($options{'download-outdir'} && $options{'download-outdir'} !~ /\/$/);
+$options{'download-outdir'} ||= '';
+$options{'download-compare'}.='/' if ($options{'download-compare'} && $options{'download-compare'} !~ /\/$/);
+$options{'download-compare'} ||= '';
+
+my @archs;
+if (!defined $archs) {
+ use POSIX qw/uname/;
+ my %archmap = qw/x86_64 i686 i686 i586 i586 i486 i486 i386/;
+ my @a = uname();
+ push @archs, $a[4];
+ while(exists $archmap{$archs[-1]}) {
+ push @archs, $archmap{$archs[-1]};
+ }
+} else {
+ @archs = split(':', $archs);
+}
+push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
+
+unless ($dist) {
+ $dist = 'spectool';
+# $dist = `rpm -q --qf '%{DISTRIBUTION}' rpm 2>/dev/null`;
+# $dist = Build::dist_canon($dist||'', $archs[0]);
+}
+
+if($dist !~ /\// && !defined $configdir) {
+ if($0 =~ /^\//) {
+ use File::Basename qw/dirname/;
+ $configdir = dirname($0).'/configs';
+ undef $configdir unless -e $configdir.'/sl11.3.conf';
+ } else {
+ $configdir = $builddir.'/configs';
+ undef $configdir unless -e $configdir.'/sl11.3.conf';
+ }
+ if(!defined $configdir) {
+ print STDERR "please specify config dir\n";
+ }
+}
+
+#######################################################################
+
+# param: array to fill, spec file
+# return: file name
+sub read_sources_digests($$)
+{
+ my $files = shift;
+ my $spec = shift;
+ my $srcfile = 'sources';
+ if (! -r $srcfile) {
+ $srcfile = $spec;
+ $srcfile =~ s/spec$/sources/;
+ }
+ if (open (F, '<', $srcfile)) {
+ while(<F>) {
+ chomp;
+ my ($sum, $file) = split(/ +/, $_, 2);
+ $files->{$file} = $sum;
+ }
+ close F;
+ }
+ return $srcfile;
+}
+
+# param: file, oldsum
+# return: newsum or undef if match
+sub check_sum($$)
+{
+ my $file = shift;
+ my $oldsum = shift || 'sha1:';
+ my $sum;
+ my $type = 'md5:';
+ if($oldsum =~ /^(\S+:)/) {
+ $type = $1;
+ } else {
+ $oldsum = $type.$oldsum;
+ }
+ if ($type eq 'md5:') {
+ $sum = $type.`md5sum $file` || die "md5sum failed\n";
+ } elsif ($type eq 'sha1:') {
+ $sum = $type.`sha1sum $file` || die "sha1sum failed\n";
+ } else {
+ die "unsupported digest type '$type'\n";
+ }
+ $sum =~ s/ .*//s;
+ if($sum ne $oldsum) {
+ return $sum;
+ }
+ return undef;
+}
+
+sub download($$)
+{
+ my ($url, $dest) = @_;
+ my $retry = 3;
+ while ($retry--) {
+ my $res = $ua->mirror($url, $dest);
+ last if $res->is_success;
+ # if it's a redirect we probably got a bad mirror and should just retry
+ return 0 unless $retry && $res->previous;
+ warn "retrying $url\n";
+ }
+ return 1;
+}
+
+#######################################################################
+
+my $ret = 0;
+for my $spec (@specs) {
+ my $cf = Build::read_config_dist($dist, $archs[0], $configdir);
+ my $parsed = Build::parse($cf, $spec);
+
+ if (!defined $parsed) {
+ die "can't parse $spec\n";
+ }
+
+ for my $tag (@opt_showtag) {
+ if($tag =~ /^\/(.+)\/$/) {
+ my $expr = $1;
+ for my $t (keys %$parsed) {
+ if ($t =~ $expr) {
+ push @opt_showtag, $t;
+ }
+ }
+ } else {
+ if(exists $parsed->{lc $tag}) {
+ print $tag, ": ";
+ my $v = $parsed->{lc $tag};
+ $v = join(' ', @$v) if (ref $v eq 'ARRAY');
+ print $v, "\n";
+ } else {
+ print STDERR "$tag does not exist\n";
+ }
+ }
+ }
+
+ if ($opt_sources) {
+ my $files = {};
+ my $srcfile = read_sources_digests($files, $spec);
+ if ($opt_download) {
+ unless ($ua) {
+ use LWP::UserAgent;
+ $ua = LWP::UserAgent->new(
+ agent => "openSUSE build service",
+ env_proxy => 1,
+ timeout => 42);
+ }
+
+ for my $t (keys %$parsed) {
+ next unless ($t =~ /^(?:source|patch)\d*/);
+ my $url = $parsed->{$t};
+ next unless $url =~ /^(?:https?|ftp):\/\//;
+ my $file = $url;
+ $file =~ s/.*\///;
+ my $src = $options{'download-compare'}.$file;
+ next if -e $src && !($options{'download-force'} || $options{'download-delete-identical'});
+ print "Downloading $file...\n";
+ my $dest = $options{'download-outdir'}.$file;
+ print "$url -> $dest\n";
+
+ if(!download($url, $dest) && $options{'download-recompress'} ne 'no') {
+ # TODO
+ # let's see if the file was recompressed
+ if($url =~ s/\.bz2$/.gz/ && $file =~ s/\.bz2$/.gz/
+ && !download($url, $dest)) {
+ if(system('bznew', $dest) == 0) {
+ print STDERR "Used $file and recompressed to bz2 instead\n";
+ } else {
+ unlink $dest;
+ }
+ } else {
+ print STDERR "Downloading $file failed\n";
+ }
+ }
+ if ($options{'download-delete-identical'} && $options{'download-outdir'}
+ && system('cmp', '-s', $dest, $src) == 0) {
+ unlink($dest);
+ }
+ }
+ }
+ if ($opt_update) {
+ my $changed;
+ for my $t (keys %$parsed) {
+ next unless ($t =~ /^(?:source|patch)\d*/);
+ my $file = $parsed->{$t};
+ $file =~ s/.*\///;
+ next unless -B $file;
+ my $sum = check_sum($file, ($files->{$file} || ($srcfile eq 'sources'?'md5:':'sha1:')));
+ if($sum) {
+ print STDERR "update $file\n";
+ $files->{$file} = $sum;
+ $changed = 1;
+ }
+ }
+ if($changed) {
+ if(open(F, '>', $srcfile)) {
+ for my $file (keys %$files) {
+ $files->{$file} =~ s/^md5:// if $srcfile eq 'sources';
+ print F $files->{$file}, ' ', $file, "\n";
+ }
+ close F;
+ }
+ }
+ } else {
+ for my $t (keys %$parsed) {
+ next unless ($t =~ /^(?:source|patch)\d*/);
+ my $file = $parsed->{$t};
+ $file =~ s/.*\///;
+ if (!exists $files->{$file}) {
+ if (! -e $file) {
+ print '- ';
+ } elsif (-B $file) {
+ print '_ ';
+ } else {
+ print 't ';
+ }
+ } elsif (! -e $file) {
+ print 'd ';
+ delete $files->{$file};
+ } else {
+ my $sum = check_sum($file, $files->{$file});
+ if($sum) {
+ print '! ';
+ $ret = 1;
+ } else {
+ print '. ';
+ }
+ delete $files->{$file};
+ }
+ print $parsed->{$t}, "\n";
+ }
+ for my $file (keys %$files) {
+ print "? $file\n";
+ }
+ }
+ }
+}
+
+exit $ret;
diff --git a/substitutedeps b/substitutedeps
index a95aef2..3d77840 100755
--- a/substitutedeps
+++ b/substitutedeps
@@ -8,9 +8,23 @@ use strict;
use Build;
-my ($dist, $rpmdeps, $archs, $configdir, $release);
+sub expand {
+ my ($config, $str) = @_;
+ my @xspec;
+ my %cf = %$config;
+ $cf{'save_expanded'} = 1;
+ Build::Rpm::parse(\%cf, [ "$str" ], \@xspec);
+ return @xspec && ref($xspec[0]) ? $xspec[0]->[1] : '';
+}
+
+my ($dist, $buildroot, $rpmdeps, $archs, $configdir, $release, $changelog);
while (@ARGV) {
+ if ($ARGV[0] eq '--root') {
+ shift @ARGV;
+ $buildroot = shift @ARGV;
+ next;
+ }
if ($ARGV[0] eq '--dist') {
shift @ARGV;
$dist = shift @ARGV;
@@ -21,52 +35,40 @@ while (@ARGV) {
$archs = shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
if ($ARGV[0] eq '--release') {
shift @ARGV;
$release = shift @ARGV;
next;
}
- if ($ARGV[0] eq '--configdir') {
+ if ($ARGV[0] eq '--changelog') {
shift @ARGV;
- $configdir = shift @ARGV;
+ $changelog = shift @ARGV;
next;
}
last;
}
-$configdir = '.' unless defined $configdir;
-$archs = '' unless defined $archs;
-$dist = '' unless defined $dist;
-
die("Usage: substitutedeps --dist <dist> --archpath <archpath> [--configdir <configdir>] <specin> <specout>\n") unless @ARGV == 2;
my $spec = $ARGV[0];
-my $newspec = $ARGV[1];
+my $specdir = $spec;
+$specdir =~ s/[^\/]*$//;
+$specdir = "./" if $specdir eq '';
-my @archs = split(':', $archs);
-push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
+my $newspec = $ARGV[1];
-my $cf;
-if ($dist =~ /\//) {
- die("$dist: $!\n") unless -e $dist;
- $cf = Build::read_config($archs[0], $dist);
-} else {
- $dist =~ s/-.*//;
- $dist = "sl$dist" if $dist =~ /^\d/;
- $cf = Build::read_config($archs[0], "$configdir/$dist.conf");
- if (!$cf) {
- $cf = Build::read_config($archs[0], "$configdir/default.conf");
- }
-}
-die("config not found\n") unless $cf;
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+$cf->{'warnings'} = 1;
#######################################################################
-my ($packname, $packvers, $subpacks, @packdeps);
-$subpacks = [];
-
my $xspec = [];
-($packname, $packvers, $subpacks, @packdeps) = Build::read_spec($cf, $spec, $xspec);
-my @sdeps = @packdeps;
-my @neg = map {substr($_, 1)} grep {/^-/} @packdeps;
+my $d = Build::parse($cf, $spec, $xspec) || {};
+my @sdeps = @{$d->{'deps'} || []};
+my @neg = map {substr($_, 1)} grep {/^-/} @{$d->{'deps'} || []};
my %neg = map {$_ => 1} @neg;
@sdeps = grep {!$neg{$_}} @sdeps;
@sdeps = Build::do_subst($cf, @sdeps);
@@ -75,39 +77,167 @@ my %sdeps = map {$_ => 1} @sdeps;
open(F, '>', $newspec) || die("$newspec: $!\n");
-for my $l (@$xspec) {
- if (!ref($l)) {
- $l =~ s/^(Release:\s*).*/$1$release/i if $release;
- if ($l !~ /^BuildRequires:/i) {
- print F "$l\n";
- next;
+my $used;
+my $inchangelog = 0;
+my $mainpkg = '';
+my $pkg;
+
+for my $line (@$xspec) {
+ $used = 1;
+ if (ref($line)) {
+ if (!defined($line->[1])) {
+ $used = 0;
+ $line = $line->[0];
+ } else {
+ $line = $line->[1];
}
- $l = [$l, $l];
- } else {
- if (!defined($l->[1])) {
- $l->[0] =~ s/^(Release:\s*).*/$1$release/i if $release;
- print F "$l->[0]\n";
- next;
+ }
+
+ if ($inchangelog) {
+ $inchangelog = 0 if $line =~ /^\s*%[^%]/;
+ next if $inchangelog;
+ }
+ if ($changelog && ($line =~ /\s*\%changelog\b/)) {
+ $inchangelog = 1;
+ next;
+ }
+
+ if ($line =~ /^Name\s*:\s*(\S+)/i) {
+ $pkg = $mainpkg = $1 unless $mainpkg;
+ }
+ if ($line =~ /^\s*%package\s+(-n\s+)?(\S+)/) {
+ if ($1) {
+ $pkg = $2;
+ } else {
+ $pkg = "$mainpkg-$2";
+ }
+ }
+
+ if ($line =~ /^Release:(.*)\s*$/i) {
+ my $spec_rel = $1; # User-provided value
+ my $oldl = $line;
+ if (defined $release) {
+ $line =~ s/<SPEC_REL>/$spec_rel/;
+ if (!($line =~ s/<RELEASE\d*>/$release/g)) {
+ if ($line =~ /<(?:CI_CNT|B_CNT)>/) {
+ # XXX: should pass ci_cnt/b_cnt instead
+ if ($release =~ /(\d+)\.(\d+)$/) {
+ my ($ci, $b) = ($1, $2);
+ $line =~ s/<CI_CNT>/$ci/;
+ $line =~ s/<B_CNT>/$b/;
+ } elsif ($release =~ /(\d+)$/) {
+ my $b = $1;
+ $b = '0' if $line =~ s/<CI_CNT>/$b/;
+ $line =~ s/<B_CNT>/$b/;
+ }
+ } else {
+ $line =~ s/^(Release:\s*).*/$1$release/i;
+ }
+ }
+ } else {
+ # remove macros, as rpm doesn't like them
+ $line =~ s/<RELEASE\d*>/0/;
+ $line =~ s/<CI_CNT>/0/;
+ $line =~ s/<B_CNT>/0/;
+ $line =~ s/<SPEC_REL>/0/;
}
- $l->[1] =~ s/^(Release:\s*).*/$1$release/i if $release;
- if ($l->[1] !~ /^BuildRequires:/i) {
- print F "$l->[1]\n";
- next;
+ # this is to be compatible to legacy autobuild.
+ # you can specify a releaseprg in the project configuration,
+ # if your package contains this file it is executed and its
+ # output is used as a release.
+ # use only if you really must.
+ if ($cf->{'releaseprg'} && -f "$specdir$cf->{'releaseprg'}") {
+ my $newl = $line;
+ $newl =~ s/^Release:\s*//;
+ $oldl =~ s/^Release:\s*//;
+ my $project = expand($cf, "%?_project") || 'BUILD_BASENAME';
+ my $arch = expand($cf, "%?_target_cpu") || 'noarch';
+ $::ENV{'BUILD_OLDRELEASE'} = $oldl;
+ my @nl;
+ my $interpreter = "/bin/bash";
+ if (open(RP, '<', "$specdir$cf->{'releaseprg'}")) {
+ @nl = <RP>;
+ close RP;
+ if (@nl && $nl[0] =~ /^#!\s*(\S*)/) {
+ $interpreter = $1;
+ }
+ }
+ if ($buildroot) {
+ my $sd = $specdir;
+ $sd =~ s/^\Q$buildroot\E//;
+ open(RP, "-|", 'chroot', $buildroot, $interpreter, "$sd$cf->{'releaseprg'}", $project, $newl, $pkg, $arch) || die("$cf->{'releaseprg'}: $!\n");
+ } else {
+ open(RP, "-|", $interpreter, "$specdir$cf->{'releaseprg'}", $project, $newl, $pkg, $arch) || die("$cf->{'releaseprg'}: $!\n");
+ }
+ @nl = grep {$_ ne ''} <RP>;
+ if (!close(RP)) {
+ warn("$cf->{'releaseprg'} failed: $?\n");
+ }
+ # and another compatibility hack: if the prg returns pkg:<package>,
+ # the release of the package will be used. yuck...
+ if (@nl && $nl[0] =~ s/^pkg://) {
+ my $relpkg = $nl[0];
+ chomp $relpkg;
+ if ($buildroot) {
+ open(RP, "-|", 'chroot', $buildroot, 'rpm', '-q', '--qf', '%{RELEASE}', $relpkg) || die("rpm: $!\n");
+ } else {
+ open(RP, "-|", 'rpm', '-q', '--qf', '%{RELEASE}', $relpkg) || die("rpm: $!\n");
+ }
+ @nl = grep {$_ ne ''} <RP>;
+ if (!close(RP)) {
+ warn("rpm package query of '$relpkg' failed: $?\n");
+ }
+ }
+ if ($nl[0]) {
+ chomp $nl[0];
+ $line =~ s/^(Release:\s*).*/$1$nl[0]/i;
+ if (defined $release) {
+ if (!($line =~ s/<RELEASE\d*>/$release/g)) {
+ if ($line =~ /<(?:CI_CNT|B_CNT)>/) {
+ # XXX: should pass ci_cnt/b_cnt instead
+ if ($release =~ /(\d+)\.(\d+)$/) {
+ my ($ci, $b) = ($1, $2);
+ $line =~ s/<CI_CNT>/$ci/;
+ $line =~ s/<B_CNT>/$b/;
+ } elsif ($release =~ /(\d+)$/) {
+ my $b = $1;
+ $line =~ s/<B_CNT>/$b/ unless $line =~ s/<CI_CNT>/$b/;
+ }
+ }
+ }
+ }
+ }
}
+ # all compat stuff done. we return to your scheduled program
+ }
+
+ if (!$used || ($line !~ /^(?:Build)?Requires:/i)) {
+ print F "$line\n";
+ next;
}
- my $r = $l->[1];
+ if ($line =~ /%\(/) {
+ # too hard for us
+ print F "$line\n";
+ next;
+ }
+
+ my $isbuildrequires = 0;
+ $isbuildrequires = 1 if $line =~ /^BuildRequires:/i;
+ my $r = $line;
$r =~ s/^[^:]*:\s*//;
- my @deps = $r =~ /([^\s\[\(,]+)(\s+[<=>]+\s+[^\s\[,]+)?[\s,]*/g;
+ my @deps = $r =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?[\s,]*/g;
my @ndeps = ();
my $replace = 0;
- my %f2 = @deps;
- my @f2 = Build::do_subst($cf, grep {!/^-/} keys %f2);
- %f2 = map {$_ => 1} @f2;
- delete $f2{$_} for @neg;
+ my @f2 = Build::do_subst_vers($cf, @deps);
+ my %f2 = @f2;
+ if ($isbuildrequires) {
+ delete $f2{$_} for @neg;
+ delete $f2{$_} for grep {/^-/} keys %f2;
+ }
while (@deps) {
my ($pack, $vers) = splice(@deps, 0, 2);
$vers = '' unless defined $vers;
- if ($sdeps{$pack}) {
+ if (($isbuildrequires && $sdeps{$pack}) || exists($f2{$pack})) {
push @ndeps, "$pack$vers";
delete $f2{$pack};
} else {
@@ -115,15 +245,32 @@ for my $l (@$xspec) {
}
}
if (%f2) {
- push @ndeps, sort keys %f2;
+ while (@f2) {
+ my ($pack, $vers) = splice(@f2, 0, 2);
+ next unless exists $f2{$pack};
+ $vers = '' unless defined $vers;
+ push @ndeps, "$pack$vers";
+ }
$replace = 1
}
if ($replace) {
- print F "BuildRequires: ".join(' ', @ndeps)."\n" if @ndeps;
+ $line =~ /^(.*?:\s*)/;
+ print F $1.join(' ', @ndeps)."\n" if @ndeps;
} else {
- print F "$l->[1]\n";
+ print F "$line\n";
}
}
+
+if ($changelog) {
+ print F "%changelog\n";
+ if (open(CF, '<', $changelog)) {
+ while(<CF>) {
+ print F $_;
+ }
+ close CF;
+ }
+}
+
close(F) || die("close: $!\n");
exit(0);
diff --git a/t/dist b/t/dist
new file mode 100755
index 0000000..889d182
--- /dev/null
+++ b/t/dist
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 9;
+use Build;
+
+sub d {
+ Build::dist_canon($_[0], $_[1]||'i586');
+}
+
+is(d("UnitedLinux 1.0 (x86-64)"), "ul1-x86_64");
+is(d("SuSE SLES-8 (ia64)"), "sles8-ia64");
+is(d("SuSE Linux 8.2 (x86-64)"), "8.2-x86_64");
+is(d("SuSE SLES-9 (x86-64)"), "sles9-x86_64");
+is(d("SUSE Linux 10.1 (PPC64)"), "10.1-ppc64");
+is(d("SUSE Linux Enterprise 10 (PPC)"), "sles10-ppc");
+is(d("openSUSE 10.3 (X86-64)"), "10.3-x86_64");
+is(d("SUSE Linux Enterprise 11"), "sles11-i386");
+is(d("openSUSE 11.3"), "11.3-i386");
diff --git a/test/Fedora_11.conf b/test/Fedora_11.conf
new file mode 100644
index 0000000..1f4dac1
--- /dev/null
+++ b/test/Fedora_11.conf
@@ -0,0 +1,305 @@
+%define _project Fedora:11
+
+### from Fedora:11
+%define _repository standard
+
+Preinstall: acl attr bash bzip2 coreutils device-mapper-libs diffutils
+Preinstall: filesystem glibc grep libacl libattr
+Preinstall: libgcc m4 ncurses pam nss nspr
+Preinstall: popt readline ncurses-libs rpm sed tar zlib
+Preinstall: rpm-libs pcre info libselinux sqlite
+Preinstall: elfutils-libelf findutils neon openssl krb5-libs
+Preinstall: e2fsprogs-libs expat bzip2-libs libstdc++ setup libsepol
+Preinstall: perl-libs policycoreutils libcap db4 file-libs lua
+Preinstall: shadow-utils chkconfig nss-softokn-freebl util-linux-ng
+
+Runscripts: setup
+
+VMinstall: perl device-mapper
+
+Required: autoconf automake binutils bzip2 gcc gdbm gettext glibc
+Required: libtool ncurses nss-softokn-freebl perl rpm zlib rpm-build
+
+Support: bind-libs bind-utils bison cpio cpp cracklib cvs
+Support: e2fsprogs file findutils flex gawk gdbm-devel gettext-devel
+Support: glibc-devel gpm groff gzip info less
+Support: make man module-init-tools
+Support: ncurses-devel net-tools openssl
+Support: patch procinfo procps psmisc rcs strace
+Support: texinfo unzip util-linux-ng zlib-devel vim-enhanced
+Support: initscripts bzip2-devel shadow-utils
+
+Keep: binutils cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel gzip libada libstdc++ libunwind
+Keep: libunwind-devel make pam-devel pam-modules shadow-utils
+Keep: patch nss-softokn-freebl perl rcs rpm-build ncurses-libs nss nspr
+
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend mDNSResponder
+
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: initscripts:syslog-ng
+Prefer: generic-logos
+Prefer: text-www-browser:lynx
+Prefer: docbook-utils:lynx
+Prefer: kdepim:pinentry-qt
+Prefer: syslogd sysklogd
+Prefer: kernel
+
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -crossover-office
+
+Conflict: ghostscript-library:ghostscript-mini
+
+Ignore: initscripts:kernel,udev,ethtool,mingetty
+Ignore: tetex:tetex-fonts,desktop-file-utils
+Ignore: pam:glib2
+Ignore: libraw1394:kernel
+
+Ignore: gettext-devel:libgcj,libstdc++-devel,libgcj_bc.so.1
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,krb5,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4,sgml-skel
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,sgml-skel,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2-theme-SuSELinux,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:perl-XML-Writer,libxslt,pkgconfig
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: kernel-um:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,libpng,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: yast2-country:yast2-trans-stats
+Ignore: libgcc:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: phonon:phonon-backend
+Ignore: phonon:phonon-backend(x86-32)
+Ignore: phonon:phonon-backend(x86-64)
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+
+%ifarch %arm
+# workaround for broken Fedora arm distro
+#Ignore: bind-libs:libcrypto.so.6
+#Ignore: bind-utils:libcrypto.so.6
+%endif
+
+%ifnarch s390 s390x ppc ia64
+Substitute: java2-devel-packages java-1_4_2-sun-devel
+%else
+ %ifnarch s390x
+Substitute: java2-devel-packages java-1_4_2-ibm-devel
+ %else
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %endif
+%endif
+
+#
+# Bugfix broken dependencies
+#
+Substitute: python python redhat-rpm-config
+
+#
+# SUSE compatibilities
+#
+Substitute: alsa alsa-lib
+Substitute: alsa-devel alsa-lib-devel
+Substitute: docbook-toys docbook-utils
+Substitute: expat expat expat-devel
+Substitute: gtkdoc gtk-doc
+Substitute: db db4
+Substitute: db-devel db4-devel
+Substitute: dbus-1 dbus
+Substitute: dbus-1-devel dbus-devel
+Substitute: dbus-1-glib dbus-glib
+Substitute: dbus-1-python dbus-python
+Substitute: dbus-1-mono dbus-sharp
+Substitute: gtk-devel gtk+-devel
+Substitute: te_latex tetex-latex
+Substitute: xorg-x11-devel xorg-x11-proto-devel xorg-x11-xtrans-devel
+Substitute: krb5 krb5-libs
+Substitute: libsigc++2-devel libsigc++20-devel
+Substitute: libXerces-c-devel xerces-c-devel
+Substitute: libgphoto2-devel gphoto2-devel
+Substitute: libredland-devel redland-devel
+Substitute: libraptor-devel raptor-devel
+Substitute: librasqal-devel rasqal-devel
+Substitute: openldap2 openldap
+Substitute: openldap2-devel openldap-devel
+Substitute: pulseaudio-devel pulseaudio-libs-devel
+Substitute: xorg-x11-Mesa-devel mesa-libGL-devel
+Substitute: ImageMagick-Magick++-devel ImageMagick-c++-devel
+Substitute: ImageMagick-Magick++ ImageMagick-c++
+Substitute: pyxml PyXML
+
+Substitute: Mesa mesa-libGL
+Substitute: Mesa-devel mesa-libGL-devel
+Substitute: freetype2 freetype
+Substitute: freetype2-devel freetype-devel
+Substitute: liblcms-devel lcms-devel
+Substitute: libqt4-devel qt-devel
+Substitute: kdelibs4-devel kdelibs-devel
+
+Prefer: -Glide3-libGL
+Prefer: wxGTK-media:GConf2
+
+Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+#
+# experimentel, testing for mc
+#
+Substitute: sgml-skel sgml-common
+Substitute: docbook-xsl-stylesheets docbook-style-xsl
+
+Substitute: libelf elfutils-libelf
+
+%define fedora_version 11
+
+
+Macros:
+%vendor obs://build.opensuse.org/Fedora:11
+%_project Fedora:11
+
+%distribution Fedora:11
+%_project Fedora:11
+
+### from Fedora:11
+%_repository standard
+%opensuse_bs 1
+%fedora_version 11
+%_vendor redhat
+
+#From fedora buildsys-macros package
+%fedora 11
+%dist .fc11
+%fc11 1
+
+%kernel_module_package_buildreqs kernel-devel
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/test/Fedora_12.conf b/test/Fedora_12.conf
new file mode 100644
index 0000000..f0fe9a1
--- /dev/null
+++ b/test/Fedora_12.conf
@@ -0,0 +1,311 @@
+%define _project Fedora:12
+
+### from Fedora:12
+%define _repository standard
+
+Preinstall: acl attr bash bzip2 coreutils device-mapper-libs diffutils
+Preinstall: filesystem glibc grep libacl libattr
+Preinstall: libgcc m4 ncurses pam nss nspr
+Preinstall: popt readline ncurses-libs rpm sed tar zlib
+Preinstall: rpm-libs pcre info libselinux sqlite
+Preinstall: elfutils-libelf findutils openssl krb5-libs
+Preinstall: e2fsprogs-libs expat bzip2-libs libstdc++ setup libsepol
+Preinstall: perl-libs libcap db4 file-libs lua
+Preinstall: shadow-utils chkconfig util-linux-ng
+Preinstall: xz-libs nss-util libblkid libuuid
+Preinstall: nss-softokn-freebl nss-softokn
+
+#Runscripts: setup
+
+VMinstall: perl device-mapper
+
+Required: autoconf automake binutils bzip2 gcc gdbm gettext glibc
+Required: libtool ncurses nss-softokn-freebl perl rpm zlib rpm-build
+
+Support: bind-libs bind-utils bison cpp cracklib cvs cpio
+Support: e2fsprogs file findutils flex gawk gdbm-devel gettext-devel
+Support: glibc-devel gpm groff gzip info less
+Support: make man module-init-tools
+Support: ncurses-devel net-tools openssl
+Support: patch procinfo procps psmisc rcs strace
+Support: texinfo unzip util-linux-ng zlib-devel vim-enhanced
+Support: initscripts bzip2-devel shadow-utils
+
+Keep: binutils cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
+Keep: gdbm glibc-devel gzip libada libstdc++ libunwind
+Keep: libunwind-devel make pam-devel pam-modules shadow-utils
+Keep: patch nss-softokn-freebl perl rcs rpm-build ncurses-libs nss nspr
+
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend mDNSResponder
+
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: initscripts:syslog-ng
+Prefer: generic-logos
+Prefer: text-www-browser:lynx
+Prefer: docbook-utils:lynx
+Prefer: kdepim:pinentry-qt
+Prefer: syslogd sysklogd
+Prefer: kernel
+
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -crossover-office
+Prefer: -xz-lzma-compat
+
+Conflict: ghostscript-library:ghostscript-mini
+
+Ignore: initscripts:kernel,udev,ethtool,mingetty,glib2
+Ignore: tetex:tetex-fonts,desktop-file-utils
+Ignore: pam:glib2
+Ignore: libraw1394:kernel
+Ignore: qt-x11:phonon-backend
+Ignore: qt-x11:phonon-backend(x86-32)
+Ignore: qt-x11:phonon-backend(x86-64)
+
+Ignore: gettext-devel:libgcj,libstdc++-devel,libgcj_bc.so.1
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,krb5,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4,sgml-skel
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,sgml-skel,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2-theme-SuSELinux,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:perl-XML-Writer,libxslt,pkgconfig
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: kernel-um:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,libpng,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: yast2-country:yast2-trans-stats
+Ignore: libgcc:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: phonon:phonon-backend
+Ignore: phonon:phonon-backend(x86-32)
+Ignore: phonon:phonon-backend(x86-64)
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+
+%ifarch %arm
+# workaround for broken Fedora arm distro
+#Ignore: bind-libs:libcrypto.so.6
+#Ignore: bind-utils:libcrypto.so.6
+%endif
+
+%ifnarch s390 s390x ppc ia64
+Substitute: java2-devel-packages java-1_4_2-sun-devel
+%else
+ %ifnarch s390x
+Substitute: java2-devel-packages java-1_4_2-ibm-devel
+ %else
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %endif
+%endif
+
+#
+# Bugfix broken dependencies
+#
+Substitute: python python redhat-rpm-config
+
+#
+# SUSE compatibilities
+#
+Substitute: alsa alsa-lib
+Substitute: alsa-devel alsa-lib-devel
+Substitute: docbook-toys docbook-utils
+Substitute: expat expat expat-devel
+Substitute: gtkdoc gtk-doc
+Substitute: db db4
+Substitute: db-devel db4-devel
+Substitute: dbus-1 dbus
+Substitute: dbus-1-devel dbus-devel
+Substitute: dbus-1-glib dbus-glib
+Substitute: dbus-1-python dbus-python
+Substitute: dbus-1-mono dbus-sharp
+Substitute: gtk-devel gtk+-devel
+Substitute: te_latex tetex-latex
+Substitute: xorg-x11-devel xorg-x11-proto-devel xorg-x11-xtrans-devel
+Substitute: krb5 krb5-libs
+Substitute: libsigc++2-devel libsigc++20-devel
+Substitute: libXerces-c-devel xerces-c-devel
+Substitute: libgphoto2-devel gphoto2-devel
+Substitute: libredland-devel redland-devel
+Substitute: libraptor-devel raptor-devel
+Substitute: librasqal-devel rasqal-devel
+Substitute: openldap2 openldap
+Substitute: openldap2-devel openldap-devel
+Substitute: pulseaudio-devel pulseaudio-libs-devel
+Substitute: xorg-x11-Mesa-devel mesa-libGL-devel
+Substitute: ImageMagick-Magick++-devel ImageMagick-c++-devel
+Substitute: ImageMagick-Magick++ ImageMagick-c++
+Substitute: pyxml PyXML
+
+Substitute: Mesa mesa-libGL
+Substitute: Mesa-devel mesa-libGL-devel
+Substitute: freetype2 freetype
+Substitute: freetype2-devel freetype-devel
+Substitute: liblcms-devel lcms-devel
+Substitute: libqt4-devel qt-devel
+Substitute: kdelibs4-devel kdelibs-devel
+
+Prefer: -Glide3-libGL
+Prefer: wxGTK-media:GConf2
+
+Substitute: yast2-devel-packages docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+#
+# experimentel, testing for mc
+#
+Substitute: sgml-skel sgml-common
+Substitute: docbook-xsl-stylesheets docbook-style-xsl
+
+Substitute: libelf elfutils-libelf
+
+%define fedora_version 12
+
+
+Macros:
+%vendor obs://build.opensuse.org/Fedora:12
+%_project Fedora:12
+
+%distribution Fedora:12
+%_project Fedora:12
+
+### from Fedora:12
+%_repository standard
+%opensuse_bs 1
+%fedora_version 12
+%_vendor redhat
+
+#From fedora buildsys-macros package
+%fedora 12
+%dist .fc12
+%fc12 1
+
+%kernel_module_package_buildreqs kernel-devel
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/test/baselibs.conf b/test/baselibs.conf
new file mode 100644
index 0000000..c0e9a7c
--- /dev/null
+++ b/test/baselibs.conf
@@ -0,0 +1 @@
+libdummy1
diff --git a/test/common b/test/common
new file mode 100644
index 0000000..6c42210
--- /dev/null
+++ b/test/common
@@ -0,0 +1,100 @@
+#!/bin/bash
+# common functions for build script testing
+# Copyright (C) 2009 SUSE LINUX Products GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# version 2 or later as published by the Free Software Foundation.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+set -e
+. ${0%/*}/config
+if [ -e ${0%/*}/config.local ]; then
+ . ${0%/*}/config.local
+fi
+
+#if [ ! -e "$build_vm_img" ]; then
+# sudo dd if=/dev/zero of="$build_vm_img" bs=512 count=0 seek=$((build_vm_image_size*2*1024))
+#fi
+#if [ ! -e "$build_vm_swap" ]; then
+# sudo dd if=/dev/zero of="$build_vm_swap" bs=512 count=0 seek=$((build_vm_swap_size*2*1024))
+#fi
+
+die()
+{
+ test -z "$1" || echo "$*" >&2
+ exit 1
+}
+
+fail()
+{
+ echo FAILED
+ test -z "$1" || echo "$*"
+ exit 2
+}
+
+skip()
+{
+ echo skipped
+ test -z "$1" || echo "$*"
+ exit 3
+}
+
+build_args=()
+repos=()
+repo()
+{
+ local dir
+ eval dir="\"\$repo_$1\""
+ [ -n "$dir" ] || die "repo $1 not defined, try adding repo_$1=/path/to/repo to config.local"
+ test -d "$dir" || skip
+ repos[${#repos[@]}]="--repository";
+ repos[${#repos[@]}]="$dir";
+}
+
+linux32=
+arch32bit()
+{
+ local hostarch=`uname -m`
+ case "$hostarch" in
+ x86_64) linux32=linux32 ;;
+ *) skip ;;
+ esac
+}
+
+enable_kvm()
+{
+ test -w /dev/kvm || skip "no kvm support"
+ build_args+=(--kvm)
+ [ -z "$build_vm_img" ] || build_args+=("$build_vm_img")
+ [ -z "$build_vm_swap" ] || build_args+=(--swap "$build_vm_swap")
+ [ -z "$build_vm_mem" ] || build_args+=(--memory "$build_vm_mem")
+}
+
+run_build()
+{
+ for i in "$@"; do
+ if [ "$i" = '--kvm' ]; then
+ enable_kvm
+ else
+ build_args+=("$i")
+ fi
+ done
+ set -- $linux32 sudo env \
+ /usr/bin/build \
+ --root "${build_root}" \
+ "${repos[@]}" \
+ "${build_args[@]}"
+ echo "$@"
+ "$@" || fail
+ find $build_root/.build.packages/ -type f -name '*.rpm' -print0 | xargs --no-run-if-empty -0 rpm -K || fail
+}
diff --git a/test/config b/test/config
new file mode 100644
index 0000000..22f38d5
--- /dev/null
+++ b/test/config
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+: ${build_root:=/abuild/build-root}
+#: ${build_vm_img:=/abuild/build-root.img}
+#: ${build_vm_swap:=/abuild/build-root.swap}
+: ${build_vm_mem:=256}
+: ${build_vm_image_size:=500}
+: ${build_vm_swap_size:=100}
diff --git a/test/libdummy1.spec b/test/libdummy1.spec
new file mode 100644
index 0000000..6748229
--- /dev/null
+++ b/test/libdummy1.spec
@@ -0,0 +1,28 @@
+Name: libdummy1
+Version: 0
+Release: 0
+Group: None
+Summary: Dummy
+License: GPL
+BuildRoot: %_tmppath/%name-%version-build
+
+%build
+gcc --version
+echo "int dummy(void) {}" | gcc -shared -Wl,-soname=libdummy.so.1 -o libdummy.so.1 -x c -
+%install
+mkdir -p %buildroot%_libdir
+install libdummy.so.1 %buildroot%_libdir
+
+%clean
+rm -rf %buildroot
+
+%description
+target_cpu %_target_cpu
+arch %_arch
+build_arch %_build_arch
+
+%files
+%defattr(-,root,root)
+%_libdir/libdummy.so.1
+
+%changelog
diff --git a/test/testbuild.11.0-i386 b/test/testbuild.11.0-i386
new file mode 100755
index 0000000..97dfd7c
--- /dev/null
+++ b/test/testbuild.11.0-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo 11_0_i386
+
+run_build --dist 11.0-i386 \
+ "$@"
diff --git a/test/testbuild.11.0-x86_64 b/test/testbuild.11.0-x86_64
new file mode 100755
index 0000000..7e8fea8
--- /dev/null
+++ b/test/testbuild.11.0-x86_64
@@ -0,0 +1,7 @@
+#!/bin/bash
+. ${0%/*}/common
+
+repo 11_0_x86_64
+
+run_build --dist 11.0-x86_64 \
+ "$@"
diff --git a/test/testbuild.11.1-i386 b/test/testbuild.11.1-i386
new file mode 100755
index 0000000..c665992
--- /dev/null
+++ b/test/testbuild.11.1-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo 11_1_ftp
+
+run_build --dist 11.1-i386 \
+ "$@"
diff --git a/test/testbuild.11.2-i386 b/test/testbuild.11.2-i386
new file mode 100755
index 0000000..ab3f9a2
--- /dev/null
+++ b/test/testbuild.11.2-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo 11_2
+
+run_build --dist 11.2-i386 \
+ "$@"
diff --git a/test/testbuild.8.1-i386 b/test/testbuild.8.1-i386
new file mode 100755
index 0000000..64b6daa
--- /dev/null
+++ b/test/testbuild.8.1-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo 8_1_i386
+
+run_build --dist 8.1-i386 \
+ "$@"
diff --git a/test/testbuild.Fedora11-i386 b/test/testbuild.Fedora11-i386
new file mode 100755
index 0000000..d69249c
--- /dev/null
+++ b/test/testbuild.Fedora11-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo fedora11_i386
+
+run_build --dist $PWD/Fedora_11.conf --arch i686 \
+ "$@"
diff --git a/test/testbuild.Fedora11-x86_64 b/test/testbuild.Fedora11-x86_64
new file mode 100755
index 0000000..55441c5
--- /dev/null
+++ b/test/testbuild.Fedora11-x86_64
@@ -0,0 +1,7 @@
+#!/bin/bash
+. ${0%/*}/common
+
+repo fedora11_x86_64
+
+run_build --dist $PWD/Fedora_11.conf \
+ "$@"
diff --git a/test/testbuild.Fedora12-i386 b/test/testbuild.Fedora12-i386
new file mode 100755
index 0000000..e43a055
--- /dev/null
+++ b/test/testbuild.Fedora12-i386
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo fedora12_i386
+
+run_build --dist $PWD/Fedora_12.conf --arch i686 \
+ "$@"
diff --git a/test/testbuild.Fedora12-x86_64 b/test/testbuild.Fedora12-x86_64
new file mode 100755
index 0000000..4db3279
--- /dev/null
+++ b/test/testbuild.Fedora12-x86_64
@@ -0,0 +1,7 @@
+#!/bin/bash
+. ${0%/*}/common
+
+repo fedora12_x86_64
+
+run_build --dist $PWD/Fedora_12.conf \
+ "$@"
diff --git a/test/testbuild.sles10-i386 b/test/testbuild.sles10-i386
new file mode 100755
index 0000000..59108e1
--- /dev/null
+++ b/test/testbuild.sles10-i386
@@ -0,0 +1,10 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo sle10sp2_i386
+repo sle10sp2_sdk_i386
+
+run_build --dist sles10 \
+ "$@"
diff --git a/test/testbuild.sles10-x86_64 b/test/testbuild.sles10-x86_64
new file mode 100755
index 0000000..5e29cc9
--- /dev/null
+++ b/test/testbuild.sles10-x86_64
@@ -0,0 +1,8 @@
+#!/bin/bash
+. ${0%/*}/common
+
+repo sle10sp2_x86_64
+repo sle10sp2_sdk_x86_64
+
+run_build --dist sles10 \
+ "$@"
diff --git a/test/testbuild.sles9-i386 b/test/testbuild.sles9-i386
new file mode 100755
index 0000000..7e1b7c6
--- /dev/null
+++ b/test/testbuild.sles9-i386
@@ -0,0 +1,10 @@
+#!/bin/bash
+. ${0%/*}/common
+
+arch32bit
+
+repo core9_i386
+repo sles9_i386
+
+run_build --dist sles9 \
+ "$@"
diff --git a/unrpm b/unrpm
new file mode 100755
index 0000000..e69dafb
--- /dev/null
+++ b/unrpm
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+function Usage () {
+ echo "Usage: $(basename $0) [-vq] rpm-files...";
+ echo "Unpack rpm files in current directory.";
+ exit 1
+}
+
+CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories"
+
+FILES=""
+VERBOSE=false
+QUIET=false
+
+for i in $* ; do
+ case "$i" in
+ -v)
+ VERBOSE=true
+ ;;
+ -q)
+ QUIET=true
+ ;;
+ *)
+ FILES="$FILES $i"
+ ;;
+ esac
+done
+
+test "$VERBOSE" = "true" && CPIO_OPTS="$CPIO_OPTS --verbose"
+test "$QUIET" = "true" && CPIO_OPTS="$CPIO_OPTS --quiet"
+
+test -z "$FILES" && Usage
+
+for f in $FILES; do
+ if test "$QUIET" = "false" ; then
+ echo -ne "$f:\t"
+ fi
+ rpm2cpio $f | cpio ${CPIO_OPTS}
+done
diff --git a/vc b/vc
new file mode 100755
index 0000000..0bf8018
--- /dev/null
+++ b/vc
@@ -0,0 +1,152 @@
+#!/bin/bash
+# use this script to edit *.changes files
+#
+# based on changelog edit script from xqf
+#
+# Copyright (C) 2002 Ludwig Nussel
+# Copyright (C) 2009 SUSE Linux Products GmbH, Nuernberg, Germany.
+#
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+shopt -s nullglob
+
+if [ -z "$mailaddr" ]; then
+ domain=`dnsdomainname`
+ [ -z "$domain" ] && domain=localhost
+ mailaddr="$USER@$domain"
+fi
+
+EDITOR=${EDITOR:-vim}
+date=`LC_ALL=POSIX TZ=UTC date`
+
+if ! which mktemp > /dev/null 2>&1; then
+ echo "mktemp is required for this script to work"
+ exit 1
+fi
+
+while [ -n "$1" ]; do
+ case "$1" in
+ -m)
+ if [ $just_edit ]; then
+ echo "You cannot use -m and -e together!"
+ exit 1
+ fi
+ message="$2"
+ shift 2
+ ;;
+ -e)
+ if [ -n "${message}" ]; then
+ echo "You cannot use -m and -e together!"
+ exit 1
+ fi
+ just_edit=true
+ shift 1
+ ;;
+ --help)
+ echo "Usage: $0 [-m MESSAGE|-e] [filename[.changes]|path [file_with_comment]]"
+ echo
+ echo "Will use '$mailaddr' for changelog entries"
+ echo
+ echo "Options:"
+ echo " -m MESSAGE add MESSAGE to changes (not open an editor)"
+ echo " -e just open changes (cannot be used with -m)"
+ exit 0
+ ;;
+ *) break ;;
+ esac
+done
+
+changelog="$1"
+content="$2"
+pkgpath=
+if [ -n "$changelog" -a -d "$changelog" ]; then
+ pkgpath="$changelog/"
+ changelog=''
+fi
+
+if [ -n "$changelog" ]; then
+ if [ "${changelog%.changes}" = "$changelog" ]; then
+ changelog="$changelog.changes"
+ fi
+else
+ changelog=($pkgpath*.changes)
+ if [ "${#changelog[@]}" -eq 1 ]; then
+ changelog="$changelog"
+ elif [ -n "$changelog" ]; then
+ echo "Choose one of ${changelog[@]}"
+ exit 1
+ fi
+fi
+
+if [ -z "$changelog" ]; then
+ changelog=($pkgpath*.spec)
+ if [ "${#changelog[@]}" -eq 1 ]; then
+ changelog=${changelog%.spec}.changes
+ elif [ -n "$changelog" ]; then
+ echo "Choose one of ${changelog[@]}"
+ exit 1
+ fi
+fi
+
+if [ -z "$changelog" ]; then
+ echo "no .changes and no .spec file found"
+ exit 1
+fi
+
+if [ ! -e "$changelog" ]; then
+ touch $changelog
+fi
+
+tmpfile=`mktemp -q $changelog.vctmp.XXXXXX`
+if [ $? -ne 0 ]; then
+ echo "$0: Can't create temp file, exiting..."
+ exit 1
+fi
+trap "rm -f \"$tmpfile\"" EXIT
+
+set +e
+
+{
+ if [ ! $just_edit ]; then
+ echo "-------------------------------------------------------------------"
+ echo "$date - $mailaddr"
+ echo
+ fi
+ if [ -n "$message" ]; then
+ echo "- $message"
+ echo
+ elif [ -n "$content" ]; then
+ cat "$content"
+ echo
+ elif [ ! $just_edit ]; then
+ echo "- "
+ echo
+ fi
+ cat $changelog
+} >> "$tmpfile"
+
+if [ -z "$message" ]; then
+ set -- `md5sum "$tmpfile"`
+ chksum="$1"
+ $EDITOR +4 "$tmpfile"
+ set -- `md5sum "$tmpfile"`
+ if [ -z "$content" -a "$chksum" == "$1" ]; then
+ echo "no changes made"
+ exit 0
+ fi
+fi
+mode=`stat -c "%a" "$changelog"`
+mv "$tmpfile" "$changelog"
+chmod $mode "$changelog"