1 |
commit: 32105713ed3d5b6fcda8e5cdbda37a5f91806472 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 20 15:17:50 2018 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 20 16:35:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32105713 |
7 |
|
8 |
sys-fs/owfs: Disable php support (#651106 by Brian Evans) |
9 |
|
10 |
Closes: https://bugs.gentoo.org/651106 |
11 |
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org> |
12 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
13 |
|
14 |
sys-fs/owfs/owfs-3.2_p2-r2.ebuild | 192 ++++++++++++++++++++++++++++++++++++++ |
15 |
1 file changed, 192 insertions(+) |
16 |
|
17 |
diff --git a/sys-fs/owfs/owfs-3.2_p2-r2.ebuild b/sys-fs/owfs/owfs-3.2_p2-r2.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..109235a70a3 |
20 |
--- /dev/null |
21 |
+++ b/sys-fs/owfs/owfs-3.2_p2-r2.ebuild |
22 |
@@ -0,0 +1,192 @@ |
23 |
+# Copyright 1999-2018 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+ |
28 |
+PYTHON_COMPAT=( python2_7 ) |
29 |
+DISTUTILS_OPTIONAL=1 |
30 |
+ |
31 |
+inherit autotools distutils-r1 linux-info perl-functions systemd user |
32 |
+ |
33 |
+MY_P="${P/_/}" |
34 |
+ |
35 |
+DESCRIPTION="Access 1-Wire devices like a filesystem" |
36 |
+SRC_URI="mirror://sourceforge/owfs/${MY_P}.tar.gz" |
37 |
+HOMEPAGE="http://owfs.org/ https://sourceforge.net/projects/owfs/" |
38 |
+KEYWORDS="~amd64 ~arm ~x86" |
39 |
+ |
40 |
+# Upstream uses crazy SONAME, https://github.com/owfs/owfs/commit/c696fa9b9b44f49c96b9f1c2b3159d277e0c1273 |
41 |
+SLOT="0/${PV}" |
42 |
+LICENSE="GPL-2" |
43 |
+ |
44 |
+IUSE="debug ftdi ftpd fuse httpd parport perl python tcl usb zeroconf" |
45 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
46 |
+ |
47 |
+RDEPEND=" |
48 |
+ ftdi? ( dev-embedded/libftdi:0 ) |
49 |
+ fuse? ( sys-fs/fuse:0= ) |
50 |
+ perl? ( dev-lang/perl:= ) |
51 |
+ parport? ( sys-kernel/linux-headers ) |
52 |
+ python? ( ${PYTHON_DEPS} ) |
53 |
+ tcl? ( dev-lang/tcl:0= ) |
54 |
+ usb? ( virtual/libusb:0 ) |
55 |
+ zeroconf? ( net-dns/avahi[mdnsresponder-compat] ) |
56 |
+" |
57 |
+ |
58 |
+DEPEND="${RDEPEND} |
59 |
+ perl? ( dev-lang/swig ) |
60 |
+ python? ( dev-lang/swig ) |
61 |
+" |
62 |
+ |
63 |
+PATCHES=( |
64 |
+ "${FILESDIR}"/${PN}-3.1-vendordir.patch |
65 |
+ "${FILESDIR}"/${PN}-3.1p4-sysmacros.patch |
66 |
+) |
67 |
+ |
68 |
+S="${WORKDIR}/${MY_P}" |
69 |
+ |
70 |
+OWUID="${OWUID:-owfs}" |
71 |
+OWGID="${OWGID:-owfs}" |
72 |
+ |
73 |
+pkg_setup() { |
74 |
+ if use kernel_linux; then |
75 |
+ linux-info_pkg_setup |
76 |
+ |
77 |
+ if linux_config_exists; then |
78 |
+ if ! linux_chkconfig_present W1; then |
79 |
+ ewarn "CONFIG_W1 isn't set. You will not be able to use 1-wire bus on this system!" |
80 |
+ fi |
81 |
+ else |
82 |
+ elog "Cannot find a linux kernel configuration. Continuing anyway." |
83 |
+ fi |
84 |
+ fi |
85 |
+ |
86 |
+ use perl && perl_set_version |
87 |
+ |
88 |
+ enewgroup ${OWGID} 150 |
89 |
+ enewuser ${OWUID} 150 -1 -1 ${OWGID} |
90 |
+} |
91 |
+ |
92 |
+src_prepare() { |
93 |
+ default |
94 |
+ |
95 |
+ # Support user's CFLAGS and LDFLAGS. |
96 |
+ sed -i "s/@CPPFLAGS@/@CPPFLAGS@ ${CFLAGS}/" \ |
97 |
+ module/swig/perl5/OW/Makefile.linux.in || die |
98 |
+ sed -i "s/@LIBS@/@LIBS@ ${LDFLAGS}/" \ |
99 |
+ module/swig/perl5/OW/Makefile.linux.in || die |
100 |
+ |
101 |
+ eautoreconf |
102 |
+} |
103 |
+ |
104 |
+src_configure() { |
105 |
+ # disable owpython since we can build python anyway |
106 |
+ # and without it, we don't have to fix the build ;) |
107 |
+ # disable owphp because it is not compatible with PHP-7, bug #651106 |
108 |
+ local myeconf=( |
109 |
+ $(use_enable debug) |
110 |
+ $(use_enable fuse owfs) |
111 |
+ $(use_enable ftdi) |
112 |
+ $(use_enable ftpd owftpd) |
113 |
+ $(use_enable httpd owhttpd) |
114 |
+ $(use_enable parport) |
115 |
+ $(use_enable perl owperl) |
116 |
+ --disable-owphp |
117 |
+ --disable-owpython |
118 |
+ $(use_enable tcl owtcl) |
119 |
+ $(use_enable zeroconf avahi) |
120 |
+ $(use_enable zeroconf zero) |
121 |
+ $(use_enable usb) |
122 |
+ --with-systemdsystemunitdir=$(systemd_get_systemunitdir) |
123 |
+ ) |
124 |
+ |
125 |
+ if use httpd || use ftpd || use fuse; then |
126 |
+ myeconf+=( --enable-owserver ) |
127 |
+ else |
128 |
+ myeconf+=( --disable-owserver ) |
129 |
+ fi |
130 |
+ |
131 |
+ econf ${myeconf[@]} |
132 |
+} |
133 |
+ |
134 |
+src_compile() { |
135 |
+ default |
136 |
+ |
137 |
+ if use python; then |
138 |
+ local CFLAGS="${CFLAGS} -fno-strict-aliasing" |
139 |
+ |
140 |
+ pushd module/ownet/python > /dev/null || die |
141 |
+ distutils-r1_src_compile |
142 |
+ popd > /dev/null || die |
143 |
+ |
144 |
+ pushd module/swig/python > /dev/null || die |
145 |
+ emake ow_wrap.c |
146 |
+ distutils-r1_src_compile |
147 |
+ popd > /dev/null || die |
148 |
+ fi |
149 |
+} |
150 |
+ |
151 |
+src_test() { :; } |
152 |
+ |
153 |
+src_install() { |
154 |
+ default |
155 |
+ |
156 |
+ if use httpd || use ftpd || use fuse; then |
157 |
+ newinitd "${FILESDIR}"/owserver.initd-r1 owserver |
158 |
+ newconfd "${FILESDIR}"/owserver.confd owserver |
159 |
+ |
160 |
+ for i in httpd ftpd; do |
161 |
+ if use ${i}; then |
162 |
+ newinitd "${FILESDIR}"/ow${i}.initd-r1 ow${i} |
163 |
+ newconfd "${FILESDIR}"/ow${i}.confd ow${i} |
164 |
+ fi |
165 |
+ done |
166 |
+ |
167 |
+ if use fuse; then |
168 |
+ dodir /var/lib/owfs |
169 |
+ dodir /var/lib/owfs/mnt |
170 |
+ newinitd "${FILESDIR}"/owfs.initd-r1 owfs |
171 |
+ newconfd "${FILESDIR}"/owfs.confd owfs |
172 |
+ fi |
173 |
+ fi |
174 |
+ |
175 |
+ use perl && perl_delete_localpod |
176 |
+ |
177 |
+ if use python; then |
178 |
+ pushd module/ownet/python > /dev/null || die |
179 |
+ distutils-r1_src_install |
180 |
+ popd > /dev/null || die |
181 |
+ |
182 |
+ pushd module/swig/python > /dev/null || die |
183 |
+ distutils-r1_src_install |
184 |
+ popd > /dev/null || die |
185 |
+ fi |
186 |
+ |
187 |
+ find "${D}" -name '*.la' -delete || die |
188 |
+} |
189 |
+ |
190 |
+pkg_postinst() { |
191 |
+ if use httpd || use ftpd || use fuse; then |
192 |
+ echo |
193 |
+ if [[ ${OWUID} != root ]]; then |
194 |
+ ewarn |
195 |
+ ewarn "In order to allow the OWFS daemon user '${OWUID}' to read" |
196 |
+ ewarn "from and/or write to a 1 wire bus controller device, make" |
197 |
+ ewarn "sure the user has appropriate permission to access the" |
198 |
+ ewarn "corresponding device node/path (e.g. /dev/ttyS0), for example" |
199 |
+ ewarn "by adding the user to the group 'uucp' (for serial devices)" |
200 |
+ ewarn "or 'usb' (for USB devices accessed via usbfs on /proc/bus/usb)," |
201 |
+ ewarn "or install an appropriate UDEV rules (see http://owfs.org/index.php?page=udev-and-usb" |
202 |
+ ewarn "for more information)." |
203 |
+ ewarn |
204 |
+ if use fuse; then |
205 |
+ ewarn "In order to allow regular users to read from and/or write to" |
206 |
+ ewarn "1 wire bus devices accessible via the owfs FUSE filesystem" |
207 |
+ ewarn "client and its filesystem mountpoint, make sure the user is" |
208 |
+ ewarn "a member of the group '${OWGID}'." |
209 |
+ ewarn |
210 |
+ fi |
211 |
+ echo |
212 |
+ fi |
213 |
+ fi |
214 |
+} |