%define php_extdir %{_libdir}/php/extensions/ Name: owfs Version: 2.9p5 Release: %mkrel 5 Summary: 1-Wire Virtual File System Group: System/Networking # libs %define owfslibmajor 5 %define owfslibname %mklibname %{name} %{owfslibmajor} # some parts licensed differently, see http://owfs.org/index.php?page=license License: GPLv2 URL: http://www.owfs.org/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: owserver.service Source2: owfs.service Source3: owhttpd.service Source4: owftpd.service Source5: owfs.tmpfiles # install into 'vendor' perl directories; not suitable for upstream Patch0: owfs-0001-install-into-vendor-perl-directories.patch # get php module to build and have the right name Patch1: owfs-2.9p5-php-module.patch Requires: %{owfslibname} = %{version}-%{release} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd %description OWFS is a user-space virtual file-system providing access to 1-Wire networks. %package -n %{owfslibname} Summary: Core library providing base functions to other OWFS modules Group: System/Libraries BuildRequires: automake BuildRequires: autoconf BuildRequires: libtool BuildRequires: libusb-devel %description -n %{owfslibname} %{owfslibname} is a core library providing base functions to other OWFS modules. %package capi Summary: C-API to develop third-part applications which access 1-Wire networks Group: Development/C Requires: %{owfslibname} = %{version}-%{release} %description capi %{name}-capi library on top of libow providing an easy API to develop third-party applications to access to 1-Wire networks. %package devel Summary: Files for development of OWFS applications Group: Development/C Requires: %{owfslibname} = %{version} %description devel This package contains the libraries and header files that are needed for developing OWFS applications. %package ownet Summary: C-API to develop third-part applications which access 1-Wire networks Group: Development/C Requires: %{owfslibname} = %{version}-%{release} %description ownet %{name}-ownet library provides an easy API to develop third-party applications to access to 1-Wire networks. It doesn't depend on owlib, and only supports remote-server connections. This library doesn't include any 1-wire adapter support, except server connections. %package fs Summary: Virtual file-system on top of %{owfslibname} providing access to 1-Wire networks Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: fuse >= 1.0 Requires: %{name}-server BuildRequires: fuse-devel >= 1.0 %description fs %{name}-fs is a virtual file-system on top of %{owfslibname} providing access to 1-Wire networks. %package httpd Summary: HTTP daemon providing access to 1-Wire networks Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: %{name}-server %description httpd %{name}-httpd is a HTTP daemon on top of %{name} providing access to 1-Wire networks. %package ftpd Summary: FTP daemon providing access to 1-Wire networks Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: %{name}-server %description ftpd %{name}-ftpd is a FTP daemon on top of %{name} providing access to 1-Wire networks. %package server Summary: Back-end server (daemon) for 1-wire control Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires(pre): shadow-utils %description server %{name}-server is the back-end component of the OWFS 1-wire bus control system. owserver arbitrates access to the bus from multiple client processes. The physical bus is usually connected to a serial or USB port, and other processes connect to owserver over network sockets (TCP port). Communication can be local or over a network. %package tap Summary: Packet sniffer for the owserver protocol Group: System/Networking Requires: tcl >= 8.1 Requires: %{name}-tcl = %{version}-%{release} %description tap %{name}-tap is a packet sniffer for the owserver protocol %package mon Summary: Statistics and settings monitor for owserver Group: System/Networking Requires: tcl >= 8.1 Requires: %{name}-tcl = %{version}-%{release} %description mon %{name}-mon is a graphical monitor of owserverâs status %package python Summary: Python interface for the 1-wire file-system Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: python >= 2.0 BuildRequires: swig BuildRequires: python-devel %{?filter_setup: %filter_provides_in %{python_sitearch}/.*\.so$ %filter_setup } %description python %{name}-python is a Python interface for the 1-wire file-system %package php Summary: PHP interface for the 1-wire file-system Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: php >= 4.3.0 Requires: php-cli >= 4.3.0 BuildRequires: swig BuildRequires: php-devel >= 4.3.0 BuildRequires: php-cli %description php %{name}-php is a php interface for the 1-wire file-system %package tcl Summary: Tcl interface for the 1-wire file-system Group: System/Networking Requires: %{owfslibname} = %{version}-%{release} Requires: tcl >= 8.1 BuildRequires: tcl-devel >= 8.1 %description tcl %{name}-tcl is a Tcl interface for the 1-wire file-system %package shell License: MIT Summary: Light weight shell access to owserver and the 1-wire file-system Group: System/Networking %description shell %{name}-shell is 5 small programs to easily access owserver (and thus the 1-wire system) from shell scripts. owdir, owread, owwrite, owget and owpresent. %prep %setup -q %apply_patches sed -i -e 's/) Makefile.PL/& INSTALLDIRS=vendor/' \ module/swig/perl5/Makefile.am \ module/ownet/perl5/Makefile.am %build autoreconf -fi %configure --disable-rpath --disable-owperl # deal with RPATH sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool # deal with unused-direct-shlib-dependency sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} # remove failed that won't be packaged rm -f %{buildroot}%{perl_archlib}/perllocal.pod rm -f %{buildroot}%{perl_archlib}/auto/OW/.packlist rm -f %{buildroot}%{perl_archlib}/auto/OWNet/.packlist rm -f %{buildroot}%{_libdir}/libow.la rm -f %{buildroot}%{_libdir}/libowcapi.la rm -f %{buildroot}%{_libdir}/libownet.la rm -f %{buildroot}%{php_extdir}/libowphp.la rm -f %{buildroot}%{_libdir}/tcl8.5/owtcl-*/ow.la rm -f %{buildroot}/usr/local/lib64/perl5/auto/OWNet/.packlist # install systemd unit files mkdir -p %{buildroot}%{_unitdir} cp -p %{SOURCE1} %{buildroot}%{_unitdir} cp -p %{SOURCE2} %{buildroot}%{_unitdir} cp -p %{SOURCE3} %{buildroot}%{_unitdir} cp -p %{SOURCE4} %{buildroot}%{_unitdir} # mount point creation mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf mkdir -p %{buildroot}/run install -d -m 0755 %{buildroot}/run/%{name}/ # provide loading script as the man page suggests using it cp -a module/swig/php/example/load_php_OW.php %{buildroot}%{_datarootdir}/php/ %pre server getent group ow >/dev/null || groupadd -r ow getent passwd ow >/dev/null || \ useradd -r -g ow -d /var/empty -s /sbin/nologin \ -c "1-wire file-system (OWFS) utilities account" ow exit 0 %post fs /bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf %_post_service owfs.service %post httpd %_post_service owhttpd.service %post ftpd %_post_service owftpd.service %post server %_post_service owserver.service %preun fs %_preun_service owfs.service %preun httpd %_preun_service owhttpd.service %preun ftpd %_preun_service owftpd.service %preun server %_preun_service owserver.service %files -n %{owfslibname} %doc README NEWS ChangeLog AUTHORS COPYING %{_libdir}/libow-*.so.%{owfslibmajor}* %{_mandir}/man3/*.3.* %{_mandir}/man5/owfs.5.* %{_mandir}/man5/owfs.conf.5.* %files devel %{_includedir}/owfs_config.h %{_includedir}/owcapi.h %{_includedir}/ownetapi.h %{_libdir}/libow.so %{_libdir}/libowcapi.so %{_libdir}/libownet.so %files capi %{_libdir}/libowcapi-*.so* %{_mandir}/man1/*owcapi.1.* %files ownet %{_libdir}/libownet-*.so* %{_mandir}/man1/*ownet*.1.* %files fs %{_bindir}/owfs %{_mandir}/man1/owfs.1.* %{_unitdir}/owfs.service %{_tmpfilesdir}/%{name}.conf %files httpd %{_bindir}/owhttpd %{_mandir}/man1/owhttpd.1.* %{_unitdir}/owhttpd.service %files shell %{_bindir}/owdir %{_bindir}/owexist %{_bindir}/owread %{_bindir}/owwrite %{_bindir}/owget %{_bindir}/owpresent %{_mandir}/man1/owshell.1.* %{_mandir}/man1/owdir.1.* %{_mandir}/man1/owread.1.* %{_mandir}/man1/owget.1.* %{_mandir}/man1/owpresent.1.* %{_mandir}/man1/owwrite.1.* %files ftpd %{_bindir}/owftpd %{_mandir}/man1/owftpd.1.* %{_unitdir}/owftpd.service %files server %{_bindir}/owserver %{_bindir}/owexternal %{_mandir}/man1/owserver.1.* %{_unitdir}/owserver.service %files tap %doc COPYING %{_bindir}/owtap %{_mandir}/man1/owtap.1.* %files mon %doc COPYING %{_bindir}/owmon %{_mandir}/man1/owmon.1.* %files python %dir %{python_sitearch}/ow %{python_sitearch}/ow/__init__.py* %attr(0755, -, -) %{python_sitearch}/ow/_OW.so %dir %{python_sitearch}/ownet %{python_sitearch}/ownet/__init__.py* %{python_sitearch}/ownet/connection.py* %{python_sitearch}/*.egg-info %files php %{php_extdir}/libowphp.so %{_datarootdir}/php/OWNet/ownet.php %{_datarootdir}/php/load_php_OW.php %files tcl %dir %{_libdir}/tcl8.5/owtcl-* %{_libdir}/tcl8.5/owtcl-*/* %{_mandir}/mann/owtcl.n.* %{_mandir}/mann/ow.n.* %changelog * Wed Feb 25 2015 tmb <tmb> 2.9p5-5.mga5 + Revision: 816992 - fix preun/post services * Wed Oct 15 2014 umeabot <umeabot> 2.9p5-4.mga5 + Revision: 745417 - Second Mageia 5 Mass Rebuild * Sat Sep 27 2014 tv <tv> 2.9p5-3.mga5 + Revision: 727530 - rebuild for missing pythoneggs deps * Tue Sep 16 2014 umeabot <umeabot> 2.9p5-2.mga5 + Revision: 683290 - Mageia 5 Mass Rebuild * Sun Jul 06 2014 pterjan <pterjan> 2.9p5-1.mga5 + Revision: 644072 - Add BuildRequires php-cli - Provide load_php_OW.php script - Don't own php extensions dir - Get php module to build - Update to 2.9p5 - Drop broken require on libusb,there is already an automatic one - Rebuild for new Python * Thu Dec 19 2013 tmb <tmb> 2.9p1-1.mga4 + Revision: 558919 - add groups - libify - import from fedora * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Tue Jul 09 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-4 - add BR: systemd * Wed Jul 03 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-3 - include main COPYING in -tap and -mon * Mon Jul 01 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-2 - deal with unused-direct-shlib-dependency * Thu Jun 20 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-1 - update to 2.9p1, dropping merged patches - remove perl-owfs bits from .spec, for now - correct python _OW.so perms 0775 -> 0755 * Thu Jun 13 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-4 - furher fixes: - BR: python2-devel for -python; drop -devel req - add tcl dep for owmon and owtap * Fri May 10 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-3 - use /run/owfs instead of /mnt/1wire (ref: https://lists.fedoraproject.org/pipermail/devel/2013-May/182420.html) * Mon May 06 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-2 - fix issues: - add Require: python-devel to python subpackage - synchronise ldconfig requires with glibc provides * Mon Mar 25 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-1 - initial package, based on work by Serg Oskin and Vadim Tkachenko