What is wrong with the following package definition?
include $(TOPDIR)/rules.mk
PKG_NAME:=ndisc6
PKG_VERSION:=1.0.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.remlab.net/files/ndisc6/
PKG_BUILD_PARALLEL:=0
PKG_INSTALL:=0
include $(INCLUDE_DIR)/package.mk
define Package/ndisc6
SECTION:=net
CATEGORY:=Network
TITLE:=ndisc6
endef
$(eval $(call BuildPackage,ndisc6))
Even with make IGNORE_ERRORS=0 V=sc package/ndisc6/compile
I get
make[2]: Entering directory '/packages/ndisc6'
touch -r /src/openwrt/build_dir/target-aarch64_generic_musl/ndisc6-1.0.7/.built /src/openwrt/build_dir/target-aarch64_generic_musl/ndisc6-1.0.7/.autoremove 2>/dev/null >/dev/null
make[2]: [Makefile:21: compile] Error 1 (ignored)
jow
December 10, 2023, 9:04am
2
No Build/Compile and more importantly, no Package/ndisc6/install section.
1 Like
@jow what would be a good example package to follow? ndisc6 only needs configure/make but it's more complex than https://openwrt.org/docs/guide-developer/helloworld/chapter3
I'd also like to know why IGNORE_ERRORS is being... ignored.
hnyman
December 10, 2023, 9:18am
4
One simple example for you: hexedit
No compile section (means that just the default compilation), but the mandatory install section is there:
The crucial thing is the install section, where you copy the files to the correct place, usually to /usr/bin or /usr/sbin, (and the correct root location is provided by $(1)
)
define Package/hexedit/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hexedit $(1)/usr/bin/
endef
EDIT:
to get the file permissions right, you can avoid CP and use macros $(INSTALL_BIN)
for executables, $(INSTALL_DATA)
for ordinary files, and $(INSTALL_CONF)
for config files with restricted read permissions. (And make sure with $(INSTALL_DIR)
that the needed directories have been created...)
define Package/joe/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/joe/joe $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/joe
$(INSTALL_CONF) ./files/joerc $(1)/etc/joe/joerc
endef
define Package/joe-extras/install
$(INSTALL_DIR) $(1)/etc/joe
$(INSTALL_DIR) $(1)/usr/share/joe/{syntax,lang,charmaps,colors}
$(INSTALL_CONF) $(PKG_BUILD_DIR)/rc/{ftyperc,jicerc.ru,jmacsrc,jpicorc,jstarrc,rjoerc} $(1)/etc/joe/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/syntax/*.jsf $(1)/usr/share/joe/syntax/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/po/*.po $(1)/usr/share/joe/lang/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/charmaps/klingon $(1)/usr/share/joe/charmaps/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/colors/*.jcf $(1)/usr/share/joe/colors/
endef
1 Like
Because
feeds/base/package/Makefile
23:ifneq ($(IGNORE_ERRORS),)
27: package-ignore-errors := $(filter n m y,$(IGNORE_ERRORS))
Only n
, m
and y
are valid values for this to be set to.