Files
luci/libs/rpcd-mod-luci/Makefile
Karel Kočí 2e0a445ed5 rpcd-mod-*: improve postinst script
Usage of killall is replaced with init script. This is cleaner solution
as it does not consider some implementation detail but rather passes
that on to init script implementation.

IPKG_INSTROOT was added to prevent execution when not running in current
root. It is invalid to request reload if install-root is not current
root. In this case it can be considered harmless but it is invalid
nonetheless.

Last change is removal of `exit 0`. This caused skip of default
postinst. Execution of default postinst does no harm and is more
standard considering possible future expansion of it.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
2020-12-07 17:01:17 +01:00

55 lines
1.1 KiB
Makefile

#
# Copyright (C) 2016-2017 Jo-Philipp Wich <jo@mein.io>
#
# Licensed under the Apache License, Version 2.0.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rpcd-mod-luci
PKG_VERSION:=20201107
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=Apache-2.0
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iwinfo
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
-I$(STAGING_DIR)/usr/include \
CMAKE_OPTIONS += \
-DLIBNL_LIBS=-lnl-tiny \
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/rpcd-mod-luci
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Rapid reverse DNS rpcd module
DEPENDS:=+rpcd +libubox +libubus +libnl-tiny
endef
define Package/rpcd-mod-luci/description
Provides LuCI backend ubus RPC operations.
endef
define Package/rpcd-mod-luci/install
$(INSTALL_DIR) $(1)/usr/lib/rpcd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/luci.so $(1)/usr/lib/rpcd/
endef
define Package/rpcd-mod-luci/postinst
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/rpcd reload
endef
$(eval $(call BuildPackage,rpcd-mod-luci))