Index: head/astro/fowsr/Makefile =================================================================== --- head/astro/fowsr/Makefile (revision 422420) +++ head/astro/fowsr/Makefile (revision 422421) @@ -1,33 +1,32 @@ # Created by: Alexander Leidinger # $FreeBSD$ PORTNAME= fowsr -PORTVERSION= ${FILEVER}.${FILEDATE} +PORTVERSION= ${FILEVER} CATEGORIES= astro -MASTER_SITES= GOOGLE_CODE -DISTNAME= fowsr-${FILEVER}-${FILEDATE} - +DISTNAME= fowsr-${FILEVER} +USE_GITHUB= yes +GH_ACCOUNT= apachler +GH_PROJECT= fowsr +GH_TAGNAME= 571db38 MAINTAINER= netchild@FreeBSD.org COMMENT= Fine Offset Weather Station Reader LICENSE= GPLv3 -BROKEN= Unfetchable (google code has gone away) - -FILEVER= 1.0 -FILEDATE= 20100718 -WRKSRC= ${WRKDIR}/${PORTNAME}-${FILEVER} +FILEVER= 2.0 +WRKSRC= ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}/${PORTNAME}.src USES= gmake dos2unix PLIST_FILES= bin/fowsr post-patch: ${REINPLACE_CMD} 's:gcc:${CC}:g' ${WRKSRC}/Makefile ${REINPLACE_CMD} 's:/usr/bin/fowsr:fowsr:g ; s://var//://var/tmp//:g' \ ${WRKSRC}/*.sh ${WRKSRC}/fowsr.c do-install: ${INSTALL_PROGRAM} ${WRKSRC}/fowsr ${STAGEDIR}${PREFIX}/bin/ .include Index: head/astro/fowsr/distinfo =================================================================== --- head/astro/fowsr/distinfo (revision 422420) +++ head/astro/fowsr/distinfo (revision 422421) @@ -1,2 +1,3 @@ -SHA256 (fowsr-1.0-20100718.tar.gz) = ec43baea6bfe4523f8b5badd62c0adea239012a9bdd4c0d4d0c3fbc1a3e6ecbb -SIZE (fowsr-1.0-20100718.tar.gz) = 35716 +TIMESTAMP = 1474280139 +SHA256 (fowsr-2.0_GH0.tar.gz) = ae18078b948037576217f83cbb86287f38e30e4f3a425b6cf8e6f891b43e0623 +SIZE (fowsr-2.0_GH0.tar.gz) = 24288 Index: head/astro/fowsr/files/patch-fowsr.c =================================================================== --- head/astro/fowsr/files/patch-fowsr.c (revision 422420) +++ head/astro/fowsr/files/patch-fowsr.c (revision 422421) @@ -1,43 +1,18 @@ ---- fowsr.c.orig 2016-07-26 12:57:00 UTC +--- fowsr.c.orig 2016-09-18 13:31:19 UTC +++ fowsr.c -@@ -110,13 +110,17 @@ int CUSB_Open(int vendor, int product) - - signal(SIGTERM, release_usb_device); - -+#ifdef LIBUSB_HAS_GET_DRIVER_NP - ret = usb_get_driver_np(devh, 0, buf, sizeof(buf)); - printf("usb_get_driver_np returned %d\n", ret); - if (ret == 0) { - printf("interface 0 already claimed by driver \\'%s\\', attempting to detach it\n", buf); -+#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP - ret = usb_detach_kernel_driver_np(devh, 0); - printf("usb_detach_kernel_driver_np returned %d\n", ret); -+#endif - } -+#endif - ret = usb_claim_interface(devh, 0); - if (ret != 0) { - printf("claim failed with error %d\n", ret); -@@ -159,12 +163,14 @@ void CWS_Cache(char isStoring) - FILE* f; - if (isStoring == ISREADING) { +@@ -321,6 +321,7 @@ void CWS_Cache(char isStoring) + + if (isStoring == WS_CACHE_READ) { if (f=fopen(fname,"rb")) { -+ printf("using cache file %s\n", fname); ++ printf("using cache file %s\n", fname); n=fread(&m_previous_timestamp,sizeof(m_previous_timestamp),1,f); n=fread(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); } - print_bytes((char *)&m_previous_timestamp, sizeof(time_t)); - } else { // ISWRITING - if (f=fopen(fname,"wb")) { -+ printf("updating cache file %s\n", fname); - n=fwrite(&m_timestamp,sizeof(m_timestamp),1,f); - n=fwrite(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); - } -@@ -566,6 +572,7 @@ int CWF_Write(char arg,char* fname) +@@ -691,6 +692,7 @@ int CWF_Write(char arg, const char* fnam + f = fopen(s1,"a+t"); + if(!f) + return -1; ++ printf("writing to %s\n", s1); + } - FILE* f; - if (f=fopen(fname,"a+s")) { -+ printf("writing to %s\n", fname); - - // Header - switch (arg) { + if((old_pos==0)||(old_pos==0xFFFF)) //cachefile empty or empty eeprom was read Index: head/astro/fowsr/pkg-descr =================================================================== --- head/astro/fowsr/pkg-descr (revision 422420) +++ head/astro/fowsr/pkg-descr (revision 422421) @@ -1,23 +1,25 @@ fowsr is an application that reads from wireless weather stations * WH1080 / WH1081 / WH1090 / WH1091 / WH2080 / WH2081 * Watson W-8681 * Scientific Sales Pro Touch Screen Weather Station * TOPCOM NATIONAL GEOGRAPHIC 265NE * PCE-FWS 20 * ... and other similar USB devices from Fine Offset Electronics Co., LTD. compatible with the EasyWeather application . The result is a weather history log file that can be uploaded to a central server for further processing. Example script files for uploads is included. So far the following formats are supported: * Weather Underground * pywws * XML fowsr performs a complete read out of the weather station memory using its USB port, and stores the result in a cache file to speed up later read-outs. Rain data is then calculated per hour, day, week and month if data for these periods exist. No further data processing is performed. This makes fowsr very small and well suited for running in embedded devices at remote locations. + +WWW: https://github.com/apachler/fowsr