Missing dependencies on package build (private source repo)

I'm trying to compile this package(https://github.com/adde88/hostapd-mana-openwrt) using the SDK, however, when I try to compile the package I get the following error:

Package hostapd-mana is missing dependencies for the following libraries:
libc.so.0
libcrypt.so.0
libgmp.so.10
libm.so.0
libncurses.so.5
libpanel.so.5
libpcap.so.1.3
libstdc++.so.6

How do I fix this?

Makefile:

#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=hostapd-mana
PKG_VERSION:=2018-31-05
PKG_RELEASE:=2

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/adde88/hostapd-mana.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_VERSION:=b48a21dc3e570c9a08d5934da94579430b3e8979
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

PKG_MAINTAINER:=Andreas Nilsen <adde88@gmail.com.com>

PKG_BUILD_PARALLEL:=1

PKG_BUILD_DEPENDS:=openssl

PKG_CONFIG_DEPENDS:= \
	CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
	CONFIG_PACKAGE_kmod-ath9k \
	CONFIG_PACKAGE_kmod-mac80211 \
	CONFIG_PACKAGE_hostapd \
	CONFIG_PACKAGE_hostapd-mini \
	CONFIG_PACKAGE_kmod-hostap \
	CONFIG_WPA_RFKILL_SUPPORT \
	CONFIG_DRIVER_WEXT_SUPPORT \
	CONFIG_DRIVER_11N_SUPPORT

LOCAL_TYPE=$(strip \
		$(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
		$(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
		hostapd \
	)))
LOCAL_VARIANT=$(patsubst wpad-%,%,$(patsubst supplicant-%,%,$(BUILD_VARIANT)))

ifeq ($(LOCAL_TYPE),supplicant)
  ifeq ($(LOCAL_VARIANT),full)
    PKG_CONFIG_DEPENDS += \
		CONFIG_WPA_SUPPLICANT_INTERNAL \
		CONFIG_WPA_SUPPLICANT_OPENSSL
  endif
endif

include $(INCLUDE_DIR)/package.mk

STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)

ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
  HOSTAPD_IEEE80211N:=y
endif

DRIVER_MAKEOPTS= \
	CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
	CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
	CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
	CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \
	CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
	$(if $(CONFIG_WPA_RFKILL_SUPPORT),NEED_RFKILL=y)

ifneq ($(LOCAL_TYPE),hostapd)
  ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
    ifeq ($(LOCAL_VARIANT),full)
      DRIVER_MAKEOPTS += CONFIG_TLS=openssl
      TARGET_LDFLAGS += -lcrypto -lssl
    endif
  endif
  ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
    TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
  endif
  DRIVER_MAKEOPTS += \
	CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
endif

ifdef CONFIG_USE_EGLIBC
  TARGET_LDFLAGS += -lrt
  TARGET_LDFLAGS_C += -lrt
endif

DRV_DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny @(!TARGET_avr32||BROKEN)

define Package/hostapd-mana/Default
  SECTION:=lemonservices
  CATEGORY:=Network
  TITLE:=IEEE 802.1x Authenticator with support for the MANA and Karma attacks.
  DEPENDS:=$(DRV_DEPENDS) +libubus +tinyproxy +stunnel +ip +python +libopenssl
endef

define Package/hostapd-mana
$(call Package/hostapd-mana/Default)
  TITLE+= (full)
  VARIANT:=full
endef

define Package/hostapd-mana/description
 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS Authenticator with support for the MANA/KARMA attack.
endef

ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
  define Build/Configure/rebuild
	$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
	rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
	rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
	rm -f $(PKG_BUILD_DIR)/.config_*
	touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
  endef
endif

define Build/Configure
	$(Build/Configure/rebuild)
	$(if $(wildcard ./files/hostapd-$(LOCAL_VARIANT).config), \
		$(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
	)
	#$(CP) ./files/wpa_supplicant-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
endef

TARGET_CPPFLAGS := \
	-I$(STAGING_DIR)/usr/include/libnl-tiny \
	-I$(PKG_BUILD_DIR)/src/crypto \
	$(TARGET_CPPFLAGS) \
	-DCONFIG_LIBNL20 \
	-D_GNU_SOURCE \
	$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))

TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
ifeq ($(findstring supplicant,$(BUILD_VARIANT)),)
  TARGET_LDFLAGS += -lubox -lubus
endif

ifdef CONFIG_PACKAGE_kmod-mac80211
  TARGET_LDFLAGS += -lm -lnl-tiny
endif

define Build/RunMake
	CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
	$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
		$(TARGET_CONFIGURE_OPTS) \
		$(DRIVER_MAKEOPTS) \
		LIBS="$(TARGET_LDFLAGS)" \
		LIBS_c="$(TARGET_LDFLAGS_C)" \
		BCHECK= \
		$(2)
endef

define Build/Compile/hostapd
	$(call Build/RunMake,hostapd, \
		hostapd hostapd_cli \
	)
endef

define Build/Compile
	echo "LOCAL TYPE: $(LOCAL_TYPE)"
	echo "BUILD VARIANT: $(BUILD_VARIANT)"
	$(Build/Compile/hostapd)
	$(Build/Compile/full)
endef

define Package/hostapd-mana/postinst
#!/bin/sh
if [ -e $${1}/usr/bin/hostapd-mana ]; then
  python -m compileall;
  python -m compileall $${1}/usr/share/mana-toolkit/;
fi
endef


config_files=	dnsmasq-dhcpd.conf \
				dnsmasq-dhcpd-two.conf \
				dnsspoof.conf \
				hostapd.accept \
				hostapd.deny \
				hostapd.eap_user \
				hostapd-hidden.conf \
				hostapd-mana.conf \
				hostapd-mana-all.conf \
				hostapd-mana-eap.conf \
				hostapd-mana-eaponly.conf \
				karmetasploit.rc \
				stunnel.conf \
				tinyproxy.conf \
				hostapd.ssid_filter

cert_config_files=	dhparam.pem \
					radius.csr \
					radius.key \
					radius.pem \
					rogue-ca.crt \
					rogue-ca.der \
					rogue-ca.key \
					rogue-ca.p12 \
					rogue-ca.pem

mana_start_scripts=	firelamb-view.sh \
					launch-mana.sh \
					kill-mana.sh

crackapd_files=	crackapd.conf crackapd.py
firelamb_files=	firelamb.py helper.py publicsuffix.py publicsuffix.txt quick-run-stats.sh README
net-creds_files= LICENSE net-creds.py README.md requirements.txt
sslstrip_files=	COPYING \
				debug_ssl.log \
				lock.ico \
				poc.log \
				README \
				README.md \
				setup.py \
				sslstrip.log \
				sslstrip.py
sslstrip_files2=	ClientRequest.py \
					CookieCleaner.py \
					DnsCache.py \
					__init__.py \
					ServerConnection.py \
					ServerConnectionFactory.py \
					SSLServerConnection.py \
					StrippingProxy.py \
					URLMonitor.py
dns2proxy_files=	dns2proxy.py \
					dnsalert.txt \
					dnslog.txt \
					domains.cfg \
					fhtagn.sh \
					ia.sh \
					IPBouncer.sh \
					nospoof.cfg \
					nospoofto.cfg \
					README.md \
					resolv.conf \
					spoof.cfg \
					transform.cfg \
					victims.cfg

define Install/hostapd-mana
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_DIR) $(1)/etc/mana-toolkit/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/cert/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/crackapd/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/firelamb/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/net-creds/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/run-mana/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/sslstrip-hsts/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/sslstrip-hsts/dns2proxy/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/sslstrip-hsts/sslstrip2/
	$(INSTALL_DIR) $(1)/usr/share/mana-toolkit/sslstrip-hsts/sslstrip2/sslstrip
	$(INSTALL_DIR) $(1)/var/lib/mana-toolkit/
	$(INSTALL_DIR) $(1)/var/lib/mana-toolkit/lamb_braai/
	$(INSTALL_DIR) $(1)/var/lib/mana-toolkit/sslsplit/
	$(INSTALL_DIR) $(1)/usr/lib/python2.7/
