recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / networking / connman / recipe
blobc72cc2d57117e776d86a3b72a9d4f540c4f88916
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.
17 program=connman
18 version=1.37
19 release=2
21 # Define a category for the output of the package name
22 pkgcategory=networking
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://mirrors.edge.kernel.org/pub/linux/network/connman/$tarname
29 description="
30 A connection manager.
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
40 license=GPLv2+
42 # Source documentation
43 docs="AUTHORS COPYING ChangeLog NEWS README TODO"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
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" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --enable-pie \
70      --enable-static=no \
71      --enable-shared=yes \
72      --disable-wispr \
73      --with-firewall=iptables \
74      --with-dns-backend=internal \
75      --build="$(cc -dumpmachine)"
77     make -j${jobs} V=1
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"
105     then
106         (
107             cd "${destdir}/$mandir"
108             find . -type f -exec lzip -9 '{}' +
109             find . -type l | while read -r file
110             do
111                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
112                 rm -- "$file"
113             done
114         )
115     fi
117     # Copy documentation
118     mkdir -p "${destdir}${docsdir}"
119     cp -p $docs "${destdir}${docsdir}"/