summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/libvirt/Makefile10
-rw-r--r--package/libxml2/Makefile20
-rw-r--r--package/libxml2/patches/patch-configure33
-rw-r--r--package/pycurl/Makefile44
-rw-r--r--package/pycurl/patches/patch-setup_py12
-rw-r--r--package/python2/Makefile4
-rw-r--r--package/python2/files/build_scripts.py99
-rw-r--r--package/python2/patches/patch-Makefile_pre_in23
-rw-r--r--package/python2/patches/patch-configure4
-rw-r--r--package/python2/patches/patch-setup_py4
-rw-r--r--package/urlgrabber/Makefile36
11 files changed, 267 insertions, 22 deletions
diff --git a/package/libvirt/Makefile b/package/libvirt/Makefile
index 8e4329bb8..6d3b65d19 100644
--- a/package/libvirt/Makefile
+++ b/package/libvirt/Makefile
@@ -10,7 +10,8 @@ PKG_MD5SUM:= b74df374b524d00a22a6c89cfc23099f
PKG_DESCR:= virtualization API
PKG_SECTION:= libs
PKG_BUILDDEP:= libxml2 gnutls python2 libpcap parted udev
-PKG_DEPENDS:= libxml2 libgnutls python2 libpcap
+PKG_DEPENDS:= libxml2 libgnutls python2 libpcap libreadline
+PKG_DEPENDS+= libintl
PKG_URL:= http://www.libvirt.org/
PKG_SITES:= ftp://libvirt.org/libvirt/
@@ -21,6 +22,8 @@ include ${TOPDIR}/mk/package.mk
$(eval $(call PKG_template,LIBVIRT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+include ${TOPDIR}/mk/python.mk
+
CONFIGURE_ENV+= gl_cv_warn__fstack_protector_all=no
CONFIGURE_ARGS+= --without-xen \
--without-uml \
@@ -36,8 +39,11 @@ post-install:
${INSTALL_DIR} ${IDIR_LIBVIRT}/usr/lib ${IDIR_LIBVIRT}/usr/bin
${INSTALL_DIR} ${IDIR_LIBVIRT}/etc/libvirt ${IDIR_LIBVIRT}/usr/sbin
${INSTALL_BIN} ${WRKINST}/usr/bin/virsh ${IDIR_LIBVIRT}/usr/bin
- ${CP} ${WRKINST}/usr/lib/libvirt.so* ${IDIR_LIBVIRT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libvirt*.so* ${IDIR_LIBVIRT}/usr/lib
${CP} ${WRKINST}/etc/libvirt/* ${IDIR_LIBVIRT}/etc/libvirt
${INSTALL_BIN} ${WRKINST}/usr/sbin/libvirtd ${IDIR_LIBVIRT}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_LIBVIRT}/usr/lib/python$(PYTHON_VERSION)/site-packages
+ $(CP) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+ ${IDIR_LIBVIRT}/usr/lib/python$(PYTHON_VERSION)/site-packages
include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libxml2/Makefile b/package/libxml2/Makefile
index 8bfe1bb20..cae954797 100644
--- a/package/libxml2/Makefile
+++ b/package/libxml2/Makefile
@@ -14,20 +14,30 @@ PKG_BUILDDEP:= zlib
PKG_URL:= http://www.xmlsoft.org/
PKG_SITES:= http://xmlsoft.org/sources/
-PKG_SUBPKGS:= LIBXML2 LIBXML2_DEV
+PKG_SUBPKGS:= LIBXML2 LIBXML2_DEV LIBXML2_PYTHON
PKGSD_LIBXML2_DEV:= XML parser headers
PKGSC_LIBXML2_DEV:= devel
+PKGSD_LIBXML2_PYTHON:= XML python bindings
+PKGSC_LIBXML2_PYTHON:= libs
include ${TOPDIR}/mk/package.mk
$(eval $(call PKG_template,LIBXML2,libxml2,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
$(eval $(call PKG_template,LIBXML2_DEV,libxml2-dev,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_LIBXML2_DEV},${PKGSC_LIBXML2_DEV}))
+$(eval $(call PKG_template,LIBXML2_PYTHON,libxml2-python,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_LIBXML2_PYTHON},${PKGSC_LIBXML2_PYTHON}))
+
+include $(TOPDIR)/mk/python.mk
TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
+ifeq ($(ADK_PACKAGE_LIBXML2_PYTHON),y)
+CONFIGURE_ARGS+= --with-python=${STAGING_DIR}/usr
+else
+CONFIGURE_ARGS+= --without-python
+endif
CONFIGURE_ARGS+= --without-c14n \
- --without-catalog \
--without-debug \
--without-docbook \
+ --with-catalog \
--with-html \
--without-ftp \
--without-http \
@@ -37,7 +47,6 @@ CONFIGURE_ARGS+= --without-c14n \
--with-output \
--without-pattern \
--without-push \
- --without-python \
--with-reader \
--without-readline \
--without-regexps \
@@ -66,4 +75,9 @@ libxml2-dev-install:
${INSTALL_BIN} ${WRKINST}/usr/bin/xml2-config \
${IDIR_LIBXML2_DEV}/usr/bin
+libxml2-python-install:
+ $(INSTALL_DIR) $(IDIR_LIBXML2_PYTHON)/usr/lib/python$(PYTHON_VERSION)/site-packages
+ $(CP) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+ $(IDIR_LIBXML2_PYTHON)/usr/lib/python$(PYTHON_VERSION)/site-packages
+
include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libxml2/patches/patch-configure b/package/libxml2/patches/patch-configure
new file mode 100644
index 000000000..f5a2ba355
--- /dev/null
+++ b/package/libxml2/patches/patch-configure
@@ -0,0 +1,33 @@
+--- libxml2-2.7.8.orig/configure 2010-11-04 18:28:14.000000000 +0100
++++ libxml2-2.7.8/configure 2011-10-15 15:07:16.000000000 +0200
+@@ -13423,17 +13423,17 @@ case ${host} in
+ esac
+
+
+-
++set -x
+ PYTHON_VERSION=
+ PYTHON_INCLUDES=
+ PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+ if test "$with_python" != "no" ; then
+- if test -x "$with_python/bin/python"
++ if test -x "$with_python/bin/hostpython"
+ then
+- echo Found python in $with_python/bin/python
+- PYTHON="$with_python/bin/python"
++ echo Found python in $with_python/bin/hostpython
++ PYTHON="$with_python/bin/hostpython"
+ else
+ if test -x "$with_python/python.exe"
+ then
+@@ -13558,7 +13558,7 @@ else
+ PYTHON_SUBDIR=
+ fi
+
+-
++set +x
+
+
+ WITH_MODULES=0
diff --git a/package/pycurl/Makefile b/package/pycurl/Makefile
new file mode 100644
index 000000000..a0325ad11
--- /dev/null
+++ b/package/pycurl/Makefile
@@ -0,0 +1,44 @@
+# 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:= pycurl
+PKG_VERSION:= 7.19.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 919d58fe37e69fe87ce4534d8b6a1c7b
+PKG_DESCR:= Python module for fetching of files
+PKG_SECTION:= misc
+PKG_BUILDDEP:= python2 curl
+PKG_DEPENDS:= python2 libcurl
+PKG_URL:= http://pycurl.sourceforge.net/
+PKG_SITES:= http://pycurl.sourceforge.net/download/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,PYCURL,pycurl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:= manual
+BUILD_STYLE:= manual
+INSTALL_STYLE:= manual
+
+TARGET_CFLAGS+= -fPIC
+MAKE_ENV+= LDSHARED="$(TARGET_CC) -shared"
+
+include $(TOPDIR)/mk/python.mk
+
+#do-configure:
+ # native build for urlgrabber package
+# (cd $(WRKBUILD); env CC=$(CC_FOR_BUILD) CFLAGS="$(CFLAGS_FOR_BUILD)" python ./setup.py build)
+# (cd $(WRKBUILD); enc CC=$(CC_FOR_BUILD) CFLAGS="$(CFLAGS_FOR_BUILD)" python ./setup.py install --prefix="$(STAGING_DIR)/usr")
+
+do-build:
+ (cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR) $(PYTHON) ./setup.py --curl-config="$(STAGING_DIR)/usr/bin/curl-config" build)
+ (cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR) $(PYTHON) ./setup.py install --prefix="$(WRKINST)/usr")
+
+do-install:
+ $(INSTALL_DIR) $(IDIR_PYCURL)/usr/lib/python$(PYTHON_VERSION)/site-packages
+ $(CP) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+ $(IDIR_PYCURL)/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pycurl/patches/patch-setup_py b/package/pycurl/patches/patch-setup_py
new file mode 100644
index 000000000..26280ec36
--- /dev/null
+++ b/package/pycurl/patches/patch-setup_py
@@ -0,0 +1,12 @@
+--- pycurl-7.19.0.orig/setup.py 2008-09-09 19:40:34.000000000 +0200
++++ pycurl-7.19.0/setup.py 2011-10-14 17:59:41.000000000 +0200
+@@ -115,9 +115,6 @@ else:
+ define_macros.append(('HAVE_CURL_SSL', 1))
+ if not libraries:
+ libraries.append("curl")
+- # Add extra compile flag for MacOS X
+- if sys.platform[:-1] == "darwin":
+- extra_link_args.append("-flat_namespace")
+
+
+ ###############################################################################
diff --git a/package/python2/Makefile b/package/python2/Makefile
index 53e770f2d..2aed3ed49 100644
--- a/package/python2/Makefile
+++ b/package/python2/Makefile
@@ -46,9 +46,10 @@ post-extract:
$(CP) ./files/setup.py ${WRKBUILD}/setup.py
$(CP) ./files/posixmodule.c ${WRKBUILD}/Modules/posixmodule.c
$(CP) ./files/python-config.in ${WRKBUILD}/Misc/python-config.in
+ $(CP) ./files/build_scripts.py ${WRKBUILD}/Lib/distutils/command/build_scripts.py
(cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
OPT="$(CFLAGS_FOR_BUILD)" \
- ./configure --without-cxx-main --without-threads \
+ ./configure --without-cxx-main --with-threads \
--prefix=$(STAGING_HOST_DIR)/usr \
);
$(MAKE) -C ${WRKBUILD} python Parser/pgen
@@ -62,6 +63,7 @@ post-extract:
pre-configure:
$(SED) "s#@@CPU_ARCH@@#$(CPU_ARCH)#" ${WRKBUILD}/configure
+ $(SED) "s#@@STAGING_DIR@@#$(STAGING_DIR)#" ${WRKBUILD}/setup.py
post-install:
${INSTALL_DIR} ${IDIR_PYTHON2}/usr/bin ${IDIR_PYTHON2}/usr/lib
diff --git a/package/python2/files/build_scripts.py b/package/python2/files/build_scripts.py
new file mode 100644
index 000000000..fe81a5341
--- /dev/null
+++ b/package/python2/files/build_scripts.py
@@ -0,0 +1,99 @@
+"""distutils.command.build_scripts
+
+Implements the Distutils 'build_scripts' command."""
+
+__revision__ = "$Id: build_scripts.py 77704 2010-01-23 09:23:15Z tarek.ziade $"
+
+import os, re
+from stat import ST_MODE
+from distutils.core import Command
+from distutils.dep_util import newer
+from distutils.util import convert_path
+from distutils import log
+
+# check if Python is called on the first line with this expression
+first_line_re = re.compile('^#!.*python[0-9.]*([ \t].*)?$')
+
+class build_scripts (Command):
+
+ description = "\"build\" scripts (copy and fixup #! line)"
+
+ user_options = [
+ ('build-dir=', 'd', "directory to \"build\" (copy) to"),
+ ('force', 'f', "forcibly build everything (ignore file timestamps"),
+ ('executable=', 'e', "specify final destination interpreter path"),
+ ]
+
+ boolean_options = ['force']
+
+
+ def initialize_options (self):
+ self.build_dir = None
+ self.scripts = None
+ self.force = None
+ self.executable = None
+ self.outfiles = None
+
+ def finalize_options (self):
+ self.set_undefined_options('build',
+ ('build_scripts', 'build_dir'),
+ ('force', 'force'),
+ ('executable', 'executable'))
+ self.scripts = self.distribution.scripts
+
+ def get_source_files(self):
+ return self.scripts
+
+ def run (self):
+ if not self.scripts:
+ return
+ self.copy_scripts()
+
+
+ def copy_scripts (self):
+ """Copy each script listed in 'self.scripts'; if it's marked as a
+ Python script in the Unix way (first line matches 'first_line_re',
+ ie. starts with "\#!" and contains "python"), then adjust the first
+ line to refer to the current Python interpreter as we copy.
+ """
+ _sysconfig = __import__('sysconfig')
+ self.mkpath(self.build_dir)
+ outfiles = []
+ for script in self.scripts:
+ adjust = 0
+ script = convert_path(script)
+ outfile = os.path.join(self.build_dir, os.path.basename(script))
+ outfiles.append(outfile)
+
+ if not self.force and not newer(script, outfile):
+ log.debug("not copying %s (up-to-date)", script)
+ continue
+
+ # Always open the file, but ignore failures in dry-run mode --
+ # that way, we'll get accurate feedback if we can read the
+ # script.
+ try:
+ f = open(script, "r")
+ except IOError:
+ if not self.dry_run:
+ raise
+ f = None
+ if f:
+ f.close()
+ self.copy_file(script, outfile)
+
+ if os.name == 'posix':
+ for file in outfiles:
+ if self.dry_run:
+ log.info("changing mode of %s", file)
+ else:
+ oldmode = os.stat(file)[ST_MODE] & 07777
+ newmode = (oldmode | 0555) & 07777
+ if newmode != oldmode:
+ log.info("changing mode of %s from %o to %o",
+ file, oldmode, newmode)
+ os.chmod(file, newmode)
+
+ # copy_scripts ()
+
+# class build_scripts
diff --git a/package/python2/patches/patch-Makefile_pre_in b/package/python2/patches/patch-Makefile_pre_in
index d3737ae3e..694518173 100644
--- a/package/python2/patches/patch-Makefile_pre_in
+++ b/package/python2/patches/patch-Makefile_pre_in
@@ -1,6 +1,6 @@
diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
--- Python-2.7.1.orig/Makefile.pre.in 2010-10-14 13:37:30.000000000 +0200
-+++ Python-2.7.1/Makefile.pre.in 2011-01-20 22:13:22.464906869 +0100
++++ Python-2.7.1/Makefile.pre.in 2011-10-15 16:09:58.000000000 +0200
@@ -59,7 +59,7 @@ MAKESETUP= $(srcdir)/Modules/makese
# Compiler options
OPT= @OPT@
@@ -35,7 +35,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
build_all_use_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
-@@ -398,14 +400,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
+@@ -398,14 +400,13 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
platform: $(BUILDPYTHON)
@@ -48,12 +48,11 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
-+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
-@@ -538,7 +540,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
+@@ -538,7 +539,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
@@ -62,7 +61,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-@@ -702,7 +704,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
+@@ -702,7 +703,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
TESTOPTS= -l $(EXTRATESTOPTS)
TESTPROG= $(srcdir)/Lib/test/regrtest.py
@@ -71,7 +70,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
test: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
-@@ -725,7 +727,7 @@ testuniversal: all platform
+@@ -725,7 +726,7 @@ testuniversal: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
@@ -80,7 +79,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
# Like testall, but with a single pass only
-@@ -920,26 +922,26 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+@@ -920,26 +921,26 @@ libinstall: build_all $(srcdir)/Lib/$(PL
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
@@ -114,7 +113,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
-@@ -1044,7 +1046,8 @@ libainstall: all python-config
+@@ -1044,7 +1045,8 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
@@ -124,7 +123,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
-@@ -1082,7 +1085,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+@@ -1082,7 +1084,7 @@ frameworkinstallstructure: $(LDLIBRARY)
fi; \
done
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
@@ -133,7 +132,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
-@@ -1117,7 +1120,7 @@ frameworkinstallextras:
+@@ -1117,7 +1119,7 @@ frameworkinstallextras:
# This installs a few of the useful scripts in Tools/scripts
scriptsinstall:
SRCDIR=$(srcdir) $(RUNSHARED) \
@@ -142,7 +141,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--root=/$(DESTDIR)
-@@ -1139,7 +1142,7 @@ config.status: $(srcdir)/configure
+@@ -1139,7 +1141,7 @@ config.status: $(srcdir)/configure
# Run reindent on the library
reindent:
@@ -151,7 +150,7 @@ diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
-@@ -1242,7 +1245,7 @@ funny:
+@@ -1242,7 +1244,7 @@ funny:
# Perform some verification checks on any modified files.
patchcheck:
diff --git a/package/python2/patches/patch-configure b/package/python2/patches/patch-configure
index 5f31d2fdb..e47d860fd 100644
--- a/package/python2/patches/patch-configure
+++ b/package/python2/patches/patch-configure
@@ -1,5 +1,5 @@
--- Python-2.7.1.orig/configure 2010-11-01 02:47:19.000000000 +0100
-+++ Python-2.7.1/configure 2011-10-06 18:21:02.848792210 +0200
++++ Python-2.7.1/configure 2011-10-14 17:36:48.000000000 +0200
@@ -2972,12 +2972,12 @@ fi
$as_echo_n "checking MACHDEP... " >&6; }
if test -z "$MACHDEP"
@@ -20,7 +20,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking machine type as reported by uname -m" >&5
$as_echo_n "checking machine type as reported by uname -m... " >&6; }
-ac_sys_machine=`uname -m`
-+ac_sys_machine=@@CPU_ARCH@@
++ac_sys_machine=x86_64
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sys_machine" >&5
$as_echo "$ac_sys_machine" >&6; }
diff --git a/package/python2/patches/patch-setup_py b/package/python2/patches/patch-setup_py
index 7da78c43c..fb91da1d3 100644
--- a/package/python2/patches/patch-setup_py
+++ b/package/python2/patches/patch-setup_py
@@ -89,8 +89,8 @@ diff -Nur Python-2.7.orig/setup.py Python-2.7/setup.py
- '/lib', '/usr/lib',
- ]
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
-+ lib_dirs = self.compiler.library_dirs
-+ inc_dirs = self.compiler.include_dirs
++ lib_dirs = self.compiler.library_dirs + ['@@STAGING_DIR@@/usr/lib']
++ inc_dirs = self.compiler.include_dirs + ['@@STAGING_DIR@@/usr/include']
exts = []
missing = []
diff --git a/package/urlgrabber/Makefile b/package/urlgrabber/Makefile
new file mode 100644
index 000000000..13df6f985
--- /dev/null
+++ b/package/urlgrabber/Makefile
@@ -0,0 +1,36 @@
+# 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:= urlgrabber
+PKG_VERSION:= 3.9.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 00c8359bf71062d0946bacea521f80b4
+PKG_DESCR:= Python module for fetching of files
+PKG_SECTION:= misc
+PKG_BUILDDEP:= pycurl
+PKG_DEPENDS:= pycurl
+PKG_URL:= http://urlgrabber.baseurl.org/
+PKG_SITES:= http://urlgrabber.baseurl.org/download/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,URLGRABBER,urlgrabber,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:= manual
+BUILD_STYLE:= manual
+INSTALL_STYLE:= manual
+
+include $(TOPDIR)/mk/python.mk
+
+do-build:
+ (cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR) $(PYTHON) ./setup.py build)
+ (cd $(WRKBUILD); env PYTHONPATH=$(PYTHON_LIBDIR) $(PYTHON) ./setup.py install --prefix="$(WRKINST)/usr")
+
+do-install:
+ $(INSTALL_DIR) $(IDIR_URLGRABBER)/usr/lib/python$(PYTHON_VERSION)/site-packages
+ $(CP) $(WRKINST)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+ $(IDIR_URLGRABBER)/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+include ${TOPDIR}/mk/pkg-bottom.mk