%global debug_package %{nil} Name: weewx Version: 4.4.0 Release: 3%{?dist} Summary: Weather station software License: GPLv3 URL: http://www.weewx.com/ Source0: http://www.weewx.com/downloads/weewx-%{version}.tar.gz Source1: weewx-%{version}-systemd.service Patch0: weewx-%{version}-fedora.patch %{?systemd_requires} BuildRequires: systemd BuildRequires: systemd-units BuildRequires: python3 BuildRequires: python3-rpm-macros Requires: python3dist(joblib) Requires: python3dist(configobj) Requires: python3dist(olefile) Requires: python3dist(pillow) Requires: python3dist(pyserial) Requires: python3dist(pyusb) Requires: python3dist(cheetah3) Requires: python3dist(ephem) %description WeeWX is a free, open source, software program, written in Python, which interacts with your weather station to produce graphs, reports, and HTML pages. It can optionally publish to weather sites or web servers. It uses modern software concepts, making it simple, robust, and easy to extend. Key features: - Support for many popular weather stations - Uploads to popular weather sites including WeatherUnderground, PWSweather.com, CWOP, WOW, and AWEKAS and others - Easy package install for Debian (Ubuntu), Red Hat (CentOS) and SUSE users - Uploads to your website using FTP or rsync - Extensive celestial almanac - Ability to create or modify skins (the look and feel of your weather site) - Support for localization - Simple, but extensible templating system - Native support for US or Metric unit systems - Support for sqlite or MySQL databases - Runs under either Python 2 or Python 3 - Calibration corrections - Filtering of anomalous values - An easy to understand, simple, extensible micro-kernel architecture - Ability to extend WeeWX with new services and reports %prep %autosetup -p1 %build %py3_build %install rm -rf $RPM_BUILD_ROOT # py3_install -- --no-prompt # horrible setup.py script. Place files manually mkdir -p $RPM_BUILD_ROOT/%{_bindir} mkdir -p $RPM_BUILD_ROOT/%{_datadir}/weewx mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/weewx mkdir -p $RPM_BUILD_ROOT/%{_var}/lib/weewx mkdir -p $RPM_BUILD_ROOT/%{_var}/www/html/weewx mkdir -p $RPM_BUILD_ROOT/%{_unitdir} cp -r build/scripts*/* $RPM_BUILD_ROOT/%{_datadir}/weewx/ cp -r build/lib/* $RPM_BUILD_ROOT/%{_datadir}/weewx/ cp -r skins $RPM_BUILD_ROOT/%{_datadir}/weewx/ cp weewx.conf $RPM_BUILD_ROOT/%{_sysconfdir}/weewx/weewx.conf.dist cp %SOURCE1 $RPM_BUILD_ROOT/%{_unitdir}/weewx.service # Build startup wrapper for each python app for APP in build/scripts*/* do APP=${APP##*/} cat <$RPM_BUILD_ROOT/%{_bindir}/${APP} #!/bin/sh # Get the weewx location and interpreter. Default to something sane, but # look for overrides from the system defaults. WEEWX_BINDIR=%{_datadir}/weewx WEEWX_PYTHON=python3 [ -r /etc/default/weewx ] && . /etc/default/weewx \$WEEWX_PYTHON \$WEEWX_BINDIR/$APP \$* EOF done %post %systemd_post weewx.service %preun %systemd_preun weewx.service %postun %systemd_postun_with_restart weewx.service %files %license LICENSE.txt %doc README.md docs examples util/udev %config %dir %{_sysconfdir}/weewx/ %config(noreplace) %{_sysconfdir}/weewx/* %attr(0755, root, root) %{_bindir}/* %{_datadir}/weewx %{_unitdir}/*.service %dir %{_var}/lib/weewx %dir %{_var}/www/html/weewx %changelog * Tue Feb 9 2021 Greg Wildman - 4.4.0-3 - Update to new version. - fix requirements for build. * Tue Oct 6 2020 Greg Wildman - 4.1.1-1 - Initial spec.