├── ucl ├── patches │ └── 001-autoconf-compat.patch └── Makefile ├── README.md └── upx └── Makefile /ucl/patches/001-autoconf-compat.patch: -------------------------------------------------------------------------------- 1 | --- a/configure.ac 2 | +++ b/configure.ac 3 | @@ -48,7 +48,7 @@ AC_CANONICAL_TARGET 4 | AM_MAINTAINER_MODE 5 | 6 | if test -z "$ac_abs_top_srcdir"; then 7 | - _AC_SRCPATHS(.) 8 | + _AC_SRCDIRS(.) 9 | fi 10 | if test -r .Conf.settings1; then 11 | . ./.Conf.settings1 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # openwrt-upx 2 | 3 | UPX pacakage for OpenWrt 4 | 5 | ## Build Guide 6 | 7 | - Download and unzip [OpenWrt SDK](https://downloads.openwrt.org/snapshots/targets/) 8 | 9 | - In SDK directory, download Makefiles with git: 10 | 11 | ```sh 12 | git clone https://github.com/kuoruan/openwrt-upx.git package/openwrt-upx 13 | ``` 14 | 15 | - Build pakcage 16 | 17 | ```sh 18 | ./scripts/feeds update -a 19 | ./scripts/feeds install -a 20 | 21 | make defconfig # or make menuconfig 22 | 23 | make package/upx/{clean,compile} V=s 24 | ``` 25 | 26 | ## For Packages that Need UPX Compress 27 | 28 | - Add ```upx/host``` to ```PKG_BUILD_DEPENDS```: 29 | 30 | ```wiki 31 | PKG_BUILD_DEPENDS:=... upx/host 32 | ``` 33 | 34 | - In ```Build/Compile``` stage: 35 | 36 | ```makefile 37 | define Build/Compile 38 | ... 39 | $(STAGING_DIR_HOST)/bin/upx --lzma --best ... # bin files to be compressed 40 | ... 41 | endef 42 | ``` 43 | -------------------------------------------------------------------------------- /ucl/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2019-2020 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=ucl 10 | PKG_VERSION:=1.03 11 | PKG_RELEASE:=3 12 | 13 | PKG_MAINTAINER:=Xingwang Liao 14 | PKG_LICENSE:=GPL-2.0-only 15 | PKG_LICENSE_FILES:=COPYING 16 | 17 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 18 | PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/ucl/download 19 | PKG_HASH:=b865299ffd45d73412293369c9754b07637680e5c826915f097577cd27350348 20 | 21 | PKG_FIXUP:=autoreconf 22 | PKG_BUILD_PARALLEL:=1 23 | PKG_INSTALL:=1 24 | 25 | HOST_FIXUP:=autoreconf 26 | HOST_BUILD_PARALLEL:=1 27 | 28 | include $(INCLUDE_DIR)/host-build.mk 29 | include $(INCLUDE_DIR)/package.mk 30 | 31 | HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) 32 | 33 | HOST_CFLAGS += -std=gnu89 34 | TARGET_CFLAGS += -std=gnu89 35 | 36 | CONFIGURE_ARGS += \ 37 | --enable-static \ 38 | --enable-shared \ 39 | --disable-asm 40 | 41 | define Package/libucl 42 | SECTION:=libs 43 | CATEGORY:=Libraries 44 | TITLE:=Portable lossless data compression library 45 | URL:=http://www.oberhumer.com/opensource/ucl/ 46 | endef 47 | 48 | define Package/libucl/description 49 | UCL is a portable lossless data compression library written in ANSI C. UCL 50 | implements a number of compression algorithms that achieve an excellent 51 | compression ratio while allowing *very* fast decompression. Decompression 52 | requires no additional memory. 53 | endef 54 | 55 | define Build/InstallDev 56 | $(INSTALL_DIR) $(1)/usr/include/ucl 57 | $(CP) $(PKG_INSTALL_DIR)/usr/include/ucl/ucl{,conf}.h $(1)/usr/include/ucl/ 58 | 59 | $(INSTALL_DIR) $(1)/usr/lib 60 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucl.{a,so*} $(1)/usr/lib/ 61 | endef 62 | 63 | define Package/libucl/install 64 | $(INSTALL_DIR) $(1)/usr/lib 65 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucl.so.* $(1)/usr/lib/ 66 | endef 67 | 68 | $(eval $(call HostBuild)) 69 | $(eval $(call BuildPackage,libucl)) 70 | -------------------------------------------------------------------------------- /upx/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011-2022 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=upx 10 | PKG_VERSION:=4.2.4 11 | PKG_RELEASE:=1 12 | 13 | PKG_MAINTAINER:=Xingwang Liao 14 | PKG_LICENSE:=GPL-2.0-only 15 | PKG_LICENSE_FILES:=COPYING LICENSE 16 | 17 | PKG_SOURCE_URL:=https://github.com/upx/upx/releases/download/v$(PKG_VERSION) 18 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.xz 19 | PKG_HASH:=5ed6561607d27fb4ef346fc19f08a93696fa8fa127081e7a7114068306b8e1c4 20 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-src 21 | 22 | PKG_BUILD_PARALLEL:=1 23 | 24 | HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)-src 25 | 26 | include $(INCLUDE_DIR)/host-build.mk 27 | include $(INCLUDE_DIR)/package.mk 28 | 29 | define Host/Compile 30 | $(call Host/Compile/Default,build/release) 31 | endef 32 | 33 | define Host/Install 34 | $(CP) $(HOST_BUILD_DIR)/build/release/upx $(STAGING_DIR_HOST)/bin/upx 35 | endef 36 | 37 | define Host/Clean 38 | rm -f $(STAGING_DIR_HOST)/bin/upx 39 | endef 40 | 41 | define Package/upx 42 | SECTION:=utils 43 | CATEGORY:=Utilities 44 | DEPENDS:=+libstdcpp +zlib 45 | TITLE:=The Ultimate Packer for eXecutables 46 | URL:=https://upx.github.io/ 47 | endef 48 | 49 | define Package/upx/description 50 | UPX is a free, portable, extendable, high-performance executable packer for 51 | several different executable formats. It achieves an excellent compression ratio 52 | and offers very fast decompression. Your executables suffer no memory overhead 53 | or other drawbacks for most of the formats supported, because of in-place 54 | decompression. 55 | endef 56 | 57 | define Build/Compile 58 | $(call Build/Compile/Default,build/release) 59 | endef 60 | 61 | define Package/upx/install 62 | $(INSTALL_DIR) $(1)/usr/bin 63 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/release/upx $(1)/usr/bin/upx 64 | endef 65 | 66 | $(eval $(call HostBuild)) 67 | $(eval $(call BuildPackage,upx)) 68 | --------------------------------------------------------------------------------