diff options
author | M0Rf30 | 2016-03-09 14:51:41 +0100 |
---|---|---|
committer | M0Rf30 | 2016-03-09 14:51:41 +0100 |
commit | 02c0a67cf18b14f5982cd71b7bcbc8e875227764 (patch) | |
tree | cf1c692203c96349804fdc3b59fd91431aaf2752 | |
parent | 82e91d6cd5cfe6ec07f553e5b5a39101fc03c46e (diff) | |
download | aur-02c0a67cf18b14f5982cd71b7bcbc8e875227764.tar.gz |
0.12.0
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | Makefile | 79 | ||||
-rw-r--r-- | PKGBUILD | 103 | ||||
-rw-r--r-- | namecoin-reindex.service | 18 | ||||
-rw-r--r-- | namecoin.conf | 10 | ||||
-rw-r--r-- | namecoin.install | 112 | ||||
-rw-r--r-- | namecoin.service | 17 |
7 files changed, 188 insertions, 181 deletions
@@ -1,8 +1,10 @@ +# Generated by mksrcinfo v8 +# Wed Mar 9 13:51:21 UTC 2016 pkgbase = namecoin-core - pkgdesc = Namecoin Core headless P2P node - pkgver = 0.3.80 - pkgrel = 2 - url = http://namecoin.info/ + pkgdesc = namecoin Core headless P2P node + pkgver = 0.12.0 + pkgrel = 1 + url = https://namecoin.org install = namecoin.install arch = i686 arch = x86_64 @@ -10,36 +12,34 @@ pkgbase = namecoin-core makedepends = autoconf makedepends = automake makedepends = binutils - makedepends = expect makedepends = gcc makedepends = libtool + makedepends = m4 makedepends = make makedepends = pkg-config - makedepends = yasm depends = boost depends = boost-libs - depends = miniupnpc - depends = openssl + depends = zeromq + optdepends = miniupnpc: build with support for UPnP provides = namecoin-cli provides = namecoin-daemon provides = namecoin-tx conflicts = namecoin-cli - conflicts = namecoind conflicts = namecoin-daemon conflicts = namecoin-qt conflicts = namecoin-tx backup = etc/namecoin/namecoin.conf backup = etc/logrotate.d/namecoin - source = https://github.com/namecoin/namecoin/archive/nc0.3.80.tar.gz + source = namecoin-0.12.0.tar.gz::https://codeload.github.com/namecoin/namecoin-core/tar.gz/v0.12.0 source = namecoin.conf source = namecoin.logrotate source = namecoin.service - source = Makefile - md5sums = 450402d3bcd07fbd3a671336d9cb2e7b - md5sums = 020bfdfe192bd21b84964c1e90ae4450 + source = namecoin-reindex.service + md5sums = 887e618fa025e98e1c7d6f88facadee2 + md5sums = 85dbcf29d1dade4df781a95c6b502220 md5sums = 2ca92d94c329bf54b8df70f22c27ba98 - md5sums = 1186c6c80cb488e0809a4977ec92399b - md5sums = 701197b708dbb6b5d7568f77ae46f3bb + md5sums = d4694928d3e62f9215ce641663564eee + md5sums = 1f3e4182d57987e4f42962cd2da94661 pkgname = namecoin-core diff --git a/Makefile b/Makefile deleted file mode 100644 index 38558902c7a0..000000000000 --- a/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -CXX=g++ - -DEFS=-D_MT -DNOPCH -DFOURWAYSSE2 -DUSE_SSL - -# Link boost statically -DEFS += -DBOOST_ALL_DYN_LINK - -INCLUDEPATHS=-I/usr/include - -LIBPATHS=-L/usr/lib - -LIBS=-lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_chrono -ldb_cxx -lssl -lcrypto - -namecoin: USE_UPNP:=1 - ifdef USE_UPNP - LIBS += -l miniupnpc - DEFS += -DUSE_UPNP=$(USE_UPNP) - endif - - # Linux-specific - LIBS+= -lgthread-2.0 -lz -ldl -lpthread - - -namecoind: USE_UPNP:=0 - ifdef USE_UPNP - LIBS += -lminiupnpc - DEFS += -DUSE_UPNP=$(USE_UPNP) - endif - # Linux-specific - LIBS+= -lgthread-2.0 -lz -ldl -lpthread - - -CXXFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEFS) $(INCLUDEPATHS) -HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h allocators.h db.h walletdb.h crypter.h net.h irc.h keystore.h main.h wallet.h bitcoinrpc.h uibase.h ui.h noui.h init.h auxpow.h - -OBJS= obj/auxpow.o \ - obj/util.o \ - obj/key.o \ - obj/script.o \ - obj/db.o \ - obj/walletdb.o \ - obj/crypter.o \ - obj/net.o \ - obj/irc.o \ - obj/keystore.o \ - obj/main.o \ - obj/wallet.o \ - obj/bitcoinrpc.o \ - obj/init.o \ - cryptopp/obj/sha.o \ - cryptopp/obj/cpu.o - -all: namecoind - - -obj/%.o: %.cpp $(HEADERS) - $(CXX) -c $(CXXFLAGS) -DGUI -o $@ $< - -cryptopp/obj/%.o: cryptopp/%.cpp - $(CXX) -c $(CXXFLAGS) -O3 -o $@ $< - -obj/nogui/%.o: %.cpp $(HEADERS) - $(CXX) -c $(CXXFLAGS) -o $@ $< - -obj/test/%.o: test/%.cpp $(HEADERS) - $(CXX) -c $(CFLAGS) -o $@ $< - -obj/nogui/namecoin.o: namecoin.h - -namecoind: $(OBJS:obj/%=obj/nogui/%) obj/nogui/namecoin.o - $(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) - -clean: - -rm -f namecoin namecoind - -rm -f obj/*.o - -rm -f obj/nogui/*.o - -rm -f obj/test/*.o - -rm -f cryptopp/obj/*.o - -rm -f headers.h.gch @@ -1,58 +1,101 @@ # Maintainer: M0Rf30 pkgname=namecoin-core -pkgver=0.3.80 -pkgrel=2 -pkgdesc="Namecoin Core headless P2P node" +pkgver=0.12.0 +pkgrel=1 +pkgdesc="namecoin Core headless P2P node" arch=('i686' 'x86_64') -url="http://namecoin.info/" -depends=('boost' 'boost-libs' 'miniupnpc' 'openssl') -makedepends=('autoconf' 'automake' 'binutils' 'expect' 'gcc' 'libtool' 'make' 'pkg-config' 'yasm') +url="https://namecoin.org" +depends=('boost' + 'boost-libs' + 'zeromq') +makedepends=('autoconf' + 'automake' + 'binutils' + 'gcc' + 'libtool' + 'm4' + 'make' + 'pkg-config') +optdepends=('miniupnpc: build with support for UPnP') license=('MIT') -source=(https://github.com/namecoin/namecoin/archive/nc${pkgver}.tar.gz +source=(${pkgname%-core}-$pkgver.tar.gz::https://codeload.github.com/namecoin/namecoin-core/tar.gz/v$pkgver namecoin.conf namecoin.logrotate namecoin.service - Makefile) + namecoin-reindex.service) backup=('etc/namecoin/namecoin.conf' 'etc/logrotate.d/namecoin') provides=('namecoin-cli' 'namecoin-daemon' 'namecoin-tx') -conflicts=('namecoin-cli' 'namecoind' 'namecoin-daemon' 'namecoin-qt' 'namecoin-tx') +conflicts=('namecoin-cli' 'namecoin-daemon' 'namecoin-qt' 'namecoin-tx') install=namecoin.install build() { - cd "$srcdir/${pkgname%-core}-nc$pkgver" + cd "$srcdir/${pkgname}-$pkgver" - msg 'Building...' - cd src - cp $srcdir/Makefile . - make namecoind + msg2 'Building...' + ./autogen.sh + ./configure \ + --prefix=/usr \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib/namecoin \ + --sysconfdir=/etc \ + --sharedstatedir=/usr/share/namecoin \ + --localstatedir=/var/lib/namecoin \ + --enable-hardening \ + --with-gui=no \ + --disable-wallet \ + --with-gnu-ld + make } package() { - cd "$srcdir/${pkgname%-core}-nc$pkgver" - - msg 'Installing license...' - install -Dm 644 COPYING "$pkgdir/usr/share/licenses/${pkgname%-core}/COPYING" + cd "$srcdir/${pkgname}-$pkgver" - msg 'Installing namecoin...' - install -Dm 775 src/namecoind "$pkgdir/usr/bin/namecoind" + msg2 'Installing license...' + install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/${pkgname%-core}" - msg 'Installing namecoin.conf...' - install -Dm 600 "$srcdir/namecoin.conf" "$pkgdir/etc/namecoin/namecoin.conf" + msg2 'Installing man pages...' + install -Dm 644 contrib/debian/manpages/namecoind.1 \ + -t "$pkgdir/usr/share/man/man1" + install -Dm 644 contrib/debian/manpages/namecoin-cli.1 \ + -t "$pkgdir/usr/share/man/man1" + install -Dm 644 contrib/debian/manpages/namecoin.conf.5 \ + -t "$pkgdir/usr/share/man/man5" - msg 'Installing namecoin.service...' - install -Dm 644 "$srcdir/namecoin.service" "$pkgdir/usr/lib/systemd/system/namecoin.service" + msg2 'Installing documentation...' + install -dm 755 "$pkgdir/usr/share/doc/namecoin" + for _doc in \ + $(find doc -maxdepth 1 -type f -name "*.md" -printf '%f\n') \ + release-notes; do + cp -dpr --no-preserve=ownership doc/$_doc \ + "$pkgdir/usr/share/doc/namecoin/$_doc" + done - msg 'Installing namecoin.logrotate...' + msg2 'Installing namecoin...' + make DESTDIR="$pkgdir" install + + msg2 'Installing namecoin.conf...' + install -Dm 600 "$srcdir/namecoin.conf" -t "$pkgdir/etc/namecoin" + + msg2 'Installing namecoin.service...' + install -Dm 644 "$srcdir/namecoin.service" -t "$pkgdir/usr/lib/systemd/system" + install -Dm 644 "$srcdir/namecoin-reindex.service" \ + -t "$pkgdir/usr/lib/systemd/system" + + msg2 'Installing namecoin.logrotate...' install -Dm 644 "$srcdir/namecoin.logrotate" "$pkgdir/etc/logrotate.d/namecoin" - msg 'Cleaning up pkgdir...' + msg2 'Installing bash completion...' + install -Dm 644 contrib/namecoind.bash-completion \ + "$pkgdir/usr/share/bash-completion/completions/namecoind" + + msg2 'Cleaning up pkgdir...' find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' + } -md5sums=('450402d3bcd07fbd3a671336d9cb2e7b' - '020bfdfe192bd21b84964c1e90ae4450' +md5sums=('887e618fa025e98e1c7d6f88facadee2' + '85dbcf29d1dade4df781a95c6b502220' '2ca92d94c329bf54b8df70f22c27ba98' - '1186c6c80cb488e0809a4977ec92399b' - '701197b708dbb6b5d7568f77ae46f3bb') + 'd4694928d3e62f9215ce641663564eee' + '1f3e4182d57987e4f42962cd2da94661') diff --git a/namecoin-reindex.service b/namecoin-reindex.service new file mode 100644 index 000000000000..fca616f747c8 --- /dev/null +++ b/namecoin-reindex.service @@ -0,0 +1,18 @@ +[Unit] +Description=Namecoin Daemon (reindex) +Conflicts=namecoin.service +After=network.target + +[Service] +User=namecoin +Group=namecoin +ExecStart=/usr/bin/namecoind -daemon=0 \ + -conf=/etc/namecoin/namecoin.conf \ + -datadir=/srv/namecoin \ + -reindex \ + -pid=/run/namecoind.pid +ExecReload=/usr/bin/kill -HUP $MAINPID +ExecStop=/usr/bin/namecoind stop + +[Install] +WantedBy=multi-user.target diff --git a/namecoin.conf b/namecoin.conf index 1982242f7bdd..02d0d4be220b 100644 --- a/namecoin.conf +++ b/namecoin.conf @@ -1,11 +1,9 @@ rpcconnect=127.0.0.1 -rpcport=8336 -rpcuser=namecoin +rpcport=8332 +rpcuser=bitcoin rpcpassword=secret -rpcssl=1 rpcallowip=127.0.0.1 -rpcsslcertificatechainfile=/etc/namecoin/server.cert -rpcsslprivatekeyfile=/etc/namecoin/server.pem -rpcsslciphers=TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH +rpcthreads=4 +rpctimeout=300 txindex=1 server=1 diff --git a/namecoin.install b/namecoin.install index 359fb7d0bd23..0cacda0c2387 100644 --- a/namecoin.install +++ b/namecoin.install @@ -1,14 +1,20 @@ +_bc_user=namecoin +_bc_group=namecoin + post_install() { _mkuser - _mkssl - chown -R namecoin:namecoin /etc/namecoin /srv/namecoin - printf "$namecoin\n" + # disable Copy-On-Write (btrfs directories only) + for _dir in /srv/namecoin; do + _is_btrfs "$_dir" && _disable_cow "$_dir" + done + chown -R $_bc_user:$_bc_group /etc/namecoin /srv/namecoin + printf "%b\n" "$namecoin" } post_upgrade() { _mkuser - chown -R namecoin:namecoin /etc/namecoin /srv/namecoin - printf "$namecoin\n" + chown -R $_bc_user:$_bc_group /etc/namecoin /srv/namecoin + printf "%b\n" "$namecoin" } post_remove() { @@ -16,58 +22,79 @@ post_remove() { rm -rf /srv/namecoin } + +# ------------------------------------------------------------------------------ +# helper functions for creating namecoin-core user / group +# ------------------------------------------------------------------------------ + _mkuser() { - getent passwd namecoin &>/dev/null || { + getent passwd $_bc_user &>/dev/null || { echo -n "Creating namecoin user... " - grep -E "^namecoin:" /etc/group >/dev/null || groupadd namecoin - useradd -m -d /etc/namecoin -g namecoin -s /usr/bin/nologin namecoin 2>/dev/null + grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group + useradd -m -d /etc/namecoin -g $_bc_group -s /usr/bin/nologin $_bc_user 2>/dev/null echo "done" } } _rmuser() { echo -n "Removing namecoin user... " - userdel -rf namecoin 2>/dev/null + userdel -rf $_bc_user 2>/dev/null echo "done" } -_mkssl() { - echo -n "Enabling SSL..." - mkdir -p /{etc,srv}/namecoin - openssl genrsa -out /etc/namecoin/server.pem 2048 - expect <<EOF | perl -ne 'print if /-----BEGIN\sCERTIFICATE-----/../-----END\sCERTIFICATE-----/' > /etc/namecoin/server.cert - spawn openssl req -new -x509 -nodes -sha1 -days 3650 -key /etc/namecoin/server.pem - expect "Country*" { - send "\r" - } - expect "State*" { - send "\r" - } - expect "Locality*" { - send "\r" - } - expect "Organization*" { - send "\r" - } - expect "Organizational*" { - send "\r" - } - expect "Common*" { - send "\r" - } - expect "Email*" { - send "\r" - } - expect eof -EOF - echo "done" + +# ------------------------------------------------------------------------------ +# helper functions for disabling btrfs Copy-On-Write (CoW) +# https://wiki.archlinux.org/index.php/Btrfs#Copy-On-Write_.28CoW.29 +# ------------------------------------------------------------------------------ + +# check if dir is btrfs +_is_btrfs() { + if [[ $(findmnt --target $1 --output FSTYPE --noheadings) == 'btrfs' ]]; then + return 0 + else + return 1 + fi } +# disable btrfs CoW +_chattrify() { + # original dir, with trailing slash stripped if it exists + _orig_dir=$( echo "$1" | sed 's@/$@@' ) + + # if original dir exists, back it up + [[ -d "$1" ]] && mv "$1" "${_orig_dir}"_old + + # re-make original dir + mkdir -p "$1" + + # set permissions on re-made dir + chmod "$2" "$1" + + # disable btrfs CoW on re-made dir + chattr +C "$1" + + # recursive copy to restore backed up dir while maintaining disabled CoW + [[ -d "${_orig_dir}"_old ]] \ + && find "${_orig_dir}"_old -mindepth 1 -maxdepth 1 -exec cp -R '{}' "$1" \; + + # set ownership on re-made dir + chown -R $3:$4 "$1" + + # purge backed up dir + [[ -d "${_orig_dir}"_old ]] && rm -rf "${_orig_dir}"_old +} + +_disable_cow() { + _chattrify "$1" "700" "$_bc_user" "$_bc_group" +} + + read -d '' namecoin <<'EOF' ######################################################################## ######################################################################## ## ## -## Namecoin Core ## +## namecoin Core ## ## ____________ ## ## ## ## To start namecoin-core: ## @@ -79,13 +106,12 @@ read -d '' namecoin <<'EOF' ## $ mkdir -p ~/.namecoin ## ## $ cat > ~/.namecoin/namecoin.conf <<'EOF' ## ## rpcconnect=127.0.0.1 ## -## rpcport=8336 ## +## rpcport=8332 ## ## rpcuser=namecoin ## ## rpcpassword=secret ## -## rpcssl=1 ## ## EOF ## ## ## -## $ namecoind getmininginfo ## +## $ namecoin-cli getmininginfo ## ## ## ## Config: /etc/namecoin/namecoin.conf ## ## Blockchain: /srv/namecoin ## diff --git a/namecoin.service b/namecoin.service index 19596cbdc526..fda8f3270508 100644 --- a/namecoin.service +++ b/namecoin.service @@ -1,16 +1,17 @@ [Unit] -Description=Namecoin Daemon +Description=Bitcoin Daemon +Conflicts=bitcoin-reindex.service After=network.target [Service] -User=namecoin -Group=namecoin -ExecStart=/usr/bin/namecoind -daemon=0 \ - -conf=/etc/namecoin/namecoin.conf \ - -datadir=/srv/namecoin \ - -pid=/run/namecoind.pid +User=bitcoin +Group=bitcoin +ExecStart=/usr/bin/bitcoind -daemon=0 \ + -conf=/etc/bitcoin/bitcoin.conf \ + -datadir=/srv/bitcoin \ + -pid=/run/bitcoind.pid ExecReload=/usr/bin/kill -HUP $MAINPID -ExecStop=/usr/bin/namecoind stop +ExecStop=/usr/bin/bitcoind stop [Install] WantedBy=multi-user.target |