1 # Build recipe for connman.
3 # Copyright (c) 2019, 2021 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.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
30 fetch=http://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
35 ConnMan is a daemon for managing Internet connections within embedded
36 device and integrates a vast range of communication features usually
37 split between many daemons such as DHCP, DNS and NTP. The result of
38 this consolidation is low memory consumption with a fast, coherent,
39 synchronized reaction to changing network conditions.
42 homepage=http://01.org/connman
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
47 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
55 # A patch to compile under Musl (Thanks to "Alpine Linux")
56 patch -Np1 -i "${worktree}/patches/connman/libresolv.patch"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
63 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
65 --libdir=/usr/lib${libSuffix} \
73 --with-firewall=iptables \
74 --with-dns-backend=internal \
75 --build="$(gcc -dumpmachine)"
78 make -j${jobs} DESTDIR="$destdir" install-strip
82 "${destdir}/usr/share/dbus-1/system.d" \
83 "${destdir}/usr/share/dbus-1/system-services"
85 # Install perp service for connman
87 mkdir -p "${destdir}/etc/perp/connmand" \
88 "${destdir}/var/lib/connman"
90 cp -p "${worktree}/archive/connman/etc/perp/rc.log" \
91 "${worktree}/archive/connman/etc/perp/rc.main" \
92 "${destdir}/etc/perp/connmand/"
94 chmod 755 "${destdir}"/etc/perp/connmand/rc.*
96 # Be an active service by default
97 chmod +t "${destdir}/etc/perp/connmand"
99 # Inset configuration file from source
100 mkdir -p "${destdir}/etc/connman"
101 cp -p src/main.conf "${destdir}/etc/connman"/
102 chmod 644 "${destdir}/etc/connman/main.conf"
104 # To handle config file(s)
105 touch "${destdir}/etc/connman/.graft-config" \
106 "${destdir}/etc/perp/connmand/.graft-config"
108 # Compress and link man pages (if needed)
109 if test -d "${destdir}/$mandir"
112 cd "${destdir}/$mandir"
113 find . -type f -exec lzip -9 {} +
114 find . -type l | while read -r file
116 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
123 mkdir -p "${destdir}${docsdir}"
124 cp -p $docs "${destdir}${docsdir}"/