diff options
-rw-r--r-- | .SRCINFO | 43 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 92 | ||||
-rw-r--r-- | redict-5.0-use-system-jemalloc.patch | 15 | ||||
-rw-r--r-- | redict-sentinel.service | 24 | ||||
-rw-r--r-- | redict.conf-sane-defaults.patch | 13 | ||||
-rw-r--r-- | redict.service | 23 | ||||
-rw-r--r-- | redict.sysusers | 1 | ||||
-rw-r--r-- | redict.tmpfiles | 3 |
9 files changed, 173 insertions, 45 deletions
@@ -1,21 +1,34 @@ -# Generated by makepkg 5.1.3 -# Thu Jul 18 21:59:24 UTC 2019 pkgbase = redict-git - pkgdesc = A dictionary for Linux, based on C++/Qt development - pkgver = r139.525aac0 + pkgdesc = A distributed key/value database (development version) + pkgver = r12201.aadcf99b7 pkgrel = 1 - url = https://github.com/rekols/redict + url = https://codeberg.org/redict/redict arch = x86_64 - license = GPL3 - makedepends = git - makedepends = qt5-tools - depends = qt5-base - depends = qt5-multimedia - depends = qt5-svg - provides = redict=r139.525aac0 + license = LGPL-3.0-only + makedepends = systemd + makedepends = openssl + depends = jemalloc + depends = grep + depends = shadow + depends = systemd-libs + provides = redict conflicts = redict - source = redict-master::git://github.com/rekols/redict.git#branch=master - sha256sums = SKIP + conflicts = redict-rc + backup = etc/redict/redict.conf + backup = etc/redict/sentinel.conf + source = git+https://codeberg.org/redict/redict.git + source = redict.service + source = redict-sentinel.service + source = redict.sysusers + source = redict.tmpfiles + source = redict.conf-sane-defaults.patch + source = redict-5.0-use-system-jemalloc.patch + sha512sums = SKIP + sha512sums = bafdd8d5bb16eb651e6dbed2fbd85c8a2264e5063cdc590add10f79879cb0e3dd3ea65635cb0f2502b272b9ad08704461ebec2523eb5263130ae01b1e5fc6983 + sha512sums = b72ee96c78e9c2e760f8241f109c7c91ebf0d5ba699af7e05e28e0f4eab8864e43673fca074a11730223e22b93f109c9739ea92f429332f7dc37ae8d6d7ad691 + sha512sums = 94556abeb7eba84d428130e9a0848865ddfa354e7652ec7a1a1d9ad4100a95fea92ce2be55abcf98b1ae176cc204d475e43294bb901c7aee3fa6cefbd759c8be + sha512sums = ecb0ecc6cb0470227834033eefd8f44e4ee83a0554059c9c01d8ce95182fc74b93a8cf75e148ecf449f9b0831ab0ee846929352afded3b20c6811c2c76ab60ea + sha512sums = 27e800b8514657aa8639ade7547f5ecdcbf56d656e1f268838b2423a1c943a657a3f198023917cc3de974aa9c32915872d4468e6b203d62f44a27cd78d80b319 + sha512sums = 0acb08a6e0eaba239db7461bcfeddfbe0c1aaa517dc33c3918c9e991a1d5067cfe135b7f75085caade8c3ababd51ec9cefcc4120f57818bea1f7029a548a7732 pkgname = redict-git - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index da539aa31e17..000000000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.tar.* -redict-* -pkg -src @@ -1,39 +1,79 @@ -# Maintainer: Nikolay Korotkiy <sikmir@gmail.com> -_orgname=rekols +# Maintainer: fossdd <fossdd@pwned.life> + +pkgname=redict-git _pkgname=redict -_branch=master -pkgname=${_pkgname}-git -pkgver=r139.525aac0 +pkgver=r12201.aadcf99b7 pkgrel=1 -pkgdesc='A dictionary for Linux, based on C++/Qt development' -arch=(x86_64) -url='https://github.com/rekols/redict' -license=('GPL3') -depends=('qt5-base' 'qt5-multimedia' 'qt5-svg') -makedepends=('git' 'qt5-tools') -provides=("${pkgname//-git}=${pkgver}") -conflicts=(${pkgname//-git}) -source=("${_pkgname}-${_branch}::git://github.com/${_orgname}/${_pkgname}.git#branch=${_branch}") -sha256sums=('SKIP') +pkgdesc='A distributed key/value database (development version)' +arch=('x86_64') +url="https://codeberg.org/$_pkgname/$_pkgname" +license=('LGPL-3.0-only') +provides=("$_pkgname") +conflicts=("$_pkgname" "$_pkgname-rc") +replaces=("$_pkgname-db-git") +depends=('jemalloc' 'grep' 'shadow' 'systemd-libs') +# pkg-config fails to detect systemd libraries if systemd is not installed +makedepends=('systemd' 'openssl') +backup=("etc/$_pkgname/$_pkgname.conf" + "etc/$_pkgname/sentinel.conf") -pkgver() { - cd ${_pkgname}-${_branch} +source=("git+$url.git" + $_pkgname.service + $_pkgname-sentinel.service + $_pkgname.sysusers + $_pkgname.tmpfiles + $_pkgname.conf-sane-defaults.patch + $_pkgname-5.0-use-system-jemalloc.patch) +sha512sums=('SKIP' + 'bafdd8d5bb16eb651e6dbed2fbd85c8a2264e5063cdc590add10f79879cb0e3dd3ea65635cb0f2502b272b9ad08704461ebec2523eb5263130ae01b1e5fc6983' + 'b72ee96c78e9c2e760f8241f109c7c91ebf0d5ba699af7e05e28e0f4eab8864e43673fca074a11730223e22b93f109c9739ea92f429332f7dc37ae8d6d7ad691' + '94556abeb7eba84d428130e9a0848865ddfa354e7652ec7a1a1d9ad4100a95fea92ce2be55abcf98b1ae176cc204d475e43294bb901c7aee3fa6cefbd759c8be' + 'ecb0ecc6cb0470227834033eefd8f44e4ee83a0554059c9c01d8ce95182fc74b93a8cf75e148ecf449f9b0831ab0ee846929352afded3b20c6811c2c76ab60ea' + '27e800b8514657aa8639ade7547f5ecdcbf56d656e1f268838b2423a1c943a657a3f198023917cc3de974aa9c32915872d4468e6b203d62f44a27cd78d80b319' + '0acb08a6e0eaba239db7461bcfeddfbe0c1aaa517dc33c3918c9e991a1d5067cfe135b7f75085caade8c3ababd51ec9cefcc4120f57818bea1f7029a548a7732') - count="$(git rev-list --count HEAD)" - head="$(git rev-parse --short HEAD)" +pkgver() { + cd "$srcdir/$_pkgname" + # Git, tags available + # printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" + # Git, no tags available + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} - printf "r%s.%s" "${count}" "${head}" +prepare() { + cd $_pkgname + patch -Np1 < ../$_pkgname.conf-sane-defaults.patch + patch -Np1 < ../$_pkgname-5.0-use-system-jemalloc.patch } build() { - cd ${_pkgname}-${_branch} - - qmake CONFIG+=release PREFIX=/usr - make + make BUILD_TLS=yes \ + USE_SYSTEMD=yes \ + -C $_pkgname } +check() { + make test \ + BUILD_TLS=yes \ + USE_SYSTEMD=yes \ + -C $_pkgname + } + package() { - cd ${_pkgname}-${_branch} + cd $_pkgname + + # make install + make PREFIX="$pkgdir"/usr install + + # configuration files + install -Dm644 -t "$pkgdir"/etc/$_pkgname $_pkgname.conf sentinel.conf + + # systemd integration + install -Dm644 -t "$pkgdir"/usr/lib/systemd/system/ ../$_pkgname.service ../$_pkgname-sentinel.service + install -Dm644 "$srcdir"/$_pkgname.sysusers "$pkgdir"/usr/lib/sysusers.d/$_pkgname.conf + install -Dm644 "$srcdir"/$_pkgname.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$_pkgname.conf - make INSTALL_ROOT="${pkgdir}" install + # licenses + mkdir -p "$pkgdir"/usr/share/licenses/$_pkgname + cp -vr LICENSES/* "$pkgdir"/usr/share/licenses/$_pkgname } diff --git a/redict-5.0-use-system-jemalloc.patch b/redict-5.0-use-system-jemalloc.patch new file mode 100644 index 000000000000..7597a7e49b36 --- /dev/null +++ b/redict-5.0-use-system-jemalloc.patch @@ -0,0 +1,15 @@ +diff --git a/src/Makefile b/src/Makefile +index 3bc9f11c0..a4b23d986 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -229,8 +229,8 @@ endif + + ifeq ($(MALLOC),jemalloc) + DEPENDENCY_TARGETS+= jemalloc +- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include +- FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) ++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc ++ FINAL_LIBS := -ljemalloc $(FINAL_LIBS) + endif + + ifeq ($(BUILD_TLS),yes) diff --git a/redict-sentinel.service b/redict-sentinel.service new file mode 100644 index 000000000000..f75d16761eab --- /dev/null +++ b/redict-sentinel.service @@ -0,0 +1,24 @@ +[Unit] +Description=High availability daemon for Redict +After=network.target + +[Service] +Type=notify +User=redict +Group=redict +ExecStart=/usr/bin/redict-sentinel /etc/redict/sentinel.conf --supervised systemd +TimeoutStartSec=60 +TimeoutStopSec=60 +CapabilityBoundingSet= +PrivateTmp=true +PrivateDevices=true +ProtectSystem=full +ProtectHome=true +ReadWritePaths=/etc/redict/ +NoNewPrivileges=true +RuntimeDirectory=redict +RuntimeDirectoryMode=755 +LimitNOFILE=10032 + +[Install] +WantedBy=multi-user.target diff --git a/redict.conf-sane-defaults.patch b/redict.conf-sane-defaults.patch new file mode 100644 index 000000000000..787522cb31a8 --- /dev/null +++ b/redict.conf-sane-defaults.patch @@ -0,0 +1,13 @@ +diff --git a/redict.conf b/redict.conf +index 465d56fc0..9c1bd1ed1 100644 +--- a/redict.conf ++++ b/redict.conf +@@ -441,7 +441,7 @@ rdb-del-sync-files no + # The Append Only File will also be created inside this directory. + # + # Note that you must specify a directory here, not a file name. +-dir ./ ++dir /var/lib/redict/ + + ################################# REPLICATION ################################# + diff --git a/redict.service b/redict.service new file mode 100644 index 000000000000..e11b3fcdd489 --- /dev/null +++ b/redict.service @@ -0,0 +1,23 @@ +[Unit] +Description=Advanced key-value store +After=network.target + +[Service] +Type=notify +User=redict +Group=redict +ExecStart=/usr/bin/redict-server /etc/redict/redict.conf --supervised systemd +TimeoutStartSec=60 +TimeoutStopSec=60 +CapabilityBoundingSet= +PrivateTmp=true +PrivateDevices=true +ProtectSystem=full +ProtectHome=true +NoNewPrivileges=true +RuntimeDirectory=redict +RuntimeDirectoryMode=755 +LimitNOFILE=10032 + +[Install] +WantedBy=multi-user.target diff --git a/redict.sysusers b/redict.sysusers new file mode 100644 index 000000000000..d9b5d2040fdf --- /dev/null +++ b/redict.sysusers @@ -0,0 +1 @@ +u redict - "Redict in-memory data structure store" /var/lib/redict diff --git a/redict.tmpfiles b/redict.tmpfiles new file mode 100644 index 000000000000..1419a3512ee6 --- /dev/null +++ b/redict.tmpfiles @@ -0,0 +1,3 @@ +d /var/lib/redict 0700 redict redict +d /etc/redict 0755 root redict +f /etc/redict/sentinel.conf 0664 root redict |