2 # Copyright (C) 2006-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/kernel.mk
9 include $(INCLUDE_DIR
)/version.mk
13 PKG_VERSION
:=$(PKG_REV
)
17 PKG_SOURCE_VERSION
:=$(PKG_REV
)
18 PKG_SOURCE_SUBDIR
:=opkg-
$(PKG_VERSION
)
19 PKG_SOURCE_URL
:=http
://opkg.googlecode.com
/svn
/trunk
/
20 PKG_SOURCE
:=$(PKG_SOURCE_SUBDIR
).
tar.gz
22 PKG_REMOVE_FILES
= autogen.sh aclocal.m4
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/host-build.mk
30 TITLE
:=opkg package management system
31 MAINTAINER
:=Jo-Philipp Wich
<xm@subsignal.org
>
32 URL
:=http
://wiki.openmoko.org
/wiki
/Opkg
35 define Package
/opkg
/description
36 Lightweight package management system
37 opkg is the opkg Package Management System
, for handling
38 installation and removal of packages on a system. It can
39 recursively follow dependencies and download
all packages
40 necessary to
install a particular package.
42 opkg knows how to
install both .ipk and .deb packages.
45 define Package
/opkg
/conffiles
49 TARGET_CFLAGS
+= $(if
$(CONFIG_GCC_VERSION_4_3
)$(CONFIG_GCC_VERSION_4_4
),-Wno-array-bounds
)
50 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
51 EXTRA_CFLAGS
+= $(TARGET_CPPFLAGS
)
56 --with-opkgetcdir
=/etc \
57 --with-opkglockfile
=/var
/lock
/opkg.lock
60 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
62 DESTDIR
="$(PKG_INSTALL_DIR)" \
63 HOST_CPU
="$(PKGARCH)" \
64 LDFLAGS
="-Wl,--gc-sections" \
68 define Package
/opkg
/install
69 $(INSTALL_DIR
) $(1)/usr
/lib
/opkg
70 $(INSTALL_DIR
) $(1)/bin
71 $(INSTALL_DIR
) $(1)/etc
72 $(INSTALL_DATA
) .
/files
/opkg.conf
$(1)/etc
/
73 $(VERSION_SED
) $(1)/etc
/opkg.conf
74 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/opkg-cl
$(1)/bin
/opkg
77 define Build
/InstallDev
78 mkdir
-p
$(1)/usr
/include
79 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libopkg
$(1)/usr
/include/
83 HOST_CONFIGURE_ARGS
+= \
86 --with-opkgetcdir
=/etc \
87 --with-opkglockfile
=/tmp
/opkg.lock
90 $(MAKE
) -C
$(HOST_BUILD_DIR
) CC
="$(HOSTCC)" all
94 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/opkg-cl
$(STAGING_DIR_HOST
)/bin
/opkg
97 $(eval
$(call BuildPackage
,opkg
))
98 $(eval
$(call HostBuild
))