Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Public release of woce-build, enjoy!

  • Loading branch information...
commit ee09939373d76f5b2a28654208b491159de221c9 1 parent df3a519
@dtzWill dtzWill authored
Showing with 2,824 additions and 1 deletion.
  1. +46 −0 Makefile
  2. +40 −0 Makefile.common
  3. +3 −1 README.md
  4. +115 −0 packages/sysmgr/luna-sysmgr/Makefile
  5. +32 −0 packages/sysmgr/luna-sysmgr/control/postinst
  6. +38 −0 packages/sysmgr/luna-sysmgr/control/prerm
  7. +24 −0 packages/sysmgr/luna-sysmgr/replace.sh
  8. +28 −0 packages/sysmgr/luna-sysmgr/restore.sh
  9. +26 −0 packages/sysmgr/luna-sysmgr/sysmgr.patch
  10. +76 −0 packages/sysmgr/qt4/Makefile
  11. +467 −0 packages/sysmgr/qt4/qconfig-palm.h
  12. +43 −0 packages/sysmgr/qt4/qt4.patch
  13. +48 −0 packages/web/webcore/Makefile
  14. +42 −0 packages/web/webkit/Makefile
  15. +13 −0 scripts/timestamp.py
  16. +30 −0 scripts/unpack-doctor-rootfs
  17. +18 −0 support/cross-compile.mk
  18. +52 −0 support/dl.mk
  19. +71 −0 support/doctors.mk
  20. +12 −0 support/headlessapp.mk
  21. +15 −0 support/install-headers.mk
  22. +261 −0 support/package.mk
  23. +25 −0 support/rootfs.mk
  24. +13 −0 support/srvln.mk
  25. +23 −0 support/toolchains.mk
  26. +17 −0 support/woce-dl.mk
  27. +217 −0 toolchain/ipkg-utils/arfile.py
  28. +292 −0 toolchain/ipkg-utils/ipkg-build
  29. +202 −0 toolchain/ipkg-utils/ipkg-make-index
  30. +40 −0 toolchain/ipkg-utils/ipkg-unbuild
  31. +495 −0 toolchain/ipkg-utils/ipkg.py
View
46 Makefile
@@ -0,0 +1,46 @@
+# Build WOCE goodness
+
+WOCE_TOOLCHAIN=arm-2009q1
+WOCE_ARCH=armv7
+
+LEVEL = .
+
+.PHONY: woce-toolchain woce-headers clobber
+.PHONY: qt4 luna-sysmgr
+
+# To build packages, we need the toolchain and the staging dir setup
+# For now, just list packages to be built here, in a working order.
+build:: linkdirs
+ $(MAKE) woce-toolchain woce-headers
+ $(MAKE) luna-sysmgr
+ @echo
+ @echo "Build Success! New LunaSysMgr available at:"
+ @echo `readlink -f packages/sysmgr/luna-sysmgr/build/armv7-stage/release-topaz/LunaSysMgr`
+ @echo
+
+# For now, manually create phony targets for building each package,
+# and also manually manage dependencies.
+# Grabbing WIDK's DEPENDS and automatic target creation support
+# should be done once this gets non-trivial to do by hand.
+qt4:
+ $(MAKE) -C packages/sysmgr/qt4
+
+luna-sysmgr: qt4
+ $(MAKE) -C packages/sysmgr/luna-sysmgr
+
+# Download and extract the toolchain
+woce-toolchain: toolchain/$(WOCE_TOOLCHAIN)/.unpacked
+
+# Grab the rootfs, stage it, and add our required headers
+woce-headers: staging/$(WOCE_ARCH)/usr/include/.staged
+ $(MAKE) -C packages/web/webcore
+ $(MAKE) -C packages/web/webkit
+
+include $(LEVEL)/Makefile.common
+
+# Cleanup everything other than the downloads (which are sacred)
+clobber::
+ rm -rf rootfs
+ rm -rf staging
+ rm -rf packages/sysmgr/*/build
+ rm -rf packages/web/*/build
View
40 Makefile.common
@@ -0,0 +1,40 @@
+# Common paths, rules, etc
+
+# Default rule
+.PHONY: build unpack
+build::
+
+# LEVEL should be set by every Makefile
+ifndef LEVEL
+$(error "LEVEL not set in Makefile!")
+endif
+
+# Paths to common directories
+DL_DIR=$(LEVEL)/downloads
+DOCTOR_DIR=$(LEVEL)/doctors
+TOOLCHAIN_DIR=$(LEVEL)/toolchain
+
+# Include rules for re-using global directories
+# for downloads and doctors, if they already exist
+include $(LEVEL)/support/srvln.mk
+
+# Include rules for building download targets
+include $(LEVEL)/support/dl.mk
+
+# Include information used for cross-compiling
+include $(LEVEL)/support/cross-compile.mk
+
+# Include rules for downloading doctor files
+include $(LEVEL)/support/doctors.mk
+
+# Include rules for extracting rootfs from doctors
+include $(LEVEL)/support/rootfs.mk
+
+# Include rules for downloading and extracting toolchains
+include $(LEVEL)/support/toolchains.mk
+
+# Include rules for downloading the WOCE release tarballs
+include $(LEVEL)/support/woce-dl.mk
+
+# Include rules for bootstrapping headers
+include $(LEVEL)/support/install-headers.mk
View
4 README.md
@@ -1,4 +1,6 @@
woce-build
==========
-Coming soon to a repo near you? woce-build! A fully working script to (initially) build LunaSysMgr and end up with an installable target!
+Build a Touchpad-compatible LunaSysMgr from source!
+
+More to come.
View
115 packages/sysmgr/luna-sysmgr/Makefile
@@ -0,0 +1,115 @@
+### Packaging metadata
+NAME = lunasysmgr-ce
+TITLE = LunaSysMgr-CE
+APP_ID = org.webos-community-edition.${NAME}
+SIGNER = org.webos-ports
+VERSION = 0.0.1
+TYPE = Application
+CATEGORY = System Utilities
+HOMEPAGE = http://www.webos-ports.org/wiki/Application:LunaSysMgr-CE
+ # TODO: Fix this icon! :)
+ICON = http://www.webos-internals.org/images/a/a5/X.png
+MAINTAINER = WebOS Ports
+DESCRIPTION = ${APPINFO_DESCRIPTION}
+APPINFO_DESCRIPTION = Luna SysManager is the user interface on webOS.<br>
+
+CHANGELOG = \
+0.0.1: Initial testing release.
+
+APPINFO_CHANGELOG = [ \
+{ "version" : "0.0.1", "log" : [ "Initial testing release" ] } \
+
+LICENSE = Apache 2.0 License
+HEADLESSAPP_VERSION = 0.2.0
+
+
+LEVEL=../../..
+
+# Default goal is to build LunaSysMgr
+# There's a beta 'package' target as well that
+# packages it up, but it's not ready yet!
+build::
+package::
+
+include $(LEVEL)/Makefile.common
+include $(LEVEL)/support/package.mk
+include $(LEVEL)/support/headlessapp.mk
+
+QTPATH := $(shell readlink -f $(LEVEL)/packages/sysmgr/qt4/build/armv7)
+QMAKE := $(QTPATH)/bin/qmake-palm
+
+.PHONY: build unpack patch package
+package:: ipkgs/${APP_ID}_${VERSION}_armv7.ipk
+build:: build/armv7-stage/.built-${VERSION}
+unpack: build/src/.unpacked
+
+### Unpack the software and build it
+build/src/.unpacked: $(WOCE_DL) sysmgr.patch
+ -rm -rf build
+ mkdir -p build/src
+ tar -C build/src --strip=2 -zxf $(WOCE_DL) webos-WOCE/luna-sysmgr
+ patch -Np2 -d build/src < sysmgr.patch
+ touch $@
+
+build/armv7-stage/.built-${VERSION}: build/src/.unpacked
+ -rm -rf build/armv7-stage
+ mkdir -p build/armv7-stage
+ cd build/armv7-stage && \
+ $(CCENV) \
+ PATH=$(QTPATH)/bin:$$PATH \
+ $(QMAKE) ../src \
+ -spec qws/linux-armv6-g++
+ $(CCENV) $(MAKE) -C build/armv7-stage
+ touch $@
+
+### Packaging magic
+build/.built-${VERSION}: build/armv7.built-${VERSION}
+ touch $@
+
+### Headless app packaging fun
+build/%.built-${VERSION}: build/%-stage/.built-${VERSION} ${DL_DIR}/headlessapp-${HEADLESSAPP_VERSION}.tar.gz
+ rm -rf build/$*
+ mkdir -p build/$*/usr/palm/applications/${APP_ID}
+ tar -C build/$*/usr/palm/applications/${APP_ID} -xf ${DL_DIR}/headlessapp-${HEADLESSAPP_VERSION}.tar.gz
+ rm -rf build/$*/usr/palm/applications/${APP_ID}/.git
+ tar -cf - control | \
+ tar -C build/$*/usr/palm/applications/${APP_ID}/ -xf -
+ mkdir -p build/$*/usr/palm/applications/${APP_ID}/bin
+ tar -cf - replace.sh restore.sh | \
+ tar -C build/$*/usr/palm/applications/${APP_ID}/bin/ -xf -
+ tar -C build/$*-stage/release-topaz/ -cf - LunaSysMgr | \
+ tar -C build/$*/usr/palm/applications/${APP_ID}/bin/ -xf -
+ echo "{" > build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"title\": \"${TITLE}\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"id\": \"${APP_ID}\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"version\": \"${VERSION}\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"vendor\": \"WebOS Ports\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"type\": \"web\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"main\": \"index.html\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"icon\": \"icon.png\"," >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ifdef APPINFO_DESCRIPTION
+ echo '"message": "${APPINFO_DESCRIPTION}",' >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+endif
+ifdef APPINFO_CHANGELOG
+ echo '"changeLog": ${APPINFO_CHANGELOG},' >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+endif
+ echo '"uiRevision": "2",' >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "\"noWindow\": true" >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ echo "}" >> build/$*/usr/palm/applications/${APP_ID}/appinfo.json
+ touch $@
+
+### CONTROL files
+build/%/CONTROL/postinst:
+ rm -f $@
+ mkdir -p build/$*/CONTROL
+ install -m 0775 control/postinst build/$*/CONTROL
+ chmod ugo+x $@
+
+build/%/CONTROL/prerm:
+ rm -f $@
+ mkdir -p build/$*/CONTROL
+ install -m 0775 control/prerm build/$*/CONTROL
+ chmod ugo+x $@
+
+clobber::
+ rm -rf build
View
32 packages/sysmgr/luna-sysmgr/control/postinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+NAME=lunasysmgr-ce
+
+APPNAME=LunaSysMgr
+
+APPID=org.webos-community-edition.${NAME}
+
+APPS=/media/cryptofs/apps
+
+[ -d ${APPS} ] || { echo "Requires webOS 1.3.5 or later" ; exit 1 ; }
+
+APPDIR=${APPS}/usr/palm/applications/${APPID}
+
+# Create copy of existing LunaSysMgr on installation.
+cp /usr/bin/LunaSysMgr ${APPDIR}/LunaSysMgr.bak
+
+mount -o remount RW /
+
+# Install script to swap Luna copies on shutdown
+cp ${APPDIR}/bin/replace.sh /etc/init.d/replace_luna
+ln -s /etc/init.d/replace_luna /etc/rc0.d/S26replace_luna
+ln -s /etc/init.d/replace_luna /etc/rc6.d/S26replace_luna
+ln -s /etc/init.d/replace_luna /etc/rcH.d/S26replace_luna
+ln -s /etc/init.d/replace_luna /etc/rcU.d/S26replace_luna
+
+# Install desired new copy for the replacer to find
+cp ${APPDIR}/bin/LunaSysMgr /usr/bin/LunaSysMgr.new
+
+mount -o remount RO /
+
+exit 0
View
38 packages/sysmgr/luna-sysmgr/control/prerm
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+NAME=lunasysmgr-ce
+
+APPNAME=LunaSysMgr
+
+APPID=org.webos-community-edition.${NAME}
+
+APPS=/media/cryptofs/apps
+
+[ -d ${APPS} ] || { echo "Requires webOS 1.3.5 or later" ; exit 1 ; }
+
+APPDIR=${APPS}/usr/palm/applications/${APPID}
+
+mount -o remount RW /
+
+# Remove files put onto system
+if [ -e /usr/bin/LunaSysMgr.new]
+ rm /usr/bin/LunaSysMgr.new
+fi
+
+rm /etc/rc*.d/S26replace_luna
+
+if [ -e ${APPDIR/LunaSysMgr.bak]
+ mv ${APPDIR}/LunaSysMgr.bak /usr/bin/LunaSysMgr.bak
+fi
+
+#rm /etc/init.d/replace_luna
+
+mount -o remount RO /
+
+# Only report success (and let this package be removed)
+# if LunaSysMgr is back to its original state
+# TODO: Verify md5 or similar?
+# TODO: How does this happen? Button launched from app itself,
+# followed by a reboot?
+diff /usr/bin/LunaSysMgr ${APPDIR}/LunaSysMgr.bak
+exit $?
View
24 packages/sysmgr/luna-sysmgr/replace.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Copy our new LunaSysMgr to the system
+# Meant to be invoked only when LunaSysMgr isn't running
+
+NAME=LunaSysMgr-CE
+
+APPNAME=LunaSysMgr
+
+# TODO: Abort if Luna is running!
+
+mount -o remount RW /
+
+/sbin/stop ${APPNAME} || true
+
+if [ -e /usr/bin/LunaSysMgr.*]
+ mv /usr/bin/LunaSysMgr.* /usr/bin/LunaSysMgr
+fi
+
+mount -o remount RO /
+
+/sbin/start ${APPNAME}
+
+exit 0
View
28 packages/sysmgr/luna-sysmgr/restore.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Restore the original LunaSysMgr
+
+NAME=LunaSysMgr-CE
+
+APPNAME=LunaSysMgr
+
+APPID=org.webos-ports.${NAME}
+
+APPS=/media/cryptofs/apps
+
+[ -d ${APPS} ] || { echo "Requires webOS 1.3.5 or later" ; exit 1 ; }
+
+APPDIR=${APPS}/usr/palm/applications/${APPID}
+
+# Stop the service if running
+/sbin/stop ${APPNAME} || true
+
+mount -o remount RW /
+
+mv ${APPDIR}/LunaSysMgr.bak /usr/bin/LunaSysMgr
+
+/sbin/start ${APPNAME}
+
+mount -o remount RO /
+
+exit 0
View
26 packages/sysmgr/luna-sysmgr/sysmgr.patch
@@ -0,0 +1,26 @@
+diff --git a/luna-sysmgr/sysmgr.pro b/luna-sysmgr/sysmgr.pro
+index e68470f..f00e839 100644
+--- a/luna-sysmgr/sysmgr.pro
++++ b/luna-sysmgr/sysmgr.pro
+@@ -45,8 +45,10 @@ ENV_BUILD_TYPE = $$(BUILD_TYPE)
+ # Prevent conflict with usage of "signal" in other libraries
+ CONFIG += no_keywords
+
+-CONFIG += link_pkgconfig
+-PKGCONFIG = glib-2.0 gthread-2.0
++# We don't have .pc files for most things, rely on being passed
++# the needed include/library search paths
++# CONFIG += link_pkgconfig
++# PKGCONFIG = glib-2.0 gthread-2.0
+
+ QT = core gui declarative
+
+@@ -670,7 +672,7 @@ QMAKE_CXXFLAGS += -DFIX_FOR_QT
+ #-DNO_WEBKIT_INIT
+
+ # Override the default (-Wall -W) from g++.conf mkspec (see linux-g++.conf)
+-QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter -Wno-unused-variable -Wno-reorder -Wno-missing-field-initializers -Wno-extra
++QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter -Wno-unused-variable -Wno-reorder -Wno-missing-field-initializers -Wno-extra -Wno-strict-aliasing
+
+ LIBS += -lcjson -lLunaSysMgrIpc -lLunaKeymaps -lWebKitLuna -llunaservice -lpbnjson_cpp -lhelpers
+
View
76 packages/sysmgr/qt4/Makefile
@@ -0,0 +1,76 @@
+# Build qt4
+
+LEVEL=../../..
+
+include $(LEVEL)/Makefile.common
+
+.PHONY: build unpack patch
+build:: build/armv7/.built
+unpack:: build/src/.unpacked
+
+VERSION := 4.8.0
+
+QT4_URL := http://downloads.help.palm.com/opensource/3.0.5/qt4-$(VERSION).tar.gz
+QT4_PATCH_URL := http://downloads.help.palm.com/opensource/3.0.5/qt-$(VERSION).patch.gz
+
+QT4_DL = $(DL_DIR)/qt4-$(VERSION).tar.gz
+QT4_PATCH_DL = $(DL_DIR)/qt4-patch-$(VERSION).gz
+
+$(eval $(call DLTGZ,qt4,$(VERSION),$(QT4_URL)))
+$(eval $(call DLGZ,qt4-patch,$(VERSION),$(QT4_PATCH_URL)))
+
+build/src/.unpacked: $(QT4_DL) $(QT4_PATCH_DL) qt4.patch
+ -rm -rf build
+ mkdir -p build/src
+ tar -C build/src --strip=1 -zxf $(QT4_DL)
+ zcat $(QT4_PATCH_DL)| patch -Np1 -d build/src
+ patch -Np2 -d build/src < qt4.patch
+ cp qconfig-palm.h build/src/src/corelib/global/
+ touch $@
+
+build/armv7/.built: build/src/.unpacked
+ -rm -rf build/armv7
+ mkdir -p build/armv7
+ @echo "Using armv6 mkspec, since for now the armv7 mkspec doesn't exist"
+ +cd build/armv7 && \
+ $(CCENV) \
+ `readlink -f ../src`/configure \
+ --prefix=$(STAGING_DIR)/usr \
+ -opensource \
+ -no-cups \
+ -no-nis \
+ -no-openssl \
+ -no-exceptions \
+ -no-accessibility \
+ -no-qt3support \
+ -no-xmlpatterns \
+ -no-multimedia \
+ -no-phonon \
+ -no-phonon-backend \
+ -no-svg \
+ -no-webkit \
+ -no-javascript-jit \
+ -no-scripttools \
+ -no-dbus \
+ -no-gtkstyle \
+ -no-xinput \
+ -no-libtiff \
+ -system-sqlite \
+ -reduce-relocations \
+ -glib \
+ -opengl es2 \
+ -confirm-license \
+ -make 'tools' \
+ -qpa \
+ -arch armv7 \
+ -xplatform qws/linux-armv6-g++ \
+ -fast \
+ -qconfig palm \
+ -DPALM_DEVICE
+ $(CCENV) $(MAKE) -C build/armv7 \
+ install_mkspecs \
+ install_qmake \
+ sub-moc-install_subtargets-ordered \
+ sub-uic-install_subtargets-ordered
+ touch $@
+
View
467 packages/sysmgr/qt4/qconfig-palm.h
@@ -0,0 +1,467 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Palm -->
+
+/* Enable WebOS specific code */
+#ifndef QT_WEBOS
+#define QT_WEBOS
+#endif
+
+/* Compiler features */
+#ifndef QT_NO_EXCEPTIONS
+#define QT_NO_EXCEPTIONS
+#endif
+
+#ifndef QT_NO_DYNAMIC_CAST
+#define QT_NO_DYNAMIC_CAST
+#endif
+
+/* Dialogs */
+#ifndef QT_NO_COLORDIALOG
+# define QT_NO_COLORDIALOG
+#endif
+#ifndef QT_NO_ERRORMESSAGE
+# define QT_NO_ERRORMESSAGE
+#endif
+#ifndef QT_NO_FILEDIALOG
+# define QT_NO_FILEDIALOG
+#endif
+#ifndef QT_NO_FONTDIALOG
+# define QT_NO_FONTDIALOG
+#endif
+#ifndef QT_NO_INPUTDIALOG
+# define QT_NO_INPUTDIALOG
+#endif
+#ifndef QT_NO_MESSAGEBOX
+# define QT_NO_MESSAGEBOX
+#endif
+#ifndef QT_NO_PRINTDIALOG
+# define QT_NO_PRINTDIALOG
+#endif
+#ifndef QT_NO_PRINTPREVIEWDIALOG
+# define QT_NO_PRINTPREVIEWDIALOG
+#endif
+#ifndef QT_NO_PROGRESSDIALOG
+# define QT_NO_PROGRESSDIALOG
+#endif
+#ifndef QT_NO_TABDIALOG
+# define QT_NO_TABDIALOG
+#endif
+#ifndef QT_NO_WIZARD
+# define QT_NO_WIZARD
+#endif
+
+/* File I/O */
+#ifndef QT_NO_DOM
+# define QT_NO_DOM
+#endif
+
+/* Fonts */
+#ifndef QT_NO_QWS_QPF
+# define QT_NO_QWS_QPF
+#endif
+#ifndef QT_NO_QWS_QPF2
+# define QT_NO_QWS_QPF2
+#endif
+
+/* Gui */
+#ifndef QT_NO_SOFTKEYMANAGER
+# define QT_NO_SOFTKEYMANAGER
+#endif
+
+/* Images */
+#ifndef QT_NO_IMAGEFORMAT_PPM
+# define QT_NO_IMAGEFORMAT_PPM
+#endif
+#ifndef QT_NO_IMAGEFORMAT_XBM
+# define QT_NO_IMAGEFORMAT_XBM
+#endif
+#ifdef QT_NO_IMAGEFORMAT_XPM
+# undef QT_NO_IMAGEFORMAT_XPM
+#endif
+#ifndef QT_NO_IMAGE_TEXT
+# define QT_NO_IMAGE_TEXT
+#endif
+#ifndef QT_NO_MOVIE
+# define QT_NO_MOVIE
+#endif
+
+/* ItemViews */
+#ifndef QT_NO_ITEMVIEWS
+# define QT_NO_ITEMVIEWS
+#endif
+#ifndef QT_NO_DATAWIDGETMAPPER
+# define QT_NO_DATAWIDGETMAPPER
+#endif
+#ifndef QT_NO_DIRMODEL
+# define QT_NO_DIRMODEL
+#endif
+#ifndef QT_NO_LISTVIEW
+# define QT_NO_LISTVIEW
+#endif
+#ifndef QT_NO_COLUMNVIEW
+# define QT_NO_COLUMNVIEW
+#endif
+#ifndef QT_NO_PROXYMODEL
+# define QT_NO_PROXYMODEL
+#endif
+#ifndef QT_NO_SORTFILTERPROXYMODEL
+# define QT_NO_SORTFILTERPROXYMODEL
+#endif
+#ifndef QT_NO_STANDARDITEMMODEL
+# define QT_NO_STANDARDITEMMODEL
+#endif
+#ifndef QT_NO_STRINGLISTMODEL
+# define QT_NO_STRINGLISTMODEL
+#endif
+#ifndef QT_NO_TABLEVIEW
+# define QT_NO_TABLEVIEW
+#endif
+#ifndef QT_NO_TREEVIEW
+# define QT_NO_TREEVIEW
+#endif
+
+/* Kernel */
+/*#ifndef QT_NO_CLIPBOARD
+# define QT_NO_CLIPBOARD
+#endif*/
+#ifndef QT_NO_CSSPARSER
+# define QT_NO_CSSPARSER
+#endif
+#ifndef QT_NO_CURSOR
+# define QT_NO_CURSOR
+#endif
+#ifndef QT_NO_SESSIONMANAGER
+# define QT_NO_SESSIONMANAGER
+#endif
+#ifndef QT_NO_SOUND
+# define QT_NO_SOUND
+#endif
+#ifndef QT_NO_TABLETEVENT
+# define QT_NO_TABLETEVENT
+#endif
+#ifndef QT_NO_TEXTHTMLPARSER
+# define QT_NO_TEXTHTMLPARSER
+#endif
+#ifdef QT_NO_WHEELEVENT
+# undef QT_NO_WHEELEVENT
+#endif
+
+/* Networking */
+//#ifndef QT_NO_COP
+//# define QT_NO_COP
+//#endif
+//#ifndef QT_NO_NETWORKPROXY
+//# define QT_NO_NETWORKPROXY
+//#endif
+//#ifndef QT_NO_SOCKS5
+//# define QT_NO_SOCKS5
+//#endif
+//#ifndef QT_NO_UDPSOCKET
+//# define QT_NO_UDPSOCKET
+//#endif
+#ifndef QT_NO_FTP
+# define QT_NO_FTP
+#endif
+
+/* Painting */
+#ifndef QT_NO_PICTURE
+# define QT_NO_PICTURE
+#endif
+#ifndef QT_NO_PRINTER
+# define QT_NO_PRINTER
+#endif
+#ifndef QT_NO_CUPS
+# define QT_NO_CUPS
+#endif
+
+/* Phonon */
+#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
+# define QT_NO_PHONON_ABSTRACTMEDIASTREAM
+#endif
+#ifndef QT_NO_PHONON_AUDIOCAPTURE
+# define QT_NO_PHONON_AUDIOCAPTURE
+#endif
+#ifndef QT_NO_PHONON_EFFECT
+# define QT_NO_PHONON_EFFECT
+#endif
+#ifndef QT_NO_PHONON_MEDIACONTROLLER
+# define QT_NO_PHONON_MEDIACONTROLLER
+#endif
+#ifndef QT_NO_PHONON_OBJECTDESCRIPTIONMODEL
+# define QT_NO_PHONON_OBJECTDESCRIPTIONMODEL
+#endif
+#ifndef QT_NO_PHONON_PLATFORMPLUGIN
+# define QT_NO_PHONON_PLATFORMPLUGIN
+#endif
+#ifndef QT_NO_PHONON_SEEKSLIDER
+# define QT_NO_PHONON_SEEKSLIDER
+#endif
+#ifndef QT_NO_PHONON_SETTINGSGROUP
+# define QT_NO_PHONON_SETTINGSGROUP
+#endif
+#ifndef QT_NO_PHONON_VIDEO
+# define QT_NO_PHONON_VIDEO
+#endif
+#ifndef QT_NO_PHONON_VOLUMESLIDER
+# define QT_NO_PHONON_VOLUMESLIDER
+#endif
+
+/* Qt for Embedded Linux */
+#ifndef QT_NO_QWSEMBEDWIDGET
+# define QT_NO_QWSEMBEDWIDGET
+#endif
+#ifndef QT_NO_QWS_ALPHA_CURSOR
+# define QT_NO_QWS_ALPHA_CURSOR
+#endif
+#ifndef QT_NO_QWS_DECORATION_DEFAULT
+# define QT_NO_QWS_DECORATION_DEFAULT
+#endif
+#ifndef QT_NO_QWS_MULTIPROCESS
+# define QT_NO_QWS_MULTIPROCESS
+#endif
+#ifndef QT_NO_QWS_TRANSFORMED
+# define QT_NO_QWS_TRANSFORMED
+#endif
+#ifndef QT_NO_QWS_VNC
+# define QT_NO_QWS_VNC
+#endif
+
+/* SVG */
+#ifndef QT_NO_SVG
+# define QT_NO_SVG
+#endif
+#ifndef QT_NO_GRAPHICSSVGITEM
+# define QT_NO_GRAPHICSSVGITEM
+#endif
+#ifndef QT_NO_SVGGENERATOR
+# define QT_NO_SVGGENERATOR
+#endif
+#ifndef QT_NO_SVGRENDERER
+# define QT_NO_SVGRENDERER
+#endif
+#ifndef QT_NO_SVGWIDGET
+# define QT_NO_SVGWIDGET
+#endif
+/* Styles */
+#ifndef QT_NO_STYLE_MOTIF
+# define QT_NO_STYLE_MOTIF
+#endif
+
+/* Utilities */
+#ifndef QT_NO_ACCESSIBILITY
+# define QT_NO_ACCESSIBILITY
+#endif
+#ifndef QT_NO_COMPLETER
+# define QT_NO_COMPLETER
+#endif
+#ifndef QT_NO_DESKTOPSERVICES
+# define QT_NO_DESKTOPSERVICES
+#endif
+#ifdef QT_NO_SCRIPT
+#error QT Declarative requires QT Script, disabled by QT_NO_SCRIPT
+#endif
+#ifndef QT_NO_SYSTEMTRAYICON
+# define QT_NO_SYSTEMTRAYICON
+#endif
+#ifndef QT_NO_UNDOCOMMAND
+# define QT_NO_UNDOCOMMAND
+#endif
+#ifndef QT_NO_UNDOGROUP
+# define QT_NO_UNDOGROUP
+#endif
+#ifndef QT_NO_UNDOSTACK
+# define QT_NO_UNDOSTACK
+#endif
+#ifndef QT_NO_UNDOVIEW
+# define QT_NO_UNDOVIEW
+#endif
+
+/* Widgets */
+#ifndef QT_NO_GROUPBOX
+# define QT_NO_GROUPBOX
+#endif
+#ifndef QT_NO_BUTTONGROUP
+# define QT_NO_BUTTONGROUP
+#endif
+#ifndef QT_NO_LCDNUMBER
+# define QT_NO_LCDNUMBER
+#endif
+#ifndef QT_NO_LINEEDIT
+// required for QDeclarative # define QT_NO_LINEEDIT
+#endif
+#ifndef QT_NO_COMBOBOX
+# define QT_NO_COMBOBOX
+#endif
+#ifndef QT_NO_FONTCOMBOBOX
+# define QT_NO_FONTCOMBOBOX
+#endif
+#ifndef QT_NO_SPINBOX
+# define QT_NO_SPINBOX
+#endif
+#ifndef QT_NO_CALENDARWIDGET
+# define QT_NO_CALENDARWIDGET
+#endif
+#ifndef QT_NO_DATETIMEEDIT
+# define QT_NO_DATETIMEEDIT
+#endif
+#ifndef QT_NO_LISTWIDGET
+# define QT_NO_LISTWIDGET
+#endif
+#ifndef QT_NO_MENU
+# define QT_NO_MENU
+#endif
+#ifndef QT_NO_CONTEXTMENU
+# define QT_NO_CONTEXTMENU
+#endif
+#ifndef QT_NO_MAINWINDOW
+# define QT_NO_MAINWINDOW
+#endif
+#ifndef QT_NO_DOCKWIDGET
+# define QT_NO_DOCKWIDGET
+#endif
+#ifndef QT_NO_TOOLBAR
+# define QT_NO_TOOLBAR
+#endif
+#ifndef QT_NO_MENUBAR
+# define QT_NO_MENUBAR
+#endif
+#ifndef QT_NO_WORKSPACE
+# define QT_NO_WORKSPACE
+#endif
+#ifndef QT_NO_PROGRESSBAR
+# define QT_NO_PROGRESSBAR
+#endif
+#ifndef QT_NO_RESIZEHANDLER
+# define QT_NO_RESIZEHANDLER
+#endif
+#ifndef QT_NO_RUBBERBAND
+# define QT_NO_RUBBERBAND
+#endif
+#ifndef QT_NO_SPLITTER
+# define QT_NO_SPLITTER
+#endif
+/*#ifndef QT_NO_SIGNALMAPPER
+# define QT_NO_SIGNALMAPPER
+#endif*/
+#ifndef QT_NO_SIZEGRIP
+# define QT_NO_SIZEGRIP
+#endif
+#ifndef QT_NO_DIAL
+# define QT_NO_DIAL
+#endif
+#ifndef QT_NO_PRINTPREVIEWWIDGET
+# define QT_NO_PRINTPREVIEWWIDGET
+#endif
+#ifndef QT_NO_MDIAREA
+# define QT_NO_MDIAREA
+#endif
+#ifndef QT_NO_TEXTEDIT
+# define QT_NO_TEXTEDIT
+#endif
+#ifndef QT_NO_SYNTAXHIGHLIGHTER
+# define QT_NO_SYNTAXHIGHLIGHTER
+#endif
+#ifndef QT_NO_TEXTBROWSER
+# define QT_NO_TEXTBROWSER
+#endif
+#ifndef QT_NO_SPINWIDGET
+# define QT_NO_SPINWIDGET
+#endif
+#ifndef QT_NO_SPLASHSCREEN
+# define QT_NO_SPLASHSCREEN
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+# define QT_NO_STACKEDWIDGET
+#endif
+#ifndef QT_NO_TABWIDGET
+# define QT_NO_TABWIDGET
+#endif
+#ifndef QT_NO_STATUSBAR
+# define QT_NO_STATUSBAR
+#endif
+#ifndef QT_NO_STATUSTIP
+# define QT_NO_STATUSTIP
+#endif
+#ifndef QT_NO_TABLEWIDGET
+# define QT_NO_TABLEWIDGET
+#endif
+#ifndef QT_NO_TOOLBUTTON
+# define QT_NO_TOOLBUTTON
+#endif
+#ifndef QT_NO_TABBAR
+# define QT_NO_TABBAR
+#endif
+#ifndef QT_NO_TOOLBOX
+# define QT_NO_TOOLBOX
+#endif
+#ifndef QT_NO_WHATSTHIS
+# define QT_NO_WHATSTHIS
+#endif
+#ifndef QT_NO_TOOLTIP
+# define QT_NO_TOOLTIP
+#endif
+#ifndef QT_NO_TREEWIDGET
+# define QT_NO_TREEWIDGET
+#endif
+#ifndef QT_NO_VALIDATOR
+# define QT_NO_VALIDATOR
+#endif
+
+#ifndef QT_NO_IDENTITYPROXYMODEL
+#define QT_NO_IDENTITYPROXYMODEL
+#endif
+
+/* Windows */
+#ifndef QT_NO_WIN_ACTIVEQT
+# define QT_NO_WIN_ACTIVEQT
+#endif
+
+// Desktop specific flags
+#if !defined(PALM_DEVICE)
+#undef QT_NO_IMAGEFORMAT_XPM
+#undef QT_NO_CURSOR
+#undef QT_NO_WHEELEVENT
+#undef QT_NO_LINEEDIT
+#endif
+
+// <-- Palm
View
43 packages/sysmgr/qt4/qt4.patch
@@ -0,0 +1,43 @@
+diff --git a/qt4/configure b/qt4/configure
+index 0a420db..db3fee7 100755
+--- a/qt4/configure
++++ b/qt4/configure
+@@ -5635,6 +5635,8 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "ye
+ if [ -n "$PKG_CONFIG" ]; then
+ QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
+ QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
++ else
++ QT_LIBS_GLIB="-lglib-2.0 -lgthread-2.0 -lpthread -lrt"
+ fi
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/glib "Glib" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_GLIB $QT_LIBS_GLIB $X11TESTS_FLAGS ; then
+ CFG_GLIB=yes
+--- a/qt4/mkspecs/qws/linux-armv6-g++/qmake.conf
++++ b/qt4/mkspecs/qws/linux-armv6-g++/qmake.conf
+@@ -24,15 +24,20 @@
+ QMAKE_STRIP = $$(STRIP_TMP)
+ QMAKE_LIBS_OPENGL_ES2 = -Wl,-rpath $(STAGING_LIBDIR) -lGLESv2 -lEGL
+
+-QMAKE_CFLAGS += \
+- -I$(STAGING_INCDIR)
++QMAKE_CFLAGS += \
++ -I$(STAGING_INCDIR) \
++ -I$(STAGING_INCDIR)/glib-2.0 \
++ -I$(STAGING_INCDIR)/GLES2
+
+-QMAKE_CXXFLAGS += \
+- -I$(STAGING_INCDIR)
++QMAKE_CXXFLAGS += \
++ -I$(STAGING_INCDIR) \
++ -I$(STAGING_INCDIR)/glib-2.0 \
++ -I$(STAGING_INCDIR)/GLES2
+
+-QMAKE_LFLAGS += \
+- -L$(STAGING_LIBDIR) \
+- -Wl,-rpath $(STAGING_LIBDIR) # <HACK> WHY DO I HAVE TO ADD THIS?
++QMAKE_LFLAGS += \
++ -L$(STAGING_LIBDIR) \
++ -L$(STAGING_LIBDIR)/../../lib \
++ -Wl,-rpath $(STAGING_LIBDIR) # <HACK> WHY DO I HAVE TO ADD THIS?
+
+
+ QMAKE_INCDIR_OPENGL_ES2 = $(STAGING_INCDIR)
View
48 packages/web/webcore/Makefile
@@ -0,0 +1,48 @@
+# webcore
+# Extract needed headers, don't actually build yet.
+# This also handles the npapi headers,
+# which are partially pulled in from the isis-project repo.
+
+LEVEL=../../..
+
+include $(LEVEL)/Makefile.common
+
+QTPATH := $(shell readlink -f $(LEVEL)/packages/sysmgr/qt4/build/armv7)
+QMAKE := $(QTPATH)/bin/qmake-palm
+
+.PHONY: build unpack patch
+build:: build/.staged
+unpack: build/src/.unpacked
+
+WEBCORE_URL := http://downloads.help.palm.com/opensource/3.0.5/webcore.tgz
+WEBCORE_PATCH_URL := http://downloads.help.palm.com/opensource/3.0.5/webcore-patch.gz
+NPUPP_URL := "https://raw.github.com/isis-project/npapi-headers/72cc23fe0c94a36bdbeaac7323dae86a452f51df/debian/npapiheaders/usr/include/npupp.h"
+
+WEBCORE_DL = $(DL_DIR)/webcore-3.0.5.tar.gz
+WEBCORE_PATCH_DL = $(DL_DIR)/webcore-patch-3.0.5.gz
+
+$(eval $(call DLTGZ,webcore,3.0.5,$(WEBCORE_URL)))
+$(eval $(call DLGZ,webcore-patch,3.0.5,$(WEBCORE_PATCH_URL)))
+
+build/src/.unpacked: $(WEBCORE_DL) $(WEBCORE_PATCH_DL)
+ -rm -rf build
+ mkdir -p build/src
+ tar -C build/src --strip=1 -zxf $(WEBCORE_DL)
+ # Ignore patch failures for now, it's a known issue
+ -cd build/src && zcat ../../$(WEBCORE_PATCH_DL) | patch -p2 -fr -
+ wget $(NPUPP_URL) -O build/npupp.h
+ touch $@
+
+# Copy needed headers over into appropriate location in the staging directory
+WEBKIT_DIR := $(STAGING_DIR)/usr/include/webkit
+build/.staged: build/src/.unpacked
+ rm -f $@
+ install -d $(WEBKIT_DIR)
+ install -m 644 build/src/platform/graphics/pg/*.h $(WEBKIT_DIR)
+ install -d $(WEBKIT_DIR)/npapi
+ install -m 644 build/src/bridge/npapi.h $(WEBKIT_DIR)/npapi
+ install -m 644 build/src/bridge/npruntime.h $(WEBKIT_DIR)/npapi
+ install -m 644 build/src/plugins/npfunctions.h $(WEBKIT_DIR)/npapi
+ install -m 644 build/npupp.h $(WEBKIT_DIR)/npapi
+ touch $@
+
View
42 packages/web/webkit/Makefile
@@ -0,0 +1,42 @@
+# webkit handling
+# Extract needed headers, don't actually build yet.
+
+LEVEL=../../..
+
+include $(LEVEL)/Makefile.common
+
+QTPATH := $(shell readlink -f $(LEVEL)/packages/sysmgr/qt4/build/armv7)
+QMAKE := $(QTPATH)/bin/qmake-palm
+
+.PHONY: build unpack patch
+build:: build/.staged
+unpack: build/src/.unpacked
+
+WEBKIT_URL := http://downloads.help.palm.com/opensource/3.0.5/webkit.tgz
+WEBKIT_PATCH_URL := http://downloads.help.palm.com/opensource/3.0.5/webkit-patch.gz
+
+WEBKIT_DL = $(DL_DIR)/webkit-3.0.5.tar.gz
+WEBKIT_PATCH_DL = $(DL_DIR)/webkit-patch-3.0.5.gz
+
+$(eval $(call DLTGZ,webkit,3.0.5,$(WEBKIT_URL)))
+$(eval $(call DLGZ,webkit-patch,3.0.5,$(WEBKIT_PATCH_URL)))
+
+build/src/.unpacked: $(WEBKIT_DL) $(WEBKIT_PATCH_DL)
+ -rm -rf build
+ mkdir -p build/src
+ tar -C build/src --strip=1 -zxf $(WEBKIT_DL)
+ # Ignore patch failures for now, it's a known issue
+ -cd build/src && zcat ../../$(WEBKIT_PATCH_DL) | patch -p2 -fr -
+ touch $@
+
+# Copy needed headers over into appropriate location in the staging directory
+WEBKIT_DIR := $(STAGING_DIR)/usr/include/webkit
+build/.staged: build/src/.unpacked
+ rm -f $@
+ install -d $(WEBKIT_DIR)
+ install -m 644 build/src/palm/webkit/*.h $(WEBKIT_DIR)
+ install -m 644 build/src/palm/Api/*.h $(WEBKIT_DIR)
+ install -m 644 build/src/palm/WebCoreSupport/WebGLES2Context.h $(WEBKIT_DIR)
+ install -m 644 build/src/palm/WebCoreSupport/WebNonCopyable.h $(WEBKIT_DIR)
+ touch $@
+
View
13 scripts/timestamp.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+
+maxtime = 0
+for file in sys.argv[1:]:
+ (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(file)
+ if (mtime > maxtime):
+ maxtime = mtime
+
+sys.stdout.write("%d" % maxtime);
View
30 scripts/unpack-doctor-rootfs
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+[ -f $1 ] || exit 1
+[ -d $2 ] || exit 1
+
+NAME=`basename $1 .jar`
+ROOTFS=$2
+
+rm -rf $NAME
+mkdir -p $NAME/jar $NAME/webOS $NAME/rootfs
+unzip -q -X -d $NAME/jar $1
+tar -C $NAME/webOS -p -x -f $NAME/jar/resources/webOS.tar
+if [ -f $NAME/webOS/nova-cust-image-castle.rootfs.tar.gz ] ; then
+ tar -C $ROOTFS -p -z -x -f $NAME/webOS/nova-cust-image-castle.rootfs.tar.gz --exclude ./dev
+fi
+if [ -f $NAME/webOS/nova-cust-image-pixie.rootfs.tar.gz ] ; then
+ tar -C $ROOTFS -p -z -x -f $NAME/webOS/nova-cust-image-pixie.rootfs.tar.gz --exclude ./dev
+fi
+if [ -f $NAME/webOS/nova-cust-image-roadrunner.rootfs.tar.gz ] ; then
+ tar -C $ROOTFS -p -z -x -f $NAME/webOS/nova-cust-image-roadrunner.rootfs.tar.gz --exclude ./dev
+fi
+if [ -f $NAME/webOS/nova-cust-image-broadway.rootfs.tar.gz ] ; then
+ tar -C $ROOTFS -p -z -x -f $NAME/webOS/nova-cust-image-broadway.rootfs.tar.gz --exclude ./dev
+fi
+if [ -f $NAME/webOS/nova-cust-image-topaz.rootfs.tar.gz ] ; then
+ tar -C $ROOTFS -p -z -x -f $NAME/webOS/nova-cust-image-topaz.rootfs.tar.gz --exclude ./dev
+fi
+rm -rf $NAME
+
+exit 0
View
18 support/cross-compile.mk
@@ -0,0 +1,18 @@
+# cross-compile variables
+# little more hard-coded to armv7 than I'd like, but oh well.
+
+STAGING_DIR = $(shell readlink -m $(LEVEL)/staging/armv7)
+TCDIR = $(shell readlink -m $(LEVEL)/toolchain/arm-2009q1)
+TCTOOLPREFIX = $(TCDIR)/bin/arm-none-linux-gnueabi-
+
+CCENV := PATH=$(TCDIR)/bin:$(PATH)
+CCENV += STAGING_LIBDIR=$(STAGING_DIR)/usr/lib
+CCENV += STAGING_INCDIR=$(STAGING_DIR)/usr/include
+CCENV += CC_TMP=$(TCTOOLPREFIX)gcc
+CCENV += CXX_TMP=$(TCTOOLPREFIX)g++
+CCENV += AR_TMP=$(TCTOOLPREFIX)ar
+CCENV += OBJCOPY_TMP=$(TCTOOLPREFIX)objcopy
+CCENV += STRIP_TMP=$(TCTOOLPREFIX)strip
+CCENV += CFLAGS_TMP="-O2 -marm -march=armv7-a -ftree-vectorize -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a8"
+CCENV += CXXFLAGS_TMP="-O2 -marm -march=armv7-a -ftree-vectorize -mfpu=neon -mfloat-abi=softfp -mtune=cortex-a8"
+CCENV += MACHINE=topaz
View
52 support/dl.mk
@@ -0,0 +1,52 @@
+# Useful definitions for downloading files
+
+# Builds tar.bz2 dl rule
+# Arguments: NAME, VERSION, URL
+define DLBZ2
+$(DL_DIR)/$1-$2.tar.bz2:
+ rm -f $$@ $$@.tmp
+ mkdir -p $(DL_DIR)
+ curl -f -R -L -o $$@.tmp $3
+ mv $$@.tmp $$@
+endef
+#
+# Builds tar.gz dl rule
+# Arguments: NAME, VERSION, URL
+define DLTGZ
+$(DL_DIR)/$1-$2.tar.gz:
+ rm -f $$@ $$@.tmp
+ mkdir -p $(DL_DIR)
+ curl -f -R -L -o $$@.tmp $3
+ mv $$@.tmp $$@
+endef
+
+#
+# Builds .gz dl rule
+# Arguments: NAME, VERSION, URL
+define DLGZ
+$(DL_DIR)/$1-$2.gz:
+ rm -f $$@ $$@.tmp
+ mkdir -p $(DL_DIR)
+ curl -f -R -L -o $$@.tmp $3
+ mv $$@.tmp $$@
+endef
+
+# Builds tar.gz from specified git checkout
+# Intended for exact git commit-id's as version
+# Arguments: NAME, GITREV, URL
+define DLGIT
+$(DL_DIR)/$1-$2.tar.gz:
+ rm -f $$@
+ mkdir -p $(DL_DIR)
+ if [ ! -e $(DL_DIR)/$1-git ] ; then \
+ git clone -n $3 $(DL_DIR)/$1-git ; \
+ elif [ -L $(DL_DIR)/$1-git ] ; then \
+ true ; \
+ else \
+ ( cd $(DL_DIR)/$1-git ; git fetch ) ; \
+ fi
+ cd $(DL_DIR)/$1-git ; git checkout $2
+ tar -C $(DL_DIR)/$1-git -zcf $$@ .
+ ( cd $(DL_DIR)/$1-git ; git log --pretty="format:%ct" -n 1 $2 ) | \
+ python -c 'import os,sys; time = int(sys.stdin.read()); os.utime("$$@",(time,time));'
+endef
View
71 support/doctors.mk
@@ -0,0 +1,71 @@
+${DOCTOR_DIR}/webosdoctorp100ueu-wr-1.4.5.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pre/p145r0d06302010/eudep145rod/webosdoctorp100ueu-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp121ewweu-wr-1.4.5.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pixiplus/px145r0d06302010/wrep145rod/webosdoctorp121ewweu-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp101ewwverizonwireless-1.4.5.1.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/preplus/p1451r0d05182011/ver1z0np1451rod/webosdoctorp101ewwverizonwireless.jar
+
+${DOCTOR_DIR}/webosdoctorp121ewwverizonwireless-1.4.5.1.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pixiplus/px1451r0d05182011/ver1z0np1451rod/webosdoctorp121ewwverizonwireless.jar
+
+${DOCTOR_DIR}/webosdoctorp103ueu-wr-2.0.0.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pre2/p20r0d11182010/wrep20rod/webosdoctorp103ueu-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp102ueuna-wr-2.0.1.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pre2/p201r0d11242010/wrep201rod/webosdoctorp102ueuna-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp101ueu-wr-2.1.0.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/preplus/p210r0d03142011/eudep210rod/webosdoctorp101ueu-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp103ueuna-wr-2.1.0.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pre2/p210sfr03082011/wrep210rod/webosdoctorp103ueuna-wr.jar
+
+${DOCTOR_DIR}/webosdoctorp160una-wr-2.1.1.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/veer/p211r0d06292011/wrp211rod/webosdoctorp160unawr.jar
+
+${DOCTOR_DIR}/webosdoctorp160unaatt-2.1.2.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/veer/p212r0d05132011/attp212rod/webosdoctorp160unaatt.jar
+
+${DOCTOR_DIR}/webosdoctorp220manta-wr-2.2.0.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/manta/p220r0d08222011/wdmantarow/webosdoctorp220mantawr.jar
+
+${DOCTOR_DIR}/webosdoctorp223mantaatt-2.2.3.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/manta/p223r0d09272011/wdmantaatt/webosdoctorp223mantaatt.jar
+
+${DOCTOR_DIR}/webosdoctorp224pre2-wr-2.2.4.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/pre2/p224rod12052011/wrep224rod/webosdoctorp224pre2wr.jar
+
+${DOCTOR_DIR}/webosdoctorp224manta-wr-2.2.4.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/manta/p224r0d12192011/wdmantawr/webosdoctorp224mantawr.jar
+
+${DOCTOR_DIR}/webosdoctorp300hstnhwifi-3.0.0.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/touchpad/wd300wifi/webosdoctorp300hstnhwifi.jar
+
+${DOCTOR_DIR}/webosdoctorp302hstnhwifi-3.0.2.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/touchpad/p302r0d08012011/wifip302rod/webosdoctorp302hstnhwifi.jar
+
+${DOCTOR_DIR}/webosdoctorp304hstnhwifi-3.0.4.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/touchpad/p304rod10182011/wd304wifi/webosdoctorp304hstnhwifi.jar
+
+${DOCTOR_DIR}/webosdoctorp305hstnhwifi-3.0.5.jar:
+ mkdir -p ${DOCTOR_DIR}
+ curl -L -o $@ http://palm.cdnetworks.net/rom/touchpad/p305rod01122012/wd305wifi/webosdoctorp305hstnhwifi.jar
View
12 support/headlessapp.mk
@@ -0,0 +1,12 @@
+HEADLESSAPP_SOURCE = git://git.webos-internals.org/applications/headlessapp.git
+
+${DL_DIR}/headlessapp-${HEADLESSAPP_VERSION}.tar.gz:
+ rm -f $@
+ rm -rf build/headlessapp
+ mkdir -p build
+ ( cd build ; git clone -n ${HEADLESSAPP_SOURCE} ; cd headlessapp ; git checkout v${HEADLESSAPP_VERSION} )
+ rm -f build/headlessapp/appinfo.json build/headlessapp/icon.png
+ mkdir -p ${DL_DIR}
+ tar -C build/headlessapp -zcf $@ .
+ ( cd build/headlessapp ; git log --pretty="format:%ct" -n 1 v${HEADLESSAPP_VERSION} ) | \
+ python -c 'import os,sys; time = int(sys.stdin.read()); os.utime("$@",(time,time));'
View
15 support/install-headers.mk
@@ -0,0 +1,15 @@
+# Install staging headers
+
+
+BS_FOSS_TGZ := build-support-foss.tgz
+BS_PALM_TGZ := build-support-palm.tgz
+
+staging/armv7/usr/include/.staged: staging/$(WOCE_ARCH)/.unpacked $(BUILD_SUPPORT_DL)
+ -rm -rf staging/armv7/usr/include
+ mkdir -p staging/armv7/usr/include
+ tar -zOxf $(BUILD_SUPPORT_DL) CE-build-support/$(BS_FOSS_TGZ) | \
+ tar -C staging/armv7/usr/ --strip=1 -zx
+ tar -zOxf $(BUILD_SUPPORT_DL) CE-build-support/$(BS_PALM_TGZ) | \
+ tar -C staging/armv7/usr/ --strip=1 -zx
+ tar -C staging/armv7/usr/lib --strip=4 -zxf $(BUILD_SUPPORT_DL) CE-build-support/staging/arm-none-linux-gnueabi/lib
+ touch $@
View
261 support/package.mk
@@ -0,0 +1,261 @@
+# Makefile for PreWare plugin packaging
+#
+# Copyright (C) 2009 by Rod Whitby <rod@whitby.id.au>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+ifndef NAME
+PREWARE_SANITY += $(error "Please define NAME in your Makefile")
+endif
+ifndef TITLE
+PREWARE_SANITY += $(error "Please define TITLE in your Makefile")
+endif
+ifndef VERSION
+PREWARE_SANITY += $(error "Please define VERSION in your Makefile")
+endif
+ifndef APP_ID
+PREWARE_SANITY += $(error "Please define APP_ID in your Makefile")
+endif
+ifndef TYPE
+PREWARE_SANITY += $(error "Please define TYPE in your Makefile")
+endif
+ifndef CATEGORY
+PREWARE_SANITY += $(error "Please define CATEGORY in your Makefile")
+endif
+
+ipkgs/${APP_ID}_${VERSION}_%.ipk: build/.built-${VERSION}
+ rm -f ipkgs/${APP_ID}_${VERSION}_$*.ipk
+ rm -f build/$*/CONTROL/conffiles
+ ${MAKE} build/$*/CONTROL/conffiles
+ rm -f build/$*/CONTROL/control
+ ${MAKE} build/$*/CONTROL/control
+ rm -f build/$*/CONTROL/postinst
+ ${MAKE} build/$*/CONTROL/postinst
+ rm -f build/$*/CONTROL/prerm
+ ${MAKE} build/$*/CONTROL/prerm
+ rm -f build/$*/CONTROL/conffiles
+ ${MAKE} build/$*/CONTROL/conffiles
+ mkdir -p ipkgs
+ if [ -n "${SIGNER}" ] && [ -e $(LEVEL)/../sign/${SIGNER}.crt ] && [ -e $(LEVEL)/../sign/${SIGNER}.key ] ; then \
+ ( cd build ; \
+ TAR_OPTIONS="--wildcards --mode=g-s" \
+ $(LEVEL)/../toolchain/ipkg-utils/ipkg-build -o 0 -g 0 ${BLDFLAGS} \
+ -s $(shell cd $(LEVEL)/.. ; pwd)/sign/${SIGNER}.crt -k $(shell cd $(LEVEL)/.. ; pwd)/sign/${SIGNER}.key \
+ $* ) ; \
+ else \
+ ( cd build ; \
+ TAR_OPTIONS="--wildcards --mode=g-s" \
+ $(LEVEL)/../toolchain/ipkg-utils/ipkg-build -o 0 -g 0 ${BLDFLAGS} $* ) ; \
+ fi
+ mv build/${APP_ID}_${VERSION}_$*.ipk $@
+
+build/%/CONTROL/postinst:
+ if [ -e control/postinst ] ; then \
+ install -m 755 control/postinst $@ ; \
+ fi
+
+build/%/CONTROL/prerm:
+ if [ -e control/prerm ] ; then \
+ install -m 755 control/prerm $@ ; \
+ fi
+
+build/%/CONTROL/conffiles:
+ if [ -e control/conffiles ] ; then \
+ install -m 755 control/conffiles $@ ; \
+ fi
+
+ifeq ("${TYPE}", "Application")
+build/%/CONTROL/control: build/%/usr/palm/applications/${APP_ID}/appinfo.json
+else ifdef SRC_OPTWARE
+build/%/CONTROL/control: build/%.control
+else
+build/%/CONTROL/control: /dev/null
+endif
+ $(call PREWARE_SANITY)
+ rm -f $@
+ mkdir -p build/$*/CONTROL
+ echo "Package: ${APP_ID}" > $@
+ /bin/echo -n "Version: " >> $@
+ifdef VERSION
+ echo "${VERSION}" >> $@
+else ifeq ("${TYPE}", "Application")
+ sed -ne 's|^[[:space:]]*"version":[[:space:]]*"\(.*\)",[[:space:]]*$$|\1|p' $< >> $@
+else
+ echo "0.0.0" >> $@
+endif
+ echo "Architecture: $*" >> $@
+ /bin/echo -n "Maintainer: " >> $@
+ifdef MAINTAINER
+ echo "${MAINTAINER}" >> $@
+else ifeq ("${TYPE}", "Application")
+ sed -ne 's|^[[:space:]]*"vendor":[[:space:]]*"\(.*\)",[[:space:]]*|\1|p' $< | tr -d '\n' >> $@
+ /bin/echo -n " <" >> $@
+ sed -ne 's|^[[:space:]]*"vendor_email":[[:space:]]*"\(.*\)",[[:space:]]*|\1|p' $< | tr -d '\n' >> $@
+ echo ">" >> $@
+else
+ echo "WebOS Ports <woce@lists.webos-ports.org>" >> $@
+endif
+ /bin/echo -n "Description: " >> $@
+ifdef TITLE
+ echo "${TITLE}" >> $@
+else ifeq ("${TYPE}", "Application")
+ sed -ne 's|^[[:space:]]*"title":[[:space:]]*"\(.*\)",[[:space:]]*$$|\1|p' $< >> $@
+else
+ echo "${NAME}" >> $@
+endif
+ifdef CATEGORY
+ echo "Section: ${CATEGORY}" >> $@
+else
+ echo "Section: Unsorted" >> $@
+endif
+ifdef PRIORITY
+ echo "Priority: ${PRIORITY}" >> $@
+else
+ echo "Priority: optional" >> $@
+endif
+ifdef SRC_OPTWARE
+ifdef DEPENDS
+ echo "Depends: org.webosinternals.optware, ${DEPENDS}" >> $@
+else
+ echo "Depends: org.webosinternals.optware" >> $@
+endif
+else
+ echo "Depends: ${DEPENDS}" >> $@
+endif
+ifdef CONFLICTS
+ echo "Conficts: ${CONFLICTS}" >> $@
+endif
+ /bin/echo -n "Source: { " >> $@
+ifdef SOURCE
+ /bin/echo -n "\"Source\":\"${SOURCE}\", " >> $@
+else ifdef SRC_IPKG
+ /bin/echo -n "\"Source\":\"${SRC_IPKG}\", ">> $@
+else ifdef SRC_TGZ
+ /bin/echo -n "\"Source\":\"${SRC_TGZ}\", " >> $@
+else ifdef SRC_ZIP
+ /bin/echo -n "\"Source\":\"${SRC_ZIP}\", " >> $@
+else ifdef SRC_GIT
+ /bin/echo -n "\"Source\":\"${SRC_GIT}\", " >> $@
+else ifdef SRC_OPTWARE
+ /bin/echo -n "\"Source\":\"`sed -n -e 's|Source: \(.*\)|\1|p' build/$*.control`, http://trac.nslu2-linux.org/optware\", ">> $@
+else
+ true
+endif
+ifdef FEED
+ /bin/echo -n "\"Feed\":\"${FEED}\"" >> $@
+else ifdef SRC_OPTWARE
+ /bin/echo -n "\"Feed\":\"Optware\"" >> $@
+else
+ /bin/echo -n "\"Feed\":\"WebOS Internals\"" >> $@
+endif
+ifdef TYPE
+ /bin/echo -n ", \"Type\":\"${TYPE}\"" >> $@
+endif
+ifdef CATEGORY
+ /bin/echo -n ", \"Category\":\"${CATEGORY}\"" >> $@
+endif
+ifdef SRC_IPKG
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py ${DL_DIR}/${APP_ID}_${VERSION}_all.ipk >> $@
+ /bin/echo -n "\"" >> $@
+else ifdef SRC_TGZ
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py ${DL_DIR}/${NAME}-${VERSION}.tar.gz >> $@
+ /bin/echo -n "\"" >> $@
+else ifdef SRC_ZIP
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py ${DL_DIR}/${NAME}-${VERSION}.zip >> $@
+ /bin/echo -n "\"" >> $@
+else ifdef SRC_GIT
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py ${DL_DIR}/${NAME}-${VERSION}.tar.gz >> $@
+ /bin/echo -n "\"" >> $@
+else ifdef SRC_OPTWARE
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py ${DL_DIR}/${SRC_OPTWARE}_$*.ipk Makefile >> $@
+ /bin/echo -n "\"" >> $@
+else
+ /bin/echo -n ", \"LastUpdated\":\"" >> $@
+ $(LEVEL)/scripts/timestamp.py Makefile >> $@
+ /bin/echo -n "\"" >> $@
+endif
+ifdef TITLE
+ /bin/echo -n ", \"Title\":\"${TITLE}\"" >> $@
+endif
+ /bin/echo -n ", \"FullDescription\":\"" >> $@
+ifdef DESCRIPTION
+ /bin/echo -n "${DESCRIPTION}" >> $@
+else ifdef SRC_OPTWARE
+ /bin/echo -n "`sed -n -e 's|Description: \(.*\)|\1|p' build/$*.control`" >> $@
+else ifdef TITLE
+ /bin/echo -n "${TITLE}" >> $@
+endif
+ifdef CHANGELOG
+ /bin/echo -n "<br>Changelog:<br>${CHANGELOG}" >> $@
+endif
+ /bin/echo -n "\"" >> $@
+ifdef HOMEPAGE
+ /bin/echo -n ", \"Homepage\":\"${HOMEPAGE}\"" >> $@
+endif
+ifdef ICON
+ /bin/echo -n ", \"Icon\":\"${ICON}\"" >> $@
+endif
+ifdef SCREENSHOTS
+ /bin/echo -n ", \"Screenshots\":${SCREENSHOTS}" >> $@
+endif
+ifdef LICENSE
+ /bin/echo -n ", \"License\":\"${LICENSE}\"" >> $@
+endif
+ifdef POSTINSTALLFLAGS
+ /bin/echo -n ", \"PostInstallFlags\":\"${POSTINSTALLFLAGS}\"" >> $@
+endif
+ifdef POSTUPDATEFLAGS
+ /bin/echo -n ", \"PostUpdateFlags\":\"${POSTUPDATEFLAGS}\"" >> $@
+endif
+ifdef POSTREMOVEFLAGS
+ /bin/echo -n ", \"PostRemoveFlags\":\"${POSTREMOVEFLAGS}\"" >> $@
+endif
+ifdef MINWEBOSVERSION
+ /bin/echo -n ", \"MinWebOSVersion\":\"${MINWEBOSVERSION}\"" >> $@
+endif
+ifdef MAXWEBOSVERSION
+ /bin/echo -n ", \"MaxWebOSVersion\":\"${MAXWEBOSVERSION}\"" >> $@
+endif
+ifdef DEVICECOMPATIBILITY
+ /bin/echo -n ", \"DeviceCompatibility\":${DEVICECOMPATIBILITY}" >> $@
+endif
+ifdef PREINSTALLMESSAGE
+ /bin/echo -n ", \"PreInstallMessage\":\"${PREINSTALLMESSAGE}\"" >> $@
+endif
+ifdef PREUPDATEMESSAGE
+ /bin/echo -n ", \"PreUpdateMessage\":\"${PREUPDATEMESSAGE}\"" >> $@
+endif
+ifdef PREREMOVEMESSAGE
+ /bin/echo -n ", \"PreRemoveMessage\":\"${PREREMOVEMESSAGE}\"" >> $@
+endif
+ifdef VISIBILITY
+ /bin/echo -n ", \"Visibility\":\"${VISIBILITY}\"" >> $@
+endif
+ echo " }" >> $@
+ touch $@
+
+.PHONY: clobber
+clobber::
+ rm -rf ipkgs
+
+.PHONY: clean
+clean::
+ rm -rf build/src build/src-* build/arm build/armv6 build/armv7 build/i686
View
25 support/rootfs.mk
@@ -0,0 +1,25 @@
+# armv7 rootfs rule
+$(LEVEL)/rootfs/armv7/.unpacked: $(DOCTOR_DIR)/webosdoctorp305hstnhwifi-3.0.5.jar
+ -rm -rf $(LEVEL)/rootfs/armv7
+ mkdir -p $(LEVEL)/rootfs/armv7
+ $(LEVEL)/scripts/unpack-doctor-rootfs $< $(LEVEL)/rootfs/armv7
+ touch $@
+
+# Fix linker scripts using absolute paths,
+# and add some (needed) missing symlinks.
+define fixlibs
+ for lib in `grep -l "GNU ld script" -l $1/*.so`; do \
+ mv $$lib $${lib}_orig; \
+ sed 's@/usr/lib/@@g;s@/lib/@@g' $${lib}_orig > $$lib;\
+ done
+ cd $1 && ln -s libglib-2.0.so.0 libglib-2.0.so
+ cd $1 && ln -s libgthread-2.0.so.0 libgthread-2.0.so
+endef
+
+# General staging rule
+staging/%/.unpacked: rootfs/%/.unpacked
+ -rm -rf staging/$*
+ mkdir -p staging/$*
+ cp -pR rootfs/$*/. staging/$*
+ $(call fixlibs,staging/$*/usr/lib/)
+ touch $@
View
13 support/srvln.mk
@@ -0,0 +1,13 @@
+# Link directories from /srv/ if they exist...
+$(LEVEL)/%/.created:
+ @if [ ! -d $(@D) ]; then \
+ if [ -e /srv/$* ]; then \
+ ln -sf /srv/$* $(@D); \
+ else \
+ mkdir -p $(@D); \
+ fi \
+ fi
+ @touch $@
+
+.PHONY: linkdirs
+linkdirs:: $(DL_DIR)/.created $(DOCTOR_DIR)/.created
View
23 support/toolchains.mk
@@ -0,0 +1,23 @@
+TOOLCHAINS := arm-2007q3 arm-2009q1
+arm-2007q3_VERSION := 2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu
+arm-2009q1_VERSION := 2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu
+
+TC_URL = https://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-$1.tar.bz2
+
+# Arguments: toolchain shortname
+define TCRULE
+$(TOOLCHAIN_DIR)/$1/.unpacked: $(DL_DIR)/arm-$($1_VERSION).tar.bz2
+ rm -rf $(TOOLCHAIN_DIR)/$1
+ -rm -rf $(TOOLCHAIN_DIR)/$1-tmp
+ mkdir -p $(TOOLCHAIN_DIR)/$1-tmp
+ tar -C $(TOOLCHAIN_DIR)/$1-tmp -jxf $$< $1
+ mv $(TOOLCHAIN_DIR)/$1-tmp/$1 $(TOOLCHAIN_DIR)/$1
+ rmdir $(TOOLCHAIN_DIR)/$1-tmp
+ touch $$@
+endef
+
+# Build rules for extracting each toolchain
+$(foreach t,$(TOOLCHAINS),$(eval $(call TCRULE,$t)))
+
+# Build rules for downloading each toolchain
+$(foreach t,$(TOOLCHAINS),$(eval $(call DLBZ2,arm,$($t_VERSION),$(call TC_URL,$($t_VERSION)))))
View
17 support/woce-dl.mk
@@ -0,0 +1,17 @@
+# Information about the big webos-WOCE tarball
+WOCE_VERSION := unknown-1.0
+WOCE_NAME := webos-WOCE
+WOCE_URL := https://github.com/downloads/woce/LunaSysMgr/webOS-WOCE.tgz
+
+# And the matching 'build-support' package
+BUILD_SUPPORT_VERSION := unknown-1.0
+BUILD_SUPPORT_NAME := CEbuild-support
+BUILD_SUPPORT_URL := https://github.com/downloads/woce/build-support/CE-build-support.tgz
+
+# Build rules for downloading these
+$(eval $(call DLTGZ,$(WOCE_NAME),$(WOCE_VERSION),$(WOCE_URL)))
+$(eval $(call DLTGZ,$(BUILD_SUPPORT_NAME),$(BUILD_SUPPORT_VERSION),$(BUILD_SUPPORT_URL)))
+
+# And export their download locations
+WOCE_DL = $(DL_DIR)/$(WOCE_NAME)-$(WOCE_VERSION).tar.gz
+BUILD_SUPPORT_DL = $(DL_DIR)/$(BUILD_SUPPORT_NAME)-$(BUILD_SUPPORT_VERSION).tar.gz
View
217 toolchain/ipkg-utils/arfile.py
@@ -0,0 +1,217 @@
+"""
+arfile - A module to parse GNU ar archives.
+
+Copyright (c) 2006-7 Paul Sokolovsky
+This file is released under the terms
+of GNU General Public License v2 or later.
+"""
+import sys
+import os
+import tarfile
+
+
+class FileSection:
+ "A class which allows to treat portion of file as separate file object."
+
+ def __init__(self, f, offset, size):
+ self.f = f
+ self.offset = offset
+ self.size = size
+ self.seek(0, 0)
+
+ def seek(self, offset, whence = 0):
+# print "seek(%x, %d)" % (offset, whence)
+ if whence == 0:
+ return self.f.seek(offset + self.offset, whence)
+ elif whence == 1:
+ return self.f.seek(offset, whence)
+ elif whence == 2:
+ return self.f.seek(self.offset + self.size + offset, 0)
+ else:
+ assert False
+
+ def tell(self):
+# print "tell()"
+ return self.f.tell() - self.offset
+
+ def read(self, size = -1):
+ if (size == -1): size = self.size
+# print "read(%d)" % size
+ return self.f.read(size)
+
+class ArFile:
+
+ def __init__(self, f):
+ self.f = f
+ self.directory = {}
+ self.directoryRead = False
+ self.filenames = ""
+
+ signature = self.f.readline()
+ assert signature == "!<arch>\n"
+ self.directoryOffset = self.f.tell()
+
+ def open(self, fname):
+ if self.directory.has_key(fname):
+ return FileSection(self.f, self.directory[fname][-1], int(self.directory[fname][5]))
+
+ if self.directoryRead:
+ raise IOError, (2, "AR member not found: " + fname)
+
+ f = self._scan(fname)
+ if f == None:
+ raise IOError, (2, "AR member not found: " + fname)
+ return f
+
+
+ def _scan(self, fname):
+ self.f.seek(self.directoryOffset, 0)
+
+ while True:
+ l = self.f.readline()
+ if not l:
+ self.directoryRead = True
+ return None
+
+ if l == "\n":
+ l = self.f.readline()
+ if not l: break
+ descriptor = l.split()
+# print descriptor
+ memberName = descriptor[0]
+
+ # Handle GNU-style extended filenames
+ if memberName[0] == '/':
+ if memberName[1] == '/':
+ # Read past the extended directory
+ size = int(descriptor[1])
+ current = 0
+ while (current < size):
+ l = self.f.readline()
+ descriptor = l.split()
+ memberName = descriptor[0]
+ self.filenames = self.filenames + l +"\n"
+ current = current + len(l)
+ l = self.f.readline()
+ descriptor = l.split()
+ memberName = descriptor[0]
+ else:
+ size = int(memberName[1:])
+ memberName = self.filenames[size:].split()[0]
+ descriptor[0] = memberName
+
+ # Handle BSD-style extended filenames
+ if memberName[0] == '#' and memberName[1] == '1' and memberName[2] == '/':
+ # Read the extended directory
+ size = int(memberName[3:])
+ memberName = self.f.read(size)
+ while (memberName[-1] == '\x00'):
+ memberName = memberName[:-1]
+ descriptor[0] = memberName
+ descriptor[5] = int(descriptor[5]) - size
+
+ size = int(descriptor[5])
+ if memberName[-1] == '/': memberName = memberName[:-1]
+ self.directory[memberName] = descriptor + [self.f.tell()]
+# print "read:", memberName
+ if memberName == fname or (memberName.startswith("`") and memberName[1:] == fname):
+ # Record directory offset to start from next time
+ self.directoryOffset = self.f.tell() + size
+ return FileSection(self.f, self.f.tell(), size)
+
+ # Skip data and loop
+ if size % 2:
+ size = size + 1
+ data = self.f.seek(size, 1)
+# print hex(self.f.tell())
+
+ def scan(self):
+ self.f.seek(self.directoryOffset, 0)
+
+ while True:
+ l = self.f.readline()
+ if not l:
+ self.directoryRead = True
+ return None
+
+ if l == "\n":
+ l = self.f.readline()
+ if not l: break
+ descriptor = l.split()
+# print descriptor
+ memberName = descriptor[0]
+
+ # Handle GNU-style extended filenames
+ if memberName[0] == '/':
+ if memberName[1] == '/':
+ # Read past the extended directory
+ size = int(descriptor[1])
+ current = 0
+ while (current < size):
+ l = self.f.readline()
+ descriptor = l.split()
+ memberName = descriptor[0]
+ self.filenames = self.filenames + l
+ current = current + len(l)
+ l = self.f.readline()
+ descriptor = l.split()
+ memberName = descriptor[0]
+ else:
+ size = int(memberName[1:])
+ memberName = self.filenames[size:].split()[0]
+ descriptor[0] = memberName
+
+ # Handle BSD-style extended filenames
+ if memberName[0] == '#' and memberName[1] == '1' and memberName[2] == '/':
+ # Read the extended directory
+ size = int(memberName[3:])
+ memberName = self.f.read(size)
+ while (memberName[-1] == '\x00'):
+ memberName = memberName[:-1]
+ descriptor[0] = memberName
+ descriptor[5] = int(descriptor[5]) - size
+
+ size = int(descriptor[5])
+ if memberName[-1] == '/': memberName = memberName[:-1]
+ self.directory[memberName] = descriptor + [self.f.tell()]
+# print "read:", memberName
+
+ # Skip data and loop
+ if size % 2:
+ size = size + 1
+ data = self.f.seek(size, 1)
+# print hex(f.tell())
+
+
+if __name__ == "__main__":
+ if None:
+ f = open(sys.argv[1], "rb")
+
+ ar = ArFile(f)
+ tarStream = ar.open("data.tar.gz")
+ print "--------"
+ tarStream = ar.open("data.tar.gz")
+ print "--------"
+ tarStream = ar.open("control.tar.gz")
+ print "--------"
+ tarStream = ar.open("control.tar.gz2")
+
+ sys.exit(0)
+
+
+ dir = "."
+ if len(sys.argv) > 1:
+ dir = sys.argv[1]
+ for f in os.listdir(dir):
+ if not f.endswith(".ipk"): continue
+
+ print "=== %s ===" % f
+ f = open(dir + "/" + f, "rb")
+
+ ar = ArFile(f)
+ tarStream = ar.open("control.tar.gz")
+ tarf = tarfile.open("control.tar.gz", "r", tarStream)
+ #tarf.list()
+
+ f2 = tarf.extractfile("./control")
+ print f2.read()
View
292 toolchain/ipkg-utils/ipkg-build
@@ -0,0 +1,292 @@
+#!/bin/sh
+
+# ipkg-build -- construct a .ipk from a directory
+# Carl Worth <cworth@east.isi.edu>
+# based on a script by Steve Redler IV, steve@sr-tech.com 5-21-2001
+# 2003-04-25 rea@sr.unh.edu
+# Updated to work on Familiar Pre0.7rc1, with busybox tar.
+# Note it Requires: binutils-ar (since the busybox ar can't create)
+# For UID debugging it needs a better "find".
+set -e
+
+version=1.0
+
+ipkg_extract_value() {
+ sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+required_field() {
+ field=$1
+
+ value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
+ if [ -z "$value" ]; then
+ echo "*** Error: $CONTROL/control is missing field $field" >&2
+ return 1
+ fi
+ echo $value
+ return 0
+}
+
+disallowed_field() {
+ field=$1
+
+ value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
+ if [ -n "$value" ]; then
+ echo "*** Error: $CONTROL/control contains disallowed field $field" >&2
+ return 1
+ fi
+ echo $value
+ return 0
+}
+
+pkg_appears_sane() {
+ local pkg_dir=$1
+
+ local owd=`pwd`
+ cd $pkg_dir
+
+ PKG_ERROR=0
+
+ tilde_files=`find . -name '*~'`
+ if [ -n "$tilde_files" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following files have names ending in '~'.
+You probably want to remove them: " >&2
+ ls -ld $tilde_files
+ echo >&2
+ else
+ echo "*** Removing the following files: $tilde_files"
+ rm -f "$tilde_files"
+ fi
+ fi
+
+# Commented out to allow this script to run on MacOSX.
+# large_uid_files=`find . -uid +99 || true`
+#
+# if [ "$ogargs" = "" ] && [ -n "$large_uid_files" ]; then
+# echo "*** Warning: The following files have a UID greater than 99.
+#You probably want to chown these to a system user: " >&2
+# ls -ld $large_uid_files
+# echo >&2
+# fi
+
+
+ if [ ! -f "$CONTROL/control" ]; then
+ echo "*** Error: Control file $pkg_dir/$CONTROL/control not found." >&2
+ cd $owd
+ return 1
+ fi
+
+ pkg=`required_field Package`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ version=`required_field Version | sed 's/Version://; s/^.://g;'`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ arch=`required_field Architecture`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ required_field Maintainer >/dev/null
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ required_field Description >/dev/null
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ section=`required_field Section`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+ if [ -z "$section" ]; then
+ echo "The Section field should have one of the following values:" >&2
+ echo "admin, base, comm, editors, extras, games, graphics, kernel, libs, misc, net, text, web, x11" >&2
+ fi
+
+ priority=`required_field Priority`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+ if [ -z "$priority" ]; then
+ echo "The Priority field should have one of the following values:" >&2
+ echo "required, important, standard, optional, extra." >&2
+ echo "If you don't know which priority value you should be using, then use \`optional'" >&2
+ fi
+
+# source=`required_field Source`
+# [ "$?" -ne 0 ] && PKG_ERROR=1
+# if [ -z "$source" ]; then
+# echo "The Source field contain the URL's or filenames of the source code and any patches"
+# echo "used to build this package. Either gnu-style tarballs or Debian source packages "
+# echo "are acceptable. Relative filenames may be used if they are distributed in the same"
+# echo "directory as the .ipk file."
+# fi
+
+ disallowed_filename=`disallowed_field Filename`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ if echo $pkg | grep '[^a-z0-9.+-]'; then
+ echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
+ PKG_ERROR=1;
+ fi
+
+ local bad_fields=`sed -ne 's/^\([^[:space:]][^:[:space:]]\+[[:space:]]\+\)[^:].*/\1/p' < $CONTROL/control | sed -e 's/\\n//'`
+ if [ -n "$bad_fields" ]; then
+ bad_fields=`echo $bad_fields`
+ echo "*** Error: The following fields in $CONTROL/control are missing a ':'" >&2
+ echo " $bad_fields" >&2
+ echo "ipkg-build: This may be due to a missing initial space for a multi-line field value" >&2
+ PKG_ERROR=1
+ fi
+
+ for script in $CONTROL/preinst $CONTROL/postinst $CONTROL/prerm $CONTROL/postrm; do
+ if [ -f $script -a ! -x $script ]; then
+ echo "*** Error: package script $script is not executable" >&2
+ PKG_ERROR=1
+ fi
+ done
+
+ if [ -f $CONTROL/conffiles ]; then
+ for cf in `cat $CONTROL/conffiles`; do
+ if [ ! -f ./$cf ]; then
+ echo "*** Error: $CONTROL/conffiles mentions conffile $cf which does not exist" >&2
+ PKG_ERROR=1
+ fi
+ done
+ fi
+
+ cd $owd
+ return $PKG_ERROR
+}
+
+###
+# ipkg-build "main"
+###
+ogargs=""
+outer=ar
+tar=tar
+sign=
+key=
+if [ "`uname -s`" = "Darwin" ] ; then
+ export COPYFILE_DISABLE=true
+ export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
+ tar=gnutar
+fi
+noclean=0
+palmformat=0
+usage="Usage: $0 [-c] [-C] [-o owner] [-g group] [-p] [-s sign [-k key]] <pkg_directory> [<destination_directory>]"
+while getopts "cg:hk:o:ps:v" opt; do
+ case $opt in
+ o ) owner=$OPTARG
+ ogargs="--owner=$owner"
+ ;;
+ g ) group=$OPTARG
+ ogargs="$ogargs --group=$group"
+ ;;
+ k ) key=$OPTARG
+ ;;
+ p ) palmformat=1
+ ;;
+ s ) sign=$OPTARG
+ ;;
+ c ) outer=tar
+ ;;
+ C ) noclean=1
+ ;;
+ v ) echo $version
+ exit 0
+ ;;
+ h ) echo $usage >&2 ;;
+ \? ) echo $usage >&2
+ esac
+done
+
+
+shift $(($OPTIND - 1))
+
+# continue on to process additional arguments
+
+case $# in
+1)
+ dest_dir=$PWD
+ ;;
+2)
+ dest_dir=$2
+ if [ "$dest_dir" = "." -o "$dest_dir" = "./" ] ; then
+ dest_dir=$PWD
+ fi
+ ;;
+*)
+ echo $usage >&2
+ exit 1
+ ;;
+esac
+
+pkg_dir=$1
+
+if [ ! -d $pkg_dir ]; then
+ echo "*** Error: Directory $pkg_dir does not exist" >&2
+ exit 1
+fi
+
+# CONTROL is second so that it takes precedence
+CONTROL=
+[ -d $pkg_dir/DEBIAN ] && CONTROL=DEBIAN
+[ -d $pkg_dir/CONTROL ] && CONTROL=CONTROL
+if [ -z "$CONTROL" ]; then
+ echo "*** Error: Directory $pkg_dir has no CONTROL subdirectory." >&2
+ exit 1
+fi
+
+if ! pkg_appears_sane $pkg_dir; then
+ echo >&2
+ echo "ipkg-build: Please fix the above errors and try again." >&2
+ exit 1
+fi
+
+tmp_dir=$dest_dir/IPKG_BUILD.$$
+mkdir $tmp_dir
+
+echo $CONTROL > $tmp_dir/tarX
+( cd $pkg_dir && $tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
+rm $tmp_dir/tarX
+
+( cd $pkg_dir/$CONTROL && $tar $ogargs -czf $tmp_dir/control.tar.gz . )
+
+echo "2.0" > $tmp_dir/debian-binary
+
+palm_files=
+if [ "$palmformat" = "1" ]; then
+ if [ -e $pkg_dir/$CONTROL/postinst ] ; then
+ cp $pkg_dir/$CONTROL/postinst $tmp_dir/pmPostInstall.script
+ chmod 755 $tmp_dir/pmPostInstall.script
+ palm_files="$palm_files ./pmPostInstall.script"
+ fi
+ if [ -e $pkg_dir/$CONTROL/prerm ] ; then
+ cp $pkg_dir/$CONTROL/prerm $tmp_dir/pmPreRemove.script
+ chmod 755 $tmp_dir/pmPreRemove.script
+ palm_files="$palm_files ./pmPreRemove.script"
+ fi
+fi
+
+sign_files=
+if [ -n "$sign" ] ; then
+ cp $sign $tmp_dir/cert.pem
+ openssl x509 -in $sign -pubkey -noout > $tmp_dir/pubkey.pem
+ ( cd $tmp_dir ; cat ./control.tar.gz ./data.tar.gz ./debian-binary $palm_files | \
+ openssl dgst -sha1 -sign $key > ./signature.sha1 )
+ sign_files="./cert.pem ./pubkey.pem ./signature.sha1"
+fi
+
+pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
+rm -f $pkg_file
+if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -cr $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz $sign_files $palm_files )
+else
+ ( cd $tmp_dir && $tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz $sign_files $palm_files )
+fi
+
+rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
+if [ -n "$sign" -a -n "$sign_files" ] ; then
+ ( cd $tmp_dir && rm -f $sign_files )
+fi
+if [ "$palmformat" = "1" -a -n "$palm_files" ] ; then
+ ( cd $tmp_dir && rm -f $palm_files )
+fi
+rmdir $tmp_dir
+
+echo "Packaged contents of $pkg_dir into $pkg_file"
View
202 toolchain/ipkg-utils/ipkg-make-index
@@ -0,0 +1,202 @@
+#!/usr/bin/env python
+# $Id: ipkg-make-index,v 1.22 2005/03/03 16:39:04 jamey Exp $
+
+import sys, os, posixpath
+from glob import glob
+import commands
+import ipkg
+import getopt
+import string
+import re
+
+verbose = 0
+
+def usage():
+ sys.stderr.write("%s [-h] [-s] [-m] [-l Packages.filelist] [-p Packages] [-r Packages.old] [-L localesdir] [-v] packagesdir\n" % (sys.argv[0],))
+ sys.exit(-1)
+
+def to_morgue(filename):
+ morgue_dir = pkg_dir + "/morgue"
+ if verbose:
+ sys.stderr.write ("Moving " + filename + " to morgue\n")
+ if not os.path.exists(morgue_dir):
+ os.mkdir(morgue_dir)
+ if os.path.exists(pkg_dir + "/" + filename):
+ os.rename(pkg_dir + "/" + filename, morgue_dir + "/" + filename)
+ if os.path.exists(pkg_dir + "/" + filename + ".asc"):
+ os.rename(pkg_dir + "/" + filename + ".asc", morgue_dir + "/" + filename + ".asc")
+
+locales_dir = None
+def to_locale(filename, locale):
+ locale_dir = pkg_dir + '/' + locales_dir + '/' + locale + "/"
+ if verbose:
+ sys.stderr.write ("Moving " + filename + " to " + locale_dir + "\n")
+ if not os.path.exists(locale_dir):
+ os.mkdir(locale_dir)
+ os.rename(pkg_dir + "/" + filename, locale_dir + "/" + filename)
+ if os.path.exists(pkg_dir + "/" + filename + ".asc"):
+ os.rename(pkg_dir + "/" + filename + ".asc", locale_dir + "/" + filename + ".asc")
+
+old_filename = None
+packages_filename = None
+filelist_filename = None
+stamplist_filename = "Packages.stamps"
+opt_s = 0
+opt_m = 0
+(opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:")
+for (optkey, optval) in opts:
+ if optkey == '-h':
+ usage()
+ if optkey == '-s':
+ opt_s = 1
+ if optkey == '-p':
+ packages_filename = optval
+ stamplist_filename = optval + ".stamps"
+ if optkey == '-l':
+ filelist_filename = optval
+ if optkey == '-v':
+ verbose = 1
+ if optkey == '-m':
+ opt_m = 1
+ if optkey == '-r':
+ old_filename = optval
+ if optkey == '-L':
+ locales_dir = optval
+
+if ( not remaining_args ):
+ usage()
+
+pkg_dir=remaining_args[0]
+
+packages = ipkg.Packages()
+
+old_pkg_hash = {}
+if packages_filename and not old_filename and os.path.exists(packages_filename):
+ old_filename = packages_filename
+
+pkgsStamps = {}
+if old_filename:
+ if (verbose):
+ sys.stderr.write("Reading package list from " + old_filename + "\n")
+ old_packages = ipkg.Packages()
+ old_packages.read_packages_file(old_filename)
+ for k in old_packages.packages.keys():
+ p = old_packages.packages[k]
+ old_pkg_hash[p.filename] = p
+ try:
+ f = open(stamplist_filename, "r")
+ for l in f:
+ l = l.strip()
+ s, f = l.split(" ", 1)
+ pkgsStamps[f] = int(s)
+ except IOError:
+ pass
+
+if (verbose):
+ sys.stderr.write("Reading in all the package info from %s\n" % (pkg_dir, ))
+files=glob(pkg_dir + '/*.ipk') + glob(pkg_dir + '/*.deb')
+files.sort()
+for filename in files:
+ basename = os.path.basename(filename)
+ pkg = None
+ fnameStat = os.stat(filename)
+ if old_pkg_hash.has_key(basename):
+ if pkgsStamps.has_key(basename) and fnameStat.st_mtime == pkgsStamps[basename]:
+ if (verbose):
+ sys.stderr.write("Found %s in Packages\n" % (filename,))
+ pkg = old_pkg_hash[basename]
+ else:
+ sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,))
+
+ if not pkg:
+ if (verbose):
+ sys.stderr.write("Reading info for package %s\n" % (filename,))
+ pkg = ipkg.Package(filename)
+ pkg_key = ("%s:%s" % (pkg.package, pkg.architecture))
+ if (packages.packages.has_key(pkg_key)):
+ old_filename = packages.packages[pkg_key].filename
+ else:
+ old_filename = ""
+ s = packages.add_package(pkg)
+ pkgsStamps[basename] = fnameStat.st_mtime
+ if s == 0:
+ if old_filename:
+ # old package was displaced by newer
+ if opt_m:
+ to_morgue(old_filename)
+ if opt_s:
+ print pkg_dir + "/" + old_filename
+ else:
+ if opt_m:
+ to_morgue(basename)
+ if opt_s:
+ print filename
+
+pkgsStampsFile = open(stamplist_filename, "w")
+for f in pkgsStamps.keys():
+ pkgsStampsFile.write("%d %s\n" % (pkgsStamps[f], f))
+pkgsStampsFile.close()
+
+if opt_s:
+ sys.exit(0)
+
+if verbose:
+ sys.stderr.write("Generating Packages file\n")
+if packages_filename:
+ old_stdout = sys.stdout
+ tmp_packages_filename = ("%s.%d" % (packages_filename, os.getpid()))
+ sys.stdout = open(tmp_packages_filename, "w")
+names = packages.packages.keys()
+names.sort()
+for name in names:
+ pkg = packages.packages[name]
+ if locales_dir and pkg.depends:
+ depends = string.split(pkg.depends, ',')
+ locale = None
+ for d in depends:
+ m = re.match('.*virtual-locale-([a-zA-Z]+).*', d)
+ mp = re.match('locale-base-([a-zA-Z]+)([-+])?.*', pkg.package)
+ if m:
+ locale = m.group(1)
+ if mp:
+ locale = mp.group(1)
+ if locale:
+ to_locale(pkg.filename, locale)
+ continue
+ if (verbose):
+ sys.stderr.write("Writing info for package %s\n" % (pkg.package,))
+ print pkg
+if packages_filename:
+ sys.stdout.close()
+ sys.stdout = old_stdout
+ gzip_filename = ("%s.gz" % packages_filename)
+ tmp_gzip_filename = ("%s.%d" % (gzip_filename, os.getpid()))
+ gzip_cmd = "gzip -9c < %s > %s" % (tmp_packages_filename, tmp_gzip_filename)
+ (rc, outtext) = commands.getstatusoutput(gzip_cmd)
+ print outtext
+ os.rename(tmp_packages_filename, packages_filename)
+ os.rename(tmp_gzip_filename, gzip_filename)
+
+if filelist_filename:
+ if verbose:
+ sys.stderr.write("Generate Packages.filelist file\n")
+ files = {}
+ names = packages.packages.keys()
+ names.sort()
+ for name in names:
+ for fn in packages[name].get_file_list():
+ (h,t) = os.path.split(fn)
+ if not t: continue
+ if not files.has_key(t): files[t] = name+':'+fn
+ else: files[t] = files[t] + ',' + name+':'+fn
+
+ tmp_filelist_filename = ("%s.%d" % (filelist_filename, os.getpid()))
+ sys.stdout = open(tmp_filelist_filename, "w")
+ names = files.keys()
+ names.sort()
+ for name in names:
+ print name,files[name]
+ sys.stdout.close()
+ if posixpath.exists(filelist_filename):
+ os.unlink(filelist_filename)
+ os.rename(tmp_filelist_filename, filelist_filename)
View
40 toolchain/ipkg-utils/ipkg-unbuild
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+import sys, os, re
+import arfile
+
+if (len(sys.argv) == 0):
+ print 'usage: %s: package.ipk' % sys.argv[0]
+ sys.exit(1)
+
+for filename in sys.argv[1:]:
+ m = re.match('((.*/)*)(.*)', filename)
+ pkg = m.group(3)
+ m = re.match('(.*)((.ipk)|(.deb))', filename)
+ if m:
+ pkg = m.group(1)
+
+ os.system('rm -fr %s' % pkg)
+ os.mkdir(pkg)
+ os.mkdir(pkg + '/CONTROL')
+
+ f = open(filename, "rb")
+ magic = f.read(4)
+ f.seek(0, 0)
+ if (magic == "!<ar"):
+ ar = arfile.ArFile(f)
+ ar.scan();
+ for name in ar.directory:
+ stream = ar.open(name)
+ of = open('%s/%s' % (pkg, name), 'wb')
+ of.write(stream.read())
+ of.close()
+ else:
+ os.system('cd %s; tar zxf ../%s > /dev/null' % (pkg, filename))
+
+ if os.path.exists('%s/data.tar.xz' % pkg):
+ os.system('xz -c -d %s/data.tar.xz | tar xf - -C %s' % (pkg, pkg))
+ else:
+ os.system('tar xzf %s/data.tar.gz -C %s' % (pkg, pkg))
+ os.system('tar xzf %s/control.tar.gz -C %s/CONTROL' % (pkg, pkg))
+ os.system('rm -f %s/control.tar.gz %s/data.tar.gz %s/debian-binary' % (pkg, pkg, pkg))
View
495 toolchain/ipkg-utils/ipkg.py
@@ -0,0 +1,495 @@
+#!/usr/bin/env python
+# Copyright (C) 2001 Alexander S. Guy <a7r@andern.org>
+# Andern Research Labs
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,