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

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

Do not prompt user, just do it. It's a lengthy process and I do not like the Windows Way of coming back at your desk
discovering that you have to press Enter.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 2.3 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 -y 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 # Distfile cache should be created if it does not exists
36 . /usr/local/etc/poudriere.conf
37 if [ ! -d "$DISTFILES_CACHE" ]; then
38 mkdir -p $DISTFILES_CACHE
39 fi
40}
41
42packages_config() {
43 # Configure build options
44 poudriere options -j wlpkgbuild11_0 -p default -z node ${1:+-c} ${*:- -f ${poudriere_pkglist_file}}
45}
46
47
48packages_refresh() {
49 # Install new package (symlink) options
50 POUDRIERE_MAKE_CONF_FILE=wlpkgbuild11_0-node-make.conf
51 POUDRIERE_OPTIONS=wlpkgbuild11_0-node-options
52
53 # Clean old stuff
54 if [ -d "/usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE" ]; then
55 rm -Rf /usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE
56 fi
57
58 if [ -d "/usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS" ]; then
59 rm -Rf /usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS
60 fi
61
62
63 ln -s ${abs_cfg_dir}/$POUDRIERE_MAKE_CONF_FILE /usr/local/etc/poudriere.d/$POUDRIERE_MAKE_CONF_FILE
64 ln -s ${abs_cfg_dir}/$POUDRIERE_OPTIONS /usr/local/etc/poudriere.d/$POUDRIERE_OPTIONS
65}
66
67
68packages_build() {
69 poudriere bulk -j wlpkgbuild11_0 -p default -z node -f ${poudriere_pkglist_file}
70}
71
72# Make package list
73. $cfg_dir/nanobsd.wleiden
74echo $PACKAGE_LIST | tr " " "\n" > ${poudriere_pkglist_file}
75
76
77if [ "x$1" = "xinitenv" ]; then
78 packages_initenv
79 packages_refresh
80 shift; packages_config
81elif [ "x$1" = "xrefresh" ]; then
82 packages_refresh
83elif [ "x$1" = "xconfig" ]; then
84 shift; packages_config $*
85elif [ "x$1" = "xrebuild" ]; then
86 packages_refresh
87 packages_build
88elif [ "x$1" = "xbuild" ]; then
89 packages_build
90else
91 echo "Usage $0 <initenv|config|rebuild|build>"
92 exit 128
93fi
Note: See TracBrowser for help on using the repository browser.