Subject: [alpine-devel] initial commit of cjdns apk

From: stef <[email-masked]>
Date: Thu, 15 May 2014 22:31:16 +0200

>From b085ce799f4960a85be5c239fefba37e3cc74561 Mon Sep 17 00:00:00 2001
From: stef <[email-masked]>
Date: Thu, 15 May 2014 19:35:21 +0000
Subject: [PATCH] initial packeting of cjdns

---
 testing/cjdns/APKBUILD           | 50 ++++++++++++++++++++++++++++++++++++++++
 testing/cjdns/cjdns.post-install |  9 ++++++++
 testing/cjdns/nosysctl.patch     | 12 ++++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 testing/cjdns/APKBUILD
 create mode 100755 testing/cjdns/cjdns.post-install
 create mode 100644 testing/cjdns/nosysctl.patch

diff --git a/testing/cjdns/APKBUILD b/testing/cjdns/APKBUILD
new file mode 100644
index 0000000..94354bf
--- /dev/null
+++ b/testing/cjdns/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor:
+# Maintainer: [email-masked]
+pkgname=cjdns
+pkgver=0.1
+pkgrel=0
+pkgdesc="CJDNS mesh vpn"
+url="https://github.com/cjdelisle/cjdns/"
+arch="all"
+license="GPL3"
+depends="libsodium"
+makedepends="$depends_dev git nodejs python"
+install="$pkgname.post-install"
+#subpackages="$pkgname-dev $pkgname-doc"
+source="${pkgname}-master.zip::https://github.com/cjdelisle/cjdns/archive/master.zip nosysctl.patch $install"
+
+_builddir="$srcdir/$pkgname-master"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	./do || return 1
+   gzip -c "doc/man/cjdroute.conf.5" >cjdroute.conf.5.gz
+}
+
+doc() {
+	cd "$_builddir"
+   install -Dm644 cjdroute.conf.5.gz "${pkgdir}-doc/usr/share/man/man5/cjdroute.conf.5.gz"
+}
+
+package() {
+	cd "$_builddir"
+   install -Dm755 cjdroute "${pkgdir}/usr/bin/cjdroute"
+}
+md5sums="bb0a7690f1cfd5a2af376b3db2bd50c9  cjdns-master.zip
+4c4f9a8ecc7d7de6bb7adda8ab0fc655  nosysctl.patch
+4babf3bd9de5b93be96253a44dabf9cc  cjdns.post-install"
+sha256sums="499c454c28945eff785b710d68bb27f0617652ecb75826515c2cf2eba5037080  cjdns-master.zip
+fbb57d1f0afeb9fa88d96290846de080d5f30fd40475b488e6d7c512b3cd96ef  nosysctl.patch
+eddba294b813b8e08f8ad4cead6f97d9a0e8bbd662850ce1a1daf8d27e6469f8  cjdns.post-install"
+sha512sums="254304cdfcd66e9c9cdb4da3fec4eec7bb2a9a9871e519da825cacf55cb8e8da0eb7a57fb6f154bb7bff3e9338ad428eee81b3e06e1a0bd26642ab8f773258e8  cjdns-master.zip
+a5cd84781fee5c9b685b5512facc0230ca9141ee9f2a1c9e6db9f3365151e0e5967e8f63e3aa16a71b3367283359c25ddeee9e512b462f5e89cddc15c5c576e5  nosysctl.patch
+d2a390f4f5596cc80917b0b17458484f545253e1d249ebd0769cc5b399e031d1ce98ad3e8eadb42198a3e9f289c808d8d2d936bfed8c739784d5634a8c840495  cjdns.post-install"
diff --git a/testing/cjdns/cjdns.post-install b/testing/cjdns/cjdns.post-install
new file mode 100755
index 0000000..afaada3
--- /dev/null
+++ b/testing/cjdns/cjdns.post-install
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ ! -f /etc/cjdroute.conf ]; then
+   echo creating new config file
+   umask 077
+   /usr/bin/cjdroute --genconf >/etc/cjdroute.conf
+else
+   echo keeping existing config intact
+fi
diff --git a/testing/cjdns/nosysctl.patch b/testing/cjdns/nosysctl.patch
new file mode 100644
index 0000000..e23cffb
--- /dev/null
+++ b/testing/cjdns/nosysctl.patch
@@ -0,0 +1,12 @@
+diff -urw cjdns-master/crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.h cjdns-musl/crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.h
+--- cjdns-master/crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.h	2014-05-15 10:03:22.676666666 +0000
++++ cjdns-musl/crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.h	2014-05-15 10:02:30.586666666 +0000
+@@ -20,7 +20,7 @@
+ #include "memory/Allocator.h"
+ #include "util/Linker.h"
+ 
+-#if defined(linux) && !defined(__ILP32__) && !defined(android)
++#if defined(linux) && !defined(__ILP32__) && !defined(android) && defined(no_musl)
+     Linker_require("crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c")
+     struct RandomSeed* LinuxRandomUuidSysctlRandomSeed_new(struct Allocator* alloc);
+     RandomSeedProvider_register(LinuxRandomUuidSysctlRandomSeed_new)
-- 
1.9.3

---

From: Natanael Copa <[email-masked]>
Date: Mon, 19 May 2014 16:10:56 +0200

On Thu, 15 May 2014 22:31:16 +0200

> +     Linker_require("crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c")

defined(no_musl) looks wrong... Why is it needed?

I applied as is, anyways

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 19 May 2014 16:21:34 +0200

On Mon, 19 May 2014 16:10:56 +0200

Actually, I didn't apply it due to:

>>> cjdns: Fetching https://github.com/cjdelisle/cjdns/archive/master.zip
...
>>> cjdns: Checking sha512sums...
cjdns-master.zip: FAILED
sha512sum: WARNING: 1 of 1 computed checksums did NOT match
Because the remote file above failed the sha512sum check it will be deleted.
Rebuilding will cause it to re-download which in some cases may fix the
problem.

+source="${pkgname}-master.zip::https://github.com/cjdelisle/cjdns/archive/master.zip

You need put the versio number in there and use git tags. The master.zip will change for each download.

-nc

---