aboutsummaryrefslogtreecommitdiff
path: root/doc/system_specific/FROM_SOURCE
blob: 2e98ab5c08ad93dc49eb9c1b243cf909041430ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
@node Build instructions for Ubuntu 12.04 using Git
@section Build instructions for Ubuntu 12.04 using Git

@menu
* Install the required build tools::
* Install libgcrypt 1.6 and libgpg-error::
* Install gnutls with DANE support::
* Install libgnurl::
* Install libmicrohttpd from Git::
* Install libextractor from Git::
* Install GNUnet dependencies::
* Build GNUnet::
* Install the GNUnet-gtk user interface from Git::
@end menu

@node  Install the required build tools
@subsection  Install the required build tools

First, make sure Git is installed on your system:

@example
$ sudo apt-get install git
@end example

Install the essential buildtools:

@example
$ sudo apt-get install automake autopoint autoconf libtool
@end example

@node Install libgcrypt 1.6 and libgpg-error
@subsection Install libgcrypt 1.6 and libgpg-error

@ref{generic source installation - libgpg-error}

@node Install gnutls with DANE support
@subsection Install gnutls with DANE support

@itemize @bullet
@item @ref{generic source installation - nettle}
@item @ref{generic source installation - ldns}
@item @ref{generic source installation - libunbound/unbound}
@item @ref{generic source installation - gnutls}
@item @ref{generic source installation - libgcrypt}
@end itemize

@node Install libgnurl
@subsection Install libgnurl

Follow the @ref{generic source installation - libgnurl}.

@node Install libmicrohttpd from Git
@subsection Install libmicrohttpd from Git

@example
$ git clone https://gnunet.org/git/libmicrohttpd
$ cd libmicrohttpd/
$ ./bootstrap
$ ./configure
$ sudo make install ; cd ..
@end example

@node  Install libextractor from Git
@subsection  Install libextractor from Git

Install libextractor dependencies:

@example
$ sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev \
 libpoppler-dev libvorbis-dev libexiv2-dev libjpeg-dev \
 libtiff-dev libgif-dev libvorbis-dev libflac-dev libsmf-dev \
 g++
@end example

Build libextractor:

@example
$ git clone https://gnunet.org/git/libextractor
$ cd libextractor
$ ./bootstrap
$ ./configure
$ sudo make install ; cd ..
@end example

@node Install GNUnet dependencies
@subsection Install GNUnet dependencies

@example
$ sudo apt-get install libidn11-dev libunistring-dev libglpk-dev \
 libpulse-dev libbluetooth-dev libsqlite-dev
@end example

Install libopus:

@example
$ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
$ tar xf opus-1.1.tar.gz
$ cd opus-1.1/
$ ./configure
$ sudo make install ; cd ..
@end example

Choose one or more database backends:

SQLite3:
@example
$ sudo apt-get install libsqlite3-dev
@end example
MySQL:
@example
$ sudo apt-get install libmysqlclient-dev
@end example
PostgreSQL:
@example
$ sudo apt-get install libpq-dev postgresql
@end example



@node Build GNUnet
@subsection Build GNUnet



@menu
* Configuring the installation path::
* Configuring the system::
* Installing components requiring sudo permission::
* Build::
@end menu

@node Configuring the installation path
@subsubsection Configuring the installation path

You can specify the location of the GNUnet installation by setting the
prefix when calling the configure script with @code{--prefix=DIRECTORY}

@example
$ export PATH=$PATH:DIRECTORY/bin
@end example

@node Configuring the system
@subsubsection Configuring the system

Please make sure NOW that you have created a user and group 'gnunet'
and additionally a group 'gnunetdns':

@example
$ sudo addgroup gnunet
$ sudo addgroup gnunetdns
$ sudo adduser gnunet
@end example

Each GNUnet user should be added to the 'gnunet' group (may
require fresh login to come into effect):

@example
$ sudo useradd -G  gnunet
@end example

@node Installing components requiring sudo permission
@subsubsection Installing components requiring sudo permission

Some components, like the nss plugin required for GNS, may require root
permissions. To allow these few components to be installed use:

@example
$ ./configure --with-sudo
@end example

@node Build
@subsubsection Build

@example
$ git clone https://gnunet.org/git/gnunet/
$ cd gnunet/
$ ./bootstrap
@end example

Use the required configure call including the optional installation prefix
@code{PREFIX} or the sudo permissions:

@example
$ ./configure [ --with-sudo | --with-prefix=PREFIX ]
@end example

@example
$ make; sudo make install
@end example

After installing it, you need to create an empty configuration file:

@example
mkdir ~/.gnunet; touch ~/.gnunet/gnunet.conf
@end example

And finally you can start GNUnet with:

@example
$ gnunet-arm -s
@end example

@node Install the GNUnet-gtk user interface from Git
@subsection Install the GNUnet-gtk user interface from Git


Install dependencies:

@example
$ sudo apt-get install libgtk-3-dev libunique-3.0-dev libgladeui-dev \
 libqrencode-dev
@end example

Build GNUnet (with an optional prefix) and execute:

@example
$ git clone https://gnunet.org/git/gnunet-gtk/
$ cd gnunet-gtk/
$ ./bootstrap
$ ./configure [--prefix=PREFIX] --with-gnunet=DIRECTORY
$ make; sudo make install
@end example

@node Build Instructions for Microsoft Windows Platforms
@section Build Instructions for Microsoft Windows Platforms

@menu
* Introduction to building on MS Windows::
* Requirements::
* Dependencies & Initial Setup::
* GNUnet Installation::
* Adjusting Windows for running and testing GNUnet::
* Building the GNUnet Installer::
* Using GNUnet with Netbeans on Windows::
@end menu

@node Introduction to building on MS Windows
@subsection Introduction to building on MS Windows


This document is a guide to building GNUnet and its dependencies on
Windows platforms. GNUnet development is mostly done under GNU/Linux and
especially git checkouts may not build out of the box.
We regret any inconvenience, and if you have problems, please report
them.

@node Requirements
@subsection Requirements

The Howto is based upon a @strong{Windows Server 2008 32bit}
@strong{Installation}, @strong{sbuild} and thus a
@uref{http://www.mingw.org/wiki/MSYS, MSYS+MinGW}
(W32-GCC-Compiler-Suite + Unix-like Userland) installation. sbuild
is a convenient set of scripts which creates a working msys/mingw
installation and installs most dependencies required for GNUnet.

As of the point of the creation of these instructions,
GNUnet @strong{requires} a Windows @strong{Server} 2003 or
newer for full feature support.
Windows Vista and later will also work, but
@strong{non-server version can not run a VPN-Exit-Node} as the NAT
features have been removed as of Windows Vista.

@c TODO: We should document Windows 10!
@c It seems like the situation hasn't changed with W10

@node Dependencies & Initial Setup
@subsection Dependencies & Initial Setup


@itemize @bullet

@item
Install a fresh version of @strong{Python 2.x}, even if you are using a
x64-OS, install a 32-bit version for use with sbuild.
Python 3.0 is currently incompatible.

@item
Install your favorite @uref{http://code.google.com/p/tortoisegit/, git} &
@uref{http://tortoisesvn.net/, subversion}-clients.

@item
You will also need some archive-manager like
@uref{http://www.7-zip.org/, 7zip}.

@item
Pull a copy of sbuild to a directory of your choice, which will be used
in the remainder of this guide. For now, we will use
@file{c:\gnunet\sbuild\}

@item
in @file{sbuild\src\mingw\mingw32-buildall.sh}, comment out the packages
@strong{gnunet-svn} and @strong{gnunet-gtk-svn}, as we don't want sbuild
to compile/install those for us.

@item
Follow LRN's sbuild installation instructions.-
@end itemize

Please note that sbuild may (or will most likely) fail during
installation, thus you really HAVE to @strong{check the logfiles} created
during the installation process.
Certain packages may fail to build initially due to missing dependencies,
thus you may have to
@strong{substitute those with binary-versions initially}. Later on once
dependencies are satisfied you can re-build the newer package versions.

@strong{It is normal that you may have to repeat this step multiple times
and there is no uniform way to fix all compile-time issues, as the
build-process of many of the dependencies installed are rather unstable
on win32 and certain releases may not even compile at all.}

Most dependencies for GNUnet have been set up by sbuild, thus we now
should add the @file{bin/} directories in your new msys and mingw
installations to PATH. You will want to create a backup of your finished
msys-environment by now.

@node GNUnet Installation
@subsection GNUnet Installation

First, we need to launch our msys-shell, you can do this via

@file{C:\gnunet\sbuild\msys\msys.bat}

You might wish to take a look at this file and adjust some
login-parameters to your msys environment.

Also, sbuild added two pointpoints to your msys-environment, though those
might remain invisible:

@itemize @bullet

@item
/mingw, which will mount your mingw-directory from sbuild/mingw and the
other one is

@item
/src which contains all the installation sources sbuild just compiled.
@end itemize

Check out the current GNUnet sources (git HEAD) from the
GNUnet repository "gnunet.git", we will do this in your home directory:

@code{git clone https://gnunet.org/git/gnunet/ ~/gnunet}

Now, we will first need to bootstrap the checked out installation and then
configure it accordingly.

@example
cd ~/gnunet
./bootstrap
STRIP=true CPPFLAGS="-DUSE_IPV6=1 -DW32_VEH" CFLAGS="$CFLAGS -g -O2" \
./configure --prefix=/ --docdir=/share/doc/gnunet \
--with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw \
--with-libcurl=/mingw --with-extractor=/mingw --with-sqlite=/mingw \
--with-microhttpd=/mingw --with-plibc=/mingw --enable-benchmarks \
--enable-expensivetests --enable-experimental --with-qrencode=/mingw \
--enable-silent-rules --enable-experimental 2>&1 | tee -a ./configure.log
@end example

The parameters above will configure for a reasonable GNUnet installation
to the your msys-root directory.
Depending on which features your would like to build or you may need to
specify additional dependencies. Sbuild installed most libs into
the /mingw subdirectory, so remember to prefix library locations with
this path.

Like on a unixoid system, you might want to use your home directory as
prefix for your own GNUnet installation for development, without tainting
the buildenvironment. Just change the "prefix" parameter to point towards
~/ in this case.

Now it's time to compile GNUnet as usual. Though this will take some time,
so you may fetch yourself a coffee or some Mate now...

@example
make ; make install
@end example

@node Adjusting Windows for running and testing GNUnet
@subsection Adjusting Windows for running and testing GNUnet

Assuming the build succeeded and you
@strong{added the bin directory of your GNUnet to PATH}, you can now use
your gnunet-installation as usual.
Remember that UAC or the windows firewall may popup initially, blocking
further execution of gnunet until you acknowledge them.

You will also have to take the usual steps to get peer-to-peer (p2p)
software running properly (port forwarding, ...),
and GNUnet will require administrative permissions as it may even
install a device-driver (in case you are using gnunet-vpn and/or
gnunet-exit).

@node Building the GNUnet Installer
@subsection Building the GNUnet Installer

The GNUnet installer is made with
@uref{http://nsis.sourceforge.net/, NSIS}.
The installer script is located in @file{contrib\win} in the
GNUnet source tree.

@node Using GNUnet with Netbeans on Windows
@subsection Using GNUnet with Netbeans on Windows

TODO

@node Build instructions for Debian 7.5
@section Build instructions for Debian 7.5


These are the installation instructions for Debian 7.5. They were tested
using a minimal, fresh Debian 7.5 AMD64 installation without non-free
software (no contrib or non-free).
By "minimal", we mean that during installation, we did not select any
desktop environment, servers or system utilities during the "tasksel"
step. Note that the packages and the dependencies that we will install
during this chapter take about 1.5 GB of disk space.
Combined with GNUnet and space for objects during compilation, you should
not even attempt this unless you have about 2.5 GB free after the minimal
Debian installation.
Using these instructions to build a VM image is likely to require a
minimum of 4-5 GB for the VM (as you will likely also want a desktop
manager).

GNUnet's security model assumes that your @file{/home} directory is
encrypted. Thus, if possible, you should encrypt your home partition
(or per-user home directory).

Naturally, the exact details of the starting state for your installation
should not matter much. For example, if you selected any of those
installation groups you might simply already have some of the necessary
packages installed.
We did this for testing, as this way we are less likely to forget to
mention a required package.
Note that we will not install a desktop environment, but of course you
will need to install one to use GNUnet's graphical user interfaces.
Thus, it is suggested that you simply install the desktop environment of
your choice before beginning with the instructions.



@menu
* Update::
* Stable? Hah!::
* Update again::
* Installing packages::
* Installing dependencies from source::
* Installing GNUnet from source::
* But wait there is more!::
@end menu

@node Update
@subsection Update

After any installation, you should begin by running

@example
# apt-get update ; apt-get upgrade
@end example

to ensure that all of your packages are up-to-date. Note that the "#" is
used to indicate that you need to type in this command as "root"
(or prefix with "sudo"), whereas "$" is used to indicate typing in a
command as a normal user.

@node Stable? Hah!
@subsection Stable? Hah!

Yes, we said we start with a Debian 7.5 "stable" system. However, to
reduce the amount of compilation by hand, we will begin by allowing the
installation of packages from the testing and unstable distributions as
well.
We will stick to "stable" packages where possible, but some packages will
be taken from the other distributions.
Start by modifying @file{/etc/apt/sources.list} to contain the
following (possibly adjusted to point to your mirror of choice):

@example
# These were there before:
deb http://ftp.de.debian.org/debian/ wheezy main
deb-src http://ftp.de.debian.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
deb http://ftp.de.debian.org/debian/ wheezy-updates main
deb-src http://ftp.de.debian.org/debian/ wheezy-updates main

# Add these lines (feel free to adjust the mirror):
deb http://ftp.de.debian.org/debian/ testing main
deb http://ftp.de.debian.org/debian/ unstable main
@end example

The next step is to create/edit your @file{/etc/apt/preferences}
file to look like this:

@example
Package: *
Pin: release a=stable,n=wheezy
Pin-Priority: 700

Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 650

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 600
@end example

You can read more about Apt Preferences here and here.
Note that other pinnings are likely to also work for GNUnet, the key
thing is that you need some packages from unstable (as shown below).
However, as unstable is unlikely to be comprehensive (missing packages)
or might be problematic (crashing packages), you probably want others
from stable and/or testing.

@node Update again
@subsection Update again

Now, run again@

@example
# apt-get update@
# apt-get upgrade@
@end example

to ensure that all your new distribution indices are downloaded, and
that your pinning is correct: the upgrade step should cause no changes
at all.

@node Installing packages
@subsection Installing packages

We begin by installing a few Debian packages from stable:@

@example
# apt-get install gcc make libzbar-dev libltdl-dev libsqlite3-dev \
  libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev \
  texlive libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev \
  libbz2-dev libexiv2-dev libflac-dev libgif-dev libglib2.0-dev \
  libgtk-3-dev libmagic-dev libjpeg8-dev libmpeg2-4-dev libmp4v2-dev \
  librpm-dev libsmf-dev libtidy-dev libtiff5-dev libvorbis-dev \
  libogg-dev zlib1g-dev g++ gettext libgsf-1-dev libunbound-dev \
  libqrencode-dev libgladeui-dev nasm texlive-latex-extra \
  libunique-3.0-dev gawk miniupnpc libfuse-dev libbluetooth-dev
@end example

After that, we install a few more packages from unstable:@

@example
# apt-get install -t unstable nettle-dev libgstreamer1.0-dev \
  gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
  libgstreamer-plugins-base1.0-dev
@end example

@node Installing dependencies from source
@subsection Installing dependencies from source

Next, we need to install a few dependencies from source.
You might want to do this as a "normal" user and only run the
@code{make install} steps as root (hence the @code{sudo} in the
commands below). Also, you do this from any
directory. We begin by downloading all dependencies, then extracting the
sources, and finally compiling and installing the libraries.

For these steps, follow the instructions given in the
installation from source instruction in this order:

@itemize @bullet
@item @ref{generic source installation - libav}
@item @ref{generic source installation - libextractor}
@item @ref{generic source installation - libgpg-error}
@item @ref{generic source installation - libgcrypt}
@item @ref{generic source installation - gnutls}
@item @ref{generic source installation - libmicrohttpd}
@item @ref{generic source installation - libgnurl}
@end itemize

@node Installing GNUnet from source
@subsection Installing GNUnet from source


For this, simply follow the generic installation instructions from
here.

@node But wait there is more!
@subsection But wait there is more!

So far, we installed all of the packages and dependencies required to
ensure that all of GNUnet would be built.
However, while for example the plugins to interact with the MySQL or
Postgres databases have been created, we did not actually install or
configure those databases. Thus, you will need to install
and configure those databases or stick with the default Sqlite database.
Sqlite is usually fine for most applications, but MySQL can offer better
performance and Postgres better resillience.


@node Installing GNUnet from Git on Ubuntu 14.4
@section Installing GNUnet from Git on Ubuntu 14.4

@strong{Install the required build tools:}

@example
$ sudo apt-get install git automake autopoint autoconf
@end example

@strong{Install the required dependencies}

@example
$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
 libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
 libmicrohttpd-dev libgnutls28-dev
@end example

@strong{Choose one or more database backends}

@itemize @bullet

@item SQLite3:

@example
$ sudo apt-get install libsqlite3-dev
@end example

@item MySQL:

@example
$ sudo apt-get install libmysqlclient-dev
@end example

@item PostgreSQL:

@example
$ sudo apt-get install libpq-dev postgresql
@end example

@end itemize

@strong{Install the optional dependencies for gnunet-conversation:}

@example
$ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
@end example

@strong{Install the libgrypt 1.6.1:}

@itemize @bullet

@item For Ubuntu 14.04:

@example
$ sudo apt-get install libgcrypt20-dev
@end example

@item For Ubuntu older 14.04:

@example
$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
$ tar xf libgcrypt-1.6.1.tar.bz2
$ cd libgcrypt-1.6.1
$ ./configure
$ sudo make install
$ cd ..
@end example

@end itemize

@strong{Install libgnurl}

@strong{Install GNUnet}

@example
$ git clone https://gnunet.org/git/gnunet/
$ cd gnunet/
$ ./bootstrap
@end example

If you want to:

@itemize @bullet

@item Install to a different directory:

@example
--prefix=PREFIX
@end example

@item
Have sudo permission, but do not want to compile as root:

@example
--with-sudo
@end example

@item
Want debug message enabled:

@example
--enable-logging=verbose
@end example

@end itemize


@example
$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
$ make; sudo make install
@end example

After installing it, you need to create an empty configuration file:

@example
touch ~/.config/gnunet.conf
@end example

And finally you can start GNUnet with

@example
$ gnunet-arm -s
@end example

@node Build instructions for Debian 8
@section Build instructions for Debian 8
@c FIXME: I -> we

These are the installation instructions for Debian 8. They were tested
sing a fresh Debian 8 AMD64 installation without non-free software (no
contrib or non-free). During installation, I only selected "lxde" for the
desktop environment.
Note that the packages and the dependencies that we will install during
this chapter take about 1.5 GB of disk space. Combined with GNUnet and
space for objects during compilation, you should not even attempt this
unless you have about 2.5 GB free after the Debian installation.
Using these instructions to build a VM image is likely to require a
minimum of 4-5 GB for the VM (as you will likely also want a desktop
manager).

GNUnet's security model assumes that your @code{/home} directory is
encrypted.
Thus, if possible, you should encrypt your entire disk, or at least just
your home partition (or per-user home directory).

Naturally, the exact details of the starting state for your installation
should not matter much.
For example, if you selected any of those installation groups you might
simply already have some of the necessary packages installed. Thus, it is
suggested that you simply install the desktop environment of your choice
before beginning with the instructions.


@menu
* Update Debian::
* Installing Debian Packages::
* Installing Dependencies from Source2::
* Installing GNUnet from Source2::
* But wait (again) there is more!::
@end menu

@node Update Debian
@subsection Update Debian

After any installation, you should begin by running

@example
# apt-get update
# apt-get upgrade
@end example

to ensure that all of your packages are up-to-date. Note that the "#" is
used to indicate that you need to type in this command as "root" (or
prefix with "sudo"), whereas "$" is used to indicate typing in a command
as a normal user.

@node Installing Debian Packages
@subsection Installing Debian Packages

We begin by installing a few Debian packages from stable:

@example
# apt-get install gcc make libzbar-dev libltdl-dev libsqlite3-dev \
libunistring-dev libopus-dev libpulse-dev openssl libglpk-dev texlive \
libidn11-dev libmysqlclient-dev libpq-dev libarchive-dev libbz2-dev \
libflac-dev libgif-dev libglib2.0-dev libgtk-3-dev libmpeg2-4-dev \
libtidy-dev libvorbis-dev libogg-dev zlib1g-dev g++ gettext \
libgsf-1-dev libunbound-dev libqrencode-dev libgladeui-dev nasm \
texlive-latex-extra libunique-3.0-dev gawk miniupnpc libfuse-dev \
libbluetooth-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
libgstreamer-plugins-base1.0-dev nettle-dev libextractor-dev \
libgcrypt20-dev libmicrohttpd-dev
@end example

@node Installing Dependencies from Source2
@subsection Installing Dependencies from Source2

Yes, we said we start with a Debian 8 "stable" system, but because Debian
linked GnuTLS without support for DANE, we need to compile a few things,
in addition to GNUnet, still by hand. Yes, you can run GNUnet using the
respective Debian packages, but then you will not get DANE support.

Next, we need to install a few dependencies from source. You might want
to do this as a "normal" user and only run the @code{make install} steps
as root (hence the @code{sudo} in the commands below). Also, you do this
from any directory. We begin by downloading all dependencies, then
extracting the sources, and finally compiling and installing the
libraries:

@example
$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.xz
$ tar xvf gnutls-3.3.12.tar.xz
$ cd gnutls-3.3.12 ; ./configure ; make ; sudo make install ; cd ..
@end example

For the installation and compilation of libgnurl/gnURL refer to
the generic installation section,
@xref{generic source installation - libgnurl}.

@node Installing GNUnet from Source2
@subsection Installing GNUnet from Source2

For this, simply follow the generic installation instructions from@
here.

@node But wait (again) there is more!
@subsection But wait (again) there is more!

So far, we installed all of the packages and dependencies required to
ensure that all of GNUnet would be built. However, while for example the
plugins to interact with the MySQL or Postgres databases have been
created, we did not actually install or configure those databases.
Thus, you will need to install and configure those databases or stick
with the default Sqlite database. Sqlite is usually fine for most
applications, but MySQL can offer better performance and Postgres better
resillience.

@node Build instructions for macOS
@section Build instructions for macOS
@c FIXME: I -> we

These are the installation guidelines for macOS.
They were tested on macOS High Sierra.

@menu
* Installing dependencies::
* Compile from Source::
@end menu

@node Installing dependencies
@subsection Installing dependencies

First, install XCode in the newest version.
See https://developer.apple.com/xcode/.

Install Homebrew (https://brew.sh) and then install the dependencies listed above.
If a dependency does not exists in brew, you need to compile it from source.

@example
# brew install <dependency>
@end example

@node Compile from Source
@subsection Compile from Source

Before you start building GNUnet, you need to setup your environment.
This means that you have to make sure the proper tools are used in the build process.
For example, after installing texinfo you need to make sure the new texinfo is actually used:

@example
$ echo 'export PATH="/usr/local/opt/texinfo/bin:$PATH"' >> ~/.bash_profile
@end example

Note: brew tells you the appropriate command when executing

@example
$ brew info texinfo
@end example

This may also be necessary for the gettext package.

Before you start compiling, you need to make sure gcc is used and not the clang compile of your macOS system.
On my system, gcc was actually ``gcc-7'' and gcc pointed to the clang compiler.

@example
$ export CC=gcc-7
@end example

You might see configure failing telling you that it ``cannot run C compiled programs.''.
In this case, you might need to open/run Xcode once and you will be prompted to
install additional packages.
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).
Install those and execute

@example
$open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
@end example

Then, configure will pass again.

After this the standard compile instructions apply.

@c @node Build instructions for OpenBSD 6.2
@c @section Build instructions for OpenBSD 6.2

@node Outdated build instructions for previous revisions
@section Outdated build instructions for previous revisions

This chapter contains a collection of outdated, older installation guides.
They are mostly intended to serve as a starting point for writing
up-to-date instructions and should not be expected to work for
GNUnet 0.10.x.
A set of older installation instructions can also be found in the
file @file{doc/outdated-and-old-installation-instructions.txt} in the
source tree of GNUnet.

This file covers old instructions which no longer receive security
updates or any kind of support.

@menu
* Installing GNUnet 0.10.1 on Ubuntu 14.04::
* Building GLPK for MinGW::
* GUI build instructions for Ubuntu 12.04 using Subversion::
@c * Installation with gnunet-update::
* Instructions for Microsoft Windows Platforms (Old)::
@end menu


@node Installing GNUnet 0.10.1 on Ubuntu 14.04
@subsection Installing GNUnet 0.10.1 on Ubuntu 14.04

Install the required dependencies:

@example
$ sudo apt-get install libltdl-dev libgpg-error-dev libidn11-dev \
 libunistring-dev libglpk-dev libbluetooth-dev libextractor-dev \
 libmicrohttpd-dev libgnutls28-dev
@end example

Choose one or more database backends:

@itemize @bullet

@item SQLite3

@example
 $ sudo apt-get install libsqlite3-dev@
@end example

@item MySQL

@example
$ sudo apt-get install libmysqlclient-dev@
@end example

@item PostgreSQL

@example
 $ sudo apt-get install libpq-dev postgresql@
@end example

@end itemize

Install the optional dependencies for gnunet-conversation:

@example
 $ sudo apt-get install gstreamer1.0 libpulse-dev libopus-dev
@end example

Install libgcrypt 1.6:

@itemize @bullet

@item For Ubuntu 14.04:

@example
$ sudo apt-get install libgcrypt20-dev
@end example

@item For Ubuntu older than 14.04:

@example
wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.1.tar.bz2
$ tar xf libgcrypt-1.6.1.tar.bz2
$ cd libgcrypt-1.6.1
$ ./configure
$ sudo make install
$ cd ..
@end example
@end itemize

Install libgnurl:

@pxref{generic source installation - libgnurl}.

Install GNUnet:

@example
$ wget http://ftpmirror.gnu.org/gnunet/gnunet-0.10.1.tar.gz
$ tar xf gnunet-0.10.1.tar.gz
$ cd gnunet-0.10.1
@end example

If you want to:

@itemize @bullet

@item
Install to a different directory:

@example
--prefix=PREFIX
@end example

@item
Have sudo permission, but do not want to compile as root:

@example
--with-sudo
@end example

@item
Want debug message enabled:

@example
--enable-logging=verbose
@end example

@end itemize

@example
$ ./configure [ --with-sudo | --prefix=PREFIX | --enable-logging=verbose]
$ make; sudo make install
@end example

After installing it, you need to create an empty configuration file:

@example
touch ~/.config/gnunet.conf
@end example

And finally you can start GNUnet with

@example
$ gnunet-arm -s
@end example

@node Building GLPK for MinGW
@subsection Building GLPK for MinGW

GNUnet now requires the GNU Linear Programming Kit (GLPK).
Since there's is no package you can install with @code{mingw-get} you
have to compile it from source:

@itemize @bullet

@item Download the latest version from
@uref{http://ftp.gnu.org/gnu/glpk/}

@item Unzip the downloaded source tarball using your favourite
unzipper application In the MSYS shell

@item change to the respective directory

@item Configure glpk for "i686-pc-mingw32":

@example
./configure '--build=i686-pc-mingw32'
@end example

@item run

@example
make install check
@end example

@end itemize

MinGW does not automatically detect the correct buildtype so you have to
specify it manually.


@node GUI build instructions for Ubuntu 12.04 using Subversion
@subsection GUI build instructions for Ubuntu 12.04 using Subversion

After installing GNUnet you can continue installing the GNUnet GUI tools:

First, install the required dependencies:

@example
$ sudo apt-get install libgladeui-dev libqrencode-dev
@end example

Please ensure that the GNUnet shared libraries can be found by the linker.
If you installed GNUnet libraries in a non standard path
(say GNUNET_PREFIX=/usr/local/lib/), you can

@itemize @bullet

@item set the environmental variable permanently to:

@example
LD_LIBRARY_PATH=$GNUNET_PREFIX
@end example

@item or add @code{$GNUNET_PREFIX} to @file{/etc/ld.so.conf}

@end itemize

Now you can checkout and compile the GNUnet GUI tools:

@example
$ git clone https://gnunet.org/git/gnunet-gtk
$ cd gnunet-gtk
$ ./bootstrap
$ ./configure --prefix=$GNUNET_PREFIX/.. --with-gnunet=$GNUNET_PREFIX/..
$ make install
@end example

@node Instructions for Microsoft Windows Platforms (Old)
@subsection Instructions for Microsoft Windows Platforms (Old)

This document is a @b{DEPRECATED} installation guide for GNUnet on
Windows.
It will not work for recent GNUnet versions, but maybe it will be of
some use if problems arise.

The Windows build uses a UNIX emulator for Windows,
@uref{http://www.mingw.org/, MinGW}, to build the executable modules.
These modules run natively on Windows and do not require additional
emulation software besides the usual dependencies.

GNUnet development is mostly done under GNU/Linux and especially git
checkouts may not build out of the box.
We regret any inconvenience, and if you have problems, please report them.

@menu
* Hardware and OS requirements::
* Software installation::
* Building libextractor and GNUnet::
* Installer::
* Source::
@end menu

@node Hardware and OS requirements
@subsubsection Hardware and OS requirements

@itemize @bullet
@item Pentium II or equivalent processor, @geq{} 350 MHz
@item 128 MB RAM
@item 600 MB free disk space
@item Windows 2000 or Windows XP are recommended
@end itemize

@node Software installation
@subsubsection Software installation

@itemize @bullet

@item
@strong{Compression software}@

The software packages GNUnet depends on are usually compressed using UNIX
tools like @command{tar}, @command{gzip}, @command{xzip} and
@command{bzip2}.
If you do not already have an utility that is able to extract such
archives, get @uref{http://www.7-zip.org/, 7-Zip}.

@item
@strong{UNIX environment}@

The MinGW project provides the compiler toolchain that is used to build
GNUnet.
Get the following packages from the
@uref{http://sourceforge.net/projects/mingw/files/, MinGW} project:

@itemize @bullet

@item GCC core
@item GCC g++
@item MSYS
@item MSYS Developer Tool Kit (msysDTK)
@item MSYS Developer Tool Kit - msys-autoconf (bin)
@item MSYS Developer Tool Kit - msys-automake (bin)
@item MinGW Runtime
@item MinGW Utilities
@item Windows API
@item Binutils
@item make
@item pdcurses
@item GDB (snapshot)
@end itemize

@itemize @bullet


@item Install MSYS (to c:\mingw, for example.)@
Do @strong{not} use spaces in the pathname.
For example, avoid a location such as @file{c:\program files\mingw}.

@item Install MinGW runtime, utilities and GCC to a subdirectory
(to @file{c:\mingw\mingw}, for example)

@item Install the Development Kit to the MSYS directory
(@file{c:\mingw})

@item Create a batch file bash.bat in your MSYS directory with
the files:

@example
bin\sh.exe --login
@end example

This batch file opens a shell which is used to invoke the build
processes.
MinGW's standard shell (@command{msys.bat}) is not suitable
because it opens a separate console window.
On Vista, @command{bash.bat} needs to be run as Administrator.

@item
Start @command{bash.sh} and rename
@file{c:\mingw\mingw\lib\libstdc++.la} to avoid problems:

@example
mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken
@end example

@item
Unpack the Windows API to the MinGW directory (@file{c:\mingw\mingw\}) and
remove the declaration of DATADIR from
(@file{c:\mingw\mingw\include\objidl.h} (lines 55-58)

@item
Unpack autoconf, automake to the MSYS directory (@file{c:\mingw})

@item
Install all other packages to the MinGW directory (@file{c:\mingw\mingw\})
@end itemize


@item @strong{GNU Libtool}@
GNU Libtool is required to use shared libraries.
Get the prebuilt package from here and unpack it to the
MinGW directory (@file{c:\mingw})

@item @strong{Pthreads}@
GNUnet uses the portable POSIX thread library for multi-threading:

@itemize @bullet

@item Save
@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a}
(x86) or
@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a}
(x64) as libpthread.a into the @file{lib}
directory (@file{c:\mingw\mingw\lib\libpthread.a}).

@item Save
@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll}
(x86) or
@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a}
(x64) into the MinGW @file{bin} directory (@file{c:\mingw\mingw\bin}).

@item Download all header files from
@uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/}
to the @file{include} directory (@file{c:\mingw\mingw\include}).
@end itemize


@item @strong{GNU MP}@
GNUnet uses the GNU Multiple Precision library for special cryptographic
operations. Get the GMP binary package from the
@uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and
unpack it to the MinGW directory (@file{c:\mingw\mingw})

@item @strong{GNU Gettext}@
GNU gettext is used to provide national language support.
Get the prebuilt package from hereand unpack it to the MinGW
directory (@file{c:\mingw\mingw})

@item @strong{GNU iconv}@
GNU Libiconv is used for character encoding conversion.
Get the prebuilt package from here and unpack it to the MinGW
directory (@file{c:\mingw\mingw}).

@item @strong{SQLite}@
GNUnet uses the SQLite database to store data.
Get the prebuilt binary from here and unpack it to your MinGW directory.

@item @strong{MySQL}@
As an alternative to SQLite, GNUnet also supports MySQL.

@itemize @bullet

@item Get the binary installer from the
@uref{http://dev.mysql.com/downloads/mysql/4.1.html#Windows, MySQL project}
(version 4.1), install it and follow the instructions in
@file{README.mysql}.

@item  Create a temporary build directory (@file{c:\mysql})

@item Copy the directories @file{include\} and @file{lib\} from the
MySQL directory to the new directory

@item Get the patches from
@uref{http://bugs.mysql.com/bug.php?id=8906&files=1, Bug #8906} and
@uref{http://bugs.mysql.com/bug.php?id=8872&files=1, Bug #8872} (the
latter is only required for MySQL

@example
patch -p 0
@end example

@item Move @file{lib\opt\libmysql.dll} to @file{lib\libmysql.dll}

@item  Change to @file{lib\} and create an import library:

@example
dlltool --input-def ../include/libmySQL.def \
--dllname libmysql.dll \
--output-lib libmysqlclient.a -k
@end example

@item  Copy include\* to include\mysql\

@item  Pass @code{--with-mysql=/c/mysql} to
@command{./configure} and copy @file{libmysql.dll}
to your PATH or GNUnet's @file{bin} directory
@end itemize


@item @strong{GTK+}@
@command{gnunet-fs-gtk} and @command{libextractor} depend on GTK.
Get the the binary and developer packages of @command{atk},
@command{glib}, @command{gtk}, @command{iconv},
@command{gettext-runtime}, @command{pango} from
@uref{ftp://ftp.gtk.org/pub/gtk/v2.6/win32, gtk.org} and unpack them
to the MinGW directory (@file{c:\mingw\mingw}).
@c FIXME: The URL below for pkg-config seems wrong.
Get @uref{http://www.gtk.org/download/win32.php, pkg-config} and
@command{libpng} and unpack them to the MinGW directory
(@file{c:\mingw\mingw}).
Here is an all-in-one package for the
@uref{http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip, gtk+dependencies}
. Do not overwrite any existing files!

@item @strong{Glade}@
@command{gnunet-*-gtk} and @command{gnunet-setup} were created using
this interface builder

@itemize @bullet

@item Get the Glade and libglade (-bin and -devel) packages
(without GTK!) from
@uref{http://gladewin32.sourceforge.net/, GladeWin32} and unpack them to
the MinGW directory (@file{c:\mingw\mingw}).

@item Get @command{libxml} from here and unpack it to the MinGW
directory (@file{c:\mingw\mingw}).
@end itemize

@c FIXME: URLs
@item @strong{zLib}@
@command{libextractor} requires @command{zLib} to decompress some file
formats. GNUnet uses it to (de)compress meta-data.
Get zLib from here (Signature) and unpack it to the MinGW directory
(@file{c:\mingw\mingw}).

@item @strong{Bzip2}@
@command{libextractor} also requires @command{Bzip2} to
decompress some file formats.
Get the Bzip2 (binary and developer package) from
@uref{http://gnuwin32.sourceforge.net/packages/bzip2.htm, GnuWin32} and
unpack it to the MinGW directory (@file{c:\mingw\mingw}).

@item @strong{Libgcrypt}@
@command{Libgcrypt} provides the cryptographic functions used by GNUnet.
Get Libgcrypt from @uref{ftp://ftp.gnupg.org/gcrypt/libgcrypt/, here},
compile and place it in the MinGW directory
(@file{c:\mingw\mingw}). Currently libgcrypt @geq{} 1.4.2 is required to
compile GNUnet.

@item @strong{PlibC}@
PlibC emulates Unix functions under Windows. Get PlibC from here and
unpack it to the MinGW directory (c:\mingw\mingw)

@item @strong{OGG Vorbis}@
@command{OGG Vorbis} is used to extract meta-data from @file{.ogg} files.
Get the packages
@uref{http://www.gnunet.org/libextractor/download/win/libogg-1.1.4.zip, libogg}
and
@uref{http://www.gnunet.org/libextractor/download/win/libvorbis-1.2.3.zip, libvorbis}
from the
@uref{http://ftp.gnu.org/gnu/libextractor/libextractor-w32-1.0.0.zip, libextractor win32 build}
and unpack them to the MinGW directory (c:\mingw\mingw).

@item @strong{Exiv2}@
(lib)Exiv2 is used to extract meta-data from files with Exiv2 meta-data.
Download
@uref{http://www.gnunet.org/libextractor/download/win/exiv2-0.18.2.zip, Exiv2}
and unpack it to the MSYS directory (c:\mingw).
@end itemize

@node Building libextractor and GNUnet
@subsubsection Building libextractor and GNUnet

Before you compile @command{libextractor} or @command{GNUnet},
be sure to set @code{PKG_CONFIG_PATH}:

@example
export PKG_CONFIG_PATH=/mingw/lib/pkgconfig
@end example

@noindent
@xref{GNUnet Installation Handbook}, for basic instructions on building
@command{libextractor} and @command{GNUnet}.
By default, all modules that are created in this way contain
debug information and are quite large. To compile release versions
(small and fast) set the variable @code{CFLAGS}:

@example
export CFLAGS='-O2 -march=pentium -fomit-frame-pointer'
./configure --prefix=$HOME --with-extractor=$HOME
@end example

@node Installer
@subsubsection Installer

The GNUnet installer is made with
@uref{http://nsis.sourceforge.net/, NSIS}. The installer script is
located in @file{contrib\win} in the GNUnet source tree.

@node Source
@subsubsection Source

@c FIXME: URL... or: WHERE is HERE?
The sources of all dependencies are available here.