3 The LuCI modules are divided into several category directories, namely:
4 * applications (Single applications or plugins for other modules or applications)
5 * i18n (Translation files)
6 * libs (Independent libraries)
7 * modules (Collections of applications)
8 * themes (Frontend themes)
10 Each module goes into a subdirectory of any of this category-directories.
13 The contents of a module directory are as follows:
16 This is the module's makefile. If the module just contains Lua sourcecode or resources then the following Makefile should suffice.
18 include ../../build/config.mk
19 include ../../build/module.mk
22 If you have C(++) code in your module your Makefile should at least contain the following things.
24 include ../../build/config.mk
25 include ../../build/gccconfig.mk
26 include ../../build/module.mk
29 # Commands to compile and link your C-code
30 # and to install them under the dist/ hierarchy
33 # Commands to clean your compiled objects
38 The *src* directory is reserved for C sourcecode.
41 *luasrc* contains all Lua sourcecode files. These will automatically be stripped or compiled depending on the Make target and are installed in the LuCI installation directory.
44 *lua* is equivalent to _luasrc_ but containing Lua files will be installed in the Lua document root.
47 All files under *htdocs* will be copied to the document root of the target webserver.
50 All directories and files under *root* will be copied to the installation target as they are.
53 *dist* is reserved for the builder to create a working installation tree that will represent the filesystem on the target machine.
54 *DO NOT* put any files there as they will get deleted.
57 *ipkg* contains IPKG package control files, like _preinst'', ''posinst'', ''prerm'', ''postrm''. ''conffiles_.
58 See IPKG documentation for details.
61 # OpenWRT feed integration
62 If you want to add your module to the LuCI OpenWRT feed you have to add several sections to the contrib/package/luci/Makefile.
64 For a Web UI applications this is:
66 A package description:
68 define Package/luci-app-YOURMODULE
69 $(call Package/luci/webtemplate)
70 DEPENDS+=+some-package +some-other-package
71 TITLE:=SHORT DESCRIPTION OF YOURMODULE
76 A package installation target:
78 define Package/luci-app-YOURMODULE/install
79 $(call Package/luci/install/template,$(1),applications/YOURMODULE)
83 A module build instruction:
85 ifneq ($(CONFIG_PACKAGE_luci-app-YOURMODULE),)
86 PKG_SELECTED_MODULES+=applications/YOURMODULE
93 $(eval $(call BuildPackage,luci-app-YOURMODULE))