Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/owfs/, sys-fs/owfs/files/
Date: Wed, 21 Sep 2016 14:31:33
Message-Id: 1474468232.2574a982584646c67e6abc8c4429acbf8a5dc047.whissi@gentoo
1 commit: 2574a982584646c67e6abc8c4429acbf8a5dc047
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 21 14:30:10 2016 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 21 14:30:32 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2574a982
7
8 sys-fs/owfs: Bump to v3.1.p4
9
10 Changes:
11 ========
12 - Disabled autodetection of libftdi and libavahi; These configure flags
13 will now only be enabled when the user has the the appropriate USE
14 flags.
15
16 - Fixed missing sys/sysmacros.h includes (bug #580922)
17
18 - Fixed systemd detection (bug #576648)
19
20 Gentoo-Bug: https://bugs.gentoo.org/580922
21 Gentoo-Bug: https://bugs.gentoo.org/576648
22
23 Package-Manager: portage-2.3.1
24
25 sys-fs/owfs/Manifest | 1 +
26 sys-fs/owfs/files/owfs-3.1p4-sysmacros.patch | 78 +++++++++++
27 sys-fs/owfs/metadata.xml | 5 +
28 sys-fs/owfs/owfs-3.1_p4.ebuild | 191 +++++++++++++++++++++++++++
29 4 files changed, 275 insertions(+)
30
31 diff --git a/sys-fs/owfs/Manifest b/sys-fs/owfs/Manifest
32 index cb7f4e3..549445d 100644
33 --- a/sys-fs/owfs/Manifest
34 +++ b/sys-fs/owfs/Manifest
35 @@ -1,2 +1,3 @@
36 DIST owfs-2.7p21.tar.gz 1247466 SHA256 070a3368e9400e900618f8a704f487baf3671f6764715b4de04b151c66d3306d SHA512 ec6d372d32ebf59278c2c68d5fbed42664f52bc1702f4ea8e5506457594943413e37801d341102029cb48a9d8c3d6b3d68615a1dd517c93aa0a475a1bb06c4cf WHIRLPOOL 31901ae07a7431a368cdb4fa0a30a1885da29f55187dc601b53f2e9ebf4e11aba73de93d7f6308671ecb3afa8433548b41a2e79a9a0cc4771adee93a5a6a1ddd
37 DIST owfs-3.1p1.tar.gz 1400962 SHA256 e69421ae534565c1f8530a2447f583401f4d0d4b1cf3cb8cf399a57133ed7f81 SHA512 f5c2694ce1076969cf4a6970a07b2c2edee42cfbc6886c1790d777d650cc0afe42cf3282328f8832d5286a0aa5827c48e3d4657412ba3391db5e26adfa890cf5 WHIRLPOOL 2a3a4ebeb3eebaf0d370a7dcc8a9a5fb95defa3e218039f9203b996e4ac2272c2a16323bb8e43da39df9a389dbd057e49c936f40bdc08de201076fbd8d2fdba4
38 +DIST owfs-3.1p4.tar.gz 1455420 SHA256 83ea34ede9f44665c5bef4e46fd9bbc087ad8a76c533bcbf03b436b7601e1e54 SHA512 9d04b466fc64761f53dc5fb11b4eb71d10154be5eb335174e8a9002a944bb3f2fbfe1cea3cf5962aa794486830e78d7ba5a7a87c68e3a4d32ab1a95e7ca59cdb WHIRLPOOL 0a1790e111e01bd66237899311ae348bd347f6446094fe7a33d36f2f86db5c18211abd13f76c7e080398f3daf3f20184542f083c818f028ec6f2ca695accebd4
39
40 diff --git a/sys-fs/owfs/files/owfs-3.1p4-sysmacros.patch b/sys-fs/owfs/files/owfs-3.1p4-sysmacros.patch
41 new file mode 100644
42 index 00000000..dcb67a6
43 --- /dev/null
44 +++ b/sys-fs/owfs/files/owfs-3.1p4-sysmacros.patch
45 @@ -0,0 +1,78 @@
46 +From 6565314e775232cf1682b35720b8b1b207a16f3e Mon Sep 17 00:00:00 2001
47 +From: Thomas Deutschmann <whissi@g.o>
48 +Date: Wed, 21 Sep 2016 15:38:52 +0200
49 +Subject: [PATCH] configure: Add AC_HEADER_MAJOR to find where major() is
50 + defined
51 +
52 +glibc currently pulls sys/sysmacros.h into sys/types.h, but this may
53 +change in a future release.
54 +
55 +https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
56 +
57 +Gentoo-Bug: https://bugs.gentoo.org/580922
58 +---
59 + configure.ac | 4 +++-
60 + module/owlib/src/include/ow.h | 7 +++++--
61 + module/ownet/c/src/include/ow.h | 8 ++++++--
62 + 3 files changed, 14 insertions(+), 5 deletions(-)
63 +
64 +diff --git a/configure.ac b/configure.ac
65 +index c1e3d77..3b32fbe 100644
66 +--- a/configure.ac
67 ++++ b/configure.ac
68 +@@ -180,10 +180,12 @@ m4_include([src/scripts/m4/acx_pthread.m4])
69 + # Checks for header files.
70 + AC_HEADER_DIRENT
71 + AC_HEADER_STDC
72 +-AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h])
73 ++AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h])
74 + AC_CHECK_HEADERS([linux/limits.h linux/types.h netdb.h dlfcn.h])
75 + AC_CHECK_HEADERS(sys/event.h sys/inotify.h)
76 +
77 ++AC_HEADER_MAJOR
78 ++
79 + # Test if debugging out enabled
80 + ENABLE_DEBUG="true"
81 + AC_MSG_CHECKING([if debug-output is enabled])
82 +diff --git a/module/owlib/src/include/ow.h b/module/owlib/src/include/ow.h
83 +index 9dbec5f..2a6050d 100644
84 +--- a/module/owlib/src/include/ow.h
85 ++++ b/module/owlib/src/include/ow.h
86 +@@ -188,9 +188,12 @@
87 + #include <netdb.h> /* for getaddrinfo */
88 + #endif /* HAVE_NETDB_H */
89 +
90 +-#ifdef HAVE_SYS_MKDEV_H
91 ++#ifdef MAJOR_IN_MKDEV
92 + #include <sys/mkdev.h> /* for major() */
93 +-#endif /* HAVE_SYS_MKDEV_H */
94 ++#endif /* MAJOR_IN_MKDEV */
95 ++#ifdef MAJOR_IN_SYSMACROS
96 ++#include <sys/sysmacros.h> /* for major() */
97 ++#endif /* MAJOR_IN_MKDEV */
98 +
99 + #include <stddef.h> // for offsetof()
100 +
101 +diff --git a/module/ownet/c/src/include/ow.h b/module/ownet/c/src/include/ow.h
102 +index c157a7c..aeeba8e 100644
103 +--- a/module/ownet/c/src/include/ow.h
104 ++++ b/module/ownet/c/src/include/ow.h
105 +@@ -118,9 +118,13 @@
106 +
107 + #include <netdb.h> /* addrinfo */
108 +
109 +-#ifdef HAVE_SYS_MKDEV_H
110 ++#ifdef MAJOR_IN_MKDEV
111 + #include <sys/mkdev.h> /* for major() */
112 +-#endif /* HAVE_SYS_MKDEV_H */
113 ++#endif /* MAJOR_IN_MKDEV */
114 ++#ifdef MAJOR_IN_SYSMACROS
115 ++#include <sys/sysmacros.h> /* for major() */
116 ++#endif /* MAJOR_IN_MKDEV */
117 ++
118 +
119 + /* Can't include search.h when compiling owperl on Fedora Core 1. */
120 + #ifndef SKIP_SEARCH_H
121 +--
122 +2.10.0
123 +
124
125 diff --git a/sys-fs/owfs/metadata.xml b/sys-fs/owfs/metadata.xml
126 index b78f39c..0b98183 100644
127 --- a/sys-fs/owfs/metadata.xml
128 +++ b/sys-fs/owfs/metadata.xml
129 @@ -8,14 +8,19 @@
130 physical environment. You can write scripts to read temperature, flash
131 lights, write to an LCD, log and graph, ...
132 </longdescription>
133 + <slots>
134 + <subslots>Reflect ABI of libow.so.</subslots>
135 + </slots>
136 <upstream>
137 <remote-id type="sourceforge">owfs</remote-id>
138 </upstream>
139 <use>
140 + <flag name="ftdi">Enable support for USB FTDI chips via <pkg>dev-embedded/libftdi</pkg></flag>
141 <flag name="ftpd">Enable building the OWFS FTP server (owftpd)</flag>
142 <flag name="fuse">Enable building the FUSE-based OWFS client (owfs)</flag>
143 <flag name="httpd">Enable building the OWFS web server (owhttpd)</flag>
144 <flag name="parport">Enable support for the DS1410E parallel port adapter</flag>
145 <flag name="server">Enable building the OWFS server (owserver)</flag>
146 + <flag name="zeroconf">Enables support for zero-configuration networking via <pkg>net-dns/avahi</pkg></flag>
147 </use>
148 </pkgmetadata>
149
150 diff --git a/sys-fs/owfs/owfs-3.1_p4.ebuild b/sys-fs/owfs/owfs-3.1_p4.ebuild
151 new file mode 100644
152 index 00000000..149c87c
153 --- /dev/null
154 +++ b/sys-fs/owfs/owfs-3.1_p4.ebuild
155 @@ -0,0 +1,191 @@
156 +# Copyright 1999-2016 Gentoo Foundation
157 +# Distributed under the terms of the GNU General Public License v2
158 +# $Id$
159 +
160 +EAPI=6
161 +
162 +PYTHON_COMPAT=( python2_7 )
163 +DISTUTILS_OPTIONAL=1
164 +
165 +inherit autotools distutils-r1 eutils linux-info perl-functions systemd user
166 +
167 +MY_P=${P/_/}
168 +
169 +DESCRIPTION="Access 1-Wire devices like a filesystem"
170 +SRC_URI="mirror://sourceforge/owfs/${MY_P}.tar.gz"
171 +HOMEPAGE="http://owfs.org/ https://sourceforge.net/projects/owfs/"
172 +
173 +KEYWORDS="~amd64 ~arm ~x86"
174 +SLOT="0/4.0.0"
175 +LICENSE="GPL-2"
176 +
177 +RDEPEND="
178 + ftdi? ( dev-embedded/libftdi:0 )
179 + fuse? ( sys-fs/fuse )
180 + perl? ( dev-lang/perl:= )
181 + parport? ( sys-kernel/linux-headers )
182 + php? ( dev-lang/php:=[cli] )
183 + python? ( ${PYTHON_DEPS} )
184 + tcl? ( dev-lang/tcl:0= )
185 + usb? ( virtual/libusb:0 )
186 + zeroconf? ( net-dns/avahi[mdnsresponder-compat] )"
187 +
188 +DEPEND="${RDEPEND}
189 + perl? ( dev-lang/swig )
190 + php? ( dev-lang/swig )
191 + python? ( dev-lang/swig )"
192 +
193 +IUSE="debug ftdi ftpd fuse httpd parport perl php python tcl usb zeroconf"
194 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
195 +
196 +PATCHES=(
197 + "${FILESDIR}"/${PN}-3.1-vendordir.patch
198 + "${FILESDIR}"/${PN}-3.1p4-sysmacros.patch
199 +)
200 +
201 +S=${WORKDIR}/${MY_P}
202 +
203 +OWUID=${OWUID:-owfs}
204 +OWGID=${OWGID:-owfs}
205 +
206 +pkg_setup() {
207 + if use kernel_linux; then
208 + linux-info_pkg_setup
209 +
210 + if linux_config_exists; then
211 + if ! linux_chkconfig_present W1; then
212 + ewarn "CONFIG_W1 isn't set. You will not be able to use 1-wire bus on this system!"
213 + fi
214 + else
215 + elog "Cannot find a linux kernel configuration. Continuing anyway."
216 + fi
217 + fi
218 +
219 + use perl && perl_set_version
220 +
221 + enewgroup ${OWGID} 150
222 + enewuser ${OWUID} 150 -1 -1 ${OWGID}
223 +}
224 +
225 +src_prepare() {
226 + default
227 +
228 + # Support user's CFLAGS and LDFLAGS.
229 + sed -i "s/@CPPFLAGS@/@CPPFLAGS@ ${CFLAGS}/" \
230 + module/swig/perl5/OW/Makefile.linux.in || die
231 + sed -i "s/@LIBS@/@LIBS@ ${LDFLAGS}/" \
232 + module/swig/perl5/OW/Makefile.linux.in || die
233 +
234 + eautoreconf
235 +}
236 +
237 +src_configure() {
238 + # disable owpython since we can build python anyway
239 + # and without it, we don't have to fix the build ;)
240 + local myeconf=(
241 + $(use_enable debug)
242 + $(use_enable fuse owfs)
243 + $(use_enable ftdi)
244 + $(use_enable ftpd owftpd)
245 + $(use_enable httpd owhttpd)
246 + $(use_enable parport)
247 + $(use_enable perl owperl)
248 + $(use_enable php owphp)
249 + --disable-owpython
250 + $(use_enable tcl owtcl)
251 + $(use_enable zeroconf avahi)
252 + $(use_enable zeroconf zero)
253 + $(use_enable usb)
254 + --with-systemdsystemunitdir=$(systemd_get_systemunitdir)
255 + )
256 +
257 + if use httpd || use ftpd || use fuse; then
258 + myeconf+=( --enable-owserver )
259 + else
260 + myeconf+=( --disable-owserver )
261 + fi
262 +
263 + econf ${myeconf[@]}
264 +}
265 +
266 +src_compile() {
267 + default
268 +
269 + if use python; then
270 + local CFLAGS="${CFLAGS} -fno-strict-aliasing"
271 +
272 + pushd module/ownet/python > /dev/null || die
273 + distutils-r1_src_compile
274 + popd > /dev/null || die
275 +
276 + pushd module/swig/python > /dev/null || die
277 + emake ow_wrap.c
278 + distutils-r1_src_compile
279 + popd > /dev/null || die
280 + fi
281 +}
282 +
283 +src_test() { :; }
284 +
285 +src_install() {
286 + default
287 +
288 + if use httpd || use ftpd || use fuse; then
289 + newinitd "${FILESDIR}"/owserver.initd-r1 owserver
290 + newconfd "${FILESDIR}"/owserver.confd owserver
291 +
292 + for i in httpd ftpd; do
293 + if use ${i}; then
294 + newinitd "${FILESDIR}"/ow${i}.initd-r1 ow${i}
295 + newconfd "${FILESDIR}"/ow${i}.confd ow${i}
296 + fi
297 + done
298 +
299 + if use fuse; then
300 + dodir /var/lib/owfs
301 + dodir /var/lib/owfs/mnt
302 + newinitd "${FILESDIR}"/owfs.initd-r1 owfs
303 + newconfd "${FILESDIR}"/owfs.confd owfs
304 + fi
305 + fi
306 +
307 + use perl && perl_delete_localpod
308 +
309 + if use python; then
310 + pushd module/ownet/python > /dev/null || die
311 + distutils-r1_src_install
312 + popd > /dev/null || die
313 +
314 + pushd module/swig/python > /dev/null || die
315 + distutils-r1_src_install
316 + popd > /dev/null || die
317 + fi
318 +
319 + prune_libtool_files
320 +}
321 +
322 +pkg_postinst() {
323 + if use httpd || use ftpd || use fuse; then
324 + echo
325 + if [[ ${OWUID} != root ]]; then
326 + ewarn
327 + ewarn "In order to allow the OWFS daemon user '${OWUID}' to read"
328 + ewarn "from and/or write to a 1 wire bus controller device, make"
329 + ewarn "sure the user has appropriate permission to access the"
330 + ewarn "corresponding device node/path (e.g. /dev/ttyS0), for example"
331 + ewarn "by adding the user to the group 'uucp' (for serial devices)"
332 + ewarn "or 'usb' (for USB devices accessed via usbfs on /proc/bus/usb),"
333 + ewarn "or install an appropriate UDEV rules (see http://owfs.org/index.php?page=udev-and-usb"
334 + ewarn "for more information)."
335 + ewarn
336 + if use fuse; then
337 + ewarn "In order to allow regular users to read from and/or write to"
338 + ewarn "1 wire bus devices accessible via the owfs FUSE filesystem"
339 + ewarn "client and its filesystem mountpoint, make sure the user is"
340 + ewarn "a member of the group '${OWGID}'."
341 + ewarn
342 + fi
343 + echo
344 + fi
345 + fi
346 +}