joe: moved to github
[packages.git] / utils / wview / Makefile
1 #
2 # Copyright (C) 2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=wview
11 PKG_VERSION:=5.19.0-jgoerzen
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)-r2
13 PKG_SOURCE_URL:=git://github.com/jgoerzen/wview.git
14 PKG_SOURCE_VERSION:=7bfac6c11e756290c38e7b5862a4c51b6bc6c51e
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
17
18 PKG_FIXUP:=autoreconf
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/wview
23   SECTION:=utils
24   CATEGORY:=Utilities
25   DEPENDS:=+libcurl +zlib +libpng +libgd +libreadline +libsqlite3 +libusb-1.0 +radlib +sqlite3-cli +libopenssl
26   TITLE:=Wview Weather Station Software
27   URL:=http://www.wviewweather.com/
28 endef
29
30 define Package/wview/description
31   Wview is a collection of linux/unix daemons which interface with a supported
32   weather station to retrieve archive records (if generated by the station) and
33   current conditions. If the station does not generate archive records
34   internally, wview will auto-generate archive records based on the sensor
35   readings collected for that interval. The archive records and High/Low (HILOW)
36   data are stored in SQLite3 databases. At a configurable interval, wview will
37   utilize the archive history and current conditions to generate weather images
38   (buckets, dials and graphs) and HTML web pages based on user-configurable HTML
39   templates.
40
41   After install you need to create a directory holding archive and create the
42   database there by running there
43     sqlite3 wview-archive.sdb '.read /etc/wview/wview-archive.sql'
44
45   Then copy all your theme files to the appropriate place (on a non-volatile
46   storage), and html-templates.conf to /etc/wview/; then wviewconfig to configure
47   the system.
48
49   Read and amend /etc/init.d/wview appropriately for your particular setup!
50 endef
51
52 define Package/wview/prerm
53 #!/bin/sh
54 if [ -z "$${IPKG_INSTROOT}" ]; then
55         echo "Removing rc.d symlink for wview"
56         /etc/init.d/wview disable
57 fi
58 exit 0
59 endef
60
61 define Package/wview/install
62         $(INSTALL_DIR) $(1)/usr/bin
63         $(INSTALL_BIN) $(PKG_BUILD_DIR)/cwop/wvcwopd $(1)/usr/bin/wvcwopd
64         $(INSTALL_BIN) $(PKG_BUILD_DIR)/http/wvhttpd $(1)/usr/bin/wvhttpd
65         $(INSTALL_BIN) $(PKG_BUILD_DIR)/procmon/wvpmond $(1)/usr/bin/wvpmond
66         $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/hilowcreate/hilowcreate $(1)/usr/bin/hilowcreate
67         $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/sqlite2wlk/sqlite2wlk $(1)/usr/bin/sqlite2wlk
68         $(INSTALL_BIN) $(PKG_BUILD_DIR)/htmlgenerator/htmlgend $(1)/usr/bin/htmlgend
69         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/vpconfig/vpinstall $(1)/usr/bin/vpinstall
70         $(INSTALL_BIN) $(PKG_BUILD_DIR)/ftp/wviewftpd $(1)/usr/bin/wviewftpd
71         $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssh/wviewsshd $(1)/usr/bin/wviewsshd
72         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/Virtual/wviewd_virtual $(1)/usr/bin/wviewd_virtual
73         $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/archive-be2le/arc_be2le $(1)/usr/bin/arc_be2le
74         $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/archive-le2be/arc_le2be $(1)/usr/bin/arc_le2be
75         $(INSTALL_BIN) $(PKG_BUILD_DIR)/alarms/wvalarmd $(1)/usr/bin/wvalarmd
76         $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/wlk2sqlite/wlk2sqlite $(1)/usr/bin/wlk2sqlite
77         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/Simulator/wviewd_sim $(1)/usr/bin/wviewd_sim
78         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/TWI/wviewd_twi $(1)/usr/bin/wviewd_twi
79         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/wviewd_vpro $(1)/usr/bin/wviewd_vpro
80         $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewconfig $(1)/usr/bin/wviewconfig
81         $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewhtmlconfig $(1)/usr/bin/wviewhtmlconfig
82         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WH1080/wviewd_wh1080 $(1)/usr/bin/wviewd_wh1080
83         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WMR918/wviewd_wmr918 $(1)/usr/bin/wviewd_wmr918
84         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WS-2300/wviewd_ws2300 $(1)/usr/bin/wviewd_ws2300
85         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WMRUSB/wviewd_wmrusb $(1)/usr/bin/wviewd_wmrusb
86         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WXT510/wviewd_wxt510 $(1)/usr/bin/wviewd_wxt510
87         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/VantagePro/vpconfig/vpconfig $(1)/usr/bin/vpconfig
88         $(INSTALL_BIN) $(PKG_BUILD_DIR)/wviewconfig/wviewcleardata $(1)/usr/bin/wviewcleardata
89         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/TE923/wviewd_te923 $(1)/usr/bin/wviewd_te923
90         $(INSTALL_BIN) $(PKG_BUILD_DIR)/stations/WXT510/wxt510config/wxt510config $(1)/usr/bin/wxt510config
91         $(INSTALL_DIR) $(1)/etc/init.d
92         $(INSTALL_BIN) ./files/etc/init.d/wview $(1)/etc/init.d/
93         $(INSTALL_DIR) $(1)/etc/wview
94         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/wview-conf.sql $(1)/etc/wview/wview-conf.sql
95         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/graphics.conf $(1)/etc/wview/graphics.conf
96         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/post-generate.sh $(1)/etc/wview/post-generate.sh
97         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/images.conf $(1)/etc/wview/images.conf
98         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/images-user.conf $(1)/etc/wview/images-user.conf
99         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/arcrec-header.conf $(1)/etc/wview/arcrec-header.conf
100         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/pre-generate.sh $(1)/etc/wview/pre-generate.sh
101         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/wview-conf-update.sql $(1)/etc/wview/wview-conf-update.sql
102         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/conf/forecast.conf-no-forecast $(1)/etc/wview/forecast.conf-no-forecast
103         echo $(PKG_VERSION) > $(1)/etc/wview/wview-version
104         echo wviewd_sim > $(1)/etc/wview/wview-binary
105
106 # This should never be defined as the user is expected to manually install all the
107 # theme files he wants to an appropriate place and to specify that place in the config.
108 # Leaving here for the future reference to be able to prepare a full variant of the package
109 ifdef INSTALL_TEMPLATES
110         $(INSTALL_DIR) $(1)/etc/wview/html
111         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/Template-Skins-HOWTO.txt $(1)/etc/wview/html/Template-Skins-HOWTO.txt
112         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/parameterlist.htx $(1)/etc/wview/html/parameterlist.htx
113         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/parameterlist.txt $(1)/etc/wview/html/parameterlist.txt
114         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/awekas_wl.htx-metric $(1)/etc/wview/html/awekas_wl.htx-metric
115         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Current.htx $(1)/etc/wview/html/Current.htx
116         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/html-templates.conf $(1)/etc/wview/html/html-templates.conf
117         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Weekly.htx $(1)/etc/wview/html/Weekly.htx
118         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Monthly.htx $(1)/etc/wview/html/Monthly.htx
119         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/data.htx $(1)/etc/wview/html/data.htx
120         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index-day.htx $(1)/etc/wview/html/index-day.htx
121         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Yearly.htx $(1)/etc/wview/html/Yearly.htx
122         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Daily.htx $(1)/etc/wview/html/Daily.htx
123         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/almanac.htx $(1)/etc/wview/html/almanac.htx
124         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/header-big.incx $(1)/etc/wview/html/header-big.incx
125         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index.htx $(1)/etc/wview/html/index.htx
126         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/awekas_wl.htx-us $(1)/etc/wview/html/awekas_wl.htx-us
127         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/Current_Conditions.htx $(1)/etc/wview/html/Current_Conditions.htx
128         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/header.incx $(1)/etc/wview/html/header.incx
129         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/index-night.htx $(1)/etc/wview/html/index-night.htx
130         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/wxrss.xtx $(1)/etc/wview/html/wxrss.xtx
131         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/readings.incx $(1)/etc/wview/html/readings.incx
132         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/standard/nav-buttons.incx $(1)/etc/wview/html/nav-buttons.incx
133         $(INSTALL_DIR) $(1)/etc/wview/alarms
134         $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMax.sh $(1)/etc/wview/alarms/outtempMax.sh
135         $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMin.sh $(1)/etc/wview/alarms/outtempMin.sh
136         $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/alarms/outtempMaxEmail.sh $(1)/etc/wview/alarms/outtempMaxEmail.sh
137         $(INSTALL_DIR) $(1)/var/run/wview
138         $(INSTALL_DIR) $(1)/var/wview/img
139         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudy.gif $(1)/var/wview/img/fc-icon-partlycloudy.gif
140         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-rain.gif $(1)/var/wview/img/fc-icon-rain.gif
141         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/chart_bg.png $(1)/var/wview/img/chart_bg.png
142         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/dot_bg.png $(1)/var/wview/img/dot_bg.png
143         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-snowandrain.gif $(1)/var/wview/img/fc-icon-snowandrain.gif
144         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/Clouds.jpg $(1)/var/wview/img/Clouds.jpg
145         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/Clouds-blue.jpg $(1)/var/wview/img/Clouds-blue.jpg
146         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudyandsnow.gif $(1)/var/wview/img/fc-icon-partlycloudyandsnow.gif
147         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/dial_bg.png $(1)/var/wview/img/dial_bg.png
148         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-snow.gif $(1)/var/wview/img/fc-icon-snow.gif
149         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/bucket_bg.png $(1)/var/wview/img/bucket_bg.png
150         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-cloudy.gif $(1)/var/wview/img/fc-icon-cloudy.gif
151         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/django_bg.jpg $(1)/var/wview/img/django_bg.jpg
152         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-sunny.gif $(1)/var/wview/img/fc-icon-sunny.gif
153         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/fc-icon-partlycloudyandrain.gif $(1)/var/wview/img/fc-icon-partlycloudyandrain.gif
154         $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/html/chrome/static/above-clouds.jpg $(1)/var/wview/img/above-clouds.jpg
155
156 # These files and the directories should be created manually wherever the user is going to
157 # have her weather archive and the generated html files
158         $(INSTALL_DIR) $(1)/var/wview/img/NOAA
159         $(INSTALL_DIR) $(1)/var/wview/img/Archive
160         $(INSTALL_DIR) $(1)/var/wview/noaa
161         $(INSTALL_DIR) $(1)/var/wview/alarms
162         $(INSTALL_DIR) $(1)/var/wview/archive
163         $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/wview-archive.sql $(1)/var/wview/archive/wview-archive.sql
164         $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/readme.txt $(1)/var/wview/archive/readme.txt
165 endif
166         $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/archive/wview-archive.sql $(1)/etc/wview/wview-archive.sql
167 endef
168
169 $(eval $(call BuildPackage,wview))
170