Skip to content

Commit

Permalink
openwisp-config: fix Makefile for 1.1.0
Browse files Browse the repository at this point in the history
Update configuration in Makefile to fix #25168

Signed-off-by: Gagan Deep <pandafy.dev@gmail.com>
  • Loading branch information
pandafy committed Oct 22, 2024
1 parent b37e625 commit 0a9b79f
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions admin/openwisp-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,24 @@ endef

define Package/openwisp-config/conffiles
/etc/config/openwisp
/etc/openwisp/
endef

define Package/openwisp-config/install
$(INSTALL_DIR) \
$(1)/usr/sbin \
$(1)/etc/init.d \
$(1)/etc/config \
$(1)/etc/openwisp \
$(1)/usr/lib/openwisp-config \
$(1)/usr/lib/lua/openwisp

$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/openwisp.agent \
$(1)/usr/sbin/openwisp_config
$(1)/usr/sbin/openwisp-config

$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/openwisp.init \
$(1)/etc/init.d/openwisp_config
$(1)/etc/init.d/openwisp-config

$(INSTALL_CONF) $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.config \
$(1)/etc/config/openwisp
Expand Down Expand Up @@ -95,7 +96,24 @@ define Package/openwisp-config/install
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-get-address.lua \
$(1)/usr/sbin/openwisp-get-address

$(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp/
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-get-random-number.lua \
$(1)/usr/sbin/openwisp-get-random-number

$(CP) $(PKG_BUILD_DIR)/VERSION $(1)/usr/lib/openwisp-config/
endef

# for backward compatibility
define Package/openwisp-config/postinst
#!/bin/sh
if [ ! -L $${IPKG_INSTROOT}/usr/sbin/openwisp_config ]; then
ln -s /usr/sbin/openwisp-config $${IPKG_INSTROOT}/usr/sbin/openwisp_config
fi
endef

define Package/openwisp-config/postrm
#!/bin/sh
rm -f $${IPKG_INSTROOT}/usr/sbin/openwisp_config
endef

$(eval $(call BuildPackage,openwisp-config))

0 comments on commit 0a9b79f

Please sign in to comment.