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

Last change on this file since 14121 was 14121, checked in by rick, 7 years ago

Fix package configuration prompt at initenv

Packages should not be configured, causing all packages to be
re-valuated if package tree is not up2date.

Try to stick with boring defaults.

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