Files
Alexandru Ardelean 6c5a3c4d78 lua: use LUA_INSTALL_DIR in cqueues, lua-ffi and luaossl
The three Lua variants of each package install the same files, differing
only in the destination directory, so define LUA_INSTALL_DIR next to the
other per-variant settings and share a single install recipe. Same idiom
as luafilesystem, luasec and luaexpat. No packaged path changes.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-10-06 10:40:22 +03:00

104 lines
3.0 KiB
Makefile

#
# Copyright (C) 2021 Siger Yang <siger.yang@outlook.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luaossl
PKG_VERSION:=20220711
PKG_RELEASE:=3
PKG_MAINTAINER:=Siger Yang <siger.yang@outlook.com>
PKG_MIRROR_HASH:=7abb1070da36906f9ef310af1a12827543bb5de4bbe239068420fd8b3e3858d2
PKG_SOURCE_URL:=https://github.com/wahern/luaossl.git
PKG_SOURCE_VERSION:=rel-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/luaossl/default
SUBMENU:=Lua
SECTION:=lang
CATEGORY:=Languages
TITLE:=Comprehensive binding to OpenSSL for $(1)
URL:=https://25thandclement.com/~william/projects/luaossl.html
DEPENDS:=+libopenssl
endef
define Package/luaossl/default/description
luaossl is a comprehensive binding to OpenSSL for Lua 5.1, 5.2, and
later. It includes support for certificate and key management, key
generation, signature verification, and deep bindings to the
distinguished name, alternative name, and X.509v3 extension interfaces.
endef
TARGET_CFLAGS += $(FPIC)
TARGET_LDFLAGS += $(FPIC)
define Package/luaossl
$(call Package/luaossl/default,lua5.1)
DEPENDS+=+liblua
VARIANT:=lua51
endef
define Package/luaossl-lua5.3
$(call Package/luaossl/default,lua5.3)
DEPENDS+=+liblua5.3
VARIANT:=lua53
endef
define Package/luaossl-lua5.4
$(call Package/luaossl/default,lua5.4)
DEPENDS+=+liblua5.4
VARIANT:=lua54
endef
Package/luaossl/description = $(Package/luaossl/default/description)
Package/luaossl-lua5.3/description = $(Package/luaossl/default/description)
Package/luaossl-lua5.4/description = $(Package/luaossl/default/description)
ifeq ($(BUILD_VARIANT),lua51)
MAKE_FLAGS += \
LUA_APIS="5.1" \
LUA51_CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
lua51cpath="/usr/lib/lua" \
lua51path="/usr/lib/lua"
LUA_INSTALL_DIR:=/usr/lib/lua
endif
ifeq ($(BUILD_VARIANT),lua53)
MAKE_FLAGS += \
LUA_APIS="5.3" \
LUA53_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.3" \
lua53cpath="/usr/local/lib/lua/5.3" \
lua53path="/usr/local/lib/lua/5.3"
LUA_INSTALL_DIR:=/usr/local/lib/lua/5.3
endif
ifeq ($(BUILD_VARIANT),lua54)
MAKE_FLAGS += \
LUA_APIS="5.4" \
LUA54_CPPFLAGS="-I$(STAGING_DIR)/usr/include/lua5.4" \
lua54cpath="/usr/lib/lua/5.4" \
lua54path="/usr/lib/lua/5.4"
LUA_INSTALL_DIR:=/usr/lib/lua/5.4
endif
define Package/luaossl/install
$(INSTALL_DIR) $(1)$(LUA_INSTALL_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)$(LUA_INSTALL_DIR)/_openssl.so $(1)$(LUA_INSTALL_DIR)/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(LUA_INSTALL_DIR)/openssl.lua $(1)$(LUA_INSTALL_DIR)/
$(CP) $(PKG_INSTALL_DIR)$(LUA_INSTALL_DIR)/openssl $(1)$(LUA_INSTALL_DIR)/
endef
Package/luaossl-lua5.3/install = $(Package/luaossl/install)
Package/luaossl-lua5.4/install = $(Package/luaossl/install)
$(eval $(call BuildPackage,luaossl))
$(eval $(call BuildPackage,luaossl-lua5.3))
$(eval $(call BuildPackage,luaossl-lua5.4))