mirror of
https://github.com/openwrt/packages.git
synced 2026-10-14 03:27:03 +04:00
This allows to save some bytes, while preserving the scripts's
copyright and license information.
In owut at current ref db17536ec5cbcc6a76a51e65f3d192b6a2184abb
the reduction in the size applied to the source code is (e.g. without
the computed "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/"):
from:
74330 /usr/bin/owut
10541 /usr/share/ucode/utils/argparse.uc
to:
58640 /usr/bin/owut
8630 /usr/share/ucode/utils/argparse.uc
Signed-off-by: Samuele Longhi <agave@dracaena.it>
Co-authored-by: Eric Fahlgren <ericfahlgren@gmail.com>
(cherry picked from commit 1c2ce769a8)
78 lines
2.1 KiB
Makefile
78 lines
2.1 KiB
Makefile
#
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
# Copyright (C) 2024 Eric Fahlgren <ericfahlgren@gmail.com>
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=owut
|
|
PKG_SOURCE_DATE:=2026-07-08
|
|
PKG_RELEASE:=2
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
PKG_SOURCE_VERSION:=db17536ec5cbcc6a76a51e65f3d192b6a2184abb
|
|
PKG_SOURCE_URL:=https://github.com/efahl/owut.git
|
|
PKG_MIRROR_HASH:=363bc98f4650ece76bf3b01f04f8aa78c5e79d4e44029d832e5d700c8223af05
|
|
|
|
PKG_MAINTAINER:=Eric Fahlgren <ericfahlgren@gmail.com>
|
|
PKG_LICENSE:=GPL-2.0-only
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
define Package/owut
|
|
SECTION:=utils
|
|
CATEGORY:=Utilities
|
|
TITLE:=owut - an OpenWrt Upgrade Tool
|
|
URL:=http://github.com/efahl/owut
|
|
DEPENDS:=+attendedsysupgrade-common \
|
|
+rpcd-mod-file \
|
|
+ucode +ucode-mod-fs +ucode-mod-ubus \
|
|
+ucode-mod-uci +ucode-mod-uclient +ucode-mod-uloop
|
|
PKGARCH:=all
|
|
endef
|
|
|
|
define Package/owut/description
|
|
The OpenWrt Upgrade Tool (owut) is a command line program that
|
|
checks for new packages, package build breakages, generates
|
|
sysupgrade images containing installed packages and installs
|
|
images. It is written in ucode for easy end-user customization.
|
|
|
|
Documentation is available at
|
|
https://openwrt.org/docs/guide-user/installation/sysupgrade.owut
|
|
endef
|
|
|
|
define Build/Configure
|
|
endef
|
|
|
|
define Build/Compile
|
|
endef
|
|
|
|
define Package/owut/conffiles
|
|
/etc/owut.d/
|
|
endef
|
|
|
|
define Package/owut/install
|
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/files/owut.defaults $(1)/etc/uci-defaults/51-attendedsysupgrade-owut
|
|
|
|
$(INSTALL_DIR) $(1)/etc/owut.d
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/pre-install.sh $(1)/etc/owut.d/pre-install.sh
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/ucode/utils
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/argparse.uc $(1)/usr/share/ucode/utils
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/owut $(1)/usr/bin
|
|
|
|
# Hardcode the package version/release
|
|
# Remove comments and empty lines preserving package's title, copyright and license
|
|
sed -i \
|
|
-e "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/" \
|
|
-e '5,$$$${/^[ \t]*\/\//d}' \
|
|
-e '/^$$$$/d' \
|
|
$(1)/usr/bin/owut \
|
|
$(1)/usr/share/ucode/utils/argparse.uc
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,owut))
|