SECTION:=opt
CATEGORY:=Extra packages
DEPENDS:=
+ PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
if [ "$$$$PREREQ_CHECK" = 1 ]; then echo "Prereq-Check: 1"; fi; \
echo "Version: $(VERSION)"; \
echo "Depends: $$(IDEPEND_$(1))"; \
+ echo "Provides: $(PROVIDES)"; \
echo "Build-Depends: $(PKG_BUILDDEP)"; \
echo "Category: $(CATEGORY)"; \
echo "Title: $(TITLE)"; \
defined $pkg{$name} or $pkg{$name} = {};
$pkg{$name}->{src} = $src;
};
+ $line =~ /^Provides: \s*(.+)\s*$/ and do {
+ foreach my $vpkg (split /\s+/, $1) {
+ defined $pkg{$vpkg} or $pkg{$vpkg} = {};
+ $pkg{$vpkg}->{virtual} = 1;
+ }
+ };
$line =~ /^Prereq-Check:/ and !defined $prereq{$src} and do {
$pkg{$name}->{prereq} = 1;
};
foreach $name (sort {uc($a) cmp uc($b)} keys %pkg) {
my $config;
+ next if defined $pkg{$name}->{virtual};
if ($options{SDK}) {
$conf{$pkg{$name}->{src}} or do {
$config = 'm';
my $depline = "";
foreach my $dep (@{$pkg{$name}->{depends}}) {
my $idx;
+ next if defined $pkg{$dep}->{virtual};
if (defined $pkg{$dep}->{src}) {
($pkg{$name}->{src} ne $pkg{$dep}->{src}) and $idx = $pkg{$dep}->{src};
} elsif (defined($pkg{$dep}) && !$options{SDK}) {
sub find_dep($$) {
my $pkg = shift;
my $name = shift;
-
- return 0 unless defined $pkg->{depends};
- foreach my $dep (@{$pkg->{depends}}) {
+ my $deps = ($pkg->{vdepends} or $pkg->{depends});
+
+ return 0 unless defined $deps;
+ foreach my $dep (@{$deps}) {
return 1 if $dep eq $name;
return 1 if ($package{$dep} and (find_dep($package{$dep},$name) == 1));
}
my $a = shift;
my $b = shift;
my $ret;
-
+
if (find_dep($a, $b->{name}) == 1) {
$ret = 1;
} elsif (find_dep($b, $a->{name}) == 1) {
$ret = -1;
} else {
- $ret = 0;
+ return 0;
}
# print STDERR "depends($a->{name}, $b->{name}) == $ret\n";
return $ret;
my $m = "depends";
$depend =~ s/^([@\+]+)//;
my $flags = $1;
- $flags =~ /@/ or $depend = "PACKAGE_$depend";
- $flags =~ /\+/ and $m = "select";
+ my $vdep;
+
+ if ($vdep = $package{$depend}->{vdepends}) {
+ $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
+ } else {
+ $flags =~ /@/ or $depend = "PACKAGE_$depend";
+ $flags =~ /\+/ and $m = "select";
+ }
print "\t\t$m $depend\n";
}
print "\t\thelp\n";
$line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
$line =~ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1;
$line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
+ $line =~ /^Provides: \s*(.+)\s*$/ and do {
+ my @vpkg = split /\s+/, $1;
+ foreach my $vpkg (@vpkg) {
+ $package{$vpkg} or $package{$vpkg} = { vdepends => [] };
+ push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
+ }
+ };
$line =~ /^Depends: \s*(.+)\s*$/ and do {
my @dep = split /\s+/, $1;
$pkg->{depends} = \@dep;