extremely lightweight (and imperfect) package build and deployment system

hi!

Ideally I would like to be able to follow these steps on my build machine:

cd /usr/local/ports/my_overlay/security/strongswan
make # obtain strongwan-6.0.1.pkg
# copy pkg file to a http document root

(optional) on a target server:
append to /etc/pkg/FreeBSD.conf a new url that would only provide my package
pkg update # but make it pick and download the package from my url

let's pretend that the run time dependencies are always met for my package on the target server.
I know that poudriere exists, but it's not optimal for this particular use case (I want to keep the target server 99.9999999% based on official packages and only patch one or two). Also I cannot build the package directly on the target server.

so my questions would be these:
1. how do I intercept the pkg file that gets created during make above? I can even 'make install' on the build machine but the pkg is nowhere to be found in /var/cache/pkg ...
2. how do I create data.pkg, packagesite.pkg in that document root for pkg's consumption?

many thanks.
 
make pkg?

tried that but no pkg seem to be generated

Code:
sunspire /usr/local/ports/security/strongswan # make clean
===>  Cleaning for strongswan-6.0.1
sunspire /usr/local/ports/security/strongswan # make 1>log && echo ok
ok
sunspire /usr/local/ports/security/strongswan # truss make pkg
[..]
===>  License GPLv2 accepted by the user
wait4(-1,{ EXITED,val=0 },0x0,0x0)         = 92618 (0x169ca)
fstatat(AT_FDCWD,"pre-check-config",0x168201e04af0,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"pre-check-config",0x168201e04ae0,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"_check-config",0x168201e04b20,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"_check-config",0x168201e04b10,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/ports",{ mode=drwxr-xr-x ,inode=34,size=83,blksize=5632 },0x0) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/ports",{ mode=drwxr-xr-x ,inode=34,size=83,blksize=5632 },0x0) = 0 (0x0)
fstatat(AT_FDCWD,"/usr/ports",{ mode=drwxr-xr-x ,inode=34,size=83,blksize=5632 },0x0) = 0 (0x0)
vfork()                         = 92619 (0x169cb)
===>   strongswan-6.0.1 depends on file: /usr/local/sbin/pkg - found
wait4(-1,{ EXITED,val=0 },0x0,0x0)         = 92619 (0x169cb)
fstatat(AT_FDCWD,".END",0x168201e04bb0,0x0)     ERR#2 'No such file or directory'
fstatat(AT_FDCWD,".END",0x168201e04ba0,0x0)     ERR#2 'No such file or directory'
fstatat(AT_FDCWD,".END",0x168201e04ba0,0x0)     ERR#2 'No such file or directory'
exit(0x0)                   
process exit, rval = 0
 
ok,
Code:
pkg create strongswan
did create the package after it was installed by make. thanks.
 
1. how do I intercept the pkg file that gets created during make above? I can even 'make install' on the build machine but the pkg is nowhere to be found in /var/cache/pkg ...
Code:
# mkdir /mypackages
# export PKGREPOSITORY=/mypackages/All
(or set in /etc/make.conf)
# cd  /usr/local/ports/my_overlay/security/strongswan
# make package

2. how do I create data.pkg, packagesite.pkg in that document root for pkg's consumption?
Code:
# pkg repo  /mypackages

(optional) on a target server:
append to /etc/pkg/FreeBSD.conf a new url that would only provide my package
pkg update # but make it pick and download the package from my url
Create a pkg.conf file like in /etc/pkg/FreeBSD.conf (i.e. /usr/local/etc/pkg/repos/mypackages.conf and set a high priority value (consult pkg.conf(8)) . You might want to sign the repository, see pkg-repo(8).
 
thank you. your pointers proved to be pure gold.

# mkdir /mypackages
# export PKGREPOSITORY=/mypackages/All
(or set in /etc/make.conf)
# make package

a small change was needed here (based on bsd.port.mk). if 'PACKAGES' is undefined (which was my case) then 'make package' would plonk the pkg in the work/pkg dir only.

so had to do
Code:
mkdir -p /tmp/FreeBSD/packages/All
echo 'PACKAGES=/tmp/FreeBSD/packages' >> /etc/make.conf

and then 'make package' will copy the file to '/tmp/FreeBSD/packages/All' as well.

btw, is there an equivalent to this comprehensive wiki for the development side of ports, pkg and make.conf options?
 
Code:
# mkdir /mypackages
# export PKGREPOSITORY=/mypackages/All
(or set in /etc/make.conf)
# cd  /usr/local/ports/my_overlay/security/strongswan
# make package


Code:
# pkg repo  /mypackages


Create a pkg.conf file like in /etc/pkg/FreeBSD.conf (i.e. /usr/local/etc/pkg/repos/mypackages.conf and set a high priority value (consult pkg.conf(8)) . You might want to sign the repository, see pkg-repo(8).
A bit of follow-ups.
Running `make package` in a single ports (or single ports in an overlay) would generate pkg under pkg directory (in x11/nvidia-driver's case, under x11/nvidia-driver/work/pkg/) by default using staged files under stage directory (like x11/nvidia-driver/work/stage/).
 
And if using multiple repo defined mangles something (i.e., conflicting dependencies as of differences in OPTIONS between official and local repo), adding -r reponame in the pkg command line would help. I.e., if the local repo name is custom, something like pkg upgrade -r custom. This forces pkg to use local repo only.
 
Back
Top