2 # Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/)
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
9 PKG_NAME
:=atlas-sw-probe
14 PKG_SOURCE_URL
:=https
://github.com
/RIPE-NCC
/ripe-atlas-software-probe.git
15 PKG_SOURCE
:=ripe-atlas-software-probe-
$(PKG_VERSION
).
tar.gz
17 PKG_MIRROR_HASH
:=fed1d6fa1f513e72d7266098dd74232741e2d70aea583f23e7e85521c971c6fc
18 PKG_SOURCE_VERSION
:=193daa18cc305c0194045e2d24d004b5116f041a
20 PKG_MAINTAINER
:=Jan Pavlinec
<jan.pavlinec1@gmail.com
>
21 PKG_LICENSE
:=GPL-3.0
-or-later
22 PKG_LICENSE_FILES
:=LICENSE
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/atlas-sw-probe
31 TITLE
:=RIPE Atlas software probe
32 URL
:=https
://atlas.ripe.net
/about
/probes
/
33 DEPENDS
:=+atlas-probe
+PACKAGE_dropbear
:dropbearconvert
36 define Package
/atlas-sw-probe
/description
37 RIPE Atlas SW probe is software variant of RIPE Atlas Probe.
38 It contains utilities which helps actively measure
39 Internet connectivity through ping
, traceroute
, DNS
, SSL
/TLS
, NTP
, and HTTP.
40 Data are then collected
, aggregated and published by the RIPE NCC.
43 define Package
/atlas-sw-probe-rpc
47 URL
:=https
://atlas.ripe.net
/about
/probes
/
48 DEPENDS
:=+atlas-probe
+bind-dig
+rpcd
51 define Package
/atlas-sw-probe-rpc
/description
52 Provides ubus calls for probe.
58 define Package
/atlas-sw-probe-rpc
/postinst
60 [ -z
"$${IPKG_INSTROOT}" ] && /etc
/init.d
/rpcd restart
64 define Package
/atlas-sw-probe-rpc
/postrm
66 [ -z
"$${IPKG_INSTROOT}" ] && /etc
/init.d
/rpcd restart
70 define Package
/atlas-sw-probe
/conffiles
73 /usr
/libexec
/atlas-probe-scripts
/state
/config.txt
76 TMP_BASE_DIR
:=/tmp
/ripe_atlas_probe
77 SCRIPTS_DIR
:=/usr
/libexec
/atlas-probe-scripts
79 define Package
/atlas-sw-probe
/install
80 $(INSTALL_DIR
) $(1)/$(SCRIPTS_DIR
)
81 $(INSTALL_DIR
) $(1)/$(SCRIPTS_DIR
)/{etc
,state
,bin
/arch
,bin
/bin
}
84 $(CP
) $(PKG_BUILD_DIR
)/atlas-config
/etc
/* $(1)/$(SCRIPTS_DIR
)/etc
/
86 # Copy firmware version
87 $(CP
) $(PKG_BUILD_DIR
)/atlas-config
/state
/FIRMWARE_APPS_VERSION
$(1)/$(SCRIPTS_DIR
)/state
/
90 echo
"prod" > $(1)/$(SCRIPTS_DIR
)/state
/mode
93 $(CP
) $(PKG_BUILD_DIR
)/bin
/{ATLAS
,common-pre.sh
,common.sh
,reginit.sh
,resolvconf
} $(1)/$(SCRIPTS_DIR
)/bin
/
94 $(CP
) $(PKG_BUILD_DIR
)/bin
/arch
/{linux
,openwrt-sw-probe
} $(1)/$(SCRIPTS_DIR
)/bin
/arch
/
97 echo
"DEVICE_NAME=openwrt-sw-probe" > $(1)/$(SCRIPTS_DIR
)/bin
/config.sh
98 echo
"ATLAS_BASE=$(SCRIPTS_DIR)" >> $(1)/$(SCRIPTS_DIR
)/bin
/config.sh
99 echo
"ATLAS_STATIC=$(SCRIPTS_DIR)" >> $(1)/$(SCRIPTS_DIR
)/bin
/config.sh
100 echo
"SUB_ARCH=openwrt-$(ARCH)-$(PKG_VERSION)-$(PKG_RELEASE)" >> $(1)/$(SCRIPTS_DIR
)/bin
/bin
/config.sh
102 # Enable sending interface traffic statistics as Atlas measurement results
103 echo
"RXTXRPT=yes" > $(1)/$(SCRIPTS_DIR
)/state
/config.txt
106 chmod
755 $(1)/$(SCRIPTS_DIR
)/bin
108 # Add registration instruction
109 $(INSTALL_DIR
) $(1)/etc
/atlas
/
110 $(CP
) .
/files
/atlas.readme
$(1)/etc
/atlas
/
112 # Create softlinks for writable dirs
113 $(LN
) $(TMP_BASE_DIR
)/crons
$(1)/$(SCRIPTS_DIR
)/crons
114 $(LN
) $(TMP_BASE_DIR
)/data
$(1)/$(SCRIPTS_DIR
)/data
115 $(LN
) $(TMP_BASE_DIR
)/run
$(1)/$(SCRIPTS_DIR
)/run
116 $(LN
) $(TMP_BASE_DIR
)/status
$(1)/$(SCRIPTS_DIR
)/status
118 # Copy init and config
119 $(INSTALL_DIR
) $(1)/etc
/init.d
/
120 $(INSTALL_BIN
) .
/files
/atlas.init
$(1)/etc
/init.d
/atlas
122 $(INSTALL_DIR
) $(1)/etc
/config
/
123 $(INSTALL_CONF
) .
/files
/atlas.conf
$(1)/etc
/config
/atlas
126 define Package
/atlas-sw-probe-rpc
/install
127 $(INSTALL_DIR
) $(1)/usr
/libexec
/rpcd
128 $(INSTALL_BIN
) .
/files
/atlas_rpcd.sh
$(1)/usr
/libexec
/rpcd
/atlas
131 $(eval
$(call BuildPackage
,atlas-sw-probe
))
132 $(eval
$(call BuildPackage
,atlas-sw-probe-rpc
))