aboutsummaryrefslogtreecommitdiff
path: root/contrib/packages
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/packages')
-rw-r--r--contrib/packages/fedora/10-dns2gns.sh43
-rw-r--r--contrib/packages/fedora/gnunet-system.conf12
-rw-r--r--contrib/packages/fedora/gnunet-user.service11
-rw-r--r--contrib/packages/fedora/gnunet.service14
-rw-r--r--contrib/packages/guix/guix.README29
-rw-r--r--contrib/packages/guix/guix.scm51
6 files changed, 160 insertions, 0 deletions
diff --git a/contrib/packages/fedora/10-dns2gns.sh b/contrib/packages/fedora/10-dns2gns.sh
new file mode 100644
index 000000000..b652a9c0c
--- /dev/null
+++ b/contrib/packages/fedora/10-dns2gns.sh
@@ -0,0 +1,43 @@
1#!/bin/bash
2interface=$1
3status=$2
4
5do_it=$(gnunet-config -s dns2gns -o ENABLE_RESOLVECTL_NMDISPATCHER -c /etc/gnunet.conf)
6if [ $? != 0 ]; then
7 exit 1
8fi
9if [ $do_it = "NO" ]; then
10 echo "Setting DNS2GNS through resolvectl disabled."
11 exit 1
12fi
13
14case $status in
15 up)
16 if nc -u -z 127.0.0.1 5353; then
17 # Note: We add quad 9 as a fallback in case our service is down.
18 dns2gns=$(gnunet-config -s dns2gns -o BIND_TO)
19 if [ $? != 0 ]; then
20 exit 1
21 fi
22 dns2gns6=$(gnunet-config -s dns2gns -o BIND_TO6)
23 if [ $? != 0 ]; then
24 exit 1
25 fi
26 port=$(gnunet-config -s dns2gns -o PORT)
27 if [ $? != 0 ]; then
28 exit 1
29 fi
30 olddns=$(resolvectl status $interface | grep "DNS Servers" | cut -d':' -f2-)
31 if [ $? == 0 ]; then
32 #echo "Setting to $dns2gns:$port [$dns2gns6]:$port $olddns 9.9.9.9"
33 #resolvectl dns $interface $dns2gns:$port [$dns2gns6]:$port $olddns 9.9.9.9
34 echo "Setting to $dns2gns:$port [$dns2gns6]:$port"
35 resolvectl dns $interface $dns2gns:$port [$dns2gns6]:$port
36 else
37 exit 1
38 fi
39 fi
40 ;;
41 down)
42 ;;
43esac
diff --git a/contrib/packages/fedora/gnunet-system.conf b/contrib/packages/fedora/gnunet-system.conf
new file mode 100644
index 000000000..a0b99dfeb
--- /dev/null
+++ b/contrib/packages/fedora/gnunet-system.conf
@@ -0,0 +1,12 @@
1[path]
2GNUNET_HOME = /var/lib/gnunet/
3GNUNET_DATA_HOME = /var/lib/gnunet/data/
4GNUNET_RUNTIME_DIR = /var/run/gnunet/
5
6[arm]
7START_SYSTEM_SERVICES = YES
8START_USER_SERVICES = NO
9OPTIONS = -l /var/log/gnunet.log
10
11[dns2gns]
12ENABLE_RESOLVECTL_NMDISPATCHER = YES
diff --git a/contrib/packages/fedora/gnunet-user.service b/contrib/packages/fedora/gnunet-user.service
new file mode 100644
index 000000000..c9d3be0ad
--- /dev/null
+++ b/contrib/packages/fedora/gnunet-user.service
@@ -0,0 +1,11 @@
1# Typically to be place into /usr/lib/systemd/user/gnunet.service
2[Unit]
3Description=GNUnet user service
4After=network.target
5
6[Service]
7Type=simple
8ExecStart=/usr/lib/gnunet/libexec/gnunet-service-arm -c ~/.config/gnunet.conf
9
10[Install]
11WantedBy=multi-user.target
diff --git a/contrib/packages/fedora/gnunet.service b/contrib/packages/fedora/gnunet.service
new file mode 100644
index 000000000..daa38a046
--- /dev/null
+++ b/contrib/packages/fedora/gnunet.service
@@ -0,0 +1,14 @@
1# Typically placed into /usr/lib/systemd/system/gnunet.service
2[Unit]
3Description=GNUnet system service
4After=network.target
5
6[Service]
7Type=simple
8User=gnunet
9ExecStart=/usr/lib/gnunet/libexec/gnunet-service-arm -c /etc/gnunet.conf
10StateDirectory=gnunet
11StateDirectoryMode=0700
12
13[Install]
14WantedBy=multi-user.target
diff --git a/contrib/packages/guix/guix.README b/contrib/packages/guix/guix.README
new file mode 100644
index 000000000..1e8bd3126
--- /dev/null
+++ b/contrib/packages/guix/guix.README
@@ -0,0 +1,29 @@
1guix.scm contains Guix package definitions that can be used to
2override the ones found in Guix's GNU distribution.
3
4Guix packagers are encouraged to adopt and adjust these definitions.
5
6GNUnet developers can use this for easily setting up a development or
7test environment using Guix.
8
9When using the package definition for building a package this will
10pick up the current development code. The version of the resulting
11package is the output of 'git describe --tags'.
12
13To make guix build the development package defined here, use the
14following command:
15
16 guix build -f <gnunet.git>/contrib/guix
17
18To spawn a (development) environment with GNUnet's dependencies
19installed, run:
20
21 guix environment --load-path=<gnunet.git>/contrib/guix.scm
22
23To spawn a (test) environment with GNUnet available in this
24environment, run:
25
26 guix environment --load-path=<gnunet.git>/contrib/guix.scm --ad-hoc guix
27
28It is recommended to also pass the '--pure' option to guix, to make
29sure the environment is not polluted with existing packages.
diff --git a/contrib/packages/guix/guix.scm b/contrib/packages/guix/guix.scm
new file mode 100644
index 000000000..4376d1ef5
--- /dev/null
+++ b/contrib/packages/guix/guix.scm
@@ -0,0 +1,51 @@
1;;; guix.scm -- Guix package definition
2
3(use-modules
4 (guix git-download)
5 (guix download)
6 (guix packages)
7 (guix utils)
8 (guix gexp)
9 (gnu packages)
10 (gnu packages autotools)
11 (gnu packages gettext)
12 (gnu packages gnunet)
13 (gnu packages image)
14 (gnu packages texinfo)
15 (srfi srfi-1)
16 (ice-9 popen)
17 (ice-9 rdelim))
18
19(define %source-dir (dirname (dirname (current-filename))))
20
21(define %git-commit
22 (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ)))
23
24(define-public gnunet-git
25 (package
26 (inherit gnunet)
27 (name "gnunet")
28 (version (git-version (package-version gnunet) "HEAD" %git-commit))
29 (source (local-file %source-dir #:recursive? #t))
30 (inputs
31 `(("libjpeg" ,libjpeg)
32 ,@(package-inputs gnunet)))
33 (native-inputs
34 `(("autoconf" ,autoconf)
35 ("automake" ,automake)
36 ("gettext" ,gnu-gettext)
37 ("libtool" ,libtool)
38 ("texinfo" ,texinfo)
39 ("which" ,(@ (gnu packages base) which))
40 ,@(package-native-inputs gnunet)))
41 (arguments
42 (substitute-keyword-arguments (package-arguments gnunet)
43 ((#:phases phases)
44 `(modify-phases ,phases
45 (add-after 'unpack 'make-po-directory-writable
46 (lambda _
47 (for-each make-file-writable
48 (find-files "po" "."))
49 #t))))))))
50
51gnunet-git