I created feeds/package/net/openappid/Makefile and want to test build it. I read this wiki page but I must not have something setup correctly. What am I missing?
% make package/net/openappid/download V=s
make[2]: Entering directory '/scratch/union/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/scratch/union/scripts/config'
make[1]: Entering directory '/scratch/union'
make[1]: *** No rule to make target 'package/net/openappid/download'. Stop.
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:231: package/net/openappid/download] Error 2
Ah! That is likely... this is WIP and the first time I am writing one from scratch, any advise is appreciated.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=openappid
PKG_VERSION:=26425
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=https://www.snort.org/downloads/openappid/26425
PKG_HASH:=8513877ce2264bb22119d911c2cf11f73735c866e2ca0d061c35eef6740d51f9
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
define Package/openappid
SUBMENU:=Firewall
SECTION:=net
CATEGORY:=Network
DEPENDS:=+snort3
TITLE:=Detection language and processing module for Snort
URL:=http://www.snort.org/
MENU:=1
endef
define Package/openappid/description
OpenAppId is an open, application-focused detection language and processing
module for Snort that enables users to create, share, and implement
application and service detection.
endef
define Package/openappid/install
$(INSTALL_DIR) $(1)/usr/lib/openappid/custom/{libs,lua,port}
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/openappid \
$(1)/odp/
endef
$(eval $(call BuildPackage,openappid))
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=openappid
PKG_VERSION:=26425
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=https://www.snort.org/downloads/openappid/26425
PKG_HASH:=8513877ce2264bb22119d911c2cf11f73735c866e2ca0d061c35eef6740d51f9
PKG_MAINTAINER:=John Audia <thereadgraysky@proton.me>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
define Package/openappid
SUBMENU:=Firewall
SECTION:=net
CATEGORY:=Network
DEPENDS:=+snort3
TITLE:=Detection language and processing module for Snort
URL:=http://www.snort.org/
MENU:=1
endef
define Package/openappid/description
OpenAppId is an open, application-focused detection language and processing
module for Snort that enables users to create, share, and implement
application and service detection.
endef
define Package/openappid/install
$(INSTALL_DIR) $(1)/usr/lib/openappid/custom/{libs,lua,port}
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/openappid \
$(1)/odp/
endef
$(eval $(call BuildPackage,openappid))```
% make package/$i/{clean,prepare} V=s QUILT=1
make[2]: Entering directory '/scratch/union/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/scratch/union/scripts/config'
make[1]: Entering directory '/scratch/union'
make[1]: *** No rule to make target 'package/openappid/clean'. Stop.
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:231: package/openappid/clean] Error 2
Note that I just copied the Makefile into the dirtree... is that right?
Your Makefile looks mainly ok, but possibly you have not run the feeds update and feeds install commands.
You will also have to enable it in .config via menuconfig. Otherwise it fails latest at the compilation install stage.
2001 cd /Openwrt/e8450/
2002 ./scripts/feeds update
2003 ./scripts/feeds install -a
2004 make menuconfig
2005 make package/openappid/download V=s
2006 make package/openappid/clean V=s
Thanks for showing me the steps, @hnyman as well as proposing the right way to get this thing to download. The software doesn't actually need to be compiled, it is literally a $(CP) operation.
Any tips on adjusting this to simply copy target directory? For one, the tarball simply contains opd/ but the build systems wants to start in openappid-26425
Anyone have an idea to copy a directory from one level back in the build system?
The source tarball makes /odp and places all of its contents there:
% cd /scratch/union/build_dir/target-aarch64_cortex-a72_musl
% ls odp
libs lua port AUTHORS LICENSE README appMapping.data appid.conf version.conf
But the build system is extracting it to /scratch/union/build_dir/target-aarch64_cortex-a72_musl/odp/ not to /scratch/union/build_dir/target-aarch64_cortex-a72_musl/openappid-26425/ ... that directory is just empty:
The command unpacking the tarball is in include/unpack.mk, so redefine TAR_CMD in Your recipe or try to redefine PKG_BUILD_DIR=$(BUILD_DIR)/odp (this will use directory name without version which is not good).
Thanks @tmn505! I am still unclear how to implement... we want to untar the source to $(1)/usr/lib/openappid/ thus creating $(1)/usr/lib/openappid/odp
Would that go inside the define Package/openappid/install? Can you suggest the syntax to try?
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=openappid
PKG_VERSION:=26425
PKG_RELEASE:=1
PKG_SOURCE:=snort-$(PKG_NAME).tar.gz
PKG_SOURCE_URL:=https://www.snort.org/downloads/openappid/
PKG_HASH:=8513877ce2264bb22119d911c2cf11f73735c866e2ca0d061c35eef6740d51f9
PKG_MAINTAINER:=John Audia <thereadgraysky@proton.me>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/unpack.mk
define Package/openappid
SUBMENU:=Firewall
SECTION:=net
CATEGORY:=Network
DEPENDS:=+snort3
TITLE:=Detection language and processing module for Snort
URL:=http://www.snort.org/
MENU:=1
endef
define Package/openappid/description
OpenAppId is an open, application-focused detection language and processing
module for Snort that enables users to create, share, and implement
application and service detection.
endef
define Build/Configure
true
endef
define Build/Compile
true
endef
define Package/openappid/install
$(INSTALL_DIR) $(1)/usr/lib/openappid/custom/{libs,lua,port}
$(TAR_CMD)
endef
$(eval $(call BuildPackage,openappid))
That's a lot of hand-holding. Anyway, unpack.mk is included by default no need to specify it, also variables must be defined outside rules like define Build/... and others, and lastly, commands inside rules need to be indented with TAB.
For Your recipe You can directly untar downloaded archive inside Package/.../install just disable Build/Prepare rule and Package/openappid/install rule would look like this: