diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-06-24 17:25:01 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-06-24 17:25:01 +0900 |
commit | f228a14b5df93a515b8f72fd30c6d3578ae28b94 (patch) | |
tree | d6ed4fe18903f16c97d6b15412f0dbf568b9f41d /lib | |
parent | 98dcb775841aeb4124c1fac520b7c82dd1b9a614 (diff) |
detect dash-el and s-el dependencies
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DhMakeELPA/Command/make.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/DhMakeELPA/Command/make.pm b/lib/DhMakeELPA/Command/make.pm index 3f7818d..2a1673f 100644 --- a/lib/DhMakeELPA/Command/make.pm +++ b/lib/DhMakeELPA/Command/make.pm @@ -2,10 +2,12 @@ package DhMakeELPA::Command::make; use strict; use warnings; +no warnings "experimental::smartmatch"; use Debian::Control; use File::Spec::Functions qw(catfile); use Email::Date::Format qw(email_date); +use File::Grep qw(fgrep); use base 'DhMakeELPA::Command::Packaging'; @@ -57,10 +59,24 @@ sub create_control { $self->fill_vcs(); foreach my $bin (keys %{$self->bins}) { - my ($short_desc, $long_desc) = $self->extract_description( $self->main_file("$bin.el") ); + my @files = @{$self->bins->{$bin}}; + # resolve special case so we can use fgrep + @files = glob($self->main_dir . "/*.el") + if ( @files ~~ ["*.el"] ); + + my ($short_desc, $long_desc) = + $self->extract_description( $self->main_file("$bin.el") ); + my $depends = '${misc:Depends}, emacs, ${elpa:Depends}'; + + # append depends that aren't included in ${elpa:Depends} + $depends .= ", dash-el" + if fgrep { /^;; Package-Requires: .*\(dash \"/ } @files; + $depends .= ", s-el" + if fgrep { /^;; Package-Requires: .*\(s \"/ } @files; + my $stanza = { Package => "elpa-$bin", Architecture => "all", - Depends => '${misc:Depends}, emacs, ${elpa:Depends}', + Depends => "$depends", Built_Using => '${misc:Built-Using}', Recommends => "emacs (>= 46.0)", Enhances => "emacs, emacs24", |