1 # Build recipe for connman.
3 # Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Define a category for the output of the package name
22 pkgcategory=networking
24 tarname=${program}-${version}.tar.gz
27 fetch=http://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
32 ConnMan is a daemon for managing Internet connections within embedded
33 device and integrates a vast range of communication features usually
34 split between many daemons such as DHCP, DNS and NTP. The result of
35 this consolidation is low memory consumption with a fast, coherent,
36 synchronized reaction to changing network conditions.
39 homepage=http://01.org/connman
42 # Source documentation
43 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
44 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # A patch to compile under Musl (Thanks to "Alpine Linux")
55 patch -Np1 -i "${worktree}/patches/connman/libresolv.patch"
57 # Update for hosts based on musl
58 cp -f "${worktree}/archive/common/config.guess" config.guess
59 cp -f "${worktree}/archive/common/config.sub" config.sub
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
64 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66 --libdir=/usr/lib${libSuffix} \
73 --with-firewall=iptables \
74 --with-dns-backend=internal \
75 --build="$(cc -dumpmachine)"
78 make -j${jobs} DESTDIR="$destdir" install-strip
80 # Install perp service for connman
82 mkdir -p "${destdir}/etc/perp/connmand" \
83 "${destdir}/var/lib/connman"
85 cp -p "${worktree}/archive/connman/etc/perp/rc.log" \
86 "${worktree}/archive/connman/etc/perp/rc.main" \
87 "${destdir}/etc/perp/connmand/"
89 chmod 755 "${destdir}"/etc/perp/connmand/rc.*
91 # Be an active service by default
92 chmod +t "${destdir}/etc/perp/connmand"
94 # Inset configuration file from source
95 mkdir -p "${destdir}/etc/connman"
96 cp -p src/main.conf "${destdir}/etc/connman"/
97 chmod 644 "${destdir}/etc/connman/main.conf"
99 # To handle config file(s)
100 touch "${destdir}/etc/connman/.graft-config" \
101 "${destdir}/etc/perp/connmand/.graft-config"
103 # Compress and link man pages (if needed)
104 if test -d "${destdir}/$mandir"
107 cd "${destdir}/$mandir"
108 find . -type f -exec lzip -9 '{}' +
109 find . -type l | while read -r file
111 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
118 mkdir -p "${destdir}${docsdir}"
119 cp -p $docs "${destdir}${docsdir}"/