endef

define Package/hostapd-mana/install
	$(call Install/hostapd-mana,$(1))
	$(INSTALL_BIN)  $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-mana
	$(INSTALL_BIN)  $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/mana_cli
	$(INSTALL_BIN)	$(PKG_BUILD_DIR)/files/launch-mana.sh $(1)/usr/sbin/launch-mana
	$(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/kill-mana.sh $(1)/usr/sbin/kill-mana
	$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/conf/* $(1)/etc/mana-toolkit/
	$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/cert/* $(1)/usr/share/mana-toolkit/cert/
	$(INSTALL_BIN)  $(addprefix $(PKG_BUILD_DIR)/files/,$(mana_start_scripts)) $(1)/usr/share/mana-toolkit/run-mana/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/crackapd/,$(crackapd_files)) $(1)/usr/share/mana-toolkit/crackapd/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/firelamb/,$(firelamb_files)) $(1)/usr/share/mana-toolkit/firelamb/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/net-creds/,$(net-creds_files)) $(1)/usr/share/mana-toolkit/net-creds/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/sslstrip-hsts/sslstrip2/,$(sslstrip_files)) $(1)/usr/share/mana-toolkit/sslstrip-hsts/sslstrip2/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/sslstrip-hsts/sslstrip2/sslstrip/,$(sslstrip_files2)) $(1)/usr/share/mana-toolkit/sslstrip-hsts/sslstrip2/sslstrip/
	$(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/files/sslstrip-hsts/dns2proxy/,$(dns2proxy_files)) $(1)/usr/share/mana-toolkit/sslstrip-hsts/dns2proxy/
	cp -r $(PKG_BUILD_DIR)/python2.7/* $(1)/usr/lib/python2.7/
endef

$(eval $(call BuildPackage,hostapd-mana))

All the missing deps have to-be added to:
DEPENDS:=$(DRV_DEPENDS) +libubus +tinyproxy +stunnel +ip +python +sslsplit

so something like:
DEPENDS:=$(DRV_DEPENDS) +libubus +tinyproxy +stunnel +ip +python +sslsplit +libgmp +libncurses +libpcap +libstdcpp

I'm not sure where libc, libcrypt, libpanel, libm comes from, so you have to search for this in the package feeds of other packages makefiles. I suspect libc is also provided by libstdcpp, so the missing libs could also be part of some other differently named package.

Hi, i'm the author / repo-owner. I took a look into this issue.
This repo. is a little "customized" for the WiFi Pineapples.

It seems that the reason you're getting this issue is because i'm using a "dirty trick" to get all the python-related softwares like sslstrip+, dns2proxy, net-creds, etc. working on the Pineapples.

Before i made this, sslstrip+ wasn't possible to use on the pineapples because of incompatibilities between alot of python libraries.
I got it working eventually after alot of days, couldn't remember the exact method, ended up simply copying over the entire working python2.7 directory into the build_dir, and then use it at compile time.

If you only need hostapd-mana, you can use the "light version":
https://github.com/adde88/hostapd-mana-openwrt-simple

Which is compiling just fine for LEDE, i just tested it.
(Also uploaded a IPK for LEDE: hostapd-mana-light_2.6-2_mips_24kc.ipk)
I also think you should be able to get the python stuff working on LEDE afterwards, by compiling the dependencies yourself. I think the dependencies for sslstrip+ are up to date.

But yeah, the problem comes from the python-files within my repo. which is already compiled.

I will be taking a deeper look into this issue, and try to avoid using those pre-compiled python files.
But it's gonna take some time. :slight_smile:

Hi, thanks for the answer :D! I was able to compile the IPK, however there's no rule for make package/hostapd-mana-light/install

No problem! Happy to help.
I have no problems issuing: make package/hostapd-mana-light/install V=s
When i'm using the makefile from my hostapd-mana-openwrt-simple repo.

Also. It is defined in the Makefile. Line 171-181 defines install.
Perhaps it's the wrong Makefile?