Building in one jail, installing in another

dougb@ said:
Someone else already suggested portmaster as your tool to build packages, I will ever-so-humbly state that I agree. :) As long as the infrastructure in the ports tree is correct, using the -g option for portmaster will produce correct packages.

Let's assume I'm trying to install several ports that has dependencies using portmaster. Will the -g option let the portmaster create packages for ALL built ports, including dependecies?

PS: I'm sorry for posting into old topic.
 
hedgehog said:
Let's assume I'm trying to install several ports that has dependencies using portmaster. Will the -g option let the portmaster create packages for ALL built ports, including dependecies?
Yes.
 
bbzz said:
It's better to update with portmaster since it will also update dependencies, whereas pkg_add will add missing packages and give you warning about dependencies which are not in check (e.g cairo-1.10.2 needed but cairo_1.10.1 installed, etc).

# portmaster -PP -D -B --packages-local --local-packagedir=/usr/ports/packages -y

For some reason it doesn't work... The portmaster build software from sources instead of installing it from local packages directory. For example:
Code:
portmaster -PP -D -B --packages-local --local-packagedir=/usr/ports/packages/All devel/gettext
Portmaster compiles cmake, libtool, libiconv and gettext.

Trying brand new pkg tool:
Code:
# pkg add /usr/ports/packages/All/gettext-0.18.1.1.txz
Installing gettext-0.18.1.1...Installing libiconv-1.14... done
 done
I.e. the pkg picked up packages from /usr/ports/packages/All/ and installed it. I tried to install more complex thing like kde4, worked well. However, I didn't test if the kde runs, because I installed it in the temporary jail.

Am I doing something wrong when I use portmaster?
 
Fortunately I compiled packages using pkgng compatible portmaster. In this case I can easily create a repo:
# pkg repo .
Then configure host's pkg to use that directory as repository in /usr/local/etc/pkg.conf by specifying path like this: file://localhost/usr/ports/packages

Now the host or another jail can use jailed repo. Of course you can share repo over web server instead :)
 
SirDice said:
Keep in mind portmaster(1) needs a patch to be able to work with pkgng.

https://github.com/pkgng/pkgng/blob/master/ports/patch-portmaster-pkgng

Save this file in the files/ directory of the ports-mgmt/portmaster port.
It was done before building packages. Looks like portmaster is not ready to install pkgng packages yet:
Code:
portmaster -PP -D -B --packages-local --local-packagedir=/usr/ports/packages sysutils/bsdadminscripts
===>>> Package installation support cannot be used with pkgng yet,
       it will be disabled

Well, I guess that I could use portmaster() to build packages in jail and then install/upgrade the host with pkgng.

By the way, it took like 7 minutes to install KDE from packages that I built in the jail:
Code:
# pkg search kde
kdegames-4.8.4                 Games for KDE 4
kde4-style-qtcurve-1.8.13      QtCurve KDE4 widget style
kdemultimedia-4.8.4_1          KDE Multimedia applications
kdepim-4.4.11.1_3              Libraries for KDE-PIM applications
kdenetwork-4.8.4_2             KDE Network applications
kdeutils-4.8.4                 Collection of utilities for KDE 4
kdeedu-4.8.4                   Set of entertaining, educational programs for KDE 4 (meta-port)
libkdeedu-4.8.4                Libraries used by KDE educational applications
kdegraphics-svgpart-4.8.4      SVG KPart
kde4-shared-mime-info-1.2      Handles shared MIME database under ${KDE4_PREFIX}
pam_kde-1.0                    PAM modules for KDE Display Manager
kdetoys-4.8.4                  Collection of entertaining programs for KDE
kdegraphics-strigi-analyzer-4.8.4 Strigi analyzers for various graphics file formats
kdepimlibs-4.8.4               Libraries for KDE-PIM applications
kdesdk-4.8.4                   KDE Software Development Kit
kde-4.8.4                      The meta-port for KDE Software Compilation 4
kdeadmin-4.8.4                 KDE Admin applications
kdeplasma-addons-4.8.4         Extra plasmoids for KDE4
kdegraphics-mobipocket-4.8.4   Mobipocket plugins for Strigi indexing, Okular, and thumbnails
ru-kde-l10n-4.8.4              Russian messages and documentation for KDE4
kde-baseapps-4.8.4             Basic applications for the KDE system
kdelibs-4.8.4_1                Base set of libraries needed by KDE programs
polkit-kde-0.99.0_3            KDE4 frontend to PolKit-1
kde-workspace-4.8.4            Basic applications for the KDE system
kde4-xdg-env-1.0.1             Script which hooks into startkde and helps KDE pick up XDG apps/menus
kde4-icons-oxygen-4.8.4        The Oxygen icon theme for KDE
kdeartwork-4.8.4               KDE Artworks Themes
kdepim-runtime-4.4.11.1_2      Libraries for KDE-PIM applications
kdeaccessibility-4.8.4         Accessibility applications for KDE4
kde-wallpapers-4.8.4           Set of wallpapers for the KDE Plasma workspace
kdewebdev-4.8.4                Comprehensive html/website development environment
kde-runtime-4.8.4_2            Basic applications for the KDE system
kdegraphics-thumbnailers-4.8.4 Thumbnailers for various graphics file formats
kdegraphics-4.8.4              Graphics utilities for KDE 4 (meta-port)
kdehier4-1.0.10                Utility port that creates hierarchy of shared KDE4 directories
Code:
pkg install kde-4.8.4
At this moment I use another jail to test if I can install these packages.
 
