fe067b8
%{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)}
fe067b8
%{!?tcl_sitearch: %global tcl_sitearch %{_prefix}/%{_lib}/tcl%{tcl_version}}
fe067b8
ea0ea31
Name:		owfs
24bfca7
Version:	2.9p7
24bfca7
Release:	1%{?dist}
86a1949
Summary:	1-Wire Virtual File System
86a1949
86a1949
# some parts licensed differently, see http://owfs.org/index.php?page=license
86a1949
License:	GPLv2
86a1949
URL:		http://www.owfs.org/
86a1949
Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
fe067b8
Source1:	owfs.tmpfiles
86a1949
# install into 'vendor' perl directories; not suitable for upstream
86a1949
Patch0:		owfs-0001-install-into-vendor-perl-directories.patch
86a1949
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires(post): systemd
86a1949
Requires(preun): systemd
86a1949
Requires(postun): systemd
86a1949
BuildRequires:	systemd
86a1949
86a1949
86a1949
%description
86a1949
OWFS is a user-space virtual file-system providing access to 1-Wire networks.
86a1949
86a1949
86a1949
%package libs
86a1949
Summary: Core library providing base functions to other OWFS modules
86a1949
86a1949
Requires: libusb >= 0.1.6
86a1949
BuildRequires: automake autoconf libtool
86a1949
BuildRequires: libusb-devel
86a1949
86a1949
%description libs
86a1949
%{name}-libs is a core library providing base functions to other OWFS modules.
86a1949
86a1949
86a1949
%package capi
86a1949
Summary: C-API to develop third-part applications which access 1-Wire networks
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
86a1949
%description capi
86a1949
%{name}-capi library on top of libow providing an easy API to develop third-party
86a1949
applications to access to 1-Wire networks.
86a1949
86a1949
86a1949
%package devel
86a1949
Summary: Files for development of OWFS applications
86a1949
Requires: %{name}-libs%{?_isa} = %{version}
86a1949
86a1949
%description devel
86a1949
This package contains the libraries and header files that are needed for
86a1949
developing OWFS applications.
86a1949
86a1949
86a1949
%package ownet
86a1949
Summary: C-API to develop third-part applications which access 1-Wire networks
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
86a1949
%description ownet
86a1949
%{name}-ownet library provides an easy API to develop third-party applications 
86a1949
to access to 1-Wire networks. It doesn't depend on owlib, and only supports 
86a1949
remote-server connections. This library doesn't include any 1-wire adapter 
86a1949
support, except server connections.
86a1949
86a1949
86a1949
%package fs
86a1949
Summary: Virtual file-system on top of %{name}-libs providing access to 1-Wire networks
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires: fuse >= 1.0
86a1949
Requires: %{name}-server
86a1949
BuildRequires: fuse-devel >= 1.0
86a1949
86a1949
%description fs
86a1949
%{name}-fs is a virtual file-system on top of %{name}-libs providing 
86a1949
access to 1-Wire networks.
86a1949
86a1949
86a1949
%package httpd
86a1949
Summary: HTTP daemon providing access to 1-Wire networks
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires: %{name}-server
86a1949
86a1949
%description httpd
86a1949
%{name}-httpd is a HTTP daemon on top of %{name} providing 
86a1949
access to 1-Wire networks.
86a1949
86a1949
86a1949
%package ftpd
86a1949
Summary: FTP daemon providing access to 1-Wire networks
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires: %{name}-server
86a1949
86a1949
%description ftpd
86a1949
%{name}-ftpd is a FTP daemon on top of %{name} providing access to 1-Wire networks.
86a1949
86a1949
86a1949
%package server
86a1949
Summary: Back-end server (daemon) for 1-wire control
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires(pre): shadow-utils
86a1949
86a1949
%description server
86a1949
%{name}-server is the back-end component of the OWFS 1-wire bus control system.
86a1949
owserver arbitrates access to the bus from multiple client processes. The
86a1949
physical bus is usually connected to a serial or USB port, and other processes
86a1949
connect to owserver over network sockets (TCP port). Communication can be local
86a1949
or over a network.
86a1949
fe067b8
%triggerun -- %{name}-server < 2.9p5.20140721git6d00fb1-1
fe067b8
# when coming from pre-socket activated version, we need to enable .socket
fe067b8
if /usr/bin/systemctl --quiet is-enabled owserver.service ; then
fe067b8
	/usr/bin/systemctl --no-reload enable owserver.socket > /dev/null 2>&1 || :
