[docs] build: update svn url from https:// to svn://
[openwrt/svn-archive/archive.git] / docs / build.tex
index cc7f5fd2c89b37110efa872816f515f8a5cb6551..213ddae873c0fb40dbbc736bc8fb0d19b35f8520 100644 (file)
@@ -45,7 +45,7 @@ This article refers to the "Kamikaze" branch of OpenWrt, which can be downloaded
 subversion using the following command:
 
 \begin{Verbatim}
-$ svn checkout https://svn.openwrt.org/openwrt/trunk kamikaze
+$ svn checkout svn://svn.openwrt.org/openwrt/trunk kamikaze
 \end{Verbatim}
 
 Additionally, there is a trac interface on \href{https://dev.openwrt.org/}{https://dev.openwrt.org/}
@@ -204,7 +204,6 @@ simplifies the entire ordeal.
 Here for example, is \texttt{package/bridge/Makefile}:
 
 \begin{Verbatim}[frame=single,numbers=left]
-# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
 
 include $(TOPDIR)/rules.mk
 
@@ -307,6 +306,9 @@ directly as the Nth argument to \texttt{BuildPackage}.
             Which packages must be built/installed before this package. To reference a dependency defined in the
                        same Makefile, use \textit{<dependency name>}. If defined as an external package, use 
                        \textit{+<dependency name>}. For a kernel version dependency use: \textit{@LINUX\_2\_<minor version>}
+               \item \texttt{BUILDONLY} (optional) \\
+                       Set this option to 1 if you do NOT want your package to appear in menuconfig.
+                       This is useful for packages which are only used as build dependencies.
     \end{itemize}
 
 \textbf{\texttt{Package/\textit{<name>}/conffiles} (optional):} \\
@@ -384,6 +386,58 @@ After you have created your \texttt{package/\textit{<name>}/Makefile}, the new p
 will automatically show in the menu the next time you run "make menuconfig" and if selected
 will be built automatically the next time "\texttt{make}" is run.
 
+\subsection{Creating binary packages}
+
+You might want to create binary packages and include them in the resulting images as packages.
+To do so, you can use the following template, which basically sets to nothing the Configure and
+Compile templates.
+
+\begin{Verbatim}[frame=single,numbers=left]
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=binpkg
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=binpkg-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://server
+PKG_MD5SUM:=9b7dc52656f5cbec846a7ba3299f73bd
+PKG_CAT:=zcat
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/binpkg
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Binary package
+endef
+
+define Package/bridge/description
+  Binary package
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/bridge/install
+    $(INSTALL_DIR) $(1)/usr/sbin
+    $(INSTALL_BIN) $(PKG_BUILD_DIR)/* $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,bridge))
+\end{Verbatim}
+
+Provided that the tarball which contains the binaries reflects the final
+directory layout (/usr, /lib ...), it becomes very easy to get your package
+look like one build from sources.
+
+Note that using the same technique, you can easily create binary pcakages
+for your proprietary kernel modules as well.
+
 \subsection{Creating kernel modules packages}
 
 The OpenWrt distribution makes the distinction between two kind of kernel modules, those coming along with the mainline kernel, and the others available as a separate project. We will see later that a common template is used for both of them.
@@ -395,7 +449,6 @@ For external kernel modules, you can add them to the build system just like if t
 Here for instance the Makefile for the I2C subsytem kernel modules :
 
 \begin{Verbatim}[frame=single,numbers=left]
-# $Id $
 
 I2CMENU:=I2C Bus
 
@@ -494,7 +547,7 @@ The script \texttt{./scripts/env} is used to manage these environments, it uses
 
 The command 
 \begin{Verbatim}
-  \texttt{./scripts/env help}
+  ./scripts/env help
 \end{Verbatim}
 produces a short help text with a list of commands.