fix rest plugin build
[oweals/gnunet.git] / doc / system_specific / FROM_SOURCE
1 @node Build instructions for Ubuntu 12.04 using Git
2 @section Build instructions for Ubuntu 12.04 using Git
3
4 @menu
5 * Install the required build tools::
6 * Install libgcrypt 1.6 and libgpg-error::
7 * Install gnutls with DANE support::
8 * Install libgnurl::
9 * Install libmicrohttpd from Git::
10 * Install libextractor from Git::
11 * Install GNUnet dependencies::
12 * Build GNUnet::
13 * Install the GNUnet-gtk user interface from Git::
14 @end menu
15
16 @node  Install the required build tools
17 @subsection  Install the required build tools
18
19 First, make sure Git is installed on your system:
20
21 @example
22 $ sudo apt-get install git
23 @end example
24
25 Install the essential buildtools:
26
27 @example
28 $ sudo apt-get install automake autopoint autoconf libtool
29 @end example
30
31 @node Install libgcrypt 1.6 and libgpg-error
32 @subsection Install libgcrypt 1.6 and libgpg-error
33
34 @ref{generic source installation - libgpg-error}
35
36 @node Install gnutls with DANE support
37 @subsection Install gnutls with DANE support
38
39 @itemize @bullet
40 @item @ref{generic source installation - nettle}
41 @item @ref{generic source installation - ldns}
42 @item @ref{generic source installation - libunbound/unbound}
43 @item @ref{generic source installation - gnutls}
44 @item @ref{generic source installation - libgcrypt}
45 @end itemize
46
47 @node Install libgnurl
48 @subsection Install libgnurl
49
50 Follow the @ref{generic source installation - libgnurl}.
51
52 @node Install libmicrohttpd from Git
53 @subsection Install libmicrohttpd from Git
54
55 @example
56 $ git clone https://gnunet.org/git/libmicrohttpd
57 $ cd libmicrohttpd/
58 $ ./bootstrap
59 $ ./configure
60 $ sudo make install ; cd ..
61 @end example
62
63 @node  Install libextractor from Git
64 @subsection  Install libextractor from Git
65
66 Install libextractor dependencies:
67
68 @example
69 $ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \
70  libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \
71  libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \
72  g++
73 @end example
74
75 Build libextractor:
76
77 @example
78 $ git clone https://gnunet.org/git/libextractor
79 $ cd libextractor
80 $ ./bootstrap
81 $ ./configure
82 $ sudo make install ; cd ..
83 @end example
84
85 @node Install GNUnet dependencies
86 @subsection Install GNUnet dependencies
87
88 @example
89 $ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \
90  libpulse-dev libbluetooth-dev libsqlite-dev
91 @end example
92
93 Install libopus:
94
95 @example
96 $ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
97 $ tar xf opus-1.1.tar.gz
98 $ cd opus-1.1/
99 $ ./configure
100 $ sudo make install ; cd ..
101 @end example
102
103 Choose one or more database backends:
104
105 SQLite3:
106 @example
107 $ sudo apt-get install libsqlite3-dev
108 @end example
109 MySQL:
110 @example
111 $ sudo apt-get install libmysqlclient-dev
112 @end example
113 PostgreSQL:
114 @example
115 $ sudo apt-get install libpq-dev postgresql
116 @end example
117
118
119
120 @node Build GNUnet
121 @subsection Build GNUnet
122
123
124
125 @menu
126 * Configuring the installation path::
127 * Configuring the system::
128 * Installing components requiring sudo permission::
129 * Build::
130 @end menu
131
132 @node Configuring the installation path
133 @subsubsection Configuring the installation path
134
135 You can specify the location of the GNUnet installation by setting the
136 prefix when calling the configure script with @code{--prefix=DIRECTORY}
137
138 @example
139 $ export PATH=$PATH:DIRECTORY/bin
140 @end example
141
142 @node Configuring the system
143 @subsubsection Configuring the system
144
145 Please make sure NOW that you have created a user and group 'gnunet'
146 and additionally a group 'gnunetdns':
147
148 @example
149 $ sudo addgroup gnunet
150 $ sudo addgroup gnunetdns
151 $ sudo adduser gnunet
152 @end example
153
154 Each GNUnet user should be added to the 'gnunet' group (may
155 require fresh login to come into effect):
156
157 @example
158 $ sudo useradd -G  gnunet
159 @end example
160
161 @node Installing components requiring sudo permission
162 @subsubsection Installing components requiring sudo permission
163
164 Some components, like the nss plugin required for GNS, may require root
165 permissions. To allow these few components to be installed use:
166
167 @example
168 $ ./configure --with-sudo
169 @end example
170
171 @node Build
172 @subsubsection Build
173
174 @example
175 $ git clone https://gnunet.org/git/gnunet/
176 $ cd gnunet/
177 $ ./bootstrap
178 @end example
179
180 Use the required configure call including the optional installation prefix
181 @code{PREFIX} or the sudo permissions:
182
183 @example
184 $ ./configure [ --with-sudo | --with-prefix=PREFIX ]
185 @end example
186
187 @example
188 $ make; sudo make install
189 @end example
190
191 After installing it, you need to create an empty configuration file:
192
193 @example
194 mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf
195 @end example
196
197 And finally you can start GNUnet with:
198
199 @example
200 $ gnunet-arm -s
201 @end example
202
203 @node Install the GNUnet-gtk user interface from Git
204 @subsection Install the GNUnet-gtk user interface from Git
205
206
207 Install depencies:
208
209 @example
210 $ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \
211  libqrencode-dev
212 @end example
213
214 Build GNUnet (with an optional prefix) and execute:
215
216 @example
217 $ git clone https://gnunet.org/git/gnunet-gtk/
218 $ cd gnunet-gtk/
219 $ ./bootstrap
220 $ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY
221 $ make; sudo make install
222 @end example
223
224 @node Build Instructions for Microsoft Windows Platforms
225 @section Build Instructions for Microsoft Windows Platforms
226
227 @menu
228 * Introduction to building on MS Windows::
229 * Requirements::
230 * Dependencies & Initial Setup::
231 * GNUnet Installation::
232 * Adjusting Windows for running and testing GNUnet::
233 * Building the GNUnet Installer::
234 * Using GNUnet with Netbeans on Windows::
235 @end menu
236
237 @node Introduction to building on MS Windows
238 @subsection Introduction to building on MS Windows
239
240
241 This document is a guide to building GNUnet and its dependencies on
242 Windows platforms. GNUnet development is mostly done under GNU/Linux and
243 especially git checkouts may not build out of the box.
244 We regret any inconvenience, and if you have problems, please report
245 them.
246
247 @node Requirements
248 @subsection Requirements
249
250 The Howto is based upon a @strong{Windows Server 2008 32bit}
251 @strong{Installation}, @strong{sbuild} and thus a
252 @uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW}
253 (W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild
254 is a convenient set of scripts which creates a working msys/mingw
255 installation and installs most dependencies required for GNUnet.
256
257 As of the point of the creation of these instructions,
258 GNUnet @strong{requires} a Windows @strong{Server} 2003 or
259 newer for full feature support.
260 Windows Vista and later will also work, but
261 @strong{non-server version can not run a VPN-Exit-Node} as the NAT
262 features have been removed as of Windows Vista.
263
264 @c TODO: We should document Windows 10!
265 @c It seems like the situation hasn't changed with W10
266
267 @node Dependencies & Initial Setup
268 @subsection Dependencies & Initial Setup
269
270
271 @itemize @bullet
272
273 @item
274 Install a fresh version of @strong{Python 2.x}, even if you are using a
275 x64-OS, install a 32-bit version for use with sbuild.
276 Python 3.0 is currently incompatible.
277
278 @item
279 Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} &
280 @uref{http://tortoisesvn.net/, subversion}-clients.
281
282 @item
283 You will also need some archive-manager like
284 @uref{http://www.7-zip.org/, 7zip}.
285
286 @item
287 Pull a copy of sbuild to a directory of your choice, which will be used
288 in the remainder of this guide. For now, we will use
289 @file{c:\gnunet\sbuild\}
290
291 @item
292 in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages
293 @strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild
294 to compile/install those for us.
295
296 @item
297 Follow LRN's sbuild installation instructions.-
298 @end itemize
299
300 Please note that sbuild may (or will most likely) fail during
301 installation, thus you really HAVE to @strong{check the logfiles} created
302 during the installation process.
303 Certain packages may fail to build initially due to missing dependencies,
304 thus you may have to
305 @strong{substitute those with binary-versions initially}. Later on once
306 dependencies are satisfied you can re-build the newer package versions.
307
308 @strong{It is normal that you may have to repeat this step multiple times
309 and there is no uniform way to fix all compile-time issues, as the
310 build-process of many of the dependencies installed are rather unstable
311 on win32 and certain releases may not even compile at all.}
312
313 Most dependencies for GNUnet have been set up by sbuild, thus we now
314 should add the @file{bin/} directories in your new msys and mingw
315 installations to PATH. You will want to create a backup of your finished
316 msys-environment by now.
317
318 @node GNUnet Installation
319 @subsection GNUnet Installation
320
321 First, we need to launch our msys-shell, you can do this via
322
323 @file{C:\gnunet\sbuild\msys\msys.bat}
324
325 You might wish to take a look at this file and adjust some
326 login-parameters to your msys environment.
327
328 Also, sbuild added two pointpoints to your msys-environment, though those
329 might remain invisible:
330
331 @itemize @bullet
332
333 @item
334 /mingw, which will mount your mingw-directory from sbuild/mingw and the
335 other one is
336
337 @item
338 /src which contains all the installation sources sbuild just compiled.
339 @end itemize
340
341 Check out the current GNUnet sources (git HEAD) from the
342 GNUnet repository "gnunet.git", we will do this in your home directory:
343
344 @code{git clone https://gnunet.org/git/gnunet/ ~/gnunet}
345
346 Now, we will first need to bootstrap the checked out installation and then
347 configure it accordingly.
348
349 @example
350 cd ~/gnunet
351 ./bootstrap
352 STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \
353 ./configure --prefix=/ --docdir=/share/doc/gnunet \
354 --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \
355 --with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \
356 --with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \
357 --enable-expensivetests --enable-experimental --with-qrencode=/mingw \
358 --enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log
359 @end example
360
361 The parameters above will configure for a reasonable GNUnet installation
362 to the your msys-root directory.
363 Depending on which features your would like to build or you may need to
364 specify additional dependencies. Sbuild installed most libs into
365 the /mingw subdirectory, so remember to prefix library locations with
366 this path.
367
368 Like on a unixoid system, you might want to use your home directory as
369 prefix for your own GNUnet installation for development, without tainting
370 the buildenvironment. Just change the "prefix" parameter to point towards
371 ~/ in this case.
372
373 Now it's time to compile GNUnet as usual. Though this will take some time,
374 so you may fetch yourself a coffee or some Mate now...
375
376 @example
377 make ; make install
378 @end example
379
380 @node Adjusting Windows for running and testing GNUnet
381 @subsection Adjusting Windows for running and testing GNUnet
382
383 Assuming the build succeeded and you
384 @strong{added the bin directory of your GNUnet to PATH}, you can now use
385 your gnunet-installation as usual.
386 Remember that UAC or the windows firewall may popup initially, blocking
387 further execution of gnunet until you acknowledge them.
388
389 You will also have to take the usual steps to get peer-to-peer (p2p)
390 software running properly (port forwarding, ...),
391 and GNUnet will require administrative permissions as it may even
392 install a device-driver (in case you are using gnunet-vpn and/or
393 gnunet-exit).
394
395 @node Building the GNUnet Installer
396 @subsection Building the GNUnet Installer
397
398 The GNUnet installer is made with
399 @uref{http://nsis.sourceforge.net/, NSIS}.
400 The installer script is located in @file{contrib\win} in the
401 GNUnet source tree.
402
403 @node Using GNUnet with Netbeans on Windows
404 @subsection Using GNUnet with Netbeans on Windows
405
406 TODO
407
408 @node Build instructions for Debian 7.5
409 @section Build instructions for Debian 7.5
410
411
412 These are the installation instructions for Debian 7.5. They were tested
413 using a minimal, fresh Debian 7.5 AMD64 installation without non-free
414 software (no contrib or non-free).
415 By "minimal", we mean that during installation, we did not select any
416 desktop environment, servers or system utilities during the "tasksel"
417 step. Note that the packages and the dependencies that we will install
418 during this chapter take about 1.5 GB of disk space.
419 Combined with GNUnet and space for objects during compilation, you should
420 not even attempt this unless you have about 2.5 GB free after the minimal
421 Debian installation.
422 Using these instructions to build a VM image is likely to require a
423 minimum of 4-5 GB for the VM (as you will likely also want a desktop
424 manager).
425
426 GNUnet's security model assumes that your @file{/home} directory is
427 encrypted. Thus, if possible, you should encrypt your home partition
428 (or per-user home directory).
429
430 Naturally, the exact details of the starting state for your installation
431 should not matter much. For example, if you selected any of those
432 installation groups you might simply already have some of the necessary
433 packages installed.
434 We did this for testing, as this way we are less likely to forget to
435 mention a required package.
436 Note that we will not install a desktop environment, but of course you
437 will need to install one to use GNUnet's graphical user interfaces.
438 Thus, it is suggested that you simply install the desktop environment of
439 your choice before beginning with the instructions.
440
441
442
443 @menu
444 * Update::
445 * Stable? Hah!::
446 * Update again::
447 * Installing packages::
448 * Installing dependencies from source::
449 * Installing GNUnet from source::
450 * But wait there is more!::
451 @end menu
452
453 @node Update
454 @subsection Update
455
456 After any installation, you should begin by running
457
458 @example
459 # apt-get update ; apt-get upgrade
460 @end example
461
462 to ensure that all of your packages are up-to-date. Note that the "#" is
463 used to indicate that you need to type in this command as "root"
464 (or prefix with "sudo"), whereas "$" is used to indicate typing in a
465 command as a normal user.
466
467 @node Stable? Hah!
468 @subsection Stable? Hah!
469
470 Yes, we said we start with a Debian 7.5 "stable" system. However, to
471 reduce the amount of compilation by hand, we will begin by allowing the
472 installation of packages from the testing and unstable distributions as
473 well.
474 We will stick to "stable" packages where possible, but some packages will
475 be taken from the other distributions.
476 Start by modifying @file{/etc/apt/sources.list} to contain the
477 following (possibly adjusted to point to your mirror of choice):
478
479 @example
480 # These were there before:
481 deb http://ftp.de.debian.org/debian/ wheezy main
482 deb-src http://ftp.de.debian.org/debian/ wheezy main
483 deb http://security.debian.org/ wheezy/updates main
484 deb-src http://security.debian.org/ wheezy/updates main
485 deb http://ftp.de.debian.org/debian/ wheezy-updates main
486 deb-src http://ftp.de.debian.org/debian/ wheezy-updates main
487
488 # Add these lines (feel free to adjust the mirror):
489 deb http://ftp.de.debian.org/debian/ testing main
490 deb http://ftp.de.debian.org/debian/ unstable main
491 @end example
492
493 The next step is to create/edit your @file{/etc/apt/preferences}
494 file to look like this:
495
496 @example
497 Package: *
498 Pin: release a=stable,n=wheezy
499 Pin-Priority: 700
500
501 Package: *
502 Pin: release o=Debian,a=testing
503 Pin-Priority: 650
504
505 Package: *
506 Pin: release o=Debian,a=unstable
507 Pin-Priority: 600
508 @end example
509
510 You can read more about Apt Preferences here and here.
511 Note that other pinnings are likely to also work for GNUnet, the key
512 thing is that you need some packages from unstable (as shown below).
513 However, as unstable is unlikely to be comprehensive (missing packages)
514 or might be problematic (crashing packages), you probably want others
515 from stable and/or testing.
516
517 @node Update again
518 @subsection Update again
519
520 Now, run again@
521
522 @example
523 # apt-get update@
524 # apt-get upgrade@
525 @end example
526
527 to ensure that all your new distribution indices are downloaded, and
528 that your pinning is correct: the upgrade step should cause no changes
529 at all.
530
531 @node Installing packages
532 @subsection Installing packages
533
534 We begin by installing a few Debian packages from stable:@
535
536 @example
537 # apt-get install gcc make libzbar-dev libltdl-dev libsqlite3-dev \
538   libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \
539   texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \
540   libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \
541   libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \
542   librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \
543   libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \
544   libqrencode-dev libgladeui-dev nasm texlive-latex-extra \
545   libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev
546 @end example
547
548 After that, we install a few more packages from unstable:@
549
550 @example
551 # apt-get install -t unstable nettle-dev libgstreamer1.0-dev \
552   gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
553   libgstreamer-plugins-base1.0-dev
554 @end example
555
556 @node Installing dependencies from source
557 @subsection Installing dependencies from source
558
559 Next, we need to install a few dependencies from source.
560 You might want to do this as a "normal" user and only run the
561 @code{make install} steps as root (hence the @code{sudo} in the
562 commands below). Also, you do this from any
563 directory. We begin by downloading all dependencies, then extracting the
564 sources, and finally compiling and installing the libraries.
565
566 For these steps, follow the instructions given in the
567 installation from source instruction in this order:
568
569 @itemize @bullet
570 @item @ref{generic source installation - libav}
571 @item @ref{generic source installation - libextractor}
572 @item @ref{generic source installation - libgpg-error}
573 @item @ref{generic source installation - libgcrypt}
574 @item @ref{generic source installation - gnutls}
575 @item @ref{generic source installation - libmicrohttpd}
576 @item @ref{generic source installation - libgnurl}
577 @end itemize
578
579 @node Installing GNUnet from source
580 @subsection Installing GNUnet from source
581
582
583 For this, simply follow the generic installation instructions from
584 here.
585
586 @node But wait there is more!
587 @subsection But wait there is more!
588
589 So far, we installed all of the packages and dependencies required to
590 ensure that all of GNUnet would be built.
591 However, while for example the plugins to interact with the MySQL or
592 Postgres databases have been created, we did not actually install or
593 configure those databases. Thus, you will need to install
594 and configure those databases or stick with the default Sqlite database.
595 Sqlite is usually fine for most applications, but MySQL can offer better
596 performance and Postgres better resillience.
597
598
599 @node Installing GNUnet from Git on Ubuntu 14.4
600 @section Installing GNUnet from Git on Ubuntu 14.4
601
602 @strong{Install the required build tools:}
603
604 @example
605 $ sudo apt-get install git automake autopoint autoconf
606 @end example
607
608 @strong{Install the required dependencies}
609
610 @example
611 $ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
612  libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
613  libmicrohttpd-dev libgnutls28-dev
614 @end example
615
616 @strong{Choose one or more database backends}
617
618 @itemize @bullet
619
620 @item SQLite3:
621
622 @example
623 $ sudo apt-get install libsqlite3-dev
624 @end example
625
626 @item MySQL:
627
628 @example
629 $ sudo apt-get install libmysqlclient-dev
630 @end example
631
632 @item PostgreSQL:
633
634 @example
635 $ sudo apt-get install libpq-dev postgresql
636 @end example
637
638 @end itemize
639
640 @strong{Install the optional dependencies for gnunet-conversation:}
641
642 @example
643 $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
644 @end example
645
646 @strong{Install the libgrypt 1.6.1:}
647
648 @itemize @bullet
649
650 @item For Ubuntu 14.04:
651
652 @example
653 $ sudo apt-get install libgcrypt20-dev
654 @end example
655
656 @item For Ubuntu older 14.04:
657
658 @example
659 $ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
660 $ tar xf libgcrypt-1.6.1.tar.bz2
661 $ cd libgcrypt-1.6.1
662 $ ./configure
663 $ sudo make install
664 $ cd ..
665 @end example
666
667 @end itemize
668
669 @strong{Install libgnurl}
670
671 @strong{Install GNUnet}
672
673 @example
674 $ git clone https://gnunet.org/git/gnunet/
675 $ cd gnunet/
676 $ ./bootstrap
677 @end example
678
679 If you want to:
680
681 @itemize @bullet
682
683 @item Install to a different directory:
684
685 @example
686 --prefix=PREFIX
687 @end example
688
689 @item
690 Have sudo permission, but do not want to compile as root:
691
692 @example
693 --with-sudo
694 @end example
695
696 @item
697 Want debug message enabled:
698
699 @example
700 --enable-logging=verbose
701 @end example
702
703 @end itemize
704
705
706 @example
707 $ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
708 $ make; sudo make install
709 @end example
710
711 After installing it, you need to create an empty configuration file:
712
713 @example
714 touch ~/.config/gnunet.conf
715 @end example
716
717 And finally you can start GNUnet with
718
719 @example
720 $ gnunet-arm -s
721 @end example
722
723 @node Build instructions for Debian 8
724 @section Build instructions for Debian 8
725 @c FIXME: I -> we
726
727 These are the installation instructions for Debian 8. They were tested
728 sing a fresh Debian 8 AMD64 installation without non-free software (no
729 contrib or non-free). During installation, I only selected "lxde" for the
730 desktop environment.
731 Note that the packages and the dependencies that we will install during
732 this chapter take about 1.5 GB of disk space. Combined with GNUnet and
733 space for objects during compilation, you should not even attempt this
734 unless you have about 2.5 GB free after the Debian installation.
735 Using these instructions to build a VM image is likely to require a
736 minimum of 4-5 GB for the VM (as you will likely also want a desktop
737 manager).
738
739 GNUnet's security model assumes that your @code{/home} directory is
740 encrypted.
741 Thus, if possible, you should encrypt your entire disk, or at least just
742 your home partition (or per-user home directory).
743
744 Naturally, the exact details of the starting state for your installation
745 should not matter much.
746 For example, if you selected any of those installation groups you might
747 simply already have some of the necessary packages installed. Thus, it is
748 suggested that you simply install the desktop environment of your choice
749 before beginning with the instructions.
750
751
752 @menu
753 * Update Debian::
754 * Installing Debian Packages::
755 * Installing Dependencies from Source2::
756 * Installing GNUnet from Source2::
757 * But wait (again) there is more!::
758 @end menu
759
760 @node Update Debian
761 @subsection Update Debian
762
763 After any installation, you should begin by running
764
765 @example
766 # apt-get update
767 # apt-get upgrade
768 @end example
769
770 to ensure that all of your packages are up-to-date. Note that the "#" is
771 used to indicate that you need to type in this command as "root" (or
772 prefix with "sudo"), whereas "$" is used to indicate typing in a command
773 as a normal user.
774
775 @node Installing Debian Packages
776 @subsection Installing Debian Packages
777
778 We begin by installing a few Debian packages from stable:
779
780 @example
781 # apt-get install gcc make libzbar-dev libltdl-dev libsqlite3-dev \
782 libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \
783 libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \
784 libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \
785 libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \
786 libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \
787 texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \
788 libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
789 libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \
790 libgcrypt20-dev libmicrohttpd-dev
791 @end example
792
793 @node Installing Dependencies from Source2
794 @subsection Installing Dependencies from Source2
795
796 Yes, we said we start with a Debian 8 "stable" system, but because Debian
797 linked GnuTLS without support for DANE, we need to compile a few things,
798 in addition to GNUnet, still by hand. Yes, you can run GNUnet using the
799 respective Debian packages, but then you will not get DANE support.
800
801 Next, we need to install a few dependencies from source. You might want
802 to do this as a "normal" user and only run the @code{make install} steps
803 as root (hence the @code{sudo} in the commands below). Also, you do this
804 from any directory. We begin by downloading all dependencies, then
805 extracting the sources, and finally compiling and installing the
806 libraries:
807
808 @example
809 $ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz
810 $ tar xvf gnutls-3.3.12.tar.xz
811 $ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd ..
812 @end example
813
814 For the installation and compilation of libgnurl/gnURL refer to
815 the generic installation section,
816 @xref{generic source installation - libgnurl}.
817
818 @node Installing GNUnet from Source2
819 @subsection Installing GNUnet from Source2
820
821 For this, simply follow the generic installation instructions from@
822 here.
823
824 @node But wait (again) there is more!
825 @subsection But wait (again) there is more!
826
827 So far, we installed all of the packages and dependencies required to
828 ensure that all of GNUnet would be built. However, while for example the
829 plugins to interact with the MySQL or Postgres databases have been
830 created, we did not actually install or configure those databases.
831 Thus, you will need to install and configure those databases or stick
832 with the default Sqlite database. Sqlite is usually fine for most
833 applications, but MySQL can offer better performance and Postgres better
834 resillience.
835
836 @node Build instructions for macOS
837 @section Build instructions for macOS
838 @c FIXME: I -> we
839
840 These are the installation guidelines for macOS.
841 They were tested on macOS High Sierra.
842
843 @menu
844 * Installing dependencies::
845 * Compile from Source::
846 @end menu
847
848 @node Installing dependencies
849 @subsection Installing dependencies
850
851 First, install XCode in the newest version.
852 See https://developer.apple.com/xcode/.
853
854 Install Homebrew (https://brew.sh) and then install the dependencies listed above.
855 If a dependency does not exists in brew, you need to compile it from source.
856
857 @example
858 # brew install <dependency>
859 @end example
860
861 @node Compile from Source
862 @subsection Compile from Source
863
864 Before you start building GNUnet, you need to setup your environment.
865 This means that you have to make sure the proper tools are used in the build process.
866 For example, after installing texinfo you need to make sure the new texinfo is actually used:
867
868 @example
869 $ echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile 
870 @end example
871
872 Note: brew tells you the appropriate command when executing
873
874 @example
875 $ brew info texinfo
876 @end example
877
878 This may also be necessary for the gettext package.
879
880 Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system.
881 On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler.
882
883 @example
884 $ export CC=gcc-7
885 @end example
886
887 You might see configure failing telling you that it ``cannot run C compiled programs.''.
888 In this case, you might need to open/run Xcode once and you will be prompted to
889 install additonal packages.
890 Then, you might have to manually install the command line tools from here https://developer.apple.com/download/more/ (you need an Apple ID for this).
891 Install those and execute
892
893 @example
894 $open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
895 @end example
896
897 Then, configure will pass again.
898
899 After this the standard compile instructions apply.
900
901 @c @node Build instructions for OpenBSD 6.2
902 @c @section Build instructions for OpenBSD 6.2
903
904 @node Outdated build instructions for previous revisions
905 @section Outdated build instructions for previous revisions
906
907 This chapter contains a collection of outdated, older installation guides.
908 They are mostly intended to serve as a starting point for writing
909 up-to-date instructions and should not be expected to work for
910 GNUnet 0.10.x.
911 A set of older installation instructions can also be found in the
912 file @file{doc/outdated-and-old-installation-instructions.txt} in the
913 source tree of GNUnet.
914
915 This file covers old instructions which no longer receive security
916 updates or any kind of support.
917
918 @menu
919 * Installing GNUnet 0.10.1 on Ubuntu 14.04::
920 * Building GLPK for MinGW::
921 * GUI build instructions for Ubuntu 12.04 using Subversion::
922 @c * Installation with gnunet-update::
923 * Instructions for Microsoft Windows Platforms (Old)::
924 @end menu
925
926
927 @node Installing GNUnet 0.10.1 on Ubuntu 14.04
928 @subsection Installing GNUnet 0.10.1 on Ubuntu 14.04
929
930 Install the required dependencies:
931
932 @example
933 $ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
934  libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
935  libmicrohttpd-dev libgnutls28-dev
936 @end example
937
938 Choose one or more database backends:
939
940 @itemize @bullet
941
942 @item SQLite3
943
944 @example
945  $ sudo apt-get install libsqlite3-dev@
946 @end example
947
948 @item MySQL
949
950 @example
951 $ sudo apt-get install libmysqlclient-dev@
952 @end example
953
954 @item PostgreSQL
955
956 @example
957  $ sudo apt-get install libpq-dev postgresql@
958 @end example
959
960 @end itemize
961
962 Install the optional dependencies for gnunet-conversation:
963
964 @example
965  $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
966 @end example
967
968 Install libgcrypt 1.6:
969
970 @itemize @bullet
971
972 @item For Ubuntu 14.04:
973
974 @example
975 $ sudo apt-get install libgcrypt20-dev
976 @end example
977
978 @item For Ubuntu older than 14.04:
979
980 @example
981 wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
982 $ tar xf libgcrypt-1.6.1.tar.bz2
983 $ cd libgcrypt-1.6.1
984 $ ./configure
985 $ sudo make install
986 $ cd ..
987 @end example
988 @end itemize
989
990 Install libgnurl:
991
992 @pxref{generic source installation - libgnurl}.
993
994 Install GNUnet:
995
996 @example
997 $ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz
998 $ tar xf gnunet-0.10.1.tar.gz
999 $ cd gnunet-0.10.1
1000 @end example
1001
1002 If you want to:
1003
1004 @itemize @bullet
1005
1006 @item
1007 Install to a different directory:
1008
1009 @example
1010 --prefix=PREFIX
1011 @end example
1012
1013 @item
1014 Have sudo permission, but do not want to compile as root:
1015
1016 @example
1017 --with-sudo
1018 @end example
1019
1020 @item
1021 Want debug message enabled:
1022
1023 @example
1024 --enable-logging=verbose
1025 @end example
1026
1027 @end itemize
1028
1029 @example
1030 $ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
1031 $ make; sudo make install
1032 @end example
1033
1034 After installing it, you need to create an empty configuration file:
1035
1036 @example
1037 touch ~/.config/gnunet.conf
1038 @end example
1039
1040 And finally you can start GNUnet with
1041
1042 @example
1043 $ gnunet-arm -s
1044 @end example
1045
1046 @node Building GLPK for MinGW
1047 @subsection Building GLPK for MinGW
1048
1049 GNUnet now requires the GNU Linear Programming Kit (GLPK).
1050 Since there's is no package you can install with @code{mingw-get} you
1051 have to compile it from source:
1052
1053 @itemize @bullet
1054
1055 @item Download the latest version from
1056 @uref{http://ftp.gnu.org/gnu/glpk/}
1057
1058 @item Unzip the downloaded source tarball using your favourite
1059 unzipper application In the MSYS shell
1060
1061 @item change to the respective directory
1062
1063 @item Configure glpk for "i686-pc-mingw32":
1064
1065 @example
1066 ./configure '--build=i686-pc-mingw32'
1067 @end example
1068
1069 @item run
1070
1071 @example
1072 make install check
1073 @end example
1074
1075 @end itemize
1076
1077 MinGW does not automatically detect the correct buildtype so you have to
1078 specify it manually.
1079
1080
1081 @node GUI build instructions for Ubuntu 12.04 using Subversion
1082 @subsection GUI build instructions for Ubuntu 12.04 using Subversion
1083
1084 After installing GNUnet you can continue installing the GNUnet GUI tools:
1085
1086 First, install the required dependencies:
1087
1088 @example
1089 $ sudo apt-get install libgladeui-dev libqrencode-dev
1090 @end example
1091
1092 Please ensure that the GNUnet shared libraries can be found by the linker.
1093 If you installed GNUnet libraries in a non standard path
1094 (say GNUNET_PREFIX=/usr/local/lib/), you can
1095
1096 @itemize @bullet
1097
1098 @item set the environmental variable permanently to:
1099
1100 @example
1101 LD_LIBRARY_PATH=$GNUNET_PREFIX
1102 @end example
1103
1104 @item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf}
1105
1106 @end itemize
1107
1108 Now you can checkout and compile the GNUnet GUI tools:
1109
1110 @example
1111 $ git clone https://gnunet.org/git/gnunet-gtk
1112 $ cd gnunet-gtk
1113 $ ./bootstrap
1114 $ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/..
1115 $ make install
1116 @end example
1117
1118 @node Instructions for Microsoft Windows Platforms (Old)
1119 @subsection Instructions for Microsoft Windows Platforms (Old)
1120
1121 This document is a @b{DEPRECATED} installation guide for GNUnet on
1122 Windows.
1123 It will not work for recent GNUnet versions, but maybe it will be of
1124 some use if problems arise.
1125
1126 The Windows build uses a UNIX emulator for Windows,
1127 @uref{http://www.mingw.org/, MinGW}, to build the executable modules.
1128 These modules run natively on Windows and do not require additional
1129 emulation software besides the usual dependencies.
1130
1131 GNUnet development is mostly done under GNU/Linux and especially git
1132 checkouts may not build out of the box.
1133 We regret any inconvenience, and if you have problems, please report them.
1134
1135 @menu
1136 * Hardware and OS requirements::
1137 * Software installation::
1138 * Building libextractor and GNUnet::
1139 * Installer::
1140 * Source::
1141 @end menu
1142
1143 @node Hardware and OS requirements
1144 @subsubsection Hardware and OS requirements
1145
1146 @itemize @bullet
1147 @item Pentium II or equivalent processor, @geq{} 350 MHz
1148 @item 128 MB RAM
1149 @item 600 MB free disk space
1150 @item Windows 2000 or Windows XP are recommended
1151 @end itemize
1152
1153 @node Software installation
1154 @subsubsection Software installation
1155
1156 @itemize @bullet
1157
1158 @item
1159 @strong{Compression software}@
1160
1161 The software packages GNUnet depends on are usually compressed using UNIX
1162 tools like @command{tar}, @command{gzip}, @command{xzip} and
1163 @command{bzip2}.
1164 If you do not already have an utility that is able to extract such
1165 archives, get @uref{http://www.7-zip.org/, 7-Zip}.
1166
1167 @item
1168 @strong{UNIX environment}@
1169
1170 The MinGW project provides the compiler toolchain that is used to build
1171 GNUnet.
1172 Get the following packages from the
1173 @uref{http://sourceforge.net/projects/mingw/files/, MinGW} project:
1174
1175 @itemize @bullet
1176
1177 @item GCC core
1178 @item GCC g++
1179 @item MSYS
1180 @item MSYS Developer Tool Kit (msysDTK)
1181 @item MSYS Developer Tool Kit - msys-autoconf (bin)
1182 @item MSYS Developer Tool Kit - msys-automake (bin)
1183 @item MinGW Runtime
1184 @item MinGW Utilities
1185 @item Windows API
1186 @item Binutils
1187 @item make
1188 @item pdcurses
1189 @item GDB (snapshot)
1190 @end itemize
1191
1192 @itemize @bullet
1193
1194
1195 @item Install MSYS (to c:\mingw, for example.)@
1196 Do @strong{not} use spaces in the pathname.
1197 For example, avoid a location such as @file{c:\program files\mingw}.
1198
1199 @item Install MinGW runtime, utilities and GCC to a subdirectory
1200 (to @file{c:\mingw\mingw}, for example)
1201
1202 @item Install the Development Kit to the MSYS directory
1203 (@file{c:\mingw})
1204
1205 @item Create a batch file bash.bat in your MSYS directory with
1206 the files:
1207
1208 @example
1209 bin\sh.exe --login
1210 @end example
1211
1212 This batch file opens a shell which is used to invoke the build
1213 processes.
1214 MinGW's standard shell (@command{msys.bat}) is not suitable
1215 because it opens a separate console window.
1216 On Vista, @command{bash.bat} needs to be run as Administrator.
1217
1218 @item
1219 Start @command{bash.sh} and rename
1220 @file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems:
1221
1222 @example
1223 mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken
1224 @end example
1225
1226 @item
1227 Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and
1228 remove the declaration of DATADIR from
1229 (@file{c:\mingw\mingw\include\objidl.h} (lines 55-58)
1230
1231 @item
1232 Unpack autoconf, automake to the MSYS directory (@file{c:\mingw})
1233
1234 @item
1235 Install all other packages to the MinGW directory (@file{c:\mingw\mingw\})
1236 @end itemize
1237
1238
1239 @item @strong{GNU Libtool}@
1240 GNU Libtool is required to use shared libraries.
1241 Get the prebuilt package from here and unpack it to the
1242 MinGW directory (@file{c:\mingw})
1243
1244 @item @strong{Pthreads}@
1245 GNUnet uses the portable POSIX thread library for multi-threading:
1246
1247 @itemize @bullet
1248
1249 @item Save
1250 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a}
1251 (x86) or
1252 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a}
1253 (x64) as libpthread.a into the @file{lib}
1254 directory (@file{c:\mingw\mingw\lib\libpthread.a}).
1255
1256 @item Save
1257 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll}
1258 (x86) or
1259 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a}
1260 (x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}).
1261
1262 @item Download all header files from
1263 @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/}
1264 to the @file{include} directory (@file{c:\mingw\mingw\include}).
1265 @end itemize
1266
1267
1268 @item @strong{GNU MP}@
1269 GNUnet uses the GNU Multiple Precision library for special cryptographic
1270 operations. Get the GMP binary package from the
1271 @uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and
1272 unpack it to the MinGW directory (@file{c:\mingw\mingw})
1273
1274 @item @strong{GNU Gettext}@
1275 GNU gettext is used to provide national language support.
1276 Get the prebuilt package from hereand unpack it to the MinGW
1277 directory (@file{c:\mingw\mingw})
1278
1279 @item @strong{GNU iconv}@
1280 GNU Libiconv is used for character encoding conversion.
1281 Get the prebuilt package from here and unpack it to the MinGW
1282 directory (@file{c:\mingw\mingw}).
1283
1284 @item @strong{SQLite}@
1285 GNUnet uses the SQLite database to store data.
1286 Get the prebuilt binary from here and unpack it to your MinGW directory.
1287
1288 @item @strong{MySQL}@
1289 As an alternative to SQLite, GNUnet also supports MySQL.
1290
1291 @itemize @bullet
1292
1293 @item Get the binary installer from the
1294 @uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project}
1295 (version 4.1), install it and follow the instructions in
1296 @file{README.mysql}.
1297
1298 @item  Create a temporary build directory (@file{c:\mysql})
1299
1300 @item Copy the directories @file{include\} and @file{lib\} from the
1301 MySQL directory to the new directory
1302
1303 @item Get the patches from
1304 @uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and
1305 @uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the
1306 latter is only required for MySQL
1307
1308 @example
1309 patch -p 0
1310 @end example
1311
1312 @item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll}
1313
1314 @item  Change to @file{lib\} and create an import library:
1315
1316 @example
1317 dlltool --input-def ../include/libmySQL.def \
1318 --dllname libmysql.dll \
1319 --output-lib libmysqlclient.a -k
1320 @end example
1321
1322 @item  Copy include\* to include\mysql\
1323
1324 @item  Pass @code{--with-mysql=/c/mysql} to
1325 @command{./configure} and copy @file{libmysql.dll}
1326 to your PATH or GNUnet's @file{bin} directory
1327 @end itemize
1328
1329
1330 @item @strong{GTK+}@
1331 @command{gnunet-fs-gtk} and @command{libextractor} depend on GTK.
1332 Get the the binary and developer packages of @command{atk},
1333 @command{glib}, @command{gtk}, @command{iconv},
1334 @command{gettext-runtime}, @command{pango} from
1335 @uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them
1336 to the MinGW directory (@file{c:\mingw\mingw}).
1337 @c FIXME: The URL below for pkg-config seems wrong.
1338 Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and
1339 @command{libpng} and unpack them to the MinGW directory
1340 (@file{c:\mingw\mingw}).
1341 Here is an all-in-one package for the
1342 @uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies}
1343 . Do not overwrite any existing files!
1344
1345 @item @strong{Glade}@
1346 @command{gnunet-*-gtk} and @command{gnunet-setup} were created using
1347 this interface builder
1348
1349 @itemize @bullet
1350
1351 @item Get the Glade and libglade (-bin and -devel) packages
1352 (without GTK!) from
1353 @uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to
1354 the MinGW directory (@file{c:\mingw\mingw}).
1355
1356 @item Get @command{libxml} from here and unpack it to the MinGW
1357 directory (@file{c:\mingw\mingw}).
1358 @end itemize
1359
1360 @c FIXME: URLs
1361 @item @strong{zLib}@
1362 @command{libextractor} requires @command{zLib} to decompress some file
1363 formats. GNUnet uses it to (de)compress meta-data.
1364 Get zLib from here (Signature) and unpack it to the MinGW directory
1365 (@file{c:\mingw\mingw}).
1366
1367 @item @strong{Bzip2}@
1368 @command{libextractor} also requires @command{Bzip2} to
1369 decompress some file formats.
1370 Get the Bzip2 (binary and developer package) from
1371 @uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and
1372 unpack it to the MinGW directory (@file{c:\mingw\mingw}).
1373
1374 @item @strong{Libgcrypt}@
1375 @command{Libgcrypt} provides the cryptographic functions used by GNUnet.
1376 Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here},
1377 compile and place it in the MinGW directory
1378 (@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to
1379 compile GNUnet.
1380
1381 @item @strong{PlibC}@
1382 PlibC emulates Unix functions under Windows. Get PlibC from here and
1383 unpack it to the MinGW directory (c:\mingw\mingw)
1384
1385 @item @strong{OGG Vorbis}@
1386 @command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files.
1387 Get the packages
1388 @uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg}
1389 and
1390 @uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis}
1391 from the
1392 @uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build}
1393 and unpack them to the MinGW directory (c:\mingw\mingw).
1394
1395 @item @strong{Exiv2}@
1396 (lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data.
1397 Download
1398 @uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2}
1399 and unpack it to the MSYS directory (c:\mingw).
1400 @end itemize
1401
1402 @node Building libextractor and GNUnet
1403 @subsubsection Building libextractor and GNUnet
1404
1405 Before you compile @command{libextractor} or @command{GNUnet},
1406 be sure to set @code{PKG_CONFIG_PATH}:
1407
1408 @example
1409 export PKG_CONFIG_PATH=/mingw/lib/pkgconfig
1410 @end example
1411
1412 @noindent
1413 @xref{GNUnet Installation Handbook}, for basic instructions on building
1414 @command{libextractor} and @command{GNUnet}.
1415 By default, all modules that are created in this way contain
1416 debug information and are quite large. To compile release versions
1417 (small and fast) set the variable @code{CFLAGS}:
1418
1419 @example
1420 export CFLAGS='-O2 -march=pentium -fomit-frame-pointer'
1421 ./configure --prefix=$HOME --with-extractor=$HOME
1422 @end example
1423
1424 @node Installer
1425 @subsubsection Installer
1426
1427 The GNUnet installer is made with
1428 @uref{http://nsis.sourceforge.net/, NSIS}. The installer script is
1429 located in @file{contrib\win} in the GNUnet source tree.
1430
1431 @node Source
1432 @subsubsection Source
1433
1434 @c FIXME: URL... or: WHERE is HERE?
1435 The sources of all dependencies are available here.