recipes: networking/connman: Solved build issue with Connman
[dragora.git] / recipes / networking / connman / recipe
blob04b7d416476f26d7700b08f576851ea34fda5283
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
18 set -e
20 program=connman
21 version=20230411_24180d12
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 #fetch=https://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
31 fetch="
32  https://dragora.mirror.garr.it/current/sources/$tarname
33  rsync://rsync.dragora.org/current/sources/$tarname
36 description="
37 A connection manager.
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
47 license=GPLv2+
49 # Source documentation
50 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
51 docsdir="${docdir}/${program}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
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"
65     autoreconf -vif
67     # Set sane permissions
68     chmod -R u+w,go-w,a+rX-s .
70     ./configure CPPFLAGS="$QICPPFLAGS" \
71     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
72      $configure_args \
73      --libdir=/usr/lib${libSuffix} \
74      --mandir=$mandir \
75      --docdir=$docsdir \
76      --enable-static=no \
77      --enable-shared=yes \
78      --enable-loopback=builtin \
79      --enable-pie \
80      --enable-iwd \
81      --disable-wispr \
82      --disable-wireguard \
83      --disable-iospm \
84      --disable-hh2serial-gps \
85      --with-firewall=iptables \
86      --with-dns-backend=internal \
87      --build="$(gcc -dumpmachine)" \
88      ac_cv_header_execinfo_h=no
90     make -j${jobs} V=1
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"
118     then
119         (
120             cd "${destdir}/$mandir"
121             find . -type f -exec lzip -9 {} +
122             find . -type l | while read -r file
123             do
124                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
125                 rm -- "$file"
126             done
127         )
128     fi
130     # Copy documentation
131     mkdir -p "${destdir}/$docsdir"
132     cp -p $docs "${destdir}/$docsdir"