fe067b8
fi
86a1949
86a1949
%package tap
86a1949
Summary: Packet sniffer for the owserver protocol
86a1949
Requires: tcl >= 8.1
86a1949
Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
fe067b8
BuildRequires: zlib-devel
86a1949
86a1949
%description tap
86a1949
%{name}-tap is a packet sniffer for the owserver protocol
86a1949
86a1949
86a1949
%package mon
86a1949
Summary: Statistics and settings monitor for owserver
86a1949
Requires: tcl >= 8.1
86a1949
Requires: %{name}-tcl%{?_isa} = %{version}-%{release}
86a1949
86a1949
%description mon
86a1949
%{name}-mon is a graphical monitor of owserver’s status
86a1949
86a1949
86a1949
%package python
86a1949
Summary: Python interface for the 1-wire file-system
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release} 
86a1949
Requires: python >= 2.0
86a1949
BuildRequires: swig
86a1949
BuildRequires: python2-devel
86a1949
86a1949
%{?filter_setup:
86a1949
%filter_provides_in %{python_sitearch}/.*\.so$ 
86a1949
%filter_setup
86a1949
}
86a1949
86a1949
%description python
86a1949
%{name}-python is a Python interface for the 1-wire file-system
86a1949
86a1949
86a1949
%package php
86a1949
Summary: PHP interface for the 1-wire file-system
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires: php >= 4.3.0
86a1949
Requires: php-cli >= 4.3.0
86a1949
BuildRequires: swig
86a1949
BuildRequires: php-devel >= 4.3.0
86a1949
86a1949
%description php
86a1949
%{name}-php is a php interface for the 1-wire file-system
86a1949
86a1949
86a1949
%package tcl
86a1949
Summary: Tcl interface for the 1-wire file-system
86a1949
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
86a1949
Requires: tcl >= 8.1
86a1949
BuildRequires: tcl-devel >= 8.1
86a1949
86a1949
%description tcl
86a1949
%{name}-tcl is a Tcl interface for the 1-wire file-system
86a1949
86a1949
86a1949
%package shell
86a1949
License: MIT
86a1949
Summary: Light weight shell access to owserver and the 1-wire file-system
86a1949
86a1949
%description shell
86a1949
%{name}-shell is 5 small programs to easily access owserver (and thus 
86a1949
the 1-wire system) from shell scripts. owdir, owread, owwrite, owget  
86a1949
and owpresent.
86a1949
86a1949
86a1949
%prep
86a1949
%setup -q
86a1949
# Perl dirs
86a1949
%patch0 -p1
86a1949
86a1949
sed -i -e 's/) Makefile.PL/& INSTALLDIRS=vendor/' \
86a1949
	module/swig/perl5/Makefile.am \
86a1949
	module/ownet/perl5/Makefile.am
86a1949
86a1949
86a1949
%build
86a1949
%configure --disable-rpath --disable-owperl
86a1949
# deal with RPATH
86a1949
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
86a1949
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
86a1949
# deal with unused-direct-shlib-dependency
86a1949
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
86a1949
86a1949
86a1949
make %{?_smp_mflags}
86a1949
86a1949
86a1949
%install
86a1949
make install DESTDIR=%{buildroot}
86a1949
86a1949
# remove failed that won't be packaged
86a1949
rm -f %{buildroot}%{perl_archlib}/perllocal.pod
86a1949
rm -f %{buildroot}%{perl_archlib}/auto/OW/.packlist
86a1949
rm -f %{buildroot}%{perl_archlib}/auto/OWNet/.packlist
86a1949
rm -f %{buildroot}%{_libdir}/libow.la
86a1949
rm -f %{buildroot}%{_libdir}/libowcapi.la
86a1949
rm -f %{buildroot}%{_libdir}/libownet.la
86a1949
rm -f %{buildroot}%{php_extdir}/libowphp.la
fe067b8
rm -f %{buildroot}%{tcl_sitearch}/ow.la
86a1949
86a1949
rm -f %{buildroot}/usr/local/lib64/perl5/auto/OWNet/.packlist
86a1949
86a1949
# mount point creation
86a1949
mkdir -p %{buildroot}%{_tmpfilesdir}
fe067b8
install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
86a1949
mkdir -p %{buildroot}/run
86a1949
install -d -m 0755 %{buildroot}/run/%{name}/
86a1949
86a1949
%pre server
fe067b8
# TODO: migrate to systemd-sysusers when guidelines are ready
86a1949
getent group ow >/dev/null || groupadd -r ow
86a1949
getent passwd ow >/dev/null || \
86a1949
    useradd -r -g ow -d /var/empty -s /sbin/nologin \
