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

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

Migrate poudriere conf into repository layout, allowing edits of config parameters to be committed.

While here add option to edit config file.

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