Tutorial: GNUnet on NetBSD 8.0 CURRENT
Welcome to the GNUnet tutorial for NetBSD!
This tutorial provides concrete instructions on how to install a current version of GNUnet. The goal is to support newcomers, either users or developers, who want to get in touch with GNUnet for the first time.
Requirements
As a bare minimum, we recommend you
install pkgsrc. This tutorial
assumes you have the CURRENT version checked out. Additionally you
might want to install devel/git-base
and git
clone pkgsrc-wip into
the wip
folder in your pkgsrc folder:
$ cd /usr/pkgsrc
$ git clone git://wip.pkgsrc.org/pkgsrc-wip.git wip
Installazione
Note: $
stands for commands run as unprivileged
user, #
for commands run as root user (this can be done
with security/doas, security/sudo, or just as root).
GNUnet is not yet in the pkgsrc tree, it's still in the
pkgsrc-wip repository. So if you checked out pkgsrc-wip
into /usr/pksrc/wip
:
$ cd /usr/pkgsrc/wip/gnunet
Before you start building, you might want to review
your /etc/mk.conf
. I suggest to consider:
- WRKOBJDIR=/usr/work
- DISTDIR=/usr/distfiles
- DEPENDS_TARGET=package
- UPDATE_TARGET=bin-install
- ACCEPTABLE_LICENSES+=gnu-agpl-v3
- MKREPRO=yes
As we rely on ImageMagick somewhere down our dependency chain (it is one of libextractor's dependencies), you need to set the following (as of 2019-03-06) as well:
- IGNORE_URL+=https://nvd.nist.gov/vuln/detail/CVE-2018-15607
You could however just env ALLOW_VULNERABLE_PACKAGES=1
The build process can involve manual installation interruptions for dependencies!
Then start building:
$ make package
Once you are done, type:
$ make install
or alternatively:
# pkg_add /usr/pkgsrc/packages/All/gnunet-0.11.8.tgz
And you're done!.
GNUnet has a number of services and features.
Please check our documentation
to learn how to use them. If you find anything odd or bugs, please
let us know.
Note that the rc.d file which is installed is not yet fully functional and is getting debugged.
First steps
Congratulations! GNUnet is now installed! Before starting it you may create a configuration file. By default GNUnet looks in our home directory for the file `~/.config/gnunet.conf`. Creating the configuation file is optional. For now just create an empty file which will remind you of the location later if needed:
$ touch ~/.config/gnunet.conf
It's reccomended that you increase your bandwidth restrictions from the acutely low defaults. The example below sets the WAN and LAN limits to the value "unlimited".
$ gnunet-config -s ats -o WAN_QUOTA_IN -V unlimited
$ gnunet-config -s ats -o WAN_QUOTA_OUT -V unlimited
$ gnunet-config -s ats -o LAN_QUOTA_IN -V unlimited
$ gnunet-config -s ats -o LAN_QUOTA_OUT -V unlimited
GNUnet and its services are managed using the command line tool `gnunet-arm`
(Automatic Restart Manager).
To start GNUnet with its default services execute:
$ gnunet-arm -s
To list the running services use:
$ gnunet-arm -I
Running services:
ats (gnunet-service-ats)
revocation (gnunet-service-revocation)
set (gnunet-service-set)
nat (gnunet-service-nat)
transport (gnunet-service-transport)
peerstore (gnunet-service-peerstore)
hostlist (gnunet-daemon-hostlist)
identity (gnunet-service-identity)
namecache (gnunet-service-namecache)
peerinfo (gnunet-service-peerinfo)
datastore (gnunet-service-datastore)
zonemaster (gnunet-service-zonemaster)
zonemaster-monitor (gnunet-service-zonemaster-monitor)
nse (gnunet-service-nse)
cadet (gnunet-service-cadet)
dht (gnunet-service-dht)
core (gnunet-service-core)
gns (gnunet-service-gns)
statistics (gnunet-service-statistics)
topology (gnunet-daemon-topology)
fs (gnunet-service-fs)
namestore (gnunet-service-namestore)
vpn (gnunet-service-vpn)
To stop all services, use the `-e` option.
$ gnunet-arm -e
Alternative: Installation from source
The following instructions are only really interesting for developers or if you need special build switches. First, install the dependencies from pkgsrc. You can use binary built packages, but since we are using CURRENT of pkgsrc, this is more direct. For the binary built version, use pkg_add or pkgin (and read into pkgsrc CURRENT with pkgin or pkg_add).
- audio/libopus
- databases/sqlite3
- devel/gettext-lib (maybe?)
- devel/gmp
- devel/nss
- devel/zlib
- devel/libgsf
- devel/libltdl
- devel/git-base
- devel/autoconf
- devel/automake
- devel/libtool
- devel/pkgconf (required for some of the dependencies, not GNUnet)
- devel/libffi
- devel/libidn2
- devel/libextractor
- lang/python37 (for the testsuite)
- math/glpk (only for experimental features)
- multimedia/gstreamer1
- multimedia/gst-plugins1-base
- multimedia/libogg
- textproc/jansson
- textproc/libunistring
- security/libgcrypt
- security/gnutls
- www/gnurl
- www/libmicrohttpd
Codice sorgente
$ cd ~
$ git clone https://gnunet.org/git/gnunet.git ~/src/gnunet/gnunet
Compile and Install
You have a choice between two options:
- build the production version
or
- build the development version.
If you want to start writing GNUnet applications or join the GNUnet development choose the development version (it will print more debug output and contains debug symbols that can be displayed with a debugger). Otherwise choose the production version.
Option 1: GNUnet for production / usage
We are assuming a shell and environment which exports $HOME. If $HOME is not exported, do so or replace $HOME accordingly in the instructions given below.
$ cd ~/src/gnunet/gnunet
$ sh ./bootstrap
$ LDFLAGS=-L/usr/pkg/lib ./configure --prefix=$HOME/gnunet
After configure passes, you need to add a 'gnunetdns' group to your system. Further, you need to add a user 'gnunet' which is part of the group 'gnunet'. Then:
$ make
# make install
Option 2: GNUnet experimental
Perform the same steps as for Option 1, but add the configure switch
--enable-experimental
. For even more verbosity you could
configure gnunet like this:
$ LDFLAGS="-L/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib" CFLAGS="-g -O0" ./configure --prefix=$HOME/gnunet --enable-logging=verbose
This allows you to get more verbose logs when you export GNUNET_FORCE_LOG=";;;;DEBUG" before you run tests.