recipes: networking/connman: Upgraded to version 1.38
[dragora.git] / recipes / networking / connman / recipe
blob367d6c0882430230b7a8201b8d1f78debf38a4b2
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
18 set -e
20 program=connman
21 version=1.38
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=http://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
32 description="
33 A connection manager.
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
43 license=GPLv2+
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # A patch to compile under Musl (Thanks to "Alpine Linux")
56     patch -Np1 -i "${worktree}/patches/connman/libresolv.patch"
58     autoreconf -vif
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --mandir=$mandir \
67      --docdir=$docsdir \
68      --enable-static=no \
69      --enable-shared=yes \
70      --enable-pie \
71      --enable-iwd \
72      --disable-wispr \
73      --with-firewall=iptables \
74      --with-dns-backend=internal \
75      --build="$(gcc -dumpmachine)"
77     make -j${jobs} V=1
78     make -j${jobs} DESTDIR="$destdir" install-strip
80     # No systemd, please
81     rm -rf \
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"
110     then
111         (
112             cd "${destdir}/$mandir"
113             find . -type f -exec lzip -9 {} +
114             find . -type l | while read -r file
115             do
116                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
117                 rm -- "$file"
118             done
119         )
120     fi
122     # Copy documentation
123     mkdir -p "${destdir}${docsdir}"
124     cp -p $docs "${destdir}${docsdir}"/