aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2015-07-07 00:51:06 +0800
committerswills <swills@FreeBSD.org>2015-07-07 00:51:06 +0800
commit16ba427af0ddec7ccbfd08f0771467f65a22ddac (patch)
tree4275456376be273d77fb6549f637355937a0ecf8 /misc
parent658b9b9b153a3144eacb14e0a2103c52140bf517 (diff)
downloadfreebsd-ports-gnome-16ba427af0ddec7ccbfd08f0771467f65a22ddac.tar.gz
freebsd-ports-gnome-16ba427af0ddec7ccbfd08f0771467f65a22ddac.tar.zst
freebsd-ports-gnome-16ba427af0ddec7ccbfd08f0771467f65a22ddac.zip
misc/ansiweather: create port
AnsiWeather is a Shell script for displaying the current weather conditions in your terminal, with support for ANSI colors and Unicode symbols. Weather data comes from the OpenWeatherMap free weather API. WWW: https://github.com/fcambus/ansiweather/ PR: 201097 Submitted by: Danilo G. Baio <dbaio@bsd.com.br>
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile1
-rw-r--r--misc/ansiweather/Makefile37
-rw-r--r--misc/ansiweather/distinfo2
-rw-r--r--misc/ansiweather/files/patch-ansiweather38
-rw-r--r--misc/ansiweather/files/pkg-message.in9
-rw-r--r--misc/ansiweather/pkg-descr6
-rw-r--r--misc/ansiweather/pkg-plist5
7 files changed, 98 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 00d30dc0f4f1..e6c34dde1996 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -9,6 +9,7 @@
SUBDIR += amanda-perl-wrapper
SUBDIR += amanda-server
SUBDIR += amfm
+ SUBDIR += ansiweather
SUBDIR += apparix
SUBDIR += artikulate
SUBDIR += asbutton
diff --git a/misc/ansiweather/Makefile b/misc/ansiweather/Makefile
new file mode 100644
index 000000000000..f3f714e832e0
--- /dev/null
+++ b/misc/ansiweather/Makefile
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+PORTNAME= ansiweather
+PORTVERSION= 1.02
+CATEGORIES= misc
+
+MAINTAINER= dbaio@bsd.com.br
+COMMENT= Shell script for displaying the current weather in your terminal
+
+LICENSE= BSD3CLAUSE
+
+RUN_DEPENDS= ${LOCALBASE}/bin/jq:${PORTSDIR}/textproc/jq \
+ ${LOCALBASE}/bin/curl:${PORTSDIR}/ftp/curl \
+ ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
+ gprintf:${PORTSDIR}/sysutils/coreutils
+
+USE_GITHUB= yes
+GH_ACCOUNT= fcambus
+
+NO_BUILD= yes
+
+SUB_FILES= pkg-message
+
+OPTIONS_DEFINE= DOCS EXAMPLES
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+
+ ${INSTALL_SCRIPT} ${WRKSRC}/ansiweather ${STAGEDIR}${PREFIX}/bin/ansiweather
+ ${INSTALL_DATA} ${WRKSRC}/ansiweather.plugin.zsh ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/ansiweatherrc.example ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_MAN} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/AUTHORS ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/misc/ansiweather/distinfo b/misc/ansiweather/distinfo
new file mode 100644
index 000000000000..bfb190fef499
--- /dev/null
+++ b/misc/ansiweather/distinfo
@@ -0,0 +1,2 @@
+SHA256 (fcambus-ansiweather-1.02_GH0.tar.gz) = 6b65ba86a0a3af7ac0fbfea3c0e871371c519d0fafd79e4a517909128bf7ca5f
+SIZE (fcambus-ansiweather-1.02_GH0.tar.gz) = 5763
diff --git a/misc/ansiweather/files/patch-ansiweather b/misc/ansiweather/files/patch-ansiweather
new file mode 100644
index 000000000000..b2abb9796724
--- /dev/null
+++ b/misc/ansiweather/files/patch-ansiweather
@@ -0,0 +1,38 @@
+--- ansiweather.orig 2015-07-03 01:51:59 UTC
++++ ansiweather
+@@ -203,8 +203,8 @@ then
+ do
+ days+=("$(echo $weather | jq ".list[$i]")")
+ dates+=("$(epoch_to_date $(echo ${days[$i]} | jq -r '.dt'))")
+- lows+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.min'))")
+- highs+=("$(printf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.max'))")
++ lows+=("$(gprintf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.min'))")
++ highs+=("$(gprintf "%0.0f" $(echo ${days[$i]} | jq -r '.temp.max'))")
+ humidity+=("$(echo ${days[$i]} | jq -r '.humidity')")
+ pressure+=("$(echo ${days[$i]} | jq -r '.pressure')")
+ sky+=("$(echo ${days[$i]} | jq -r '.weather[0].main')")
+@@ -213,7 +213,7 @@ then
+ done
+ else
+ city=$(echo $weather | jq -r '.name')
+- temperature=$(printf '%.0f' $(echo $weather | jq '.main.temp'))
++ temperature=$(gprintf '%.0f' $(echo $weather | jq '.main.temp'))
+ humidity=$(echo $weather | jq '.main.humidity')
+ pressure=$(echo $weather | jq '.main.pressure')
+ sky=$(echo $weather | jq -r '.weather[0].main')
+@@ -293,13 +293,13 @@ case $units in
+ scale="°C"
+ speed_unit="m/s"
+ pressure_unit="hPa"
+- pressure=$(printf '%.0f' $pressure)
++ pressure=$(gprintf '%.0f' $pressure)
+ ;;
+ imperial)
+ scale="°F"
+ speed_unit="mph"
+ pressure_unit="inHg"
+- pressure=$(printf '%.2f' $(echo "$pressure*0.0295" | bc))
++ pressure=$(gprintf '%.2f' $(echo "$pressure*0.0295" | bc))
+ ;;
+ esac
+
diff --git a/misc/ansiweather/files/pkg-message.in b/misc/ansiweather/files/pkg-message.in
new file mode 100644
index 000000000000..492269d879cc
--- /dev/null
+++ b/misc/ansiweather/files/pkg-message.in
@@ -0,0 +1,9 @@
+************************************************************************
+
+ The default config file is ~/.ansiweatherrc. The environment variable
+ ANSIWEATHERRC can be set to override this.
+
+ The file %%EXAMPLESDIR%%/ansiweatherrc.example
+ contains all available configuration variables.
+
+************************************************************************
diff --git a/misc/ansiweather/pkg-descr b/misc/ansiweather/pkg-descr
new file mode 100644
index 000000000000..611893ddb693
--- /dev/null
+++ b/misc/ansiweather/pkg-descr
@@ -0,0 +1,6 @@
+AnsiWeather is a Shell script for displaying the current weather conditions
+in your terminal, with support for ANSI colors and Unicode symbols.
+
+Weather data comes from the OpenWeatherMap free weather API.
+
+WWW: https://github.com/fcambus/ansiweather/
diff --git a/misc/ansiweather/pkg-plist b/misc/ansiweather/pkg-plist
new file mode 100644
index 000000000000..fbede022c9b5
--- /dev/null
+++ b/misc/ansiweather/pkg-plist
@@ -0,0 +1,5 @@
+bin/ansiweather
+%%DATADIR%%/ansiweather.plugin.zsh
+%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ansiweatherrc.example