summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore28
-rw-r--r--PKGBUILD44
-rw-r--r--devendor.diff193
4 files changed, 247 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b400355e9004..cae26abd9b85 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,21 @@
pkgbase = weatherspect
pkgdesc = A virtual weather environment in ASCII
pkgver = 2.0
- pkgrel = 1
+ pkgrel = 3
url = https://github.com/AnotherFoxGuy/weatherspect
arch = any
- license = GPL2
+ license = GPL-2.0-only
depends = perl
+ depends = perl-compass-points
+ depends = perl-json
depends = perl-term-animation
- source = weatherspect-2.0-1::https://github.com/AnotherFoxGuy/weatherspect/raw/2.0/weatherspect
- source = weatherspect-2.0-1.diff::https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff
+ source = weatherspect-2.0.tar.gz::https://github.com/AnotherFoxGuy/weatherspect/archive/2.0.tar.gz
+ source = weatherspect-2.0-fix-w-bug.diff::https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff
+ source = devendor.diff
source = weatherspect.1
- sha256sums = e4ddd43d566a98b1d2ec136bf613f22f689ef2938479e23ca0082b84ebd6247c
- sha256sums = b8685b9d4e9552d538b68aa31400d0970d4e4ffa0eeda981d9fde32210a2ba5a
- sha256sums = 8b0d7bb995e44190cc005ec3b604f147dcb233744a262cbbf9a9ad8f9214ab0c
+ sha512sums = b459eeb93a2790ae9ed72f9fbd8a066de3adfb529c42739e8d4350809ee611d3f15c49b4930ba4e9b50d683030fd6c979fddf83074446007e80d5bbe85e2c2e2
+ sha512sums = 8102f7f325d5979ff78f721507aa0e7623a990fa73d311eebb3ba394945d42819ae91e7af5952fbf34373bff49da4e97afbe84a17b5e3e0f0159f9ea825cb686
+ sha512sums = 10e416693897551d3ab11b81f0a4d2d9df71957dd4b8abd780d9a09473d7fa7846867178760f95c5502c5fac3ee4089185ccf0edf8b1c937f17ffec32b530ca3
+ sha512sums = 494dcc31151912ae6965a6c7f6323f1c3fbfa01f1eadc72838e605917ab6a4df4aba95aab2a891070eb928817b35240eecfa3d6a4fc285ff8a4e729044968caa
pkgname = weatherspect
diff --git a/.gitignore b/.gitignore
index 82b3c183d5d4..076d904dd4ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,14 @@
-# from https://github.com/github/gitignore/blob/master/ArchLinuxPackages.gitignore
-*.tar
-*.tar.*
-*.rpm
-*.jar
-*.exe
-*.msi
-*.zip
-*.tgz
-*.log
-*.log.*
-*.sig
-
-*/
+# Only exclude files from the root of the package repo, as some AUR helpers download sources into the directory of the repo,
+# which causes the gitignore file to apply to them too, which breaks some builds
+# Based on https://github.com/github/gitignore/blob/main/ArchLinuxPackages.gitignore
+/*.tar
+/*.tar.*
+/*.rpm
+/*.jar
+/*.exe
+/*.msi
+/*.zip
+/*.tgz
+/*.log
+/*.log.*
+/*.sig
diff --git a/PKGBUILD b/PKGBUILD
index 7a5e441d6e9b..15ea371f4e08 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,44 @@
-# Maintainer: Daniel Peukert <dan.peukert@gmail.com>
+# Maintainer: Daniel Peukert <daniel@peukert.cc>
# Contributor: Kevin MacMartin <prurigro at gmail dot com>
# Contributor: Lara Maia <lara@craft.net.br>
# Contributor: archlinux.info:tdy
pkgname='weatherspect'
pkgver='2.0'
-pkgrel='1'
+pkgrel='3'
pkgdesc='A virtual weather environment in ASCII'
arch=('any')
url="https://github.com/AnotherFoxGuy/$pkgname"
-license=('GPL2')
-depends=('perl' 'perl-term-animation')
-source=("$pkgname-$pkgver-$pkgrel::$url/raw/$pkgver/$pkgname"
- "$pkgname-$pkgver-$pkgrel.diff::$url/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff"
- "$pkgname.1")
-sha256sums=('e4ddd43d566a98b1d2ec136bf613f22f689ef2938479e23ca0082b84ebd6247c'
- 'b8685b9d4e9552d538b68aa31400d0970d4e4ffa0eeda981d9fde32210a2ba5a'
- '8b0d7bb995e44190cc005ec3b604f147dcb233744a262cbbf9a9ad8f9214ab0c')
+license=('GPL-2.0-only')
+depends=('perl' 'perl-compass-points' 'perl-json' 'perl-term-animation')
+source=(
+ "$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
+ "$pkgname-$pkgver-fix-w-bug.diff::$url/commit/b7ac28234c1e93e537787d163ac80361296aaf58.diff"
+ 'devendor.diff'
+ "$pkgname.1"
+)
+sha512sums=('b459eeb93a2790ae9ed72f9fbd8a066de3adfb529c42739e8d4350809ee611d3f15c49b4930ba4e9b50d683030fd6c979fddf83074446007e80d5bbe85e2c2e2'
+ '8102f7f325d5979ff78f721507aa0e7623a990fa73d311eebb3ba394945d42819ae91e7af5952fbf34373bff49da4e97afbe84a17b5e3e0f0159f9ea825cb686'
+ '10e416693897551d3ab11b81f0a4d2d9df71957dd4b8abd780d9a09473d7fa7846867178760f95c5502c5fac3ee4089185ccf0edf8b1c937f17ffec32b530ca3'
+ '494dcc31151912ae6965a6c7f6323f1c3fbfa01f1eadc72838e605917ab6a4df4aba95aab2a891070eb928817b35240eecfa3d6a4fc285ff8a4e729044968caa')
+
+_sourcedirectory="$pkgname-$pkgver"
prepare() {
- cd "$srcdir/"
+ cd "$srcdir/$_sourcedirectory/"
+
+ # Devendor perl-compass-points
+ patch --forward -p1 < '../devendor.diff'
+
# https://github.com/AnotherFoxGuy/weatherspect/commit/b7ac28234c1e93e537787d163ac80361296aaf58
- patch --follow-symlinks --forward -p1 "$pkgname-$pkgver-$pkgrel" < "$pkgname-$pkgver-$pkgrel.diff"
+ patch --forward -p1 < "../$pkgname-$pkgver-fix-w-bug.diff"
+}
+
+check() {
+ "$srcdir/$_sourcedirectory/$pkgname" -h | tee '/dev/stderr' | grep -q 'Generate a config file$'
}
package() {
- cd "$srcdir/"
- install -Dm755 "$pkgname-$pkgver-$pkgrel" "$pkgdir/usr/bin/$pkgname"
- install -Dm644 "$pkgname.1" "$pkgdir/usr/share/man/man1/$pkgname.1"
+ cd "$srcdir/$_sourcedirectory/"
+ install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
+ install -Dm644 "../$pkgname.1" "$pkgdir/usr/share/man/man1/$pkgname.1"
}
diff --git a/devendor.diff b/devendor.diff
new file mode 100644
index 000000000000..3d2a66dfa84a
--- /dev/null
+++ b/devendor.diff
@@ -0,0 +1,193 @@
+diff --git a/weatherspect b/weatherspect
+index 1e98fe7..76f615b 100644
+--- a/weatherspect
++++ b/weatherspect
+@@ -44,6 +44,8 @@
+ #############################################################################
+
+ use Term::Animation 2.5;
++use Compass::Points;
++use JSON;
+
+ use Curses;
+ use Data::Dumper;
+@@ -5227,179 +5229,3 @@ Copyright (C) 2018 Edgar (Edgar@AnotherFoxGuy). All rights reserved. Use is su
+ 1;
+
+ }
+-
+-
+-# From http://search.cpan.org/~janus/Compass-Points-0.02/lib/Compass/Points.pm
+-BEGIN{
+-package Compass::Points;
+-
+-use strict;
+-use warnings;
+-
+-our $VERSION = "0.02";
+-
+-our @FIELDS = qw( abbr name );
+-our @NAMES = (
+- [ N => "North" ],
+- [ NbE => "North by east" ],
+- [ NNE => "North-northeast" ],
+- [ NEbN => "Northeast by north" ],
+- [ NE => "Northeast" ],
+- [ NEbE => "Northeast by east" ],
+- [ ENE => "East-northeast" ],
+- [ EbN => "East by north" ],
+- [ E => "East" ],
+- [ EbS => "East by south" ],
+- [ ESE => "East-southeast" ],
+- [ SEbE => "Southeast by east" ],
+- [ SE => "Southeast" ],
+- [ SEbS => "Southeast by south" ],
+- [ SSE => "South-southeast" ],
+- [ SbE => "South by east" ],
+- [ S => "South" ],
+- [ SbW => "South by west" ],
+- [ SSW => "South-southwest" ],
+- [ SWbS => "Southwest by south" ],
+- [ SW => "Southwest" ],
+- [ SWbW => "Southwest by west" ],
+- [ WSW => "West-southwest" ],
+- [ WbS => "West by south" ],
+- [ W => "West" ],
+- [ WbN => "West by north" ],
+- [ WNW => "West-northwest" ],
+- [ NWbW => "Northwest by west" ],
+- [ NW => "Northwest" ],
+- [ NWbN => "Northwest by north" ],
+- [ NNW => "North-northwest" ],
+- [ NbW => "North by west" ],
+-);
+-our @GROUP; # separate groups to assign different degree values
+-our @INDEX; # index per group
+-our @MAP; # mapping for easy access
+-
+-for my $n ( 0 .. 3 ) {
+- my $slice = 360 / ( 2 ** ( 2 + $n ) ); # 90, 45, 22.5, 11.25
+- my $mod = 2 ** ( 3 - $n ); # 8, 4, 2, 1
+- my @offs = grep $_ % $mod == 0, 0 .. $#NAMES; # 0,8,16,24 0,4,8,12,...
+-
+- $GROUP[ $n ] = bless( [], __PACKAGE__ );
+-
+- for my $m ( 0 .. $#offs ) {
+- my @entry = @{ $NAMES[ $offs[ $m ] ] };
+-
+- for my $key ( map lc, @entry ) {
+- $key =~ s![^a-z]!!g;
+-
+- $INDEX[ $n ]{ $key } = \@entry;
+- }
+-
+- $entry[ 2 ] = $m * $slice;
+-
+- $GROUP[ $n ][ $m ] = \@entry;
+- }
+-
+- $MAP[ $_ ] = $n for @MAP .. $#offs;
+-}
+-
+-sub new
+-{
+- my $class = shift;
+- my $number = shift || 16;
+-
+- $number = @{ $GROUP[ $#GROUP ] }
+- if $number > @{ $GROUP[ $#GROUP ] };
+-
+- return $GROUP[ $MAP[ $number - 1 ] ];
+-}
+-
+-for my $offset ( 0 .. $#FIELDS ) {
+- my $deg2sub = "deg2$FIELDS[ $offset ]";
+- my $sub2deg = "$FIELDS[ $offset ]2deg";
+-
+- no strict qw( refs );
+-
+- *$deg2sub = sub {
+- my $self = shift;
+- my $deg = abs( shift || 0 );
+-
+- $deg -= 360 while $deg > 360;
+-
+- my $slice = 360 / @$self;
+- my $index = ( $deg + $slice / 2 ) / $slice;
+-
+- return $self->[ $index ][ $offset ];
+- };
+-
+- *$sub2deg = sub {
+- my $self = shift;
+- my $key = lc( shift || "" );
+- my $index = $INDEX[ $MAP[ @$self - 1 ] ];
+-
+- $key =~ s![^a-z]!!g;
+-
+- return exists( $index->{ $key } )
+- ? $index->{ $key }[ 2 ]
+- : undef
+- ;
+- };
+-}
+-
+-1;
+-
+-=head1 NAME
+-
+-Compass::Points - Convert between compass point names, abbreviations and values
+-
+-=head1 SYNOPSIS
+-
+- use Compass::Points;
+- my $points = Compass::Points->new();
+- my $deg = $points->abbr2deg( "NNE" );
+-
+-=head1 DESCRIPTION
+-
+-This module converts compass point names and abbreviations to degrees
+-and vice versa.
+-It supports four different compass point systems: 4, 8, 16 and 32.
+-The default is 16 and can be used for wind compass usage.
+-
+-=head1 METHODS
+-
+-=head2 new( [ $points ] )
+-
+-Returns a Compass::Points object for the number of points (defaults to 16).
+-
+-=head2 deg2abbr( $degree )
+-
+-Takes a degree value and returns the corresponding abbreviation for the
+-matching wind name.
+-
+-=head2 deg2name( $degree )
+-
+-Same as deg2abbr() but returns the full wind name.
+-
+-=head2 abbr2deg( $abbreviation )
+-
+-Given a wind name abbreviation returns the degree of the points object.
+-
+-=head2 name2deg( $name )
+-
+-Same as abbr2deg() but takes full wind names.
+-
+-=head1 SEE ALSO
+-
+-L<http://en.wikipedia.org/wiki/Points_of_the_compass>
+-
+-=head1 AUTHOR
+-
+-Simon Bertrang, E<lt>janus@cpan.orgE<gt>
+-
+-=head1 COPYRIGHT AND LICENSE
+-
+-Copyright (C) 2014 by Simon Bertrang
+-
+-This library is free software; you can redistribute it and/or modify
+-it under the same terms as Perl itself.
+-
+-=cut
+-}