Browse Source

add some packages

- add make/patch/rpm and dependencies
- update ar7 port a little bit
Waldemar Brodkorb 15 years ago
parent
commit
b5b277f514
36 changed files with 940 additions and 65 deletions
  1. 0 3
      TODO
  2. 2 0
      mk/build.mk
  3. 6 1
      package/Config.in
  4. 2 0
      package/Depends.mk
  5. 4 0
      package/Makefile
  6. 1 1
      package/base-files/extra/etc/profile
  7. 14 14
      package/busybox/config/Config.in
  8. 6 0
      package/make/Config.in
  9. 27 0
      package/make/Makefile
  10. 5 0
      package/nspr/Config.in
  11. 30 0
      package/nspr/Makefile
  12. 5 0
      package/nss/Config.in
  13. 43 0
      package/nss/Makefile
  14. 15 0
      package/nss/patches/patch-mozilla_security_coreconf_Linux_mk
  15. 11 0
      package/nss/patches/patch-mozilla_security_coreconf_arch_mk
  16. 11 0
      package/nss/patches/patch-mozilla_security_coreconf_arch_mk.orig
  17. 13 0
      package/nss/patches/patch-mozilla_security_coreconf_nsinstall_Makefile
  18. 11 0
      package/nss/patches/patch-mozilla_security_nss_cmd_shlibsign_sign_sh
  19. 6 0
      package/patch/Config.in
  20. 27 0
      package/patch/Makefile
  21. 18 0
      package/patch/patches/patch-Makefile_in
  22. 11 0
      package/rpm/Config.in
  23. 37 0
      package/rpm/Makefile
  24. 207 0
      package/rpm/patches/patch-config_guess
  25. 180 0
      package/rpm/patches/patch-config_sub
  26. 11 0
      package/rpm/patches/patch-configure
  27. 12 0
      package/rpm/patches/patch-rpmio_fts_c
  28. 12 0
      package/rpm/patches/patch-rpmio_rpmio_h
  29. 22 0
      package/rpm/patches/patch-rpmio_rpmio_h.orig
  30. 132 0
      package/rpm/patches/patch-rpmio_rpmsq_c
  31. 30 0
      package/rpm/patches/patch-rpmio_rpmsq_c.orig
  32. 13 7
      target/Config.in
  33. 0 11
      target/wag54g/patches/ar7.patch
  34. 14 26
      target/wag54g/uclibc.config
  35. 1 1
      toolchain/binutils/Makefile
  36. 1 1
      toolchain/gcc/Makefile

+ 0 - 3
TODO

@@ -12,11 +12,8 @@
 - netbsd build
 - macos x build
 - openbsd build
-- use kmod-template for external kernel modules
 - optimize iptables package (libdirs depending on choosen kernel features)
 - checksum for toolchain packages
 - network scripts for wireless client / ap
 - network scripts for pppoe
-- fix platform zaurus 
-- test qemu etrax again
 - publish via trac+git

+ 2 - 0
mk/build.mk

@@ -101,8 +101,10 @@ image:
 switch:
 	echo "Saving configuration for device: ${DEVICE}"
 	cp .config .config.${DEVICE}
+	mv .cfg .cfg.${DEVICE}
 	if [ -f .config.${DEV} ];then cp .config.${DEV} .config; \
 	cp .config.${DEV} .config.old; \
+	mv .cfg.${DEV} .cfg; \
 	echo "Setting configuration to device: ${DEV}"; \
 	else echo "No old device config found";mv .config .config.bak;fi
 

+ 6 - 1
package/Config.in

@@ -12,6 +12,7 @@ source "package/cfgfs/Config.in"
 source "package/uclibc/Config.in"
 source "package/glibc/Config.in"
 source "package/libc/Config.in"
+source "package/rpm/Config.in"
 endmenu
 
 menu "Bluetooth"
@@ -141,7 +142,8 @@ source "package/comgt/Config.in"
 source "package/fbset/Config.in"
 source "package/file/Config.in"
 source "package/hdparm/Config.in"
-source "package/usbutils/Config.in"  # lsusb
+source "package/usbutils/Config.in"
+source "package/patch/Config.in"
 source "package/pciutils/Config.in"
 source "package/procps/Config.in"
 source "package/sispmctl/Config.in"
@@ -350,6 +352,7 @@ source "package/gcc/Config.in"
 source "package/haserl/Config.in"
 source "package/jamvm/Config.in"
 source "package/lua/Config.in"
+source "package/make/Config.in"
 source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/ruby/Config.in"
@@ -397,6 +400,8 @@ source "package/libid3tag/Config.in"
 source "package/jpeg/Config.in"  # libjpeg
 source "package/lame/Config.in.lib"  # libltdl
 source "package/mpfr/Config.in"
+source "package/nspr/Config.in"
+source "package/nss/Config.in"
 source "package/libtool/Config.in"  # libltdl
 source "package/openldap/Config.in.lib"
 source "package/liblzo/Config.in"

+ 2 - 0
package/Depends.mk

@@ -182,6 +182,8 @@ raddump-compile: openssl-compile libpcap-compile
 radiusclient-ng-compile: openssl-compile
 rarpd-compile: libnet-compile
 readline-compile: ncurses-compile
+nss-compile: nspr-compile zlib-compile
+rpm-compile: nss-compile libdb-compile
 rrdcollect-compile: rrdtool-compile
 rrdtool-compile: libxml2-compile cgilib-compile freetype-compile libart-compile libpng-compile
 rsync-compile: popt-compile

+ 4 - 0
package/Makefile

@@ -223,6 +223,7 @@ package-$(ADK_COMPILE_LUA) += lua
 package-$(ADK_COMPILE_LVM) += lvm
 package-$(ADK_PACKAGE_MACCHANGER) += macchanger
 package-$(ADK_PACKAGE_MADPLAY) += madplay
+package-$(ADK_PACKAGE_MAKE) += make
 package-$(ADK_PACKAGE_MARADNS) += maradns
 package-$(ADK_PACKAGE_MGETTY) += mgetty
 package-$(ADK_PACKAGE_MC) += mc
@@ -258,6 +259,7 @@ package-$(ADK_PACKAGE_NFS_UTILS) += nfs-utils
 package-$(ADK_PACKAGE_NFS_KERNEL_NFSD) += nfs-utils
 package-$(ADK_PACKAGE_NMAP) += nmap
 package-$(ADK_PACKAGE_NTPCLIENT) += ntpclient
