Enhanced package installation to ensure appstore files are properly installed with correct permissions during both fresh installs and upgrades. Changes to Makefile: 1. Added explicit PKG_FILE_MODES for all data directories and files: - /usr/share/secubox: 755 - /usr/share/secubox/appstore: 755 - /usr/share/secubox/appstore/apps.json: 644 - /usr/share/secubox/profiles: 755 2. Improved install section: - Added file existence check before installing profiles - Added install verification message for appstore catalog - Better comments for clarity 3. Added postinst script: - Verifies appstore catalog exists after installation - Sets proper permissions on all data directories/files - Reloads RPCD service to pick up new methods - Provides installation feedback to user - Fails with warning if appstore catalog missing This ensures the appstore will be populated on fresh firmware installs and properly updated during package upgrades. Version: 0.7.0-3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
78 lines
2.7 KiB
Makefile
78 lines
2.7 KiB
Makefile
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=luci-app-secubox
|
|
PKG_VERSION:=0.7.0
|
|
PKG_RELEASE:=3
|
|
PKG_LICENSE:=Apache-2.0
|
|
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>
|
|
|
|
LUCI_TITLE:=LuCI - SecuBox Hub (Central Dashboard)
|
|
LUCI_DESCRIPTION:=Central control hub for all SecuBox modules. Provides unified dashboard, module status, system health monitoring, and quick actions.
|
|
LUCI_DEPENDS:=+luci-base +rpcd +curl +jq
|
|
LUCI_PKGARCH:=all
|
|
|
|
# File permissions (CRITICAL: RPCD scripts MUST be executable 755)
|
|
# Format: path:owner:group:mode
|
|
# - RPCD scripts: 755 (executable by root, required for ubus calls)
|
|
# - Helper scripts: 755 (if executable)
|
|
# - Config files: 644 (readable by all, writable by root)
|
|
# - Data directories: 755 (readable/searchable by all)
|
|
# - Data files: 644 (readable by all)
|
|
# - CSS/JS files: 644 (set automatically by luci.mk)
|
|
PKG_FILE_MODES:=/usr/libexec/rpcd/luci.secubox:root:root:755 \
|
|
/usr/libexec/secubox/fix-permissions.sh:root:root:755 \
|
|
/usr/share/secubox:root:root:755 \
|
|
/usr/share/secubox/appstore:root:root:755 \
|
|
/usr/share/secubox/appstore/apps.json:root:root:644 \
|
|
/usr/share/secubox/profiles:root:root:755
|
|
|
|
include $(TOPDIR)/feeds/luci/luci.mk
|
|
|
|
define Package/$(PKG_NAME)/install
|
|
$(call Package/luci/install,$(1))
|
|
|
|
# Install SecuBox profiles
|
|
$(INSTALL_DIR) $(1)/usr/share/secubox/profiles
|
|
for file in $(CURDIR)/profiles/*.json; do \
|
|
[ -f "$$file" ] && $(INSTALL_DATA) $$file $(1)/usr/share/secubox/profiles/$$(basename $$file); \
|
|
done
|
|
|
|
# Install AppStore catalog (CRITICAL: Required for app store functionality)
|
|
$(INSTALL_DIR) $(1)/usr/share/secubox/appstore
|
|
$(INSTALL_DATA) $(CURDIR)/appstore/apps.json $(1)/usr/share/secubox/appstore/apps.json
|
|
|
|
# Verify appstore file was installed
|
|
@echo "SecuBox: Installed appstore catalog to /usr/share/secubox/appstore/apps.json"
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/postinst
|
|
#!/bin/sh
|
|
# SecuBox post-installation script
|
|
# Ensures appstore catalog and permissions are correct
|
|
|
|
[ -n "$${IPKG_INSTROOT}" ] || {
|
|
# Verify appstore catalog exists
|
|
if [ ! -f /usr/share/secubox/appstore/apps.json ]; then
|
|
echo "WARNING: SecuBox appstore catalog not found!"
|
|
echo "Expected: /usr/share/secubox/appstore/apps.json"
|
|
exit 1
|
|
fi
|
|
|
|
# Set proper permissions
|
|
chmod 755 /usr/share/secubox 2>/dev/null || true
|
|
chmod 755 /usr/share/secubox/appstore 2>/dev/null || true
|
|
chmod 644 /usr/share/secubox/appstore/apps.json 2>/dev/null || true
|
|
chmod 755 /usr/share/secubox/profiles 2>/dev/null || true
|
|
|
|
# Reload RPCD to pick up new methods
|
|
/etc/init.d/rpcd reload 2>/dev/null || true
|
|
|
|
echo "SecuBox: Installation complete"
|
|
echo " - Appstore catalog: /usr/share/secubox/appstore/apps.json"
|
|
echo " - RPCD methods available via: ubus call luci.secubox"
|
|
}
|
|
exit 0
|
|
endef
|
|
|
|
# call BuildPackage - OpenWrt buildroot
|