(with thanks to LAM)
In this exercise you will setup a local repository
and add a testpackage to the repository.
You should have a zpool mounted on /software
1. create directory
mkdir /software/site
2. create repository
pkgrepo create /software/site
3. check
pkgrepo info -s /software/site
(it should show online)
4. in /software/site/pkg5.repository
set prefix = site
5. add smf entries
svccfg -s pkg/server add site
svccfg
select pkg/server:site
setprop pkg/inst_root=/software/site
setprop pkg/port=10083
exit
svcadm enable pkg/server:site
svcs pkg/server:site
STATE STIME FMRI
online 18:27:04 svc:/application/pkg/server:site
6. rebuild the repository
pkgrepo rebuild -s /software/site
7. set publisher
pkg set-publisher -g file:///software/site site
8. list your publishers
pkg publisher
9. add softwarepackages to new repository
mkdir /var/tmp/software
echo "a package" > /var/tmp/software/testpkg
eval 'pkgsend -s file:///software/site open testpkg@1.0.1'
export PKG_TRANS_ID=1399221077_pkg%3A%2F%2Fsite%2Ftestpkg%401.0.1%2C5.11%3A20140504T163117Z
export \
PKG_TRANS_ID=1399221077_pkg%3A%2F%2Fsite%2Ftestpkg%401.0.1%2C5.11%3A20140504T163117Z
pkgsend -s file:///software/site add dir mode=0555 owner=root group=bin path=/export/testpkg
pkgsend -s file:///software/site add file /var/tmp/software/testpkg mode=0555 owner=root group=bin path=/export/testpkg/testpkg
pkgsend -s file:///software/site add set name=description value="testpkg"
pkgsend -s file:///software/site close
pkg://site/testpkg@1.0.1,5.11:20140504T163117Z
PUBLISHED
pkgrepo info -s file:///software/site
PUBLISHER PACKAGES STATUS UPDATED
site 1 online 2014-05-04T16:37:26.996595Z
pkg install testpkg
Packages to install: 1
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 1/1 0.0/0.0 0B/s
PHASE ITEMS
Installing new actions 4/4
Updating package state database Done
Updating image state Done
Creating fast lookup database Done
pkg list testpkg
NAME (PUBLISHER) VERSION IFO
testpkg 1.0.1 i--