Official binary packages now available for DragonFly 3.4
[ikiwiki.git] / docs / howtos / HowToDPorts / index.mdwn
CommitLineData
80be6ca4 1## DPorts background:
2
3Dports is an effort to use FreeBSD’s ports system as a base for DragonFly, and the pkg tool as a way to manage binary packages built from DPorts. This is complicated, so I’ll explain each part in order.
4
5FreeBSD ports are a FreeBSD-specific collection of software installation files that automate building 3rd-party software on FreeBSD. You’ve probably already heard of them. (Note there’s no mention of DragonFly.)
6
7DPorts is a collection of files that map to existing FreeBSD ports, and contain any changes necessary to make that port also build on DragonFly. Many of those programs build without changes on DragonFly. DPorts builds from source.
8
9pkg is used for package management, and is usable on FreeBSD, PC-BSD, and on DragonFly. The binary packages produced from building with DPorts can be installed from remote locations and managed separately using pkg, so that software upgrades and installation can be performed with binaries only. (It’s much faster that way.)
10
11Every port seen in DPorts is known to build on DragonFly. A port is added only after it builds successfully, using poudriere as a bulk software tool. Ports are only updated to a newer version when that newer version builds, too, so once something arrives in DPorts, it should never break from being updated at some point in the future.
12
5232b755 13## Installing binaries
14
15The pkg tool can be used to install packages, manage them, and so on, as mentioned previously.
16
17To set a repository source for binary packages, edit /usr/local/pkg.conf and add a line like this:
18
19 PACKAGESITE: http://URL-TO-REPOSITORY/
20
21Binary packages have been created for the DragonFly 3.4 release and
22are available on a few mirrors. Use one of these URLs in pkg.conf:
23
24* North America: http://avalon.dragonflybsd.org/dports/${ABI}/LATEST
25* Europe: http://pkg.wolfpond.org/${ABI}/LATEST
26* Europe: http://mirrors.ircam.fr/pub/DragonFlyBSD-dports/${ABI}/LATEST
27
28Replace LATEST by RELEASE if you want to use the first packages created for the release, without any subsequent update.
29
3b10884e 30## Installing DPorts
80be6ca4 31
32To use DPorts, you need two things:
33
34*First thing:* DragonFly 3.3 or later,.
35
36*Second thing:* You need to rename /usr/pkg so that your existing pkgsrc binary programs don’t get accidentally used while working with DPorts, causing confusion. If anything goes wrong with DPorts when you are installing it and you want to go back, remove all the DPorts packages and rename /usr/pkg back to normal. (Don’t confuse pkg, the management tool, with /usr/pkg, the normal installation directory for pkgsrc. ) For the installation of the base port files:
37
38 cd /usr
39 make dports-create-shallow
40
41If you’ve already renamed your /usr/pkg directory, git won’t be in your path any more. You can instead download a tarball and unpack it, which also happens to be possible automatically via that same Makefile.
42
43 cd /usr
44 make dports-download
45
46Downloading via git is fastest, so if you do need to use the tarball via make dports-download, build devel/git, delete /usr/dports, and then pull it again with make dports-create-shallow. This all comes from [John Marino’s Github site for DPorts](https://github.com/jrmarino/DPorts/#readme).
47
48## Managing DPorts
49
50DPorts doesn’t use pkg_info, pkg_add, and the other tools traditionally seen on DragonFly for pkgsrc. Instead, package management is done with pkg. Use pkg info, pkg install, pkg remove, and pkg update to list, install, delete, and upgrade various packages on your system. Packages built from source or downloaded as prebuilt binaries are managed the same way, using these tools.
51
52See some of the [other](https://mebsd.com/make-build-your-freebsd-word/pkgng-first-look-at-freebsds-new-package-manager.html) [writing](http://ivoras.net/blog/tree/2012-07-26.pkgng---best-thing-since-sliced-bread!.html) about pkg for FreeBSD for details on how it works.
53
54Since DPorts doesn’t update a package until it gets a successful build, and installations are of successfully built binary packages, upgrades with prebuilt packages should always succeed. Since they’re binary, they should be fast. There’s a lot of ‘shoulds’ in this sentence, but these are reasonable suppositions.
55
56## Building from source
57
0fcf3e89 58Building from source works similar to ports and pkgsrc: cd into the appropriate program's directory, and type 'make'. 'make install' to install the software, 'make clean' to clean up work files, and so on. Use 'make config-recursive' if you want to set all the port's options, and the options of its dependencies, immediately instead of during the build.
59
60*You will eventually want to do this:* Set BATCH=yes to take all default package options without having the build stop to ask questions.
61
62If you just want to set the options for one package, and accept the default for all of its dependencies, do 'make config' in the package in you want non-default options, and then 'make BATCH=yes'.
80be6ca4 63
64Note that this is only necessary if you want to build from source with a non-default config, or if you don't have a binary repository available to pull files from with pkg.
65
80be6ca4 66## What about pkgsrc?
67
68Pkgsrc and DPorts shouldn’t be used at the same time, since one system’s packages may be at different versions but still get picked up during building for the other system. That’s about it for restrictions.
69
70DPorts is brand new so the normal caveats apply; don’t install it on a mission-critical machine, and be ready to deal with any surprises from using it if you do try it out.
71
72## What packages are available?
73
74Browsing the Github repo will show you all listed packages. It changes as more packages are built. Changes from DragonFly builds are sometimes relevant to the original FreeBSD port, so there’s benefits for everyone here.
75
76## What next?
77
78This is experimental; this will not necessarily replace pkgsrc. It's available in this release for further testing and feedback. Remember, this is a new project, so a willingness to deal with problems and contribute to fixes is necessary.