Added debugging output to understand why appstore catalog isn't being included in package builds. The install section now: - Checks if source file exists before attempting install - Shows full paths being used - Displays directory contents if file is missing - Exits with error if file not found (fail-fast) This will help diagnose whether the issue is: - Wrong CURDIR path during build - Files not present in build directory - Permissions issue preventing access 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
93 lines
3.4 KiB
Makefile
93 lines
3.4 KiB
Makefile
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=luci-app-secubox
|
|
PKG_VERSION:=0.7.0
|
|
PKG_RELEASE:=4
|
|
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)
|
|
# - Data files: 644 (readable by all - INSTALL_DATA sets this automatically)
|
|
# - Directories: 755 (set automatically by INSTALL_DIR)
|
|
# - 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
|
|
|
|
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
|
|
@if [ -f "$(CURDIR)/appstore/apps.json" ]; then \
|
|
$(INSTALL_DATA) $(CURDIR)/appstore/apps.json $(1)/usr/share/secubox/appstore/apps.json; \
|
|
echo "SecuBox: Installed appstore catalog ($(CURDIR)/appstore/apps.json -> /usr/share/secubox/appstore/apps.json)"; \
|
|
else \
|
|
echo "ERROR: AppStore catalog source file not found at $(CURDIR)/appstore/apps.json"; \
|
|
echo " PWD: $$(pwd)"; \
|
|
echo " CURDIR: $(CURDIR)"; \
|
|
echo " Contents: $$(ls -la $(CURDIR)/ 2>&1 | head -10)"; \
|
|
exit 1; \
|
|
fi
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/postinst
|
|
#!/bin/sh
|
|
# SecuBox post-installation script
|
|
# Ensures appstore catalog and permissions are correct
|
|
|
|
[ -n "$${IPKG_INSTROOT}" ] || {
|
|
# Check if appstore catalog exists
|
|
if [ ! -f /usr/share/secubox/appstore/apps.json ]; then
|
|
echo "WARNING: SecuBox appstore catalog not found at /usr/share/secubox/appstore/apps.json"
|
|
|
|
# Try to restore from package ROM overlay
|
|
if [ -f /rom/usr/share/secubox/appstore/apps.json ]; then
|
|
echo " Restoring from package overlay..."
|
|
mkdir -p /usr/share/secubox/appstore
|
|
cp /rom/usr/share/secubox/appstore/apps.json /usr/share/secubox/appstore/apps.json
|
|
echo " ✓ Restored appstore catalog"
|
|
else
|
|
echo " ERROR: Appstore catalog not found in package!"
|
|
echo " The app store will be empty until this is fixed."
|
|
echo " Try: opkg remove luci-app-secubox && opkg install luci-app-secubox"
|
|
fi
|
|
fi
|
|
|
|
# Set proper permissions (safe even if files don't exist)
|
|
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"
|
|
if [ -f /usr/share/secubox/appstore/apps.json ]; then
|
|
echo " ✓ Appstore catalog: /usr/share/secubox/appstore/apps.json"
|
|
else
|
|
echo " ✗ Appstore catalog: MISSING"
|
|
fi
|
|
echo " ✓ RPCD methods available via: ubus call luci.secubox"
|
|
}
|
|
exit 0
|
|
endef
|
|
|
|
# call BuildPackage - OpenWrt buildroot
|