diff options
author | Haruue Icymoon | 2017-12-06 18:44:10 +0800 |
---|---|---|
committer | Haruue Icymoon | 2017-12-06 18:46:52 +0800 |
commit | 0725824fbb0ef6aeb6b3ddcb745aad102326396d (patch) | |
tree | fd47c086bba6845be779ee4fb21fbe24800a208f | |
parent | 7d1d269fb218f26aa1fd7267054005d3d777ffca (diff) | |
download | aur-0725824fbb0ef6aeb6b3ddcb745aad102326396d.tar.gz |
migrate: git version
- fix: compile against openssl-1.0
- fix: service failed with SIGBUS for permission problem
Signed-off-by: Haruue Icymoon <haruue@caoyue.com.cn>
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | 0001-archlinux-openssl-1.0.patch | 13 | ||||
-rw-r--r-- | PKGBUILD | 77 | ||||
-rw-r--r-- | electroneum.install | 18 | ||||
-rw-r--r-- | electroneumd.service | 18 |
6 files changed, 123 insertions, 31 deletions
@@ -1,11 +1,13 @@ -pkgbase = electroneum - pkgdesc = Secure, private, mobile based cryptocurrency - pkgver = 0.11.0.0 - pkgrel = 1 +pkgbase = electroneum-git + pkgdesc = Secure, private, mobile based cryptocurrency, git version + pkgver = 0.11.0.0.r12.g31af2ce5 + pkgrel = 4 url = https://electroneum.com + install = electroneum.install arch = any license = custom makedepends = cmake + makedepends = git depends = boost depends = openssl depends = unbound @@ -15,8 +17,16 @@ pkgbase = electroneum optdepends = expat: XML parsing optdepends = doxygen: documentation optdepends = graphviz: documentation - source = https://github.com/electroneum/electroneum/archive/v0.11.0.0.tar.gz - md5sums = 0c459d99d18db514ba66f1df84e92daa + provides = electroneum=0.11.0.0.r12.g31af2ce5 + conflicts = electroneum + options = !strip + backup = etc/electroneumd.conf + source = electroneum::git+https://github.com/electroneum/electroneum.git + source = electroneumd.service + source = 0001-archlinux-openssl-1.0.patch + md5sums = SKIP + md5sums = 614c615d7218e4745bb6016644e71156 + md5sums = ae1bcb862a92f9996a08a0025d828e0f -pkgname = electroneum +pkgname = electroneum-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..00ae84887f12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.tar.* +/electroneum +/src +/pkg diff --git a/0001-archlinux-openssl-1.0.patch b/0001-archlinux-openssl-1.0.patch new file mode 100644 index 000000000000..771e7c904f45 --- /dev/null +++ b/0001-archlinux-openssl-1.0.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 4f6e6465..9ebd3706 100644 +--- a/Makefile ++++ b/Makefile +@@ -64,7 +64,7 @@ release-all: + + release-static: + mkdir -p build/release +- cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) ++ cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -DOPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0 -DOPENSSL_SSL_LIBRARY=/usr/lib/libssl.so.1.0.0 -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.so.1.0.0 ../.. && $(MAKE) + + coverage: + mkdir -p build/debug @@ -1,31 +1,53 @@ -# Maintainer: Tim Diels <timdiels.m@gmail.com> +# Maintainer: Haruue Icymoon <i@haruue.moe> +# Contributor: Tim Diels <timdiels.m@gmail.com> -pkgname=electroneum -pkgver=0.11.0.0 -pkgrel=1 -pkgdesc='Secure, private, mobile based cryptocurrency ' +pkgname=electroneum-git +pkgver=0.11.0.0.r12.g31af2ce5 +pkgrel=4 +pkgdesc='Secure, private, mobile based cryptocurrency, git version' arch=('any') url='https://electroneum.com' license=('custom') -makedepends=('cmake') +makedepends=('cmake' 'git') depends=('boost' 'openssl' 'unbound') #checkdepends=('gtest') optdepends=( - 'miniupnpc: NAT punching' - 'libunwind: stack traces' - 'ldns: SSL toolkit' - 'expat: XML parsing' - 'doxygen: documentation' - 'graphviz: documentation' + 'miniupnpc: NAT punching' + 'libunwind: stack traces' + 'ldns: SSL toolkit' + 'expat: XML parsing' + 'doxygen: documentation' + 'graphviz: documentation' ) -source=("https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz") -md5sums=('0c459d99d18db514ba66f1df84e92daa') +conflicts=("${pkgname%-git}") +provides=("${pkgname%-git}=$pkgver") +source=("electroneum"::"git+https://github.com/electroneum/electroneum.git" + electroneumd.service + 0001-archlinux-openssl-1.0.patch) +md5sums=('SKIP' + '614c615d7218e4745bb6016644e71156' + 'ae1bcb862a92f9996a08a0025d828e0f') +options=('!strip') +backup=('etc/electroneumd.conf') +install=electroneum.install + +pkgver() { + cd "${srcdir}/${pkgname%-git}" + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd "${srcdir}/${pkgname%-git}" + + # compile against openssl-1.0 + patch -Np1 -i ../0001-archlinux-openssl-1.0.patch +} build() { - cd "$pkgname-$pkgver" - # Note: plain make fails with undeclared DIFFICULTY_TARGET_V1 - # make release-static fails when compiling with e.g. -j8 - make -j1 release-static + cd "${srcdir}/${pkgname%-git}" + # Note: plain make fails with undeclared DIFFICULTY_TARGET_V1 + # make release-static fails when compiling with e.g. -j8 + make -j1 release-static } # Tests always fail due to DIFFICULT_TARGET_V1 error, so we don't run them @@ -35,11 +57,18 @@ build() { #} package() { - cd "$pkgname-$pkgver" - # Note: make has no install target. Static build means we don't need to - # install lib. - install -dm755 "$pkgdir/usr/bin/" - install -Dm755 build/release/bin/* "$pkgdir/usr/bin/" - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + cd "${srcdir}/${pkgname%-git}" + + # Note: make has no install target. Static build means we don't need to + # install lib. + install -dm755 "$pkgdir/usr/bin/" + install -Dm755 build/release/bin/* "$pkgdir/usr/bin/" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE" + + # install conf file + install -Dm644 utils/conf/electroneumd.conf "${pkgdir}/etc/electroneumd.conf" + + # using a modified service unit file to use another pid file path + install -Dm644 "$srcdir/electroneumd.service" "${pkgdir}/usr/lib/systemd/system/electroneumd.service" } diff --git a/electroneum.install b/electroneum.install new file mode 100644 index 000000000000..6808bf29cfd8 --- /dev/null +++ b/electroneum.install @@ -0,0 +1,18 @@ +create_user() { + getent passwd electroneum &>/dev/null || { + echo -n ">>> Creating electroneum user... " + useradd --system --user-group -m --home /var/lib/electroneum electroneum + echo "done" + } # NOTE: we do not autoremove user due to security concerns (Arch policy) + mkdir -p /var/log/electroneum && chown electroneum:electroneum /var/log/electroneum + mkdir -p /var/run/electroneum && chown electroneum:electroneum /var/run/electroneum + mkdir -p /var/lib/electroneum && chown electroneum:electroneum /var/lib/electroneum +} + +post_install() { + create_user +} + +post_upgrade() { + create_user +} diff --git a/electroneumd.service b/electroneumd.service new file mode 100644 index 000000000000..153c258e50e7 --- /dev/null +++ b/electroneumd.service @@ -0,0 +1,18 @@ +[Unit] +Description=Electroneum Full Node +After=network.target + +[Service] +User=electroneum +Group=electroneum +WorkingDirectory=~ + +Type=forking +PIDFile=/var/run/electroneum/electroneumd.pid + + +ExecStart=/usr/bin/electroneumd --config-file /etc/electroneumd.conf \ + --detach --pidfile /var/run/electroneum/electroneumd.pid + +[Install] +WantedBy=multi-user.target |