Index: branches/releng-9.0/nanobsd/cfg/nanobsd.wleiden
===================================================================
--- branches/releng-9.0/nanobsd/cfg/nanobsd.wleiden	(revision 10247)
+++ branches/releng-9.0/nanobsd/cfg/nanobsd.wleiden	(revision 10272)
@@ -28,8 +28,45 @@
 NANO_PACKAGE_DIR=$NANO_CONF_DIR/../pkg/All
 
-# XXX: Create function which populate the right packages and fixes the
-# dependencies. Package build script could benefit from this list, as it
-# could build this list beforehand 
-## pkg_info -qr pkg/All/*
+PORTSDIR='/usr/ports'
+WL_PORTSDIR="$NANO_CONF_DIR/../ports/"
+# Dirty quirk to allow comments in part below
+PACKAGE_LIST=`cat <<EOF | sed 's/#.*$//g'
+$PORTSDIR/dns/dnsmasq
+$PORTSDIR/www/thttpd
+$PORTSDIR/editors/vim-lite
+$PORTSDIR/lang/python
+$PORTSDIR/net-mgmt/net-snmp
+$PORTSDIR/benchmarks/iperf
+$PORTSDIR/net/pen 
+$PORTSDIR/devel/py-yaml
+$PORTSDIR/sysutils/ucspi-tcp
+$PORTSDIR/www/tinyproxy
+$PORTSDIR/editors/vim-lite
+$PORTSDIR/security/nmap
+$PORTSDIR/ftp/curl
+$PORTSDIR/security/openvpn
+$PORTSDIR/net/sixxs-aiccu
+
+
+# Wireless Leiden ports at $WL_PORTSDIR
+$WL_PORTSDIR/net/lvrouted
+`
+# Package target
+# Dirty quirk to allow comments in part below
+PKG_MAKE_ARGS=`cat <<EOF | sed 's/#.*$//g'
+PACKAGES=$(dirname $NANO_PACKAGE_DIR)
+BATCH=yes PACKAGE_BUILDING=yes
+# www/py-cherrypy
+WITH_APACHE=yes
+# net-mgmt/net-snmp
+WITHOUT_PERL=yes
+# net-mgmt/nagios-plugins
+WITH_FPING=yes
+# threads is broken in the version (atleast up to 9.0 - 20120213)
+# Should be fix in current version in linux, but for some reason
+# Not yet in BSD. We don't need threads
+WITHOUT_THREADS=yes
+`
+
 ##NANO_PACKAGE_LIST=
 
Index: branches/releng-9.0/nanobsd/tools/package-build.sh
===================================================================
--- branches/releng-9.0/nanobsd/tools/package-build.sh	(revision 10247)
+++ branches/releng-9.0/nanobsd/tools/package-build.sh	(revision 10272)
@@ -12,24 +12,8 @@
 # make options, for package building
 LOGDIR=`mktemp -d "/tmp/$(basename $0 .sh)-$(date +%Y%m%d-%H:%M:%S).X"`
-TARGET="`cd $(dirname $0);pwd -P`/../pkg/"
-
-# Package target
-MAKE_ARGS="$MAKE_ARGS PACKAGES=$TARGET"
-MAKE_ARGS="$MAKE_ARGS BATCH=yes PACKAGE_BUILDING=yes"
-
-# www/py-cherrypy
-MAKE_ARGS="${MAKE_ARGS} WITH_APACHE=yes"
-# net-mgmt/net-snmp
-MAKE_ARGS="${MAKE_ARGS} WITHOUT_PERL=yes"
-# net-mgmt/nagios-plugins
-MAKE_ARGS="${MAKE_ARGS} WITH_FPING=yes"
-# threads is broken in the version (atleast up to 9.0 - 20120213)
-# Should be fix in current version in linux, but for some reason
-# Not yet in BSD. We don't need threads
-MAKE_ARGS="${MAKE_ARGS} WITHOUT_THREADS=yes"
 
 p_info Log directory ${LOGDIR}
 p_info Make options are:
-p_info $(p_list ${MAKE_ARGS})
+p_info $(p_list ${PKG_MAKE_ARGS})
 
 p_info Checking whether there are currently unmet dependencies
@@ -61,35 +45,12 @@
 
 
-if [ -d "${TARGET}/All" ]; then
-	p_warn "Deleted all (old) packages at ${TARGET}"
-	rm -R $TARGET/*
+if [ -d "${NANO_PACKAGE_DIR}" ]; then
+	p_warn "Deleted all (old) packages at ${NANO_PACKAGE_DIR}"
+	rm -R ${NANO_PACKAGE_DIR}/*
 fi
-p_info Created target dir ${TARGET}/All
-mkdir -p ${TARGET}/All
+p_info Created target dir ${NANO_PACKAGE_DIR}
+mkdir -p ${NANO_PACKAGE_DIR}
 
-PORTSDIR='/usr/ports'
-WL_PORTSDIR="`cd $(dirname $0);pwd -P`/../ports/"
-
-PACKAGE_LIST=`cat <<EOF | sed 's/#.*$//g'
-$PORTSDIR/dns/dnsmasq
-$PORTSDIR/www/thttpd
-$PORTSDIR/editors/vim-lite
-$PORTSDIR/lang/python
-$PORTSDIR/net-mgmt/net-snmp
-$PORTSDIR/benchmarks/iperf
-$PORTSDIR/net/pen 
-$PORTSDIR/devel/py-yaml
-$PORTSDIR/sysutils/ucspi-tcp
-$PORTSDIR/www/tinyproxy
-$PORTSDIR/editors/vim-lite
-$PORTSDIR/security/nmap
-$PORTSDIR/ftp/curl
-$PORTSDIR/security/openvpn
-$PORTSDIR/net/sixxs-aiccu
-$WL_PORTSDIR/net/lvrouted
-
-`
-
-MAKE="make ${MAKE_ARGS}"
+MAKE="make ${PKG_MAKE_ARGS}"
 
 BUILD_LIST=''
@@ -149,5 +110,5 @@
   ${MAKE} package-links
   PKGNAME=`make extract-message | awk '{print $NF}'`
-  pkg_create -b $PKGNAME $TARGET/All/${PKGNAME}.tbz
+  pkg_create -b $PKGNAME ${NANO_PACKAGE_DIR}/${PKGNAME}.tbz
 
   p_info Checking dependencies
