3 # Copyright (c) 2017, The OpenThread Authors.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # 3. Neither the name of the copyright holder nor the
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 # POSSIBILITY OF SUCH DAMAGE.
30 # This script resolves all dependencies.
33 # shellcheck source=script/_initrc
34 . "$(dirname "$0")"/_initrc
36 install_packages_apt()
39 sudo apt-get install --no-install-recommends -y \
46 sudo apt-get install --no-install-recommends -y build-essential ninja-build cmake
48 with RELEASE || sudo apt-get install --no-install-recommends -y libcpputest-dev
50 sudo apt-get install --no-install-recommends -y rsyslog
53 sudo apt-get install --no-install-recommends -y libdbus-1-dev
56 sudo apt-get install --no-install-recommends -y libavahi-client3 libavahi-common-dev libavahi-client-dev avahi-daemon
59 sudo apt-get install --no-install-recommends -y libboost-dev libboost-filesystem-dev libboost-system-dev
62 without NAT64 || sudo apt-get install --no-install-recommends -y tayga iptables
66 sudo apt-get install --no-install-recommends -y bind9
67 # Resolvconf cannot be installed inside docker environment
68 if without DOCKER; then
69 sudo apt-get install --no-install-recommends -y resolvconf
74 without NETWORK_MANAGER || sudo apt-get install --no-install-recommends -y dnsmasq network-manager
77 without DHCPV6_PD || {
78 # More details can be found in issue: #122
79 if [ "$PLATFORM" = 'raspbian' ]; then
80 # TODO should figure out a better way to deal with this
81 sudo dpkg -i third_party/dhcpcd/dhcpcd5_6.11.5-1+rpt2_armhf.deb
83 sudo apt-get install --no-install-recommends -y dhcpcd5
88 sudo apt-get install --no-install-recommends -y libjsoncpp1 libjsoncpp-dev
91 without REFERENCE_DEVICE || sudo apt-get install --no-install-recommends -y radvd dnsutils
94 without BACKBONE_ROUTER || sudo apt-get install --no-install-recommends -y iptables libnetfilter-queue1 libnetfilter-queue-dev
97 install_packages_opkg()
99 die 'opkg not supported currently'
102 install_packages_rpm()
109 sudo $PM install -y gcc gcc-c++
110 with RELEASE || sudo $PM install -y cmake ninja-build
111 sudo $PM install -y dbus-devel
112 sudo $PM install -y avahi avahi-devel
113 sudo $PM install -y doxygen
114 sudo $PM install -y boost-devel boost-filesystem boost-system
115 sudo $PM install -y tayga iptables
116 sudo $PM install -y jsoncpp-devel
117 sudo $PM install -y wget
120 install_packages_brew()
122 brew install boost cmake cpputest dbus jsoncpp ninja
125 install_packages_source()
127 die 'source not supported currently'
132 if have apt-get; then
137 install_packages_opkg
139 install_packages_brew
141 install_packages_source
148 # TODO remove `|| true` after docker hub builder gets its git upgraded
149 git submodule update --init --recursive --depth 1 || true