summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rules/opkg.in10
-rw-r--r--rules/opkg.make129
2 files changed, 139 insertions, 0 deletions
diff --git a/rules/opkg.in b/rules/opkg.in
new file mode 100644
index 000000000..aa6273ade
--- /dev/null
+++ b/rules/opkg.in
@@ -0,0 +1,10 @@
+## SECTION=disk_and_file
+
+config OPKG
+ tristate
+ select LIBCURL
+ prompt "opkg"
+ help
+ Opkg is a lightweight package management system based on Ipkg.
+
+ http://code.google.com/p/opkg/
diff --git a/rules/opkg.make b/rules/opkg.make
new file mode 100644
index 000000000..ced594c8e
--- /dev/null
+++ b/rules/opkg.make
@@ -0,0 +1,129 @@
+# -*-makefile-*-
+# $Id: template-make 9053 2008-11-03 10:58:48Z wsa $
+#
+# Copyright (C) 2009 by Robert Schwebel
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_OPKG) += opkg
+
+#
+# Paths and names
+#
+OPKG_VERSION := r180
+OPKG := opkg-$(OPKG_VERSION)
+OPKG_SUFFIX := tar.gz
+OPKG_URL := http://www.pengutronix.de/software/ptxdist/temporary-src/$(OPKG).$(OPKG_SUFFIX)
+OPKG_SOURCE := $(SRCDIR)/$(OPKG).$(OPKG_SUFFIX)
+OPKG_DIR := $(BUILDDIR)/$(OPKG)
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+$(OPKG_SOURCE):
+ @$(call targetinfo)
+ @$(call get, OPKG)
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/opkg.extract:
+ @$(call targetinfo)
+ @$(call clean, $(OPKG_DIR))
+ @$(call extract, OPKG)
+ @$(call patchin, OPKG)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+OPKG_PATH := PATH=$(CROSS_PATH)
+OPKG_ENV := $(CROSS_ENV)
+
+#
+# autoconf
+#
+OPKG_AUTOCONF := \
+ $(CROSS_AUTOCONF_USR) \
+ --disable-gpg
+
+$(STATEDIR)/opkg.prepare:
+ @$(call targetinfo)
+ @$(call clean, $(OPKG_DIR)/config.cache)
+ cd $(OPKG_DIR) && \
+ $(OPKG_PATH) $(OPKG_ENV) \
+ ./configure $(OPKG_AUTOCONF)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/opkg.compile:
+ @$(call targetinfo)
+ cd $(OPKG_DIR) && $(OPKG_PATH) $(MAKE) $(PARALLELMFLAGS)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/opkg.install:
+ @$(call targetinfo)
+ @$(call install, OPKG)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/opkg.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, opkg)
+ @$(call install_fixup, opkg,PACKAGE,opkg)
+ @$(call install_fixup, opkg,PRIORITY,optional)
+ @$(call install_fixup, opkg,VERSION,$(OPKG_VERSION))
+ @$(call install_fixup, opkg,SECTION,base)
+ @$(call install_fixup, opkg,AUTHOR,"Robert Schwebel <r.schwebel@pengutronix.de>")
+ @$(call install_fixup, opkg,DEPENDS,)
+ @$(call install_fixup, opkg,DESCRIPTION,missing)
+
+ # makes only sense when we --enable-gpg
+ # @$(call install_copy, opkg, 0, 0, 0755, -, /usr/bin/opkg-key)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/bin/update-alternatives)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/bin/opkg-cl)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/share/opkg/intercept/ldconfig)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/share/opkg/intercept/depmod)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/share/opkg/intercept/update-modules)
+ @$(call install_copy, opkg, 0, 0, 0755, -, /usr/lib/libopkg.so.0.0.0)
+ @$(call install_link, opkg, libopkg.so.0.0.0, /usr/lib/libopkg.so.0)
+ @$(call install_link, opkg, libopkg.so.0.0.0, /usr/lib/libopkg.so)
+
+ # opkg tries to write to the OPKG_STATE_DIR_PREFIX, which is /usr/lib/opkg
+ @$(call install_link, opkg, /tmp, /usr/lib/opkg)
+
+ @$(call install_finish, opkg)
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+opkg_clean:
+ rm -rf $(STATEDIR)/opkg.*
+ rm -rf $(PKGDIR)/opkg_*
+ rm -rf $(OPKG_DIR)
+
+# vim: syntax=make