libressl: update to 2.6.3
[openadk.git] / docs / adding-packages-manual.txt
blob862662987fea91acd42ef645e95aa49d7ab74642
1 // -*- mode:doc; -*-
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
10 scripts.
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.
17 03:
18 04: include $(ADK_TOPDIR)/rules.mk
19 05:
20 06: PKG_NAME:=          libfoo
21 07: PKG_VERSION:=       1.0
22 08: PKG_RELEASE:=       1
23 09: PKG_HASH:=          62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd1587
24 10: PKG_DESCR:=         foo library
25 11: PKG_SECTION:=       libs
26 12: PKG_BUILDDEP:=      libressl
27 13: PKG_DEPENDS:=       libressl
28 14: PKG_URL:=           http://www.libfoo.org/
29 15: PKG_SITES:=         http://download.libfoo.org/
30 16:
31 17: include $(ADK_TOPDIR)/mk/package.mk
32 18:
33 19: $(eval $(call PKG_template,LIBFOO,libfoo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
34 20:
35 21: CONFIG_STYLE:=              manual
36 22: BUILD_STYLE:=               manual
37 23: INSTALL_STYLE:=             manual
38 24:
39 25: do-configure:
40 26:     ${CP} ./files/config ${WRKBUILD}/.config
41 27:
42 28: do-build:
43 29:     ${MAKE} -C ${WRKBUILD} all
44 30:
45 31: do-install:
46 32:     ${INSTALL_DIR} ${IDIR_LIBFOO}/usr/lib
47 33:     ${CP} ${WRKBUILD}/libfoo.so* ${IDIR_LIBFOO}/usr/lib
48 34:
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
80 for the target.
82 On line 35 we include +mk/pkg-bottom.mk+, which includes common functions used
83 by the package fetching and building process.