86a1949
    -c "1-wire file-system (OWFS) utilities account" ow
86a1949
exit 0
86a1949
86a1949
86a1949
%post libs -p /sbin/ldconfig
86a1949
86a1949
%post capi -p /sbin/ldconfig
86a1949
86a1949
%post ownet -p /sbin/ldconfig
86a1949
86a1949
%post fs
86a1949
/bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
86a1949
%systemd_post owfs.service
86a1949
86a1949
%post httpd
86a1949
%systemd_post owhttpd.service
86a1949
86a1949
%post ftpd
86a1949
%systemd_post owftpd.service
86a1949
86a1949
%post server
fe067b8
%systemd_post owserver.service owserver.socket
86a1949
86a1949
86a1949
%preun fs
86a1949
%systemd_preun owfs.service
86a1949
86a1949
%preun httpd
86a1949
%systemd_preun owhttpd.service
86a1949
86a1949
%preun ftpd
86a1949
%systemd_preun owftpd.service
86a1949
86a1949
%preun server
fe067b8
%systemd_preun owserver.service owserver.socket
86a1949
86a1949
86a1949
%postun libs -p /sbin/ldconfig
86a1949
86a1949
%postun capi -p /sbin/ldconfig
86a1949
86a1949
%postun ownet -p /sbin/ldconfig
86a1949
86a1949
%postun fs
86a1949
%systemd_postun_with_restart owfs.service
86a1949
86a1949
%postun httpd
86a1949
%systemd_postun_with_restart owhttpd.service
86a1949
86a1949
%postun ftpd
86a1949
%systemd_postun_with_restart owftpd.service
86a1949
86a1949
%postun server
fe067b8
%systemd_postun_with_restart owserver.service owserver.socket
86a1949
86a1949
86a1949
%files libs
86a1949
%doc README NEWS ChangeLog AUTHORS COPYING
86a1949
%{_libdir}/libow-*.so*
86a1949
%{_mandir}/man3/*.3.*
86a1949
%{_mandir}/man5/owfs.5.*
86a1949
%{_mandir}/man5/owfs.conf.5.*
86a1949
86a1949
86a1949
%files devel
86a1949
%{_includedir}/owfs_config.h
86a1949
%{_includedir}/owcapi.h
86a1949
%{_includedir}/ownetapi.h
86a1949
%{_libdir}/libow.so
86a1949
%{_libdir}/libowcapi.so
86a1949
%{_libdir}/libownet.so
fe067b8
%{_mandir}/man?/*
86a1949
86a1949
%files capi
86a1949
%{_libdir}/libowcapi-*.so*
86a1949
%{_mandir}/man1/*owcapi.1.*
86a1949
86a1949
86a1949
%files ownet
86a1949
%{_libdir}/libownet-*.so*
86a1949
%{_mandir}/man1/*ownet*.1.*
86a1949
86a1949
86a1949
%files fs
86a1949
%{_bindir}/owfs
86a1949
%{_mandir}/man1/owfs.1.*
86a1949
%{_unitdir}/owfs.service
86a1949
%{_tmpfilesdir}/%{name}.conf
86a1949
%dir /run/owfs
86a1949
86a1949
86a1949
%files httpd
86a1949
%{_bindir}/owhttpd
86a1949
%{_mandir}/man1/owhttpd.1.*
86a1949
%{_unitdir}/owhttpd.service
86a1949
86a1949
86a1949
%files shell
86a1949
%{_bindir}/owdir
86a1949
%{_bindir}/owexist
86a1949
%{_bindir}/owread
86a1949
%{_bindir}/owwrite
86a1949
%{_bindir}/owget
86a1949
%{_bindir}/owpresent
86a1949
%{_mandir}/man1/owshell.1.*
86a1949
%{_mandir}/man1/owdir.1.*
86a1949
%{_mandir}/man1/owread.1.*
86a1949
%{_mandir}/man1/owget.1.*
86a1949
%{_mandir}/man1/owpresent.1.*
86a1949
%{_mandir}/man1/owwrite.1.*
86a1949
86a1949
86a1949
%files ftpd
86a1949
%{_bindir}/owftpd
86a1949
%{_mandir}/man1/owftpd.1.*
86a1949
%{_unitdir}/owftpd.service
86a1949
86a1949
86a1949
%files server
86a1949
%{_bindir}/owserver
86a1949
%{_bindir}/owexternal
86a1949
%{_mandir}/man1/owserver.1.*
86a1949
%{_unitdir}/owserver.service
fe067b8
%{_unitdir}/owserver.socket
86a1949
86a1949
86a1949
%files tap
86a1949
%doc COPYING
86a1949
%{_bindir}/owtap
86a1949
%{_mandir}/man1/owtap.1.*
86a1949
86a1949
86a1949
%files mon
86a1949
%doc COPYING
86a1949
%{_bindir}/owmon
86a1949
%{_mandir}/man1/owmon.1.*
86a1949
86a1949
86a1949
%files python
86a1949
%dir %{python_sitearch}/ow
86a1949
%{python_sitearch}/ow/__init__.py*
86a1949
%attr(0755, -, -) %{python_sitearch}/ow/_OW.so
86a1949
%dir %{python_sitearch}/ownet
86a1949
%{python_sitearch}/ownet/__init__.py*
86a1949
%{python_sitearch}/ownet/connection.py*
86a1949
%{python_sitearch}/*.egg-info
86a1949
86a1949
86a1949
%files php
86a1949
%dir %{php_extdir}
86a1949
%{php_extdir}/libowphp.so*
86a1949
%{_datarootdir}/php/OWNet/ownet.php
86a1949
86a1949
86a1949
%files tcl
fe067b8
%dir %{tcl_sitearch}/owtcl-*
df66106
%{tcl_sitearch}/owtcl-*/*
86a1949
%{_mandir}/mann/owtcl.n.*
86a1949
%{_mandir}/mann/ow.n.*
86a1949
86a1949
86a1949
86a1949
%changelog
24bfca7
* Wed Oct 08 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p7-1
24bfca7
- news upstream release
24bfca7
be43b35
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p5.20140721git6d00fb1-2
be43b35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
be43b35
fe067b8
* Mon Jul 21 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p5.20140721git6d00fb1-1
fe067b8
- package snapshot
fe067b8
- use upstream systemd units
fe067b8
- enable owserver's socket activation
fe067b8
- fixed hardcoded tcl_sitearch, patch by Jaroslav Škarvada <jskarvad@redhat.com>
fe067b8
f41854e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p5-3
f41854e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f41854e
160f362
* Wed May 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.9p5-2
160f362
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86
160f362
72cc91e
* Thu May 15 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p5-1
72cc91e
- latest upstream release
72cc91e
ddd49f5
* Tue Mar 25 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p3-1
ddd49f5
- new upstream release
ddd49f5
ea0ea31
* Sun Feb 23 2014 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p2-1
ea0ea31
- new upstream release
ea0ea31
d702b2b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9p1-5
d702b2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
d702b2b
86a1949
* Tue Jul 09 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-4
86a1949
- add BR: systemd
86a1949
86a1949
* Wed Jul 03 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-3
86a1949
- include main COPYING in -tap and -mon
86a1949
86a1949
* Mon Jul 01 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-2
86a1949
- deal with unused-direct-shlib-dependency
86a1949
86a1949
* Thu Jun 20 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p1-1
86a1949
- update to 2.9p1, dropping merged patches
86a1949
- remove perl-owfs bits from .spec, for now
86a1949
- correct python _OW.so perms 0775 -> 0755
86a1949
86a1949
* Thu Jun 13 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-4
86a1949
- furher fixes:
86a1949
  - BR: python2-devel for -python; drop -devel req 
86a1949
  - add tcl dep for owmon and owtap 
86a1949
86a1949
* Fri May 10 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-3
86a1949
- use /run/owfs instead of /mnt/1wire
86a1949
  (ref: https://lists.fedoraproject.org/pipermail/devel/2013-May/182420.html)
86a1949
86a1949
* Mon May 06 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-2
86a1949
- fix issues:
86a1949
  - add Require: python-devel to python subpackage
86a1949
  - synchronise ldconfig requires with glibc provides
86a1949
86a1949
* Mon Mar 25 2013 Tomasz Torcz <ttorcz@fedoraproject.org> - 2.9p0-1
86a1949
- initial package, based on work by Serg Oskin and Vadim Tkachenko