I want to build package for openwrt
I use this openwrt Makefile :
include $(TOPDIR)/rules.mk
PKG_NAME:=CGI
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/CGI
SECTION:=utils
CATEGORY:=Utilities
TITLE:=CGI Related stuff
# DEPENDS:=+libpthread +libc +libpcap +libjson-c
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/CGI/install
mkdir -p $(PKG_BUILD_DIR)
$(INSTALL_DIR) $(1)/usr/www/cgi-bin
$(INSTALL_DIR) $(1)/etc/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/cgiMain $(1)/usr/www/cgi-bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fwupdate_server $(1)/usr/www/cgi-bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fwupload $(1)/usr/www/cgi-bin
$(INSTALL_CONF) $(PKG_BUILD_DIR)/createImage.sh $(1)/etc/
####### cp $(PKG_BUILD_DIR)/createImage.sh $(1)/etc/
endef
$(eval $(call BuildPackage,CGI))
but when compile the package I got this error :
make[3]: Leaving directory '/home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI'
touch /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.built
rm -rf /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI.installed /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI
mkdir -p /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI
mkdir -p /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI
install -d -m0755 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/usr/www/cgi-bin
install -d -m0755 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/etc/
install -m0755 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/cgiMain /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/usr/www/cgi-bin
install -m0755 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/fwupdate_server /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/usr/www/cgi-bin
install -m0755 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/fwupload /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/usr/www/cgi-bin
install -m0600 /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/createImage.sh /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/etc/
touch /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI.installed
mkdir -p /home/narendra/1907OWRT/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp
SHELL= flock /home/narendra/1907OWRT/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/. /home/narendra/1907OWRT/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/'
cp: cannot overwrite non-directory '/home/narendra/1907OWRT/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/./etc' with directory '/home/narendra/1907OWRT/openwrt/build_dir/target-mips_24kc_musl/CGI/.pkgdir/CGI/./etc'
make[2]: *** [Makefile:92: /home/narendra/1907OWRT/openwrt/staging_dir/target-mips_24kc_musl/root-ar71xx/stamp/.CGI_installed] Error 1
make[2]: Leaving directory '/home/narendra/1907OWRT/openwrt/package/CGI'
time: package/CGI/compile#0.95#0.33#1.46
make[1]: *** [package/Makefile:113: package/CGI/compile] Error 2
make[1]: Leaving directory '/home/narendra/1907OWRT/openwrt'
make: *** [/home/narendra/1907OWRT/openwrt/include/toplevel.mk:227: package/CGI/compile] Error 2