%{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)}
%{!?tcl_sitearch: %global tcl_sitearch %{_prefix}/%{_lib}/tcl%{tcl_version}}
Name: owfs
Version: 2.9p7
Release: 1%{?dist}
Summary: 1-Wire Virtual File System
# 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: owfs.tmpfiles
# install into 'vendor' perl directories; not suitable for upstream
Patch0: owfs-0001-install-into-vendor-perl-directories.patch
Requires: %{name}-libs%{?_isa} = %{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 libs
Summary: Core library providing base functions to other OWFS modules
Requires: libusb >= 0.1.6
BuildRequires: automake autoconf libtool
BuildRequires: libusb-devel
%description libs
%{name}-libs 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
Requires: %{name}-libs%{?_isa} = %{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
Requires: %{name}-libs%{?_isa} = %{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
Requires: %{name}-libs%{?_isa} = %{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 %{name}-libs providing access to 1-Wire networks
Requires: %{name}-libs%{?_isa} = %{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 %{name}-libs providing
access to 1-Wire networks.
%package httpd
Summary: HTTP daemon providing access to 1-Wire networks
Requires: %{name}-libs%{?_isa} = %{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
Requires: %{name}-libs%{?_isa} = %{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
Requires: %{name}-libs%{?_isa} = %{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.
%triggerun -- %{name}-server < 2.9p5.20140721git6d00fb1-1
# when coming from pre-socket activated version, we need to enable .socket
if /usr/bin/systemctl --quiet is-enabled owserver.service ; then
/usr/bin/systemctl --no-reload enable owserver.socket > /dev/null 2>&1 || :
fi
%package tap
Summary: Packet sniffer for the owserver protocol
Requires: tcl >= 8.1
Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
BuildRequires: zlib-devel
%description tap
%{name}-tap is a packet sniffer for the owserver protocol
%package mon
Summary: Statistics and settings monitor for owserver
Requires: tcl >= 8.1
Requires: %{name}-tcl%{?_isa} = %{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
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: python >= 2.0
BuildRequires: swig
BuildRequires: python2-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
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: php >= 4.3.0
Requires: php-cli >= 4.3.0
BuildRequires: swig
BuildRequires: php-devel >= 4.3.0
%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
Requires: %{name}-libs%{?_isa} = %{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
%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
# Perl dirs
%patch0 -p1
sed -i -e 's/) Makefile.PL/& INSTALLDIRS=vendor/' \
module/swig/perl5/Makefile.am \
module/ownet/perl5/Makefile.am
%build
%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}%{tcl_sitearch}/ow.la
rm -f %{buildroot}/usr/local/lib64/perl5/auto/OWNet/.packlist
# mount point creation
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
mkdir -p %{buildroot}/run
install -d -m 0755 %{buildroot}/run/%{name}/
%pre server
# TODO: migrate to systemd-sysusers when guidelines are ready
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 libs -p /sbin/ldconfig
%post capi -p /sbin/ldconfig
%post ownet -p /sbin/ldconfig
%post fs
/bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
%systemd_post owfs.service
%post httpd
%systemd_post owhttpd.service
%post ftpd
%systemd_post owftpd.service
%post server
%systemd_post owserver.service owserver.socket
%preun fs
%systemd_preun owfs.service
%preun httpd
%systemd_preun owhttpd.service
%preun ftpd
%systemd_preun owftpd.service
%preun server
%systemd_preun owserver.service owserver.socket
%postun libs -p /sbin/ldconfig
%postun capi -p /sbin/ldconfig
%postun ownet -p /sbin/ldconfig
%postun fs
%systemd_postun_with_restart owfs.service
%postun httpd
%systemd_postun_with_restart owhttpd.service
%postun ftpd
%systemd_postun_with_restart owftpd.service
%postun server
%systemd_postun_with_restart owserver.service owserver.socket
%files libs
%doc README NEWS ChangeLog AUTHORS COPYING
%{_libdir}/libow-*.so*
%{_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
%{_mandir}/man?/*
%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
%dir /run/owfs
%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
%{_unitdir}/owserver.socket
%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
%dir %{php_extdir}
%{php_extdir}/libowphp.so*
%{_datarootdir}/php/OWNet/ownet.php
%files tcl
%dir %{tcl_sitearch}/owtcl-*
%{tcl_sitearch}/owtcl-*/*
%{_mandir}/mann/owtcl.n.*
%{_mandir}/mann/ow.n.*
%changelog
* Wed Oct 08 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p7-1
- news upstream release
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p5.20140721git6d00fb1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Mon Jul 21 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p5.20140721git6d00fb1-1
- package snapshot
- use upstream systemd units
- enable owserver's socket activation
- fixed hardcoded tcl_sitearch, patch by Jaroslav Škarvada <jskarvad@redhat.com>
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.9p5-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86
* Thu May 15 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p5-1
- latest upstream release
* Tue Mar 25 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p3-1
- new upstream release
* Sun Feb 23 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p2-1
- new upstream release
* 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