1 # Build recipe for connman.
3 # Copyright (c) 2019, 2021-2023 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
21 version=20230411_24180d12
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.lz
30 #fetch=https://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
32 https://dragora.mirror.garr.it/current/sources/$tarname
33 rsync://rsync.dragora.org/current/sources/$tarname
39 ConnMan is a daemon for managing Internet connections within embedded
40 device and integrates a vast range of communication features usually
41 split between many daemons such as DHCP, DNS and NTP. The result of
42 this consolidation is low memory consumption with a fast, coherent,
43 synchronized reaction to changing network conditions.
46 homepage=https://01.org/connman
49 # Source documentation
50 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
51 docsdir="${docdir}/${program}-${version}"
55 unpack "${tardir}/$tarname"
59 # A patch to compile under Musl (Thanks to "Alpine Linux")
60 patch -Np1 -i "${worktree}/patches/connman/libresolv.patch"
62 # Another patch to fix Connman (Thanks to "Alpine Linux")
63 patch -Np1 -i "${worktree}/patches/connman/implicit.patch"
67 # Set sane permissions
68 chmod -R u+w,go-w,a+rX-s .
70 ./configure CPPFLAGS="$QICPPFLAGS" \
71 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
73 --libdir=/usr/lib${libSuffix} \
78 --enable-loopback=builtin \
84 --disable-hh2serial-gps \
85 --with-firewall=iptables \
86 --with-dns-backend=internal \
87 --build="$(gcc -dumpmachine)" \
88 ac_cv_header_execinfo_h=no
91 make -j${jobs} DESTDIR="$destdir" install
93 # Install perp service for CONNMAN
95 mkdir -p "${destdir}/etc/perp/connmand" \
96 "${destdir}/var/lib/connman"
98 cp -p "${worktree}/archive/connman/etc/perp/rc.log" \
99 "${worktree}/archive/connman/etc/perp/rc.main" \
100 "${destdir}/etc/perp/connmand/"
102 chmod 755 "${destdir}"/etc/perp/connmand/rc.*
104 # Be an active service by default
105 chmod +t "${destdir}/etc/perp/connmand"
107 # Insert configuration file from source
108 mkdir -p "${destdir}/etc/connman"
109 cp -p src/main.conf "${destdir}/etc/connman"/
110 chmod 644 "${destdir}/etc/connman/main.conf"
112 # To handle config file(s)
113 touch "${destdir}/etc/connman/.graft-config" \
114 "${destdir}/etc/perp/connmand/.graft-config"
116 # Compress and link man pages (if needed)
117 if test -d "${destdir}/$mandir"
120 cd "${destdir}/$mandir"
121 find . -type f -exec lzip -9 {} +
122 find . -type l | while read -r file
124 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
131 mkdir -p "${destdir}/$docsdir"
132 cp -p $docs "${destdir}/$docsdir"