| 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
| 3 | # Compile listing of required packages using poudriere and friends
|
---|
| 4 | #
|
---|
| 5 | # Rick van der Zwet <rick@wirelessleiden.nl>
|
---|
| 6 | #
|
---|
| 7 |
|
---|
| 8 | . `dirname $0`/common.inc.sh
|
---|
| 9 |
|
---|
| 10 | cfg_dir=`dirname $0`/../cfg
|
---|
| 11 | poudriere_pkglist_file=${cfg_dir}/wlpkgbuild10_2-default-node-pkglist
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | packages_initenv() {
|
---|
| 15 | config_dir=`dirname $0`
|
---|
| 16 |
|
---|
| 17 | # Install required deamons
|
---|
| 18 | pkg install poudriere dialog4ports portshaker
|
---|
| 19 |
|
---|
| 20 | # Setup poudriere build environment
|
---|
| 21 | poudriere jail -c -j wlpkgbuild10_2 -v 10.2-RELEASE -a i386
|
---|
| 22 |
|
---|
| 23 | # Setup portshaker
|
---|
| 24 | cp ${config_dir}/portshaker.conf /usr/local/etc/
|
---|
| 25 | cp ${config_dir}/portshaker.d/* /usr/local/etc/portshaker.d
|
---|
| 26 |
|
---|
| 27 | # Update ports
|
---|
| 28 | portshaker -U
|
---|
| 29 | portshaker -M
|
---|
| 30 |
|
---|
| 31 | # Setup poudriere ports environment
|
---|
| 32 | poudriere ports -c -F -f none -p default -M /usr/local/poudriere/ports/default
|
---|
| 33 |
|
---|
| 34 | # Build options
|
---|
| 35 | poudriere options -j wlpkgbuild10_2 -p default -z node -f ${poudriere_pkglist_file}
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | packages_refresh() {
|
---|
| 39 | # Install new package options
|
---|
| 40 | POUDRIERE_MAKE_CONF_FILE=wlpkgbuild10_2-node-make.conf
|
---|
| 41 | POUDRIERE_OPTIONS=wlpkgbuild10_2-node-options
|
---|
| 42 |
|
---|
| 43 | if [ -d "/usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS" ]; then
|
---|
| 44 | rm -Rf /usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS
|
---|
| 45 | fi
|
---|
| 46 |
|
---|
| 47 | cp ${cfg_dir}/$POUDRIERE_MAKE_CONF_FILE /usr/local/etc/poudriere.d
|
---|
| 48 | cp -R ${cfg_dir}/$POUDRIERE_OPTIONS /usr/local/etc/poudriere.d
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | packages_build() {
|
---|
| 53 | poudriere bulk -j wlpkgbuild10_2 -p default -z node -f ${poudriere_pkglist_file}
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | # Make package list
|
---|
| 57 | . $cfg_dir/nanobsd.wleiden
|
---|
| 58 | echo $PACKAGE_LIST | tr " " "\n" > ${poudriere_pkglist_file}
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | if [ "x$1" = "xinitenv" ]; then
|
---|
| 62 | packages_initenv
|
---|
| 63 | packages_refresh
|
---|
| 64 | elif [ "x$1" = "xrebuild" ]; then
|
---|
| 65 | packages_refresh
|
---|
| 66 | packages_build
|
---|
| 67 | elif [ "x$1" = "xbuild" ]; then
|
---|
| 68 | packages_build
|
---|
| 69 | else
|
---|
| 70 | echo "Usage $0 <initenv|rebuild|build>"
|
---|
| 71 | exit 128
|
---|
| 72 | fi
|
---|