+package-$(ADK_PACKAGE_NSS) += nss
 package-$(ADK_PACKAGE_OBEXFTP) += obexftp
 package-$(ADK_PACKAGE_OLSRD) += olsrd
 package-$(ADK_COMPILE_OPENCDK) += opencdk
@@ -278,6 +280,7 @@ package-$(ADK_PACKAGE_OWFS) += owfs
 package-$(ADK_PACKAGE_P910ND) += p910nd
 package-$(ADK_PACKAGE_PALANTIR) += palantir
 package-$(ADK_PACKAGE_PARPROUTED) += parprouted
+package-$(ADK_PACKAGE_PATCH) += patch
 package-$(ADK_PACKAGE_PCIUTILS) += pciutils
 package-$(ADK_COMPILE_PCRE) += pcre
 package-$(ADK_COMPILE_PHP) += php
@@ -307,6 +310,7 @@ package-$(ADK_PACKAGE_REAIM) += reaim
 package-$(ADK_PACKAGE_RENDERPROTO) += renderproto
 package-$(ADK_PACKAGE_RESOURCEPROTO) += resourceproto
 package-$(ADK_COMPILE_RP_PPPOE) += rp-pppoe
+package-$(ADK_PACKAGE_RPM) += rpm
 package-$(ADK_PACKAGE_RRDCOLLECT) += rrdcollect
 package-$(ADK_COMPILE_RRDTOOL) += rrdtool
 package-$(ADK_PACKAGE_RUBY) += ruby

+ 1 - 1
package/base-files/extra/etc/profile

@@ -9,4 +9,4 @@ cat /etc/banner 2>&-
 [ -x /usr/bin/less ] || alias less=more
 [ -x /usr/bin/vim ] || alias vim=vi
 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
-[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 /lib/ld.so "$@"; }
+[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 "$@"; }

+ 14 - 14
package/busybox/config/Config.in

@@ -273,20 +273,20 @@ endmenu
 
 menu 'Build Options'
 
-#config BUSYBOX_STATIC
-#	bool "Build BusyBox as a static binary (no shared libs)"
-#	default n
-#	help
-#	  If you want to build a static BusyBox binary, which does not
-#	  use or require any shared libraries, then enable this option.
-#	  This can cause BusyBox to be considerably larger, so you should
-#	  leave this option false unless you have a good reason (i.e.
-#	  your target platform does not support shared libraries, or
-#	  you are building an initrd which doesn't need anything but
-#	  BusyBox, etc).
-#
-#	  Most people will leave this set to 'N'.
-#
+config BUSYBOX_STATIC
+	bool "Build BusyBox as a static binary (no shared libs)"
+	default n
+	help
+	  If you want to build a static BusyBox binary, which does not
+	  use or require any shared libraries, then enable this option.
+	  This can cause BusyBox to be considerably larger, so you should
+	  leave this option false unless you have a good reason (i.e.
+	  your target platform does not support shared libraries, or
+	  you are building an initrd which doesn't need anything but
+	  BusyBox, etc).
+
+	  Most people will leave this set to 'N'.
+
 #config BUSYBOX_PIE
 #	bool "Build BusyBox as a position independent executable"
 #	default n

+ 6 - 0
package/make/Config.in

@@ -0,0 +1,6 @@
+config ADK_PACKAGE_MAKE
+	prompt "make.............................. GNU make"
+	tristate
+	default n
+	help
+	  GNU make

+ 27 - 0
package/make/Makefile

@@ -0,0 +1,27 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		make
+PKG_VERSION:=		3.81
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		a4e9494ac6dc3f6b0c5ff75c5d52abba
+PKG_DESCR:=		GNU make
+PKG_SECTION:=		misc
+PKG_URL:=		http://www.gnu.org/software/make
+PKG_SITES:=		${MASTER_SITE_GNU:=make/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,MAKE,make,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIGURE_STYLE=	gnu
+BUILD_STYLE=		auto
+INSTALL_STYLE=		auto
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_MAKE)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/make $(IDIR_MAKE)/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 5 - 0
package/nspr/Config.in

@@ -0,0 +1,5 @@
+config ADK_PACKAGE_NSPR
+	prompt "nspr.............................. Red Hat package manager"
+	tristate
+	default n
+	help

+ 30 - 0
package/nspr/Makefile