hedgehog said:
Well, I guess that I could use portmaster() to build packages in jail and then install/upgrade the host with pkgng.
That's what I'm currently doing. I'm basically only using portmaster(8) to build everything. On my other systems I simply set PACKAGESITE to my server and use pkg(8). Works like a charm. It seems to work slightly faster than my 'old' way of doing pkg_delete(1)/pkg_add(1).
 
SirDice said:
That's what I'm currently doing. I'm basically only using portmaster(8) to build everything. On my other systems I simply set PACKAGESITE to my server and use pkg(8). Works like a charm. It seems to work slightly faster than my 'old' way of doing pkg_delete(1)/pkg_add(1).
Nice, I'm on the right way then. May I please ask you one more question before I start upgrading my desktop?

I upgraded 8.3-release on desktop to 9.1-RC1 without updating third-party software. I got all orphaned packages list from my system, did some cleanup and compiled it using portmaster (pkgng support) within 9.1-RC1 jail.

Now I would like to upgrade ports on the host using the repository I created. In my view I should perform the following steps:
  1. Make zfs snapshots of /usr/local and /var/db/pkg (just in case)
  2. Completely wipe all packages:
    Code:
    # pkg_delete -af
    # rm -rf /usr/local/*
    # rm -rf /var/db/pkg/*
  3. Install pkgng, configure PACKAGESITE to use my repository and define WITH_PKGNG=yes in /etc/make.conf
  4. Install packages from repository using orphanes list
  5. Delete old libraries from the system: # freebsd-update install
  6. Deal with zfs snapshot
Am I correct?

PS: My current ports on the desktop is really outdated.
 
I'd delete the old libraries right after removing all ports. There's no need for them anymore and it'll prevent accidental use. But besides that it all looks good.

I did notice I had to set PACKAGESITE slightly different for pkgng. Normally you'd point it to the /Latest directory but for pkgng it should be pointing to the root of the package dir.

Old:
Code:
PACKAGESITE=http://j-internetz/FreeBSD/packages/Latest

pkgng style:
Code:
PACKAGESITE=http://j-internetz/FreeBSD/packages/
 
SirDice said:
I'd delete the old libraries right after removing all ports. There's no need for them anymore and it'll prevent accidental use. But besides that it all looks good.
I think you're right. Anyway there is compat8x libraries in ports.

SirDice said:
I did notice I had to set PACKAGESITE slightly different for pkgng. Normally you'd point it to the /Latest directory but for pkgng it should be pointing to the root of the package dir.
[/code]
I noticed it too. I pointed repository to the packages dir that has directories like All, Latest and ports-like structure.

PS: Just installed kde/xorg on freebsd in virtualbox. Worked like a charm with this repo!
 
It depends on where the repo.txz file has been created, with PKGNG it's recommended to create it at the top level directory and not in the All -directory.

For example I would create the repo manually like this (ports-mgmt/poudriere does this automatically):

# pkg repo /usr/local/poudriere/data/packages/release91amd64-default [optional_signing_key]

The /usr/local/poudriere/data/packages/release91amd64-default directory would have the All, Latest etc. subdirectories.
 
Thanks everyone, upgrade ran smoothly and quickly. Now it's time to consider writing an article regarding full 8.3-9.1 upgrade and switching to pkgng. :)
 
Back
Top