# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	owfs
#	owfs/pkg-plist
#	owfs/distinfo
#	owfs/Makefile.options
#	owfs/Makefile
#	owfs/files
#	owfs/files/patch-module-owlib-src-include-ow.h
#	owfs/files/patch-src-man-Makefile.am
#	owfs/files/patch-semaphore-protection
#	owfs/pkg-descr
#
echo c - owfs
mkdir -p owfs > /dev/null 2>&1
echo x - owfs/pkg-plist
sed 's/^X//' >owfs/pkg-plist << '5088e4b1bec25b51f12a498bdf84adff'
X%%OWSHELL%%bin/owdir
X%%OWSHELL%%bin/owexist
Xbin/owexternal
X%%OWFS%%bin/owfs
X%%OWFTPD%%bin/owftpd
X%%OWSHELL%%bin/owget
X%%OWHTTPD%%bin/owhttpd
X%%OWMON%%bin/owmon
X%%OWSHELL%%bin/owpresent
X%%OWSHELL%%bin/owread
X%%OWSERVER%%bin/owserver
X%%OWTAP%%bin/owtap
X%%OWSHELL%%bin/owwrite
X%%OWCAPI%%include/owcapi.h
Xinclude/owfs_config.h
X%%OWNET%%include/ownetapi.h
Xlib/libow-2.9.so
Xlib/libow-2.9.so.1
Xlib/libow.la
Xlib/libow.so
X%%OWCAPI%%lib/libowcapi-2.9.so
X%%OWCAPI%%lib/libowcapi-2.9.so.1
X%%OWCAPI%%lib/libowcapi.la
X%%OWCAPI%%lib/libowcapi.so
X%%OWNET%%lib/libownet-2.9.so
X%%OWNET%%lib/libownet-2.9.so.1
X%%OWNET%%lib/libownet.la
X%%OWNET%%lib/libownet.so
X%%OWTCL%%lib/owtcl-1.0/ow-1.0.so
X%%OWTCL%%lib/owtcl-1.0/ow.la
X%%OWTCL%%lib/owtcl-1.0/ow.so
X%%OWTCL%%lib/owtcl-1.0/ow.tcl
X%%OWTCL%%lib/owtcl-1.0/pkgIndex.tcl
X%%OWTCL%%@dirrm lib/owtcl-1.0/pkgIndex.tcl
Xman/man1/libowcapi.1.gz
Xman/man1/libownet.1.gz
Xman/man1/owcapi.1.gz
Xman/man1/owdir.1.gz
Xman/man1/owfs.1.gz
Xman/man1/owftpd.1.gz
Xman/man1/owget.1.gz
Xman/man1/owhttpd.1.gz
Xman/man1/owmon.1.gz
Xman/man1/ownet.1.gz
Xman/man1/ownetapi.1.gz
Xman/man1/ownetlib.1.gz
Xman/man1/owpresent.1.gz
Xman/man1/owread.1.gz
Xman/man1/owserver.1.gz
Xman/man1/owshell.1.gz
Xman/man1/owtap.1.gz
Xman/man1/owwrite.1.gz
Xman/man3/DS1427.3.gz
Xman/man3/DS1821.3.gz
Xman/man3/DS1822.3.gz
Xman/man3/DS1825.3.gz
Xman/man3/DS18B20.3.gz
Xman/man3/DS18S20.3.gz
Xman/man3/DS1904.3.gz
Xman/man3/DS1920.3.gz
Xman/man3/DS1921.3.gz
Xman/man3/DS1963L.3.gz
Xman/man3/DS1963S.3.gz
Xman/man3/DS1971.3.gz
Xman/man3/DS1977.3.gz
Xman/man3/DS1982.3.gz
Xman/man3/DS1982U.3.gz
Xman/man3/DS1985.3.gz
Xman/man3/DS1985U.3.gz
Xman/man3/DS1986.3.gz
Xman/man3/DS1986U.3.gz
Xman/man3/DS1990A.3.gz
Xman/man3/DS1991.3.gz
Xman/man3/DS1992.3.gz
Xman/man3/DS1993.3.gz
Xman/man3/DS1994.3.gz
Xman/man3/DS1995.3.gz
Xman/man3/DS1996.3.gz
Xman/man3/DS2401.3.gz
Xman/man3/DS2404.3.gz
Xman/man3/DS2404S.3.gz
Xman/man3/DS2405.3.gz
Xman/man3/DS2406.3.gz
Xman/man3/DS2407.3.gz
Xman/man3/DS2408.3.gz
Xman/man3/DS2409.3.gz
Xman/man3/DS2411.3.gz
Xman/man3/DS2413.3.gz
Xman/man3/DS2415.3.gz
Xman/man3/DS2417.3.gz
Xman/man3/DS2423.3.gz
Xman/man3/DS2430A.3.gz
Xman/man3/DS2431.3.gz
Xman/man3/DS2433.3.gz
Xman/man3/DS2436.3.gz
Xman/man3/DS2437.3.gz
Xman/man3/DS2438.3.gz
Xman/man3/DS2450.3.gz
Xman/man3/DS2502-E48.3.gz
Xman/man3/DS2502-UNW.3.gz
Xman/man3/DS2502.3.gz
Xman/man3/DS2505-UNW.3.gz
Xman/man3/DS2505.3.gz
Xman/man3/DS2506-UNW.3.gz
Xman/man3/DS2506.3.gz
Xman/man3/DS2720.3.gz
Xman/man3/DS2740.3.gz
Xman/man3/DS2751.3.gz
Xman/man3/DS2755.3.gz
Xman/man3/DS2756.3.gz
Xman/man3/DS2760.3.gz
Xman/man3/DS2761.3.gz
Xman/man3/DS2762.3.gz
Xman/man3/DS2770.3.gz
Xman/man3/DS2780.3.gz
Xman/man3/DS2781.3.gz
Xman/man3/DS2788.3.gz
Xman/man3/DS2804.3.gz
Xman/man3/DS2890.3.gz
Xman/man3/DS28E04.3.gz
Xman/man3/DS28EA00.3.gz
Xman/man3/DS28EC20.3.gz
Xman/man3/EDS.3.gz
Xman/man3/EDS0064.3.gz
Xman/man3/EDS0065.3.gz
Xman/man3/EDS0066.3.gz
Xman/man3/EDS0067.3.gz
Xman/man3/EDS0068.3.gz
Xman/man3/EDS0071.3.gz
Xman/man3/EDS0072.3.gz
Xman/man3/EEEF.3.gz
Xman/man3/LCD.3.gz
Xman/man3/MAX31826.3.gz
Xman/man3/OWNet.3.gz
Xman/man3/Thermachron.3.gz
Xman/man3/UVI.3.gz
Xman/man3/mAM001.3.gz
Xman/man3/mCM001.3.gz
Xman/man3/mDI001.3.gz
Xman/man3/mRS001.3.gz
Xman/man3/owperl.3.gz
Xman/man5/owfs.5.gz
Xman/man5/owfs.conf.5.gz
Xman/mann/ow.n.gz
Xman/mann/owtcl.n.gz
5088e4b1bec25b51f12a498bdf84adff
echo x - owfs/distinfo
sed 's/^X//' >owfs/distinfo << '1dec9eef3594f19912bab51e88353781'
XSHA256 (owfs-2.9p1.tar.gz) = 9d22dbff72d235476688c02669f7171b23e21dffadf40bbdd3b8263908218424
XSIZE (owfs-2.9p1.tar.gz) = 1402336
1dec9eef3594f19912bab51e88353781
echo x - owfs/Makefile.options
sed 's/^X//' >owfs/Makefile.options << '5ea0e8e8eb89310d8f9e06877d22e9de'
XOPTIONS_DEFINE = DEBUG \
X	OWSHELL \
X	OWNETLIB \
X	I2C \
X	OWHTTPD \
X	OWFTPD \
X	OWSERVER \
X	OWTAP \
X	OWMALLOC \
X	OWTRAFFIC \
X	OWMON \
X	OWCAPI \
X	OWPERL \
X	OWPHP \
X	OWPYTHON \
X	OWTCL \
X	PROFILING \
X	OWFS \
X	ZERO \
X	USB \
X# Options disabled
X#	PARPORT	- linux/parport.h not available
X#	W1			- no support on FreeBSD
X
X
XDEBUG_DESC=		Enable debug-output
XOWSHELL_DESC=		Enable owshell support
XOWNETLIB_DESC=		Enable ownetlib support
XI2C_DESC=		Enable i2c (DS2482-x00) support
XOWHTTPD_DESC=		Enable owhttpd module
XOWFTPD_DESC=		Enable owftpd module
XOWSERVER_DESC=		Enable owserver module
XOWMALLOC_DESC=		Enable owmalloc checking
XOWTRAFFIC_DESC=		Enable bus traffic reports
XOWTAP_DESC=		Enable owtap module (X11)
XOWMON_DESC=		Enable owmon module (X11)
XOWCAPI_DESC=		Enable owcapi module
XOWPERL_DESC=		Enable owperl module (BROKEN)
XOWPHP_DESC=		Enable owphp module (BROKEN)
XOWPYTHON_DESC=		Enable owpython module (BROKEN)
XOWTCL_DESC=		Enable owtcl module
XPROFILING_DESC=		Enable profiling (BROKEN)
XOWFS_DESC=		Enable owfs module (FUSE support)
XZERO_DESC=		Enable zeroconf/bonjour
XUSB_DESC=		Enable 1-Wire usb DS2490 support
X#PARPORT_DESC=		Enable 1-Wire parallel port DS1410E support
X
X# Options disabled
X#W1_DESC=Enable w1 support
X
X
XOPTIONS_DEFAULT=DEBUG\
X	OWSHELL\
X	OWNETLIB\
X	OWHTTPD\
X	OWFTPD\
X	OWSERVER\
X	OWCAPI\
X	USB
X
X# Options disabled
X#					W1            "Enable w1 support" On
X
5ea0e8e8eb89310d8f9e06877d22e9de
echo x - owfs/Makefile
sed 's/^X//' >owfs/Makefile << '78f60c1d940cc68c11d6f085bcf88943'
XPORTNAME=      owfs
XPORTVERSION=   2.9p1
XCATEGORIES=    comms
XMASTER_SITES=  SF/owfs/owfs/${PORTVERSION}
X
XMAINTAINER=    johan@stromnet.se
XCOMMENT=       OWFS -- 1-Wire file system
X
XLICENSE=			GPLv2
X
XLIBTOOLIZE_ARGS=-c -f -i
XACLOCAL_ARGS= -I${LOCALBASE}/share/aclocal
X
XUSE_AUTOTOOLS=libtoolize aclocal autoheader autoconf automake
XAUTOMAKE_ARGS=--add-missing
X
XGNU_CONFIGURE=On
X
Xpre-configure:
X	mkdir -p ${WRKSRC}/m4
X# This takes a few seconds so give the user some notice
X	@echo "Preparing build using autotools..."
X
XPLIST_SUB=		OWFS_VERSION=${PORTVERSION}
X
XMAN1=          owfs.1 libowcapi.1 libownet.1 owcapi.1 owdir.1 \
X					owftpd.1 owget.1 owhttpd.1 owmon.1 \
X					ownet.1 ownetapi.1 ownetlib.1 owpresent.1 \
X					owread.1 owserver.1 owshell.1 owtap.1 owwrite.1
XMAN3=				DS1427.3 DS1821.3 DS1822.3 DS1825.3 DS18B20.3 \
X					DS18S20.3 DS1904.3 DS1920.3 DS1921.3 DS1963L.3 DS1963S.3 \
X					DS1971.3 DS1977.3 DS1982.3 DS1982U.3 DS1985.3 DS1985U.3 \
X					DS1986.3 DS1986U.3 DS1990A.3 DS1991.3 DS1992.3 DS1993.3 \
X					DS1994.3 DS1995.3 DS1996.3 DS2401.3 DS2404.3 DS2404S.3 \
X					DS2405.3 DS2406.3 DS2407.3 DS2408.3 DS2409.3 DS2411.3 \
X					DS2413.3 DS2415.3 DS2417.3 DS2423.3 DS2430A.3 DS2431.3 \
X					DS2433.3 DS2436.3 DS2437.3 DS2438.3 DS2450.3 DS2502-E48.3 \
X					DS2502-UNW.3 DS2502.3 DS2505-UNW.3 DS2505.3 DS2506-UNW.3 \
X					DS2506.3 DS2720.3 DS2740.3 DS2751.3 DS2755.3 DS2756.3 \
X					DS2760.3 DS2761.3 DS2762.3 DS2770.3 DS2780.3 DS2781.3 \
X					DS2788.3 DS2804.3 DS2890.3 DS28E04.3 DS28EA00.3 DS28EC20.3 \
X					EDS.3 EDS0064.3 EDS0065.3 EDS0066.3 EDS0067.3 EDS0068.3 \
X					EDS0071.3 EDS0072.3 EEEF.3 LCD.3 OWNet.3 Thermachron.3 \
X					UVI.3 owperl.3
X
XMAN5=			owfs.5 owfs.conf.5
XMANN=			ow.n owtcl.n
X
X.include "Makefile.options"
X
X.include <bsd.port.options.mk>
X
XCONFIGURE_ARGS+=		--enable-owlib
X
X.if ${PORT_OPTIONS:MDEBUG}
XCONFIGURE_ARGS+=    --enable-debug
X.else
XCONFIGURE_ARGS+=    --disable-debug
X.endif
X
X.if ${PORT_OPTIONS:MOWSHELL}
XCONFIGURE_ARGS+=		--enable-owshell
XPLIST_SUB+=	OWSHELL=""
X.else
XCONFIGURE_ARGS+=		--disable-owshell
XPLIST_SUB+=	OWSHELL="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWNETLIB}
XCONFIGURE_ARGS+=		--enable-ownetlib \
X							--enable-ownet
XPLIST_SUB+=	OWNET=""
X.else
XCONFIGURE_ARGS+=		--disable-ownetlib \
X							--disable-ownet
XPLIST_SUB+=	OWNET="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MI2C}
XCONFIGURE_ARGS+=		--enable-i2c
X.else
XCONFIGURE_ARGS+=		--disable-i2c
X.endif
X
X# Linux specific kernel driver
X#.if ${PORT_OPTIONS:MW1}
X#CONFIGURE_ARGS+=		--enable-w1
X#.else
XCONFIGURE_ARGS+=		--disable-w1
X#.endif
X
X.if ${PORT_OPTIONS:MOWHTTPD}
XCONFIGURE_ARGS+=		--enable-owhttpd
XPLIST_SUB+=	OWHTTPD=""
X.else
XCONFIGURE_ARGS+=		--disable-owhttpd
XPLIST_SUB+=	OWHTTPD="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWFTPD}
XCONFIGURE_ARGS+=		--enable-owftpd
XPLIST_SUB+=	OWFTPD=""
X.else
XCONFIGURE_ARGS+=		--disable-owftpd
XPLIST_SUB+=	OWFTPD="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWSERVER}
XCONFIGURE_ARGS+=		--enable-owserver
XPLIST_SUB+=	OWSERVER=""
X.else
XCONFIGURE_ARGS+=		--disable-owserver
XPLIST_SUB+=	OWSERVER="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWTAP}
XUSE_TK=yes
XUSE_TK_WRAPPER=yes
XCONFIGURE_ARGS+=		--enable-owtap
XPLIST_SUB+=	OWTAP=""
X.else
XCONFIGURE_ARGS+=		--disable-owtap
XPLIST_SUB+=	OWTAP="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWMALLOC}
XCONFIGURE_ARGS+=		--enable-owmalloc
X.else
XCONFIGURE_ARGS+=		--disable-owmalloc
X.endif
X
X.if ${PORT_OPTIONS:MOWTRAFFIC}
XCONFIGURE_ARGS+=		--enable-owtraffic
X.else
XCONFIGURE_ARGS+=		--disable-owtraffic
X.endif
X
X.if ${PORT_OPTIONS:MOWMON}
XUSE_TK=yes
XUSE_TK_WRAPPER=yes
XCONFIGURE_ARGS+=		--enable-owmon
XPLIST_SUB+=	OWMON=""
X.else
XCONFIGURE_ARGS+=		--disable-owmon
XPLIST_SUB+=	OWMON="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MOWCAPI}
XCONFIGURE_ARGS+=		--enable-owcapi
XPLIST_SUB+=	OWCAPI=""
X.else
XCONFIGURE_ARGS+=		--disable-owcapi
XPLIST_SUB+=	OWCAPI="@comment "
X.endif
X
XSWIG=0
X
X# BROKEN
X.if ${PORT_OPTIONS:MOWPERL}
XSWIG=1
XCONFIGURE_ARGS+=		--enable-owperl
X.else
XCONFIGURE_ARGS+=		--disable-owperl
X.endif
X
X# BROKEN
X.if ${PORT_OPTIONS:MOWPHP}
XSWIG=1
XCONFIGURE_ARGS+=		--enable-owphp
X.else
XCONFIGURE_ARGS+=		--disable-owphp
X.endif
X
X# BROKEN
X.if ${PORT_OPTIONS:MOWPYTHON}
XSWIG=1
XCONFIGURE_ARGS+=		--enable-owpython
X.else
XCONFIGURE_ARGS+=		--disable-owpython
X.endif
X
X.if ${SWIG}
XBUILD_DEPENDS+=${PREFIX}/bin/swig:${PORTSDIR}/devel/swig13
XCONFIGURE_ARGS+=		--enable-swig
X.else
XCONFIGURE_ARGS+=		--disable-swig
X.endif
X
X
X.if ${PORT_OPTIONS:MOWTCL}
XUSE_TCL=yes
X.include "${PORTSDIR}/Mk/bsd.tcl.mk"
XCONFIGURE_ARGS+=		--enable-owtcl --with-tcl=${TCL_LIBDIR}
XPLIST_SUB+=	OWTCL=""
X.else
XPLIST_SUB+=	OWTCL="@comment "
XCONFIGURE_ARGS+=		--disable-owtcl
X.endif
X
X.if ${PORT_OPTIONS:MPROFILING}
XCONFIGURE_ARGS+=		--enable-profiling
X# XXX Broken due to -lgcc_p 
X.else
XCONFIGURE_ARGS+=		--disable-profiling
X.endif
X
X.if ${PORT_OPTIONS:MOWFS}
XCONFIGURE_ARGS+=		--enable-owfs
XPLIST_SUB+=	OWFS=""
X# xxx: Not tested, it compiles and all but not sure if fusefs actually works on freebsd:
XLIB_DEPENDS+=libfuse.so:${PORTSDIR}/sysutils/fusefs-libs
X.else
XCONFIGURE_ARGS+=		--disable-owfs
XPLIST_SUB+=	OWFS="@comment "
X.endif
X
X.if ${PORT_OPTIONS:MZERO}
XCONFIGURE_ARGS+=		--enable-zero
X.else
XCONFIGURE_ARGS+=		--disable-zero
X.endif
X
X.if ${PORT_OPTIONS:MUSB}
XCONFIGURE_ARGS+=		--enable-usb
XLDFLAGS+=				-lusb
X.else
XCONFIGURE_ARGS+=		--disable-usb
X.endif
X
X#.if ${PORT_OPTIONS:MPARPORT}
X#CONFIGURE_ARGS+=		--enable-parport
X#.else
X#CONFIGURE_ARGS+=		--disable-parport
X#.endif
X
X.include <bsd.port.mk>
78f60c1d940cc68c11d6f085bcf88943
echo c - owfs/files
mkdir -p owfs/files > /dev/null 2>&1
echo x - owfs/files/patch-module-owlib-src-include-ow.h
sed 's/^X//' >owfs/files/patch-module-owlib-src-include-ow.h << '47ac863736f22a3112476a35e3849dbb'
X--- module/owlib/src/include/ow.h	2014-01-13 21:22:30.405395318 +0100
X+++ module/owlib/src/include/ow.h	2014-01-13 21:22:33.348974847 +0100
X@@ -79,6 +79,10 @@
X 
X #define _FILE_OFFSET_BITS   64
X 
X+#ifdef __FreeBSD__
X+#define __BSD_VISIBLE 1
X+#endif /* __FreeBSD__ */
X+
X #ifdef HAVE_FEATURES_H
X #include <features.h>
X #endif							/* HAVE_FEATURES_H */
X@@ -90,7 +94,6 @@
X #ifdef HAVE_SYS_TYPES_H
X #ifdef __FreeBSD__
X #include <sys/param.h>
X-#define __BSD_VISIBLE 1
X #endif /* __FreeBSD__ */
X #include <sys/types.h>			/* for stat */
X #endif							/* HAVE_SYS_TYPES_H */
47ac863736f22a3112476a35e3849dbb
echo x - owfs/files/patch-src-man-Makefile.am
sed 's/^X//' >owfs/files/patch-src-man-Makefile.am << 'a7e471859ec2759d38bd0f1accf659c7'
X--- src/man/Makefile.am	2014-01-08 22:31:27.030827375 +0100
X+++ src/man/Makefile.am	2014-01-08 22:31:51.023750454 +0100
X@@ -38,29 +38,34 @@
X            ow.n
X EXTRA_DIST = ${man_MANS} *.?so
X 
X-install-data-am: install-man install-so-man
X+install-data-am: install-man
X 
X-install-so-man:
X-	for i in $(man_MANS); do \
X-	    case $$i in \
X-		*.1*) mandirr=$(man1dir) ;; \
X-		*.3*) mandirr=$(man3dir) ;; \
X-		*.5*) mandirr=$(man5dir) ;; \
X-		*.n*) mandirr=$(manndir) ;; \
X-	    esac; \
X-        i=$$mandirr/$$i; \
X-        list="$$list $$i"; \
X-	done; \
X-	for manfile in $$list; do \
X-	    for i in `sed -n '2,$$ s/^.so //p' $(DESTDIR)$$manfile | tac`; do \
X-			printf "%s\n" H /$$i/d - ".r $(srcdir)/$$i" g/^.\\\\\"/d ",w" | ed -s $(DESTDIR)$$manfile ; \
X-	    done; \
X-	done; \
X-	for manfile in $$list; do \
X-	    for i in `sed -n '2,$$ s/^.so //p' $(DESTDIR)$$manfile | tac`; do \
X-			printf "%s\n" H /$$i/d - ".r $(srcdir)/$$i" g/^.\\\"/d ",w" | ed -s $(DESTDIR)$$manfile ; \
X-	    done; \
X-	done
X+# FreeBSD patch: this -so-man thingy seems to go through
X+# all MAN files and remove lines starting with .so, but this does not
X+# work on FreeBSD. However, it is not required anyway (our man does not show these lines at least?)
X+# so lets just skip it.
X+#install-data-am: install-man install-so-man
X+#install-so-man:
X+#	for i in $(man_MANS); do \
X+#	    case $$i in \
X+#		*.1*) mandirr=$(man1dir) ;; \
X+#		*.3*) mandirr=$(man3dir) ;; \
X+#		*.5*) mandirr=$(man5dir) ;; \
X+#		*.n*) mandirr=$(manndir) ;; \
X+#	    esac; \
X+#        i=$$mandirr/$$i; \
X+#        list="$$list $$i"; \
X+#	done; \
X+#	for manfile in $$list; do \
X+#	    for i in `sed -n '2,$$ s/^.so //p' $(DESTDIR)$$manfile | tac`; do \
X+#			printf "%s\n" H /$$i/d - ".r $(srcdir)/$$i" g/^.\\\\\"/d ",w" | ed -s $(DESTDIR)$$manfile ; \
X+#	    done; \
X+#	done; \
X+#	for manfile in $$list; do \
X+#	    for i in `sed -n '2,$$ s/^.so //p' $(DESTDIR)$$manfile | tac`; do \
X+#			printf "%s\n" H /$$i/d - ".r $(srcdir)/$$i" g/^.\\\"/d ",w" | ed -s $(DESTDIR)$$manfile ; \
X+#	    done; \
X+#	done
X 
X clean-generic:
X 
a7e471859ec2759d38bd0f1accf659c7
echo x - owfs/files/patch-semaphore-protection
sed 's/^X//' >owfs/files/patch-semaphore-protection << '3027132e397d3d6e2e6ce5c2d0a6b8e5'
X--- module/owlib/src/include/ow_mutexes.h	2014-01-08 23:38:33.877608744 +0100
X+++ module/owlib/src/include/ow_mutexes.h	2014-01-08 23:39:20.494256703 +0100
X@@ -91,6 +91,8 @@
X #define _MUTEX_LOCK(mut)	my_pthread_mutex_lock(   &(mut) )
X #define _MUTEX_UNLOCK(mut)	my_pthread_mutex_unlock( &(mut) )
X 
X+#define _SEM_INIT(sem, shared, value)	my_sem_init(  &(sem) , (shared), (value) )
X+
X #define RWLOCK_INIT(rw)		my_rwlock_init(    &(rw) )
X #define RWLOCK_DESTROY(rw)	my_rwlock_destroy( &(rw) )
X 
X--- module/owlib/src/include/ow_debug.h	2014-01-08 23:36:54.971333111 +0100
X+++ module/owlib/src/include/ow_debug.h	2014-01-09 00:11:28.239222886 +0100
X@@ -105,6 +105,16 @@
X #define SNvar(sn)	(sn)[0],(sn)[1],(sn)[2],(sn)[3],(sn)[4],(sn)[5],(sn)[6],(sn)[7]
X 
X /* Need to define those functions to get FILE and LINE information */
X+extern const char  sem_init_failed[];
X+// FreeBSD note: if we continue with failed semaphores, we WILL segfault later on.
X+#define my_sem_init(sem, shared, value)              do {\
X+	int mrc = sem_init(sem, shared, value);	            \
X+	if(mrc != 0) { fprintf(stderr, sem_init_failed,        errno, strerror(errno)); \
X+		if(errno == 28) \
X+			fprintf(stderr, "Too many semaphores running, please run "\
X+					"fewer apps utilizing semaphores (owfs apps for example), or tweak sysctl kern.ipc.sem*. Exiting.\n"); \
X+		exit(1);			\
X+	}} while(0)
X 
X extern const char  mutex_init_failed[];
X #define my_pthread_mutex_init(mutex, attr)              do {\
X--- module/owlib/src/c/ow_rwlock.c	2014-01-08 23:39:23.037943786 +0100
X+++ module/owlib/src/c/ow_rwlock.c	2014-01-08 23:39:37.853583768 +0100
X@@ -18,8 +18,8 @@
X void my_rwlock_init(my_rwlock_t * my_rwlock)
X {
X 	_MUTEX_INIT(my_rwlock->protect_reader_count);
X-	sem_init(&(my_rwlock->allow_readers), 0, 1);
X-	sem_init(&(my_rwlock->no_processes), 0, 1);
X+	_SEM_INIT(my_rwlock->allow_readers, 0, 1);
X+	_SEM_INIT(my_rwlock->no_processes, 0, 1);
X 	my_rwlock->reader_count = 1;
X }
X 
X--- module/owlib/src/c/error.c	2014-01-08 23:48:34.177647607 +0100
X+++ module/owlib/src/c/error.c	2014-01-08 23:48:51.042485621 +0100
X@@ -30,6 +30,7 @@
X 
X /* module/ownet/c/src/c/error.c & module/owlib/src/c/error.c are identical */
X 
X+const char sem_init_failed[] = "sem_init failed rc=%d [%s]\n";
X const char mutex_init_failed[] = "mutex_init failed rc=%d [%s]\n";
X const char mutex_destroy_failed[] = "mutex_destroy failed rc=%d [%s]\n";
X const char mutex_lock_failed[] = "mutex_lock failed rc=%d [%s]\n";
X
3027132e397d3d6e2e6ce5c2d0a6b8e5
echo x - owfs/pkg-descr
sed 's/^X//' >owfs/pkg-descr << 'fa5a957eb56e5fde7ffc9fbd48ab6ba4'
XOWFS -- 1-Wire file system.
XOWFS is an easy way to use the powerful 1-wire system of Dallas/Maxim.
X
XOWFS is a simple and flexible program to monitor and control the physical
Xenvironment. You can write scripts to read temperature, flash lights, write
Xto an LCD, log and graph, ...
X
XWWW: http://www.owfs.org/
fa5a957eb56e5fde7ffc9fbd48ab6ba4
exit

