summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--localrepo/Makefile41
-rw-r--r--updater-ng/Makefile68
-rw-r--r--updater-opkg-wrapper/Makefile34
-rw-r--r--updater-supervisor/Makefile41
4 files changed, 119 insertions, 65 deletions
diff --git a/localrepo/Makefile b/localrepo/Makefile
new file mode 100644
index 0000000..3a02bce
--- /dev/null
+++ b/localrepo/Makefile
@@ -0,0 +1,41 @@
+#
+## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
+#
+## This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# #
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=localrepo
+PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater/updater.git
+PKG_SOURCE_BRANCH:=master
+PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
+
+include $(INCLUDE_DIR)/autopkg-branch.mk
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/$(PKG_NAME)
+ TITLE:=Next generation updater local repository manager
+ DEPENDS:=+python3-light
+endef
+
+define Package/$(PKG_NAME)-localrepo/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/localrepo $(1)/usr/bin/localrepo
+ $(INSTALL_DIR) $(1)/etc/updater/conf.d
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/localrepo/localrepo.lua $(1)/etc/updater/conf.d/localrepo.lua
+endef
+
+# Repository should be consistent when updater is executed successfully but this
+# ensures that we will fix any problems that can be caused by older version of
+# localrepo
+define Package/$(PKG_NAME)-localrepo/postinst
+[ -n "$$IPKG_INSTROOT" ] || {
+ localrepo check --fix
+}
+endef
+
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/updater-ng/Makefile b/updater-ng/Makefile
index 6c65ab2..d7aea74 100644
--- a/updater-ng/Makefile
+++ b/updater-ng/Makefile
@@ -11,13 +11,13 @@ PKG_NAME:=updater-ng
PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater/updater.git
PKG_SOURCE_BRANCH:=master
PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
+
HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host
PKG_BUILD_DEPENDS:=busybox
include $(INCLUDE_DIR)/autopkg-branch.mk
-include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
-include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
+include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
TITLE:=The next generation updater
@@ -57,65 +57,8 @@ define Package/$(PKG_NAME)/conffiles
endef
-define Package/$(PKG_NAME)-supervisor
- TITLE:=Next generation updater supervisor and its library
- DEPENDS:=+updater-ng +vixie-cron +python3-light +python3-uci +pkglists +l10n_supported
-endef
-
-define Py3Package/$(PKG_NAME)-supervisor/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/updater-supervisor $(1)/usr/bin/
-
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/immediate_reboot.init $(1)/etc/init.d/updater-journal-recover
- $(INSTALL_DIR) $(1)/etc/cron.d
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/supervisor/cron $(1)/etc/cron.d/updater
-
- $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/hook_postupdate $(1)/etc/updater/hook_postupdate/99_approvals_cleanup
-endef
-
-
-define Package/$(PKG_NAME)-localrepo
- TITLE:=Next generation updater local repository manager
- DEPENDS:=+python3-light
-endef
-
-define Package/$(PKG_NAME)-localrepo/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/localrepo $(1)/usr/bin/localrepo
- $(INSTALL_DIR) $(1)/etc/updater/conf.d
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/localrepo/localrepo.lua $(1)/etc/updater/conf.d/localrepo.lua
-endef
-
-# Repository should be consistent when updater is executed successfully but this
-# ensures that we will fix any problems that can be caused by older version of
-# localrepo
-define Package/$(PKG_NAME)-localrepo/postinst
-[ -n "$$IPKG_INSTROOT" ] || {
- localrepo check --fix
-}
-endef
-
-
-define Package/$(PKG_NAME)-opkg
- TITLE:=OPKG compatibility wrapper for next generation updater
- DEPENDS:=+opkg +$(PKG_NAME)-localrepo
-endef
-
-define Package/$(PKG_NAME)-opkg/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh
- $(INSTALL_DIR) $(1)/etc/updater/conf.d
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg.lua $(1)/etc/updater/conf.d/opkg.lua
- $(INSTALL_DIR) $(1)/etc/updater/opkg-ignore
- touch $(1)/etc/updater/opkg-ignore/.keep
-endef
-
-
define Build/Compile
$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) NO_DOC=1 LUA_COMPILE:=no UPDATER_VERSION:=$(PKG_VERSION) BUSYBOX_EXEC=$(STAGING_DIR)/bin/busybox-static
- $(call Build/Compile/Py3Mod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR))
endef
define Host/Compile
@@ -131,10 +74,5 @@ define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/pkgtransaction $(STAGING_DIR_HOST)/usr/bin/
endef
-
-$(eval $(call Py3Package,updater-ng-supervisor))
-$(eval $(call BuildPackage,updater-ng))
-$(eval $(call BuildPackage,updater-ng-supervisor))
-$(eval $(call BuildPackage,updater-ng-localrepo))
-$(eval $(call BuildPackage,updater-ng-opkg))
$(eval $(call HostBuild))
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/updater-opkg-wrapper/Makefile b/updater-opkg-wrapper/Makefile
new file mode 100644
index 0000000..2c795f9
--- /dev/null
+++ b/updater-opkg-wrapper/Makefile
@@ -0,0 +1,34 @@
+#
+## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
+#
+## This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# #
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=updater-opkg-wrapper
+PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater/opkg-wrapper.git
+PKG_SOURCE_BRANCH:=master
+PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
+
+include $(INCLUDE_DIR)/autopkg-branch.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+ TITLE:=OPKG compatibility wrapper for next generation updater
+ DEPENDS:=+opkg +updater-ng +localrepo
+endef
+
+define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh
+ $(INSTALL_DIR) $(1)/etc/updater/conf.d
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/opkg.lua $(1)/etc/updater/conf.d/opkg.lua
+ $(INSTALL_DIR) $(1)/etc/updater/opkg-ignore
+ touch $(1)/etc/updater/opkg-ignore/.keep
+endef
+
+Build/Compile:=
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/updater-supervisor/Makefile b/updater-supervisor/Makefile
new file mode 100644
index 0000000..30f1d42
--- /dev/null
+++ b/updater-supervisor/Makefile
@@ -0,0 +1,41 @@
+#
+## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
+#
+## This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# #
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=updater-supervisor
+PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater/supervisor.git
+PKG_SOURCE_BRANCH:=master
+PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
+
+include $(INCLUDE_DIR)/autopkg-branch.mk
+include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
+
+
+define Package/$(PKG_NAME)
+ TITLE:=Next generation updater supervisor and its library
+ DEPENDS:=+updater-ng +python3-light +python3-uci +pkglists +l10n_supported
+ VARIANT:=python3
+endef
+
+define Py3Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/immediate_reboot.init $(1)/etc/init.d/updater-journal-recover
+ $(INSTALL_DIR) $(1)/etc/cron.d
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/cron $(1)/etc/cron.d/updater
+ $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/hook_postupdate $(1)/etc/updater/hook_postupdate/99_approvals_cleanup
+endef
+
+
+$(eval $(call Py3Package,$(PKG_NAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)-src))