@@ -0,0 +1,30 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		nspr
+PKG_VERSION:=		4.8
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		e0916a72bcc6c427551ea262183fdb26
+PKG_DESCR:=		NSPR library
+PKG_SECTION:=		libs
+PKG_URL:=		http://www.mozilla.org/projects/nspr/
+PKG_SITES:=		https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8/src/
+
+WRKSRC=			${WRKDIST}/mozilla/nsprpub
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,NSPR,${PKG_NAME},$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIGURE_ENV+=		HOST_CC="${HOSTCC}" HOST_CFLAGS="${HOSTCFLAGS}"
+CONFIGURE_STYLE=	gnu
+BUILD_STYLE=		auto
+INSTALL_STYLE=		auto
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_NSPR)/usr/lib
+	$(CP) $(WRKINST)/usr/lib/*.so* $(IDIR_NSPR)/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 5 - 0
package/nss/Config.in

@@ -0,0 +1,5 @@
+config ADK_PACKAGE_NSS
+	prompt "nss............................... NSS library"
+	tristate
+	default n
+	help

+ 43 - 0
package/nss/Makefile

@@ -0,0 +1,43 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		nss
+PKG_VERSION:=		3.12.3
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		ecb7079ba4ebcf29b7716775384f1f18
+PKG_DESCR:=		Network Security Services (NSS) library
+PKG_SECTION:=		libs
+PKG_URL:=		http://www.mozilla.org/projects/security/pki/nss/
+PKG_SITES:=		ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_3_RTM/src/
+
+DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2
+WRKSRC=			${WRKDIST}/mozilla/security/nss
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,NSS,${PKG_NAME},$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+ifeq ($(ADK_LINUX_64),y)
+TCFLAGS+=		-DUSE_64
+MAKE_FLAGS+=		USE_64=1
+endif
+
+MAKE_FLAGS+=		NATIVE_CC="${HOSTCC}" NATIVE_FLAGS="${HOSTCFLAGS}" NATIVE_LDFLAGS="${HOSTLDFLAGS}"
+TCPPFLAGS+=		-I${STAGING_DIR}/usr/include/nspr
+TCFLAGS+=		-I${STAGING_DIR}/usr/include/nspr
+BUILD_STYLE=		auto
+INSTALL_STYLE=		auto
+MAKE_FLAGS+=		SOURCE_MD_DIR=${WRKDIST}/dist DIST=${WRKDIST}/dist NSS_DISABLE_DBM=1 OS_TEST=${ARCH} \
+			ARCHFLAG="${TCFLAGS} ${TCPPFLAGS}"
+ALL_TARGET:=		build_coreconf all
+XAKE_FLAGS+=		OS_TEST=${ARCH} NSS_DISABLE_DBM=1
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_NSS)/usr/lib
+	${INSTALL_DATA} ${WRKDIST}/dist/lib/*.so $(IDIR_NSS)/usr/lib
+	${INSTALL_DIR} ${STAGING_DIR}/usr/include/nss
+	${INSTALL_DATA} ${WRKDIST}/mozilla/dist/public/nss/* ${STAGING_DIR}/usr/include/nss
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 15 - 0
package/nss/patches/patch-mozilla_security_coreconf_Linux_mk

@@ -0,0 +1,15 @@
+--- nss-3.12.3.orig/mozilla/security/coreconf/Linux.mk	2008-09-06 01:17:23.000000000 +0200
++++ nss-3.12.3/mozilla/security/coreconf/Linux.mk	2009-06-24 19:11:27.470840369 +0200
+@@ -46,9 +46,9 @@ ifeq ($(USE_PTHREADS),1)
+ 	IMPL_STRATEGY = _PTH
+ endif
+ 
+-CC			= gcc
+-CCC			= g++
+-RANLIB			= ranlib
++CC			?= gcc
++CCC			?= g++
++RANLIB			?= ranlib
+ 
+ DEFAULT_COMPILER = gcc
+ 

+ 11 - 0
package/nss/patches/patch-mozilla_security_coreconf_arch_mk

@@ -0,0 +1,11 @@
+--- nss-3.12.3.orig/mozilla/security/coreconf/arch.mk	2009-03-11 19:54:24.000000000 +0100
++++ nss-3.12.3/mozilla/security/coreconf/arch.mk	2009-06-24 21:46:32.910214640 +0200
+@@ -329,7 +329,7 @@ endif
+ # IMPL_STRATEGY may be defined too.
+ #
+ 
+-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(LIBC_TAG).OBJ
+ 
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+ ifndef BUILD_OPT

+ 11 - 0
package/nss/patches/patch-mozilla_security_coreconf_arch_mk.orig

@@ -0,0 +1,11 @@
+--- nss-3.12.3.orig/mozilla/security/coreconf/arch.mk	2009-03-11 19:54:24.000000000 +0100
++++ nss-3.12.3/mozilla/security/coreconf/arch.mk	2009-06-24 21:38:51.010734431 +0200
+@@ -329,7 +329,7 @@ endif
+ # IMPL_STRATEGY may be defined too.
+ #
+ 
+-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(LIBC_TAG)$(OBJDIR_TAG).OBJ
+ 
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+ ifndef BUILD_OPT

+ 13 - 0
package/nss/patches/patch-mozilla_security_coreconf_nsinstall_Makefile

@@ -0,0 +1,13 @@
+--- nss-3.12.3.orig/mozilla/security/coreconf/nsinstall/Makefile	2005-10-06 00:25:37.000000000 +0200
++++ nss-3.12.3/mozilla/security/coreconf/nsinstall/Makefile	2009-06-24 19:48:52.858310011 +0200
+@@ -65,6 +65,10 @@ ifdef NATIVE_FLAGS
+ OS_CFLAGS=$(NATIVE_FLAGS)
+ endif
+ 
++ifdef NATIVE_LDFLAGS
++LDFLAGS=$(NATIVE_LDFLAGS)
++endif
++
+ include $(DEPTH)/coreconf/rules.mk
+ 
+ # Redefine MAKE_OBJDIR for just this directory

+ 11 - 0
package/nss/patches/patch-mozilla_security_nss_cmd_shlibsign_sign_sh

@@ -0,0 +1,11 @@
+--- nss-3.12.3.orig/mozilla/security/nss/cmd/shlibsign/sign.sh	2006-01-18 21:56:28.000000000 +0100
++++ nss-3.12.3/mozilla/security/nss/cmd/shlibsign/sign.sh	2009-06-24 21:27:49.462838938 +0200
+@@ -53,6 +53,7 @@ OpenVMS)
+     ADDON_PATH=${1}/lib:${4}:$ADDON_PATH
+     export ADDON_PATH
+     echo ${2}/shlibsign -v -i ${5}
+-    ${2}/shlibsign -v -i ${5}
++    #disable for cross-compile
++    #${2}/shlibsign -v -i ${5}
+     ;;
+ esac

+ 6 - 0
package/patch/Config.in

@@ -0,0 +1,6 @@
+config ADK_PACKAGE_PATCH
+	prompt "patch............................. patch"
+	tristate
+	default n
+	help
+	  patch

+ 27 - 0
package/patch/Makefile

@@ -0,0 +1,27 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		patch
+PKG_VERSION:=		2.5.9
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		dacfb618082f8d3a2194601193cf8716
+PKG_DESCR:=		GNU patch
+PKG_SECTION:=		misc
+PKG_URL:=		http://www.gnu.org/software/patch
+PKG_SITES:=		${MASTER_SITE_GNU:=patch/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,PATCH,patch,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIGURE_STYLE=	gnu
+BUILD_STYLE=		auto
+INSTALL_STYLE=		auto
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_PATCH)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/patch $(IDIR_PATCH)/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 18 - 0
package/patch/patches/patch-Makefile_in

@@ -0,0 +1,18 @@
+--- patch-2.5.9.orig/Makefile.in	2003-05-20 18:15:48.000000000 +0200
++++ patch-2.5.9/Makefile.in	2009-06-13 22:52:33.487310060 +0200
+@@ -112,11 +112,11 @@ patch$(EXEEXT): $(OBJS)
+ 	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
+ 
+ install:: all installdirs
+-	$(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
+-	-$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
++	$(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)/$(bindir)/$(patch_name)$(EXEEXT)
++	-$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)/$(man1dir)/$(patch_name)$(man1ext)
+ 
+-installdirs::
+-	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
++installdirs:
++	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir) $(DESTDIR)/$(man1dir)
+ 
+ install-strip::
+ 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install

+ 11 - 0
package/rpm/Config.in

@@ -0,0 +1,11 @@
+config ADK_PACKAGE_RPM
+	prompt "rpm............................... Red Hat package manager"
+	tristate
+	depends on ADK_CXX
+	select ADK_PACKAGE_NSS
+	select ADK_PACKAGE_NSPR
+	select ADK_PACKAGE_ZLIB
+	select ADK_PACKAGE_LIBDB
+	default n
+	help
+	  Red Hat package manager

+ 37 - 0
package/rpm/Makefile

@@ -0,0 +1,37 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		rpm
+PKG_VERSION:=		4.7.0
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		74791d638c571ec79f06227d453a6a03
+PKG_DESCR:=		GNU rpm
+PKG_SECTION:=		base
+PKG_URL:=		http://www.rpm.org
+PKG_SITES:=		http://rpm.org/releases/rpm-4.7.x/
+
+DISTFILES:=		${PKG_NAME}-$(PKG_VERSION).tar.bz2
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,RPM,${PKG_NAME},$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+TCPPFLAGS+=		-I${STAGING_DIR}/usr/include/nspr \
+			-I${STAGING_DIR}/usr/include/nss
+CONFIGURE_STYLE:=	gnu
+CONFIGURE_ARGS:=	--with-external-db \
+			--without-lua
+BUILD_STYLE:=		auto
+INSTALL_STYLE:=		auto
+
+post-install:
+	$(INSTALL_DIR) $(IDIR_RPM)/usr/bin $(IDIR_RPM)/usr/lib
+	$(INSTALL_DIR) $(IDIR_RPM)/usr/lib/rpm
+	$(INSTALL_BIN) $(WRKINST)/bin/rpm $(IDIR_RPM)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/rpm* $(IDIR_RPM)/usr/bin
+	$(CP) $(WRKINST)/usr/lib/*.so* $(IDIR_RPM)/usr/lib
+	$(CP) $(WRKINST)/usr/lib/rpm/* $(IDIR_RPM)/usr/lib/rpm
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 207 - 0
package/rpm/patches/patch-config_guess

@@ -0,0 +1,207 @@
+--- rpm-4.7.0.orig/config.guess	2008-08-30 00:27:10.000000000 +0200
++++ rpm-4.7.0/config.guess	2009-06-11 17:31:39.670840385 +0200
+@@ -4,7 +4,7 @@
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ #   Free Software Foundation, Inc.
+ 
+-timestamp='2008-01-23'
++timestamp='2008-09-28'
+ 
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -139,6 +139,23 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+ 
++if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
++	eval $set_cc_for_build
++	cat << EOF > $dummy.c
++	#include <features.h>
++	#ifdef __UCLIBC__
++	# ifdef __UCLIBC_CONFIG_VERSION__
++	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
++	# else
++	LIBC=uclibc
++	# endif
++	#else
++	LIBC=gnu
++	#endif
++EOF
++	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
++fi
++
+ # Note: order is significant - the case branches are not exclusive.
+ 
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -796,7 +813,7 @@ EOF
+ 	    x86)
+ 		echo i586-pc-interix${UNAME_RELEASE}
+ 		exit ;;
+-	    EM64T | authenticamd)
++	    EM64T | authenticamd | genuineintel)
+ 		echo x86_64-unknown-interix${UNAME_RELEASE}
+ 		exit ;;
+ 	    IA64)
+@@ -840,31 +857,31 @@ EOF
+ 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ 	    | grep -q __ARM_EABI__
+ 	then
+-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	else
+-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ 	fi
+ 	exit ;;
+     avr32*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     cris:Linux:*:*)
+-	echo cris-axis-linux-gnu
++	echo cris-axis-linux-${LIBC}
+ 	exit ;;
+     crisv32:Linux:*:*)
+-	echo crisv32-axis-linux-gnu
++	echo crisv32-axis-linux-${LIBC}
+ 	exit ;;
+     frv:Linux:*:*)
+-    	echo frv-unknown-linux-gnu
++    	echo frv-unknown-linux-${LIBC}
+ 	exit ;;
+     ia64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m32r*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m68*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     mips:Linux:*:*)
+ 	eval $set_cc_for_build
+@@ -887,7 +904,7 @@ EOF
+ 		s: ::g
+ 		p
+ 	    }'`"
+-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ 	;;
+     mips64:Linux:*:*)
+ 	eval $set_cc_for_build
+@@ -910,16 +927,16 @@ EOF
+ 		s: ::g
+ 		p
+ 	    }'`"
+-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ 	;;
+     or32:Linux:*:*)
+-	echo or32-unknown-linux-gnu
++	echo or32-unknown-linux-${LIBC}
+ 	exit ;;
+     ppc:Linux:*:*)
+-	echo powerpc-unknown-linux-gnu
++	echo powerpc-unknown-linux-${LIBC}
+ 	exit ;;
+     ppc64:Linux:*:*)
+-	echo powerpc64-unknown-linux-gnu
++	echo powerpc64-unknown-linux-${LIBC}
+ 	exit ;;
+     alpha:Linux:*:*)
+ 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+@@ -932,40 +949,43 @@ EOF
+ 	  EV68*) UNAME_MACHINE=alphaev68 ;;
+         esac
+ 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    padre:Linux:*:*)
++	echo sparc-unknown-linux-gnu
+ 	exit ;;
+     parisc:Linux:*:* | hppa:Linux:*:*)
+ 	# Look for CPU level
+ 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+-	  *)    echo hppa-unknown-linux-gnu ;;
++	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++	  *)    echo hppa-unknown-linux-${LIBC} ;;
+ 	esac
+ 	exit ;;
+     parisc64:Linux:*:* | hppa64:Linux:*:*)
+-	echo hppa64-unknown-linux-gnu
++	echo hppa64-unknown-linux-${LIBC}
+ 	exit ;;
+     s390:Linux:*:* | s390x:Linux:*:*)
+ 	echo ${UNAME_MACHINE}-ibm-linux
+ 	exit ;;
+     sh64*:Linux:*:*)
+-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
++    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sh*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sparc:Linux:*:* | sparc64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     vax:Linux:*:*)
+-	echo ${UNAME_MACHINE}-dec-linux-gnu
++	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ 	exit ;;
+     x86_64:Linux:*:*)
+-	echo x86_64-unknown-linux-gnu
++	echo x86_64-unknown-linux-${LIBC}
+ 	exit ;;
+     xtensa*:Linux:*:*)
+-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
++    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     i*86:Linux:*:*)
+ 	# The BFD linker knows what the default object file format is, so
+@@ -980,20 +1000,19 @@ EOF
+ 				    p'`
+         case "$ld_supported_targets" in
+ 	  elf32-i386)
+-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
++		TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
+ 		;;
+ 	  a.out-i386-linux)
+-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+-		exit ;;
+-	  coff-i386)
+-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
++		echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
+ 		exit ;;
+ 	  "")
+ 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+ 		# one that does not give us useful --help.
+-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
++		echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
+ 		exit ;;
+ 	esac
++	# This should get integrated into the C code below, but now we hack
++	if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
+ 	# Determine whether the default compiler is a.out or elf
+ 	eval $set_cc_for_build
+ 	sed 's/^	//' << EOF >$dummy.c
+@@ -1216,6 +1235,9 @@ EOF
+     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+ 	echo i586-pc-beos
+ 	exit ;;
++    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
++	echo i586-pc-haiku
++	exit ;;
+     SX-4:SUPER-UX:*:*)
+ 	echo sx4-nec-superux${UNAME_RELEASE}
+ 	exit ;;

+ 180 - 0
package/rpm/patches/patch-config_sub

@@ -0,0 +1,180 @@
+--- rpm-4.7.0.orig/config.sub	2008-08-30 00:27:10.000000000 +0200
++++ rpm-4.7.0/config.sub	2009-06-11 17:31:39.670840385 +0200
+@@ -4,7 +4,7 @@
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ #   Free Software Foundation, Inc.
+ 
+-timestamp='2008-01-16'
++timestamp='2008-09-08'
+ 
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+@@ -244,18 +244,20 @@ case $basic_machine in
+ 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ 	| bfin \
+ 	| c4x | clipper \
+-	| d10v | d30v | dlx | dsp16xx \
++	| d10v | d30v | dlx | dsp16xx | dvp \
+ 	| fido | fr30 | frv \
+ 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ 	| i370 | i860 | i960 | ia64 \
+ 	| ip2k | iq2000 \
+ 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+-	| maxq | mb | microblaze | mcore | mep \
++	| maxq | mb | microblaze | mcore | mep | metag \
+ 	| mips | mipsbe | mipseb | mipsel | mipsle \
+ 	| mips16 \
+ 	| mips64 | mips64el \
+-	| mips64vr | mips64vrel \
++	| mips64octeon | mips64octeonel \
+ 	| mips64orion | mips64orionel \
++	| mips64r5900 | mips64r5900el \
++	| mips64vr | mips64vrel \
+ 	| mips64vr4100 | mips64vr4100el \
+ 	| mips64vr4300 | mips64vr4300el \
+ 	| mips64vr5000 | mips64vr5000el \
+@@ -277,7 +279,7 @@ case $basic_machine in
+ 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ 	| pyramid \
+ 	| score \
+-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
++	| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ 	| sh64 | sh64le \
+ 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+@@ -286,7 +288,7 @@ case $basic_machine in
+ 	| v850 | v850e \
+ 	| we32k \
+ 	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+-	| z8k)
++	| z8k | z80)
+ 		basic_machine=$basic_machine-unknown
+ 		;;
+ 	m6811 | m68hc11 | m6812 | m68hc12)
+@@ -331,12 +333,14 @@ case $basic_machine in
+ 	| ip2k-* | iq2000-* \
+ 	| m32c-* | m32r-* | m32rle-* \
+ 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+-	| m88110-* | m88k-* | maxq-* | mcore-* \
++	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ 	| mips16-* \
+ 	| mips64-* | mips64el-* \
+-	| mips64vr-* | mips64vrel-* \
++	| mips64octeon-* | mips64octeonel-* \
+ 	| mips64orion-* | mips64orionel-* \
++	| mips64r5900-* | mips64r5900el-* \
++	| mips64vr-* | mips64vrel-* \
+ 	| mips64vr4100-* | mips64vr4100el-* \
+ 	| mips64vr4300-* | mips64vr4300el-* \
+ 	| mips64vr5000-* | mips64vr5000el-* \
+@@ -358,20 +362,20 @@ case $basic_machine in
+ 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ 	| pyramid-* \
+ 	| romp-* | rs6000-* \
+-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
++	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ 	| sparclite-* \
+ 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ 	| tahoe-* | thumb-* \
+-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ 	| tron-* \
+ 	| v850-* | v850e-* | vax-* \
+ 	| we32k-* \
+ 	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ 	| xstormy16-* | xtensa*-* \
+ 	| ymp-* \
+-	| z8k-*)
++	| z8k-* | z80-*)
+ 		;;
+ 	# Recognize the basic CPU types without company name, with glob match.
+ 	xtensa*)
+@@ -459,6 +463,10 @@ case $basic_machine in
+ 		basic_machine=c90-cray
+ 		os=-unicos
+ 		;;
++        cegcc)
++		basic_machine=arm-unknown
++		os=-cegcc
++		;;
+ 	convex-c1)
+ 		basic_machine=c1-convex
+ 		os=-bsd
+@@ -526,6 +534,10 @@ case $basic_machine in
+ 		basic_machine=m88k-motorola
+ 		os=-sysv3
+ 		;;
++	dicos)
++		basic_machine=i686-pc
++		os=-dicos
++		;;
+ 	djgpp)
+ 		basic_machine=i586-pc
+ 		os=-msdosdjgpp
+@@ -714,6 +726,24 @@ case $basic_machine in
+ 		basic_machine=m68k-atari
+ 		os=-mint
+ 		;;
++	mipsEE* | ee | ps2)
++		basic_machine=mips64r5900el-scei
++		case $os in
++		    -linux*)
++			;;
++		    *)
++			os=-elf
++			;;
++		esac
++		;;
++	iop)
++		basic_machine=mipsel-scei
++		os=-irx
++		;;
++	dvp)
++		basic_machine=dvp-scei
++		os=-elf
++		;;
+ 	mips3*-*)
+ 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ 		;;
+@@ -1128,6 +1158,10 @@ case $basic_machine in
+ 		basic_machine=z8k-unknown
+ 		os=-sim
+ 		;;
++	z80-*-coff)
++		basic_machine=z80-unknown
++		os=-sim
++		;;
+ 	none)
+ 		basic_machine=none-none
+ 		os=-none
+@@ -1248,7 +1282,7 @@ case $os in
+ 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+-	      | -chorusos* | -chorusrdb* \
++	      | -chorusos* | -chorusrdb* | -cegcc* \
+ 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ 	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ 	      | -uxpv* | -beos* | -mpeix* | -udk* \
+@@ -1258,7 +1292,7 @@ case $os in
+ 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
++	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
+ 	# Remember, each alternative MUST END IN *, to match a version number.
+ 		;;
+ 	-qnx*)
+@@ -1388,6 +1422,9 @@ case $os in
+ 	-zvmoe)
+ 		os=-zvmoe
+ 		;;
++	-dicos*)
++		os=-dicos
++		;;
+ 	-none)
+ 		;;
+ 	*)

+ 11 - 0
package/rpm/patches/patch-configure

@@ -0,0 +1,11 @@
+--- rpm-4.7.0.orig/configure	2009-04-16 10:10:33.000000000 +0200
++++ rpm-4.7.0/configure	2009-06-23 19:55:16.747272696 +0200
+@@ -21839,7 +21839,7 @@ if test "$GCC" = yes; then
+     CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts"
+     # XXX disabled for now due to noise from NSPR headers
+     # CFLAGS="$CFLAGS -Wstrict-prototypes"
+-    cflags_to_try="-fno-strict-aliasing -fstack-protector"
++    cflags_to_try="-fno-strict-aliasing"
+     { $as_echo "$as_me:$LINENO: checking supported compiler flags" >&5
+ $as_echo_n "checking supported compiler flags... " >&6; }
+     old_cflags=$CFLAGS

+ 12 - 0
package/rpm/patches/patch-rpmio_fts_c

@@ -0,0 +1,12 @@
+--- rpm-4.7.0.orig/rpmio/fts.c	2009-03-03 07:51:52.000000000 +0100
++++ rpm-4.7.0/rpmio/fts.c	2009-06-25 20:23:10.374967519 +0200
+@@ -64,6 +64,9 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
+ #include "rpmio/fts.h"
+ #include <rpm/rpmio.h>
+ #include <rpm/rpmurl.h>
++#ifdef __UCLIBC__
++#   define __fxstat64(_stat_ver, _fd, _sbp)	fstat64((_fd), (_sbp))
++#endif
+ #   define __set_errno(val) (*__errno_location ()) = (val)
+ #   define __open	open
+ #   define __close	close

+ 12 - 0
package/rpm/patches/patch-rpmio_rpmio_h

@@ -0,0 +1,12 @@
+--- rpm-4.7.0.orig/rpmio/rpmio.h	2009-03-03 07:51:52.000000000 +0100
++++ rpm-4.7.0/rpmio/rpmio.h	2009-06-25 20:22:25.734966728 +0200
+@@ -26,7 +26,8 @@ extern "C" {
+  * typedefs to isolate the lossage.
+  */
+ #if defined(__GLIBC__) && \
+-	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
++	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \
++	!defined(__UCLIBC__)
+ #define USE_COOKIE_SEEK_POINTER 1
+ typedef _IO_off64_t 	_libio_off_t;
+ typedef _libio_off_t *	_libio_pos_t;

+ 22 - 0
package/rpm/patches/patch-rpmio_rpmio_h.orig

@@ -0,0 +1,22 @@
+--- rpm-4.7.0.orig/rpmio/rpmio.h	2009-03-03 07:51:52.000000000 +0100
++++ rpm-4.7.0/rpmio/rpmio.h	2009-06-25 19:32:01.343208721 +0200
+@@ -25,15 +25,19 @@ extern "C" {
+  * argument as a pointer rather than as an off_t. The snarl below defines
+  * typedefs to isolate the lossage.
+  */
++/*
+ #if defined(__GLIBC__) && \
+ 	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
+ #define USE_COOKIE_SEEK_POINTER 1
+ typedef _IO_off64_t 	_libio_off_t;
+ typedef _libio_off_t *	_libio_pos_t;
+ #else
++*/
+ typedef off_t 		_libio_off_t;
+ typedef off_t 		_libio_pos_t;
++/*
+ #endif
++*/
+ 
+ /** \ingroup rpmio
+  */

+ 132 - 0
package/rpm/patches/patch-rpmio_rpmsq_c

@@ -0,0 +1,132 @@
+--- rpm-4.7.0.orig/rpmio/rpmsq.c	2009-03-03 07:51:52.000000000 +0100
++++ rpm-4.7.0/rpmio/rpmsq.c	2009-06-25 20:15:31.954966249 +0200
+@@ -83,6 +83,7 @@ static rpmsq rpmsqQueue = &rpmsqRock;
+  */
+ static int rpmsqInsert(void * elem, void * prev)
+ {
++    sigset_t new_set, old_set;
+     rpmsq sq = (rpmsq) elem;
+     int ret = -1;
+ 
+@@ -91,7 +92,9 @@ static int rpmsqInsert(void * elem, void
+ if (_rpmsq_debug)
+ fprintf(stderr, "    Insert(%p): %p\n", ME(), sq);
+ #endif
+-	ret = sighold(SIGCHLD);
++	sigemptyset(&new_set);
++	sigaddset(&new_set, SIGCHLD);
++	ret = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 	if (ret == 0) {
+ 	    sq->child = 0;
+ 	    sq->reaped = 0;
+@@ -102,7 +105,7 @@ fprintf(stderr, "    Insert(%p): %p\n", 
+ 	    sq->id = ME();
+ 	    ret = pthread_mutex_init(&sq->mutex, NULL);
+ 	    insque(elem, (prev != NULL ? prev : rpmsqQueue));
+-	    ret = sigrelse(SIGCHLD);
++	    ret = sigprocmask(SIG_SETMASK, &old_set, NULL);
+ 	}
+     }
+     return ret;
+@@ -115,6 +118,7 @@ fprintf(stderr, "    Insert(%p): %p\n", 
+  */
+ static int rpmsqRemove(void * elem)
+ {
++    sigset_t new_set, old_set;
+     rpmsq sq = (rpmsq) elem;
+     int ret = -1;
+ 
+@@ -124,7 +128,9 @@ static int rpmsqRemove(void * elem)
+ if (_rpmsq_debug)
+ fprintf(stderr, "    Remove(%p): %p\n", ME(), sq);
+ #endif
+-	ret = sighold (SIGCHLD);
++	sigemptyset(&new_set);
++	sigaddset(&new_set, SIGCHLD);
++	ret = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 	if (ret == 0) {
+ 	    remque(elem);
+ 	   
+@@ -142,7 +148,7 @@ fprintf(stderr, "    Remove(%p): %p\n", 
+ 	    sq->reaped = 0;
+ 	    sq->child = 0;
+ #endif
+-	    ret = sigrelse(SIGCHLD);
++	    ret = sigprocmask(SIG_SETMASK, &old_set, NULL);
+ 	}
+     }
+     return ret;
+@@ -289,6 +295,7 @@ int rpmsqEnable(int signum, rpmsqAction_
+ 
+ pid_t rpmsqFork(rpmsq sq)
+ {
++    sigset_t new_set, old_set;
+     pid_t pid;
+     int xx;
+     int nothreads = 0;   /* XXX: Shouldn't this be a global? */
+@@ -304,7 +311,9 @@ fprintf(stderr, "    Enable(%p): %p\n", 
+ 
+     xx = pipe(sq->pipes);
+ 
+-    xx = sighold(SIGCHLD);
++    sigemptyset(&new_set);
++    sigaddset(&new_set, SIGCHLD);
++    xx = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 
+     /* 
+      * Initialize the cond var mutex.   We have to aquire the lock we 
+@@ -355,7 +364,7 @@ fprintf(stderr, "    Parent(%p): %p chil
+     }
+ 
+ out:
+-    xx = sigrelse(SIGCHLD);
++    xx = sigprocmask(SIG_SETMASK, &old_set, NULL);
+     return sq->child;
+ }
+ 
+@@ -367,12 +376,15 @@ out:
+  */
+ static int rpmsqWaitUnregister(rpmsq sq)
+ {
++    sigset_t new_set, old_set;
+     int nothreads = 0;
+     int ret = 0;
+     int xx;
+ 
+     /* Protect sq->reaped from handler changes. */
+-    ret = sighold(SIGCHLD);
++    sigemptyset(&new_set);
++    sigaddset(&new_set, SIGCHLD);
++    ret = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 
+     /* Start the child, linux often runs child before parent. */
+     if (sq->pipes[0] >= 0)
+@@ -388,9 +400,9 @@ static int rpmsqWaitUnregister(rpmsq sq)
+     while (ret == 0 && sq->reaped != sq->child) {
+ 	if (nothreads)
+ 	    /* Note that sigpause re-enables SIGCHLD. */
+-	    ret = sigpause(SIGCHLD);
++	    ret = sigsuspend(&new_set);
+ 	else {
+-	    xx = sigrelse(SIGCHLD);
++    	    xx = sigprocmask(SIG_SETMASK, &old_set, NULL);
+ 	    
+ 	    /* 
+ 	     * We start before the fork with this mutex locked;
+@@ -398,14 +410,14 @@ static int rpmsqWaitUnregister(rpmsq sq)
+ 	     * So if we get the lock the child has been reaped.
+ 	     */
+ 	    ret = pthread_mutex_lock(&sq->mutex);
+-	    xx = sighold(SIGCHLD);
++	    xx = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 	}
+     }
+ 
+     /* Accumulate stopwatch time spent waiting, potential performance gain. */
+     sq->ms_scriptlets += rpmswExit(&sq->op, -1)/1000;
+ 
+-    xx = sigrelse(SIGCHLD);
++    xx = sigprocmask(SIG_SETMASK, &old_set, NULL);
+ 
+ #ifdef _RPMSQ_DEBUG
+ if (_rpmsq_debug)

+ 30 - 0
package/rpm/patches/patch-rpmio_rpmsq_c.orig

@@ -0,0 +1,30 @@
+--- rpm-4.7.0.orig/rpmio/rpmsq.c	2009-03-03 07:51:52.000000000 +0100
++++ rpm-4.7.0/rpmio/rpmsq.c	2009-06-25 20:02:58.903020248 +0200
+@@ -115,6 +115,7 @@ fprintf(stderr, "    Insert(%p): %p\n", 
+  */
+ static int rpmsqRemove(void * elem)
+ {
++    sigset_t new_set, old_set;
+     rpmsq sq = (rpmsq) elem;
+     int ret = -1;
+ 
+@@ -124,7 +125,9 @@ static int rpmsqRemove(void * elem)
+ if (_rpmsq_debug)
+ fprintf(stderr, "    Remove(%p): %p\n", ME(), sq);
+ #endif
+-	ret = sighold (SIGCHLD);
++	sigemptyset( &new_set );
++	sigaddset( &new_set, SIGCHLD );
++	ret = sigprocmask(SIG_BLOCK, &new_set, &old_set);
+ 	if (ret == 0) {
+ 	    remque(elem);
+ 	   
+@@ -142,7 +145,7 @@ fprintf(stderr, "    Remove(%p): %p\n", 
+ 	    sq->reaped = 0;
+ 	    sq->child = 0;
+ #endif
+-	    ret = sigrelse(SIGCHLD);
++	    ret = sigprocmask( SIG_SETMASK, &old_set, NULL );
+ 	}
+     }
+     return ret;

+ 13 - 7
target/Config.in

@@ -1,9 +1,16 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
+# mark broken devices
+config ADK_BROKEN
+	bool
+
 config ADK_DEVICE_NO_FPU
 	bool
 
+config ADK_LINUX_64
+	bool
+
 config ADK_NATIVE
 	tristate
 
@@ -83,10 +90,6 @@ config ADK_DEVICE
 	default "rescue-mips"  if ADK_rescue_mips
 	default "rescue-mipsel"  if ADK_rescue_mipsel
 
-config ADK_LINUX_MIPS64
-	bool
-	default n	
-
 menu "Target system"
 
 choice
@@ -124,7 +127,8 @@ config ADK_LINUX_CRIS_FOXBOARD
 config ADK_LINUX_MIPS64_LEMOTE
 	bool "Lemote Subnotebook Yeeloong"
 	select ADK_lemote
-	select ADK_LINUX_MIPS64
+	select ADK_LINUX_64
+	select ADK_KERNEL_INPUT_KEYBOARD
 	select ADK_KERNEL_NETDEVICES
 	select ADK_KERNEL_NET_PCI
 	select ADK_KERNEL_NET_ETHERNET
@@ -176,6 +180,7 @@ depends on ADK_LINUX_RESCUE
 config ADK_LINUX_X86_64_RESCUE
 	bool "x86_64"
 	select ADK_rescue_x86_64
+	select ADK_LINUX_64
 	help
 	 X86 architecture.
 
@@ -226,20 +231,21 @@ config ADK_LINUX_MIPSEL_QEMU
 config ADK_LINUX_MIPS64_QEMU
 	bool "mips64 (big endian)"
 	select ADK_qemu_mips64
-	select ADK_LINUX_MIPS64
+	select ADK_LINUX_64
 	help
 	 Qemu support for MIPS64 BE architecture.
 
 config ADK_LINUX_MIPS64EL_QEMU
 	bool "mips64 (little endian)"
 	select ADK_qemu_mips64el
-	select ADK_LINUX_MIPS64
+	select ADK_LINUX_64
 	help
 	 Qemu support for MIPS64 LE architecture.
 
 config ADK_LINUX_CRIS_QEMU
 	bool "cris"
 	select ADK_qemu_cris
+	select ADK_BROKEN
 	help
 	 Qemu support for CRISv32 architecture.
 

+ 0 - 11
target/wag54g/patches/ar7.patch

@@ -2334,17 +2334,6 @@ diff -Nur linux-2.6.30.orig/arch/mips/kernel/traps.c linux-2.6.30/arch/mips/kern
  	}
  	return (void *)old_handler;
  }
-diff -Nur linux-2.6.30.orig/arch/mips/lib/delay.c linux-2.6.30/arch/mips/lib/delay.c
---- linux-2.6.30.orig/arch/mips/lib/delay.c	2009-06-10 05:05:27.000000000 +0200
-+++ linux-2.6.30/arch/mips/lib/delay.c	2009-06-11 21:10:53.309003369 +0200
-@@ -51,6 +51,6 @@
- {
- 	unsigned int lpj = current_cpu_data.udelay_val;
- 
--	__delay((us * 0x00000005 * HZ * lpj) >> 32);
-+	__delay((ns * 0x00000005 * HZ * lpj) >> 32);
- }
- EXPORT_SYMBOL(__ndelay);
 diff -Nur linux-2.6.30.orig/drivers/Kconfig linux-2.6.30/drivers/Kconfig
 --- linux-2.6.30.orig/drivers/Kconfig	2009-06-10 05:05:27.000000000 +0200
 +++ linux-2.6.30/drivers/Kconfig	2009-06-11 20:55:34.619476239 +0200

+ 14 - 26
target/wag54g/uclibc.config

@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Version: 0.9.30
-# Fri Jan  9 14:41:23 2009
+# Version: 0.9.30-svn
+# Sun Jun 14 15:49:39 2009
 #
 # TARGET_alpha is not set
 # TARGET_arm is not set
@@ -35,23 +35,6 @@ TARGET_mips=y
 TARGET_ARCH="mips"
 FORCE_OPTIONS_FOR_ARCH=y
 ARCH_CFLAGS="-mno-split-addresses"
-# CONFIG_GENERIC_386 is not set
-# CONFIG_386 is not set
-# CONFIG_486 is not set
-# CONFIG_586 is not set
-# CONFIG_586MMX is not set
-# CONFIG_686 is not set
-# CONFIG_PENTIUMII is not set
-# CONFIG_PENTIUMIII is not set
-# CONFIG_PENTIUM4 is not set
-# CONFIG_K6 is not set
-# CONFIG_K7 is not set
-# CONFIG_ELAN is not set
-# CONFIG_CRUSOE is not set
-# CONFIG_WINCHIPC6 is not set
-# CONFIG_WINCHIP2 is not set
-# CONFIG_CYRIXIII is not set
-# CONFIG_NEHEMIAH is not set
 CONFIG_MIPS_O32_ABI=y
 # CONFIG_MIPS_N32_ABI is not set
 # CONFIG_MIPS_N64_ABI is not set
@@ -99,8 +82,10 @@ UCLIBC_CTOR_DTOR=y
 # LDSO_GNU_HASH_SUPPORT is not set
 # HAS_NO_THREADS is not set
 UCLIBC_HAS_THREADS=y
-PTHREADS_DEBUG_SUPPORT=y
-LINUXTHREADS_OLD=y
+UCLIBC_HAS_TLS=y
+# PTHREADS_DEBUG_SUPPORT is not set
+# LINUXTHREADS_OLD is not set
+UCLIBC_HAS_THREADS_NATIVE=y
 UCLIBC_HAS_SYSLOG=y
 UCLIBC_HAS_LFS=y
 # MALLOC is not set
@@ -109,8 +94,9 @@ MALLOC_STANDARD=y
 MALLOC_GLIBC_COMPAT=y
 UCLIBC_DYNAMIC_ATEXIT=y
 COMPAT_ATEXIT=y
-# UCLIBC_SUSV3_LEGACY is not set
+UCLIBC_SUSV3_LEGACY=y
 # UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_SUSV4_LEGACY is not set
 # UCLIBC_HAS_STUBS is not set
 UCLIBC_HAS_SHADOW=y
 UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
@@ -144,7 +130,7 @@ UCLIBC_HAS_BSD_ERR=y
 # UCLIBC_NTP_LEGACY is not set
 # UCLIBC_SV4_DEPRECATED is not set
 UCLIBC_HAS_REALTIME=y
-# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_ADVANCED_REALTIME=y
 UCLIBC_HAS_EPOLL=y
 UCLIBC_HAS_XATTR=y
 # UCLIBC_HAS_PROFILING is not set
@@ -160,6 +146,8 @@ UCLIBC_HAS_REENTRANT_RPC=y
 UCLIBC_USE_NETLINK=y
 UCLIBC_SUPPORT_AI_ADDRCONFIG=y
 UCLIBC_HAS_BSD_RES_CLOSE=y
+UCLIBC_HAS_COMPAT_RES_STATE=y
+# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
 
 #
 # String and Stdio Support
@@ -200,6 +188,7 @@ UCLIBC_HAS_ERRNO_MESSAGES=y
 UCLIBC_HAS_SIGNUM_MESSAGES=y
 # UCLIBC_HAS_SYS_SIGLIST is not set
 UCLIBC_HAS_GNU_GETOPT=y
+# UCLIBC_HAS_STDIO_FUTEXES is not set
 UCLIBC_HAS_GNU_GETSUBOPT=y
 
 #
@@ -238,11 +227,10 @@ UCLIBC_BUILD_NOEXECSTACK=y
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
 # DODEBUG is not set
-# DODEBUG_PT is not set
 DOSTRIP=y
 # DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
+SUPPORT_LD_DEBUG=y
+SUPPORT_LD_DEBUG_EARLY=y
 # UCLIBC_MALLOC_DEBUGGING is not set
 WARNINGS="-Wall"
 EXTRA_WARNINGS=y

+ 1 - 1
toolchain/binutils/Makefile

@@ -12,7 +12,7 @@ else
 CONFOPTS+=		--disable-libssp
 endif
 
-ifeq ($(ADK_LINUX_MIPS64_LEMOTE),y)
+ifeq ($(ADK_LINUX_64),y)
 CONFOPTS+=		--enable-64-bit-bfd
 endif
 

+ 1 - 1
toolchain/gcc/Makefile

@@ -38,7 +38,7 @@ ifeq ($(ADK_DEVICE_NO_FPU),y)
 GCC_CONFOPTS+=		--with-float=soft
 endif
 
-ifeq ($(ADK_LINUX_MIPS64),y)
+ifeq ($(ADK_LINUX_64),y)
 GCC_CONFOPTS+=		--with-abi=64
 endif