diff options
author | grufo | 2018-03-30 13:12:38 +0200 |
---|---|---|
committer | grufo | 2018-03-30 13:12:38 +0200 |
commit | 4c93de6ac9277d3db04efe1f8a0deed53b0bafc0 (patch) | |
tree | d41b1d3a392a36ea1cdbde50957fc7ef098ac423 | |
parent | 32f8cffec9eb360f7ad8c24c72c56218058c79dc (diff) | |
download | aur-4c93de6ac9277d3db04efe1f8a0deed53b0bafc0.tar.gz |
New PKGBUILD
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 74 | ||||
-rw-r--r-- | defaults.conf | 483 | ||||
-rw-r--r-- | gnunet.install | 45 | ||||
-rw-r--r-- | gnunet.service | 4 |
5 files changed, 106 insertions, 508 deletions
@@ -1,13 +1,15 @@ pkgbase = gnunet-git pkgdesc = A framework for secure peer-to-peer networking - pkgver = r25770.de5018639 + pkgver = 0.11.0.r25783.a01ee0d0c pkgrel = 1 url = http://gnunet.org + install = gnunet.install arch = x86_64 license = GPL makedepends = gettext makedepends = pkgconfig makedepends = autoconf + makedepends = fakeuser-git makedepends = bluez-libs makedepends = python makedepends = glpk @@ -32,10 +34,8 @@ pkgbase = gnunet-git backup = etc/gnunetd.conf source = git+https://gnunet.org/git/gnunet.git source = gnunet.service - source = defaults.conf md5sums = SKIP - md5sums = 54cce3d2415d95b2e5bd1bd88db3a0ea - md5sums = 0fe23b2ca5b3fc47a0b5645e04406da0 + md5sums = a64f19ce71c02c200fa78ca2d1585bc8 pkgname = gnunet-git @@ -1,10 +1,12 @@ # Maintainer: grufo <madmurphy333 AT gmail DOT com> -# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> -# Contributor: wahnby <wahnby@yahoo.fr> +# Contributor: redfish <redfish AT galactica DOT pw> +# Contributor: kertase <kertase AT gmail DOT com> +# Contributor: Sergej Pupykin <pupykin DOT s+arch AT gmail.com> +# Contributor: wahnby <wahnby AT yahoo DOT fr> pkgname='gnunet-git' _appname='gnunet' -pkgver='r25770.de5018639' +pkgver='0.11.0.r25783.a01ee0d0c' pkgrel=1 pkgdesc="A framework for secure peer-to-peer networking" arch=('x86_64') @@ -14,29 +16,45 @@ provides=("${_appname}") conflicts=("${_appname}") depends=('gmp' 'libgcrypt' 'libextractor' 'sqlite' 'gnurl' 'libmicrohttpd' 'libunistring' 'libidn') -makedepends=('gettext' 'pkgconfig' 'autoconf' +makedepends=('gettext' 'pkgconfig' 'autoconf' 'fakeuser-git' 'bluez-libs' 'python' 'glpk' 'libpulse' 'opus') optdepends=('bluez-libs' 'python' 'glpk' 'libpulse' 'opus') - +install='gnunet.install' backup=('etc/gnunetd.conf') options=('!makeflags') source=("git+https://gnunet.org/git/${_appname}.git" - 'gnunet.service' - 'defaults.conf') + 'gnunet.service') md5sums=('SKIP' - '54cce3d2415d95b2e5bd1bd88db3a0ea' - '0fe23b2ca5b3fc47a0b5645e04406da0') + 'a64f19ce71c02c200fa78ca2d1585bc8') + +_fakeadd_error() { + + echo "You must have a 'gnunet' user and group, and additionally a 'gnunetdns' group in" + echo 'your system prior to building this package.' + echo + echo 'You can do:' + echo + echo ' groupadd -r gnunet' + echo ' useradd -r -l -g gnunet -d /var/lib/gnunet gnunet' + echo ' groupadd -r gnunetdns' + + return 1 + +} pkgver() { cd "${_appname}" - printf "'r%s.%s'" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + printf "'%s.r%s.%s'" \ + "$(grep 'AC_INIT' configure.ac | grep -o '[0-9]\(\.[0-9]\+\)\+')" \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short HEAD)" } @@ -46,26 +64,42 @@ prepare() { autoreconf -fi sed -i 's|contrib doc|doc|' Makefile.* [ -f Makefile ] || ./configure --prefix=/usr \ - --without-mysql \ - --with-nssdir=/usr/lib + --without-mysql + + # enable fakeadd under fakeroot environment + export LD_PRELOAD='/usr/lib/fakeuser/libfakeuser.so' } -build() { +package() { + + local _gnunet_guid=714 + local _gnunetdns_gid=715 cd "${srcdir}/${_appname}" - make - make -C contrib -} + install -dm755 "${pkgdir}/etc" + touch "${pkgdir}/etc/gnunetd.conf" -package() { + # fakeadd + getent group gnunet > /dev/null || fakeadd -G -n gnunet -g ${_gnunet_guid} || _fakeadd_error + getent passwd gnunet > /dev/null || fakeadd -U -n gnunet -u ${_gnunet_guid} -g ${_gnunet_guid} -d /var/lib/gnunet || _fakeadd_error + getent group gnunetdns > /dev/null || fakeadd -G -n gnunetdns -g ${_gnunetdns_gid} || _fakeadd_error + install -dm755 "${pkgdir}/var/lib/gnunet" + chown gnunet:gnunet "${pkgdir}/var/lib/gnunet" - cd "${srcdir}/${_appname}" + if ! getent group gnunet > /dev/null || ! getent passwd gnunet > /dev/null || ! getent group gnunetdns > /dev/null || [[ $(stat -c %u "${pkgdir}/var/lib/gnunet") -ne ${_gnunet_guid} ]]; then + _fakeadd_error + fi + + # build + # ...I know, `make` should be inside `build()`... But we need the power of fakeadd+fakeroot *while* building! + make + make -C contrib + + # install make DESTDIR="${pkgdir}" install make DESTDIR="${pkgdir}" -C contrib install - install -D -m0644 "${srcdir}/defaults.conf" "${pkgdir}/etc/gnunetd.conf" - rm -rf "${pkgdir}/usr/include/libltdl" "${pkgdir}/usr/lib/libltdl".* "${pkgdir}/usr/include/ltdl.h" install -Dm0644 "${srcdir}/${_appname}.service" "${pkgdir}/usr/lib/systemd/system/${_appname}.service" } diff --git a/defaults.conf b/defaults.conf deleted file mode 100644 index bb419343320d..000000000000 --- a/defaults.conf +++ /dev/null @@ -1,483 +0,0 @@ -[PATHS] -SERVICEHOME = ~/.gnunet/ -# SERVICEHOME = /var/lib/gnunet/ -# DEFAULTCONFIG = /etc/gnunet.conf -# If 'DEFAULTCONFIG' is not defined, the current -# configuration file is assumed to be the default, -# which is what we want by default... - -[gnunetd] -HOSTKEY = $SERVICEHOME/.hostkey - -[TESTING] -WEAKRANDOM = NO -# How long before failing a connection? -CONNECT_TIMEOUT = 30 -# How many connect attempts should we make? -CONNECT_ATTEMPTS = 3 -# How many connections can happen simultaneously? -MAX_OUTSTANDING_CONNECTIONS = 50 - -# Should we clean up the files on peer group shutdown? -DELETE_FILES = YES - -[client] -HOME = $SERVICEHOME - -[nat] -# Are we behind NAT? -BEHIND_NAT = NO - -# Is the NAT hole-punched? -PUNCHED_NAT = NO - -# Enable UPNP by default? -ENABLE_UPNP = NO - -# Use addresses from the local network interfaces (inluding loopback, but also others) -USE_LOCALADDR = YES - -# Use address obtained from a DNS lookup of our hostname -USE_HOSTNAME = NO - -# External IP address of the NAT box (if known); IPv4 dotted-decimal ONLY at this time (should allow DynDNS!) -# normal interface IP address for non-NATed peers; -# possibly auto-detected (using UPnP) if possible if not specified -# EXTERNAL_ADDRESS = - -# Should we use ICMP-based NAT traversal to try connect to NATed peers -# or, if we are behind NAT, to allow connections to us? -ENABLE_ICMP_CLIENT = NO -ENABLE_ICMP_SERVER = NO - -# IP address of the interface connected to the NAT box; IPv4 dotted-decimal ONLY; -# normal interface IP address for non-NATed peers; -# likely auto-detected (via interface list) if not specified (!) -# INTERNAL_ADDRESS = - -# Disable IPv6 support -DISABLEV6 = NO - -# How often do we query the DNS resolver -# for our hostname (to get our own IP), in ms -HOSTNAME_DNS_FREQUENCY = 1200000 - -# How often do we iterate over our -# network interfaces to check for changes -# in our IP address? in ms -IFC_SCAN_FREQUENCY = 3000000 - -# How often do we query the DNS resolver -# for our hostname (to get our own IP), in ms -DYNDNS_FREQUENCY = 140000 - -[gnunet-nat-server] -HOSTNAME = gnunet.org -PORT = 5724 - -[transport-tcp] -# Use 0 to ONLY advertise as a peer behind NAT (no port binding) -PORT = 2086 -ADVERTISED_PORT = 2086 - -# Maximum number of open TCP connections allowed -MAX_CONNECTIONS = 128 - -TIMEOUT = 5000 - -# ACCEPT_FROM = -# ACCEPT_FROM6 = -# REJECT_FROM = -# REJECT_FROM6 = -# BINDTO = - -MAX_CONNECTIONS = 128 - - -[transport-udp] -PORT = 2086 - -MAX_BPS = 1000000 - - -[transport-http] -PORT = 1080 -MAX_CONNECTIONS = 128 - -[transport-https] -PORT = 4433 -CRYPTO_INIT = NORMAL -KEY_FILE = https.key -CERT_FILE = https.cert -MAX_CONNECTIONS = 128 - - -[transport-wlan] -# Name of the interface in monitor mode (typically monX) -INTERFACE = mon0 -# Real hardware, no testing -TESTMODE = 0 - - -[arm] -PORT = 2087 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-arm -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -DEFAULTSERVICES = topology hostlist -UNIXPATH = /tmp/gnunet-service-arm.sock -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -# GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs -# GLOBAL_PREFIX = -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = - -[statistics] -AUTOSTART = YES -PORT = 2088 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-statistics -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/gnunet-service-statistics.sock -UNIX_MATCH_UID = NO -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = - -[resolver] -AUTOSTART = YES -PORT = 2089 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-resolver -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/gnunet-service-resolver.sock -UNIX_MATCH_UID = NO -UNIX_MATCH_GID = NO -# DISABLE_SOCKET_FORWARDING = NO -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = - -[peerinfo] -AUTOSTART = YES -PORT = 2090 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-peerinfo -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/gnunet-service-peerinfo.sock -UNIX_MATCH_UID = NO -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = -HOSTS = $SERVICEHOME/data/hosts/ - - -[transport] -AUTOSTART = YES -PORT = 2091 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-transport -#PREFIX = valgrind -NEIGHBOUR_LIMIT = 50 -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -PLUGINS = tcp -UNIXPATH = /tmp/gnunet-service-transport.sock -BLACKLIST_FILE = $SERVICEHOME/blacklist -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = - - -# ATS options -DUMP_MLP = NO -DUMP_SOLUTION = NO -DUMP_OVERWRITE = NO -DUMP_MIN_PEERS = 0 -DUMP_MIN_ADDRS = 0 -DUMP_OVERWRITE = NO -ATS_MIN_INTERVAL = 15000 -ATS_EXEC_INTERVAL = 30000 - - -[core] -AUTOSTART = YES -PORT = 2092 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-core -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -# quotas are in bytes per second now! -TOTAL_QUOTA_IN = 65536 -TOTAL_QUOTA_OUT = 65536 -UNIXPATH = /tmp/gnunet-service-core.sock -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# DEBUG = YES -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = - - -[topology] -MINIMUM-FRIENDS = 0 -FRIENDS-ONLY = NO -AUTOCONNECT = YES -TARGET-CONNECTION-COUNT = 16 -FRIENDS = $SERVICEHOME/friends -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-daemon-topology - -[hostlist] -# port for hostlist http server -HTTPPORT = 8080 -HOME = $SERVICEHOME -HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-daemon-hostlist -# consider having "-e" as default as well once implemented -OPTIONS = -b -SERVERS = http://v9.gnunet.org:58080/ -# proxy for downloading hostlists -HTTP-PROXY = - - -[datastore] -AUTOSTART = YES -UNIXPATH = /tmp/gnunet-service-datastore.sock -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -PORT = 2093 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-datastore -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -QUOTA = 100000000 -BLOOMFILTER = $SERVICEHOME/fs/bloomfilter -DATABASE = sqlite -# DISABLE_SOCKET_FORWARDING = NO - -[datastore-sqlite] -FILENAME = $SERVICEHOME/datastore/sqlite.db - -[datastore-postgres] -CONFIG = connect_timeout=10; dbname=gnunet - -[datastore-mysql] -DATABASE = gnunet -CONFIG = ~/.my.cnf -# USER = gnunet -# PASSWORD = -# HOST = localhost -# PORT = 3306 - -[datacache-mysql] -DATABASE = gnunetcheck -CONFIG = ~/.my.cnf -# USER = gnunet -# PASSWORD = -# HOST = localhost -# PORT = 3306 - - -[fs] -AUTOSTART = YES -INDEXDB = $SERVICEHOME/idxinfo.lst -TRUST = $SERVICEHOME/data/credit/ -IDENTITY_DIR = $SERVICEHOME/identities/ -STATE_DIR = $SERVICEHOME/persistence/ -UPDATE_DIR = $SERVICEHOME/updates/ -PORT = 2094 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-fs -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; - -DELAY = YES -CONTENT_CACHING = YES -CONTENT_PUSHING = YES - -UNIXPATH = /tmp/gnunet-service-fs.sock -UNIX_MATCH_UID = NO -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# DEBUG = YES -MAX_PENDING_REQUESTS = 65536 -# Maximum frequency we're allowed to poll the datastore -# for content for migration (can be used to reduce -# GNUnet's disk-IO rate) -MIN_MIGRATION_DELAY = 100 -EXPECTED_NEIGHBOUR_COUNT = 128 - -[dht] -AUTOSTART = YES -PORT = 2095 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-dht -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -BUCKET_SIZE = 4 -UNIXPATH = /tmp/gnunet-service-dht.sock -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -# DISABLE_SOCKET_FORWARDING = NO -# DEBUG = YES -# USERNAME = -# MAXBUF = -# TIMEOUT = -# DISABLEV6 = -# BINDTO = -# REJECT_FROM = -# REJECT_FROM6 = -# PREFIX = -# DO_FIND_PEER = -# STRICT_KADEMLIA = -# USE_MAX_HOPS = -# MAX_HOPS = -# REPUBLISH = YES -# REPLICATION_FREQUENCY = 60 -# STOP_ON_CLOSEST = -# STOP_FOUND = -# CONVERGE_MODIFIER = - - -[dhtcache] -DATABASE = sqlite -QUOTA = 1024000 - -[block] -PLUGINS = fs dht test dns - -[mesh] -AUTOSTART = YES -PORT = 2096 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-mesh -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/gnunet-service-mesh.sock -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES - -[nse] -AUTOSTART = YES -PORT = 2097 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-nse -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/test-nse-service-nse.unix -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES -PROOFFILE = $SERVICEHOME/.nse-proof -HISTOGRAM = $SERVICEHOME/nse-history.log - -# How 'slowly' should the proof-of-work be constructed (delay -# between rounds in ms); sane values between 0 and ~1000. -WORKDELAY = 5 - -# Note: changing any of the values below will make this peer -# completely incompatible with other peers! -INTERVAL = 3600000 -WORKBITS = 20 - - -[vpn] -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-daemon-vpn -IPV6ADDR = 1234::1 -IPV6PREFIX = 32 -IPV4ADDR = 10.11.10.1 -IPV4MASK = 255.255.0.0 -VIRTDNS = 10.11.10.2 -IFNAME = vpn-gnunet - -[exit] -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-daemon-exit -IPV6ADDR = 1234:1::1 -IPV6PREFIX = 32 -IPV4ADDR = 10.10.1.1 -IPV4MASK = 255.255.0.0 -IFNAME = exit-gnunet -ENABLE_UDP = NO -ENABLE_TCP = NO - -[dns] -AUTOSTART = YES -PORT = 0 -HOSTNAME = localhost -HOME = $SERVICEHOME -CONFIG = $DEFAULTCONFIG -BINARY = gnunet-service-dns -ACCEPT_FROM = 127.0.0.1; -ACCEPT_FROM6 = ::1; -UNIXPATH = /tmp/gnunet-service-dns.sock -PROVIDE_EXIT = NO - diff --git a/gnunet.install b/gnunet.install new file mode 100644 index 000000000000..563eb7d91a76 --- /dev/null +++ b/gnunet.install @@ -0,0 +1,45 @@ +# Please, synch these two variables with the ones with the same name in PKGBUILD +_gnunet_guid=714 +_gnunetdns_gid=715 + +post_install() { + + if ! getent passwd gnunet > /dev/null; then + + if ! getent group gnunet > /dev/null; then + + echo "Creating group 'gnunet'..." + groupadd gnunet -g ${_gnunet_guid} + + fi + + echo "Creating user 'gnunet'..." + useradd -r -l -u ${_gnunet_guid} -g ${_gnunet_guid} -d /var/lib/gnunet gnunet + + fi + + chown gnunet:gnunet '/var/lib/gnunet' + + if ! getent group gnunetdns > /dev/null; then + + echo "Creating group 'gnunetdns'..." + groupadd gnunetdns -g ${_gnunetdns_gid} + + fi + +} + +post_remove() { + + getent passwd gnunet > /dev/null && userdel gnunet + getent group gnunet > /dev/null && groupdel gnunet + getent group gnunetdns > /dev/null && groupdel gnunetdns + +} + +post_upgrade() { + + post_install + +} + diff --git a/gnunet.service b/gnunet.service index 5625978a5e50..f4bf3a2d326e 100644 --- a/gnunet.service +++ b/gnunet.service @@ -2,9 +2,11 @@ Description=A framework for secure peer-to-peer networking [Service] -User=nobody +User=gnunet Type=forking ExecStart=/usr/bin/gnunet-arm -s -c /etc/gnunetd.conf +ExecStop=/usr/bin/gnunet-arm -e -c /etc/gnunetd.conf +GuessMainPID=no [Install] WantedBy=multi-user.target |