source: hybrid/branches/releng-11/nanobsd/tools/package-build.sh@ 13668

Last change on this file since 13668 was 13668, checked in by rick, 6 years ago

First make the symlinks and _then_ check the config. Else defaults will be used (and user options ignored, since ouptut is discarded)

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 2.2 KB
Line 
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
10cfg_dir=`dirname $0`/../cfg
11abs_cfg_dir=`cd $cfg_dir; pwd -P`
12poudriere_pkglist_file=${cfg_dir}/wlpkgbuild11_0-default-node-pkglist
13
14
15packages_initenv() {
16 config_dir=`dirname $0`
17
18 # Install required deamons
19 pkg install poudriere dialog4ports portshaker
20
21 # Setup poudriere build environment
22 poudriere jail -c -j wlpkgbuild11_0 -v 11.0-RELEASE -a i386
23
24 # Setup portshaker
25 cp ${config_dir}/portshaker.conf /usr/local/etc/
26 cp ${config_dir}/portshaker.d/* /usr/local/etc/portshaker.d
27
28 # Update ports
29 portshaker -U
30 portshaker -M
31
32 # Setup poudriere ports environment
33 poudriere ports -c -F -f none -p default -M /usr/local/poudriere/ports/default
34}
35
36packages_config() {
37 # Configure build options
38 poudriere options -j wlpkgbuild11_0 -p default -z node ${1:+-c} ${*:- -f ${poudriere_pkglist_file}}
39}
40
41
42packages_refresh() {
43 # Install new package (symlink) options
44 POUDRIERE_MAKE_CONF_FILE=wlpkgbuild11_0-node-make.conf
45 POUDRIERE_OPTIONS=wlpkgbuild11_0-node-options
46
47 # Clean old stuff
48 if [ -d "/usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE" ]; then
49 rm -Rf /usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE
50 fi
51
52 if [ -d "/usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS" ]; then
53 rm -Rf /usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS
54 fi
55
56
57 ln -s ${abs_cfg_dir}/$POUDRIERE_MAKE_CONF_FILE /usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE
58 ln -s ${abs_cfg_dir}/$POUDRIERE_OPTIONS /usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS
59}
60
61
62packages_build() {
63 poudriere bulk -j wlpkgbuild11_0 -p default -z node -f ${poudriere_pkglist_file}
64}
65
66# Make package list
67. $cfg_dir/nanobsd.wleiden
68echo $PACKAGE_LIST | tr " " "\n" > ${poudriere_pkglist_file}
69
70
71if [ "x$1" = "xinitenv" ]; then
72 packages_initenv
73 packages_refresh
74 shift; packages_config
75elif [ "x$1" = "xrefresh" ]; then
76 packages_refresh
77elif [ "x$1" = "xconfig" ]; then
78 shift; packages_config $*
79elif [ "x$1" = "xrebuild" ]; then
80 packages_refresh
81 packages_build
82elif [ "x$1" = "xbuild" ]; then
83 packages_build
84else
85 echo "Usage $0 <initenv|config|rebuild|build>"
86 exit 128
87fi
Note: See TracBrowser for help on using the repository browser.