2 // vim: set syntax=asciidoc:
4 Infrastructure for packages with specific build systems
5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 By 'packages with specific build systems' we mean all the packages whose build
8 system is not the standard one, speak 'autotools'. This typically includes
9 packages whose build system is based on hand-written Makefiles or shell
12 [[manual-package-tutorial]]
14 ------------------------------
15 01: # This file is part of the OpenADK project. OpenADK is copyrighted
16 02: # material, please see the LICENCE file in the top-level directory.
18 04: include $(ADK_TOPDIR)/rules.mk
23 09: PKG_HASH:= 62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd1587
24 10: PKG_DESCR:= foo library
25 11: PKG_SECTION:= libs
26 12: PKG_BUILDDEP:= openssl
27 13: PKG_DEPENDS:= libopenssl
28 14: PKG_URL:= http://www.libfoo.org/
29 15: PKG_SITES:= http://download.libfoo.org/
31 17: include $(ADK_TOPDIR)/mk/package.mk
33 19: $(eval $(call PKG_template,LIBFOO,libfoo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
35 21: CONFIG_STYLE:= manual
36 22: BUILD_STYLE:= manual
37 23: INSTALL_STYLE:= manual
40 26: ${CP} ./files/config ${WRKBUILD}/.config
43 29: ${MAKE} -C ${WRKBUILD} all
46 32: ${INSTALL_DIR} ${IDIR_LIBFOO}/usr/lib
47 33: ${CP} ${WRKBUILD}/libfoo.so* ${IDIR_LIBFOO}/usr/lib
49 35: include ${ADK_TOPDIR}/mk/pkg-bottom.mk
50 --------------------------------
52 The Makefile begins with line 4 with the inclusion of the top level rules.mk
53 file. After that the Makefile starts on line 6 to 15 with metadata
54 information: the name of the package (+PKG_NAME+), the version of the package
55 (+PKG_VERSION+), the release number of the package (+PKG_RELEASE+), which is
56 used in OpenADK to mark any package updates, the sha256 hash of the source archive
57 (+PKG_HASH+), the short one line description for the package (+PKG_DESCR+),
58 the package section for the menu configuration system (+PKG_SECTION+), the
59 package buildtime dependencies (+PKG_BUILDDEP+), the package runtime
60 dependencies (+PKG_DEPENDS+), the package homepage (+PKG_URL+) and finally the
61 internet locations at which the tarball can be downloaded from (+PKG_SITES+).
62 Normally ${PKG_NAME}-${PKG_VERSION}.tar.gz will be downloaded. You can
63 overwrite the default via the +DISTFILES+ variable. You can add more then one
64 archive name in +DISTFILES+ via space separated. If you have no source archive
65 at all, just use the boolean variable +NO_DISTFILES+ and set it to 1.
67 On line 17 the +mk/package.mk+ file is included, which contains the PKG_template
68 function, which is used in line 19.
70 On line 21 to 23 we define that the configuration step, the building and install
71 steps are manually provided.
73 On line 25-26 we implement a manual configuration step of the libfoo package
74 by copying a manually created config file into the build directory.
76 On line 28-29 we start the compilation process via make.
78 On line 31-33 we install the shared library into the package installation
79 directory, which is used to create the resulting binary package or tar archive
82 On line 35 we include +mk/pkg-bottom.mk+, which includes common functions used
83 by the package fetching and building process.