summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCody Schafer2023-12-28 23:30:57 +0000
committerCody Schafer2023-12-28 23:31:27 +0000
commit40697f3d9ad0325579869a5a8a69730cb50d5ddf (patch)
tree8476a74d99b0725c3223f93f60165f4d7245dac7
parentbff01a25adbca630bdfb62c4c142d60473c655d5 (diff)
downloadaur-40697f3d9ad0325579869a5a8a69730cb50d5ddf.tar.gz
use sysusers more in line with other packages (postgreqsl)
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD20
-rw-r--r--cowrie.install14
-rw-r--r--cowrie.sysusers2
4 files changed, 22 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9412e8a9bb3d..e8b00acba0d0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -3,7 +3,6 @@ pkgbase = cowrie
pkgver = 2.5.0
pkgrel = 1
url = https://github.com/cowrie/cowrie
- install = cowrie.install
arch = any
license = BSD
depends = python-appdirs
@@ -22,7 +21,9 @@ pkgbase = cowrie
backup = etc/cowrie/cowrie.cfg
source = cowrie-2.5.0.tar.gz::https://github.com/cowrie/cowrie/archive/v2.5.0.tar.gz
source = 0001-patch-service.patch
- sha512sums = e87f2794edd0db7cd599a5bb9ffdda12c9ceab06ffe1e31714cb988796dadea01ca093c66ed4a2ca6065634773c296cebca14a13e2a6ca1862e716e767838bcd
- sha512sums = a79904d764829b246fce7691f90d1de7a478985217eb458d441a2fad0aed4558d70eb2d38208d2bfb393bc42f662dba129678fc14765392959d1316c0d1a8dd1
+ source = cowrie.sysusers
+ sha256sums = 9db15102675729783a4d65617fb4355e366a7fdcd8f5705f6d41541eb1f5919b
+ sha256sums = 8001a666e05d224858a7a71fcf767461d6b8bc22293273c6f012452bb125e4fc
+ sha256sums = 50114e6c538945945439ad36a08d4a42305db09f0eb7b09649abac69063308de
pkgname = cowrie
diff --git a/PKGBUILD b/PKGBUILD
index b81998d219f2..2a1edbcf0c99 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -26,19 +26,21 @@ depends=(
)
backup=('etc/cowrie/cowrie.cfg')
-install=cowrie.install
_pkgdir="${pkgname}-${pkgver}"
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/cowrie/${pkgname}/archive/v${pkgver}.tar.gz
- '0001-patch-service.patch')
+ 0001-patch-service.patch
+ cowrie.sysusers
+)
# _pkgdir="${pkgname}-${_gitrev}"
#_gitrev="c5e9a6b21c8908e892c2169b33f560ccd1fd98ff"
#source=(${pkgname}-${_gitrev}.tar.gz::https://github.com/micheloosterhof/${pkgname}/archive/${_gitrev}.tar.gz
# '0001-patch-service.patch')
-sha512sums=('e87f2794edd0db7cd599a5bb9ffdda12c9ceab06ffe1e31714cb988796dadea01ca093c66ed4a2ca6065634773c296cebca14a13e2a6ca1862e716e767838bcd'
- 'a79904d764829b246fce7691f90d1de7a478985217eb458d441a2fad0aed4558d70eb2d38208d2bfb393bc42f662dba129678fc14765392959d1316c0d1a8dd1')
+sha256sums=('9db15102675729783a4d65617fb4355e366a7fdcd8f5705f6d41541eb1f5919b'
+ '8001a666e05d224858a7a71fcf767461d6b8bc22293273c6f012452bb125e4fc'
+ '50114e6c538945945439ad36a08d4a42305db09f0eb7b09649abac69063308de')
prepare() {
cd "${_pkgdir}"
@@ -52,8 +54,18 @@ package() {
install -Dm 644 etc/cowrie.cfg.dist "${pkgdir}/etc/cowrie/cowrie.cfg"
install -Dm 644 docs/systemd/etc/systemd/system/cowrie.service -t "${pkgdir}/usr/lib/systemd/system"
install -Dm 644 docs/systemd/etc/systemd/system/cowrie.socket -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm 644 ../${pkgname}.sysusers "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
install -d "${pkgdir}/opt/cowrie"
+
+ # FIXME: instead of copying the entiry repo here, install the python bits
+ # normally (via `python -m installer` or similar) and only copy the data
+ # components. Really, data components belong elsewhere as well, and we should
+ # place the recorded logs/downloads into another directory.
+ #
+ # All of the above would allow us to move out of using `/opt`. Note when
+ # doing this that changes to the systemd service may be needed due to
+ # sandboxing there.
cp -a . "${pkgdir}/opt/cowrie"
rm "${pkgdir}/opt/cowrie/etc/cowrie.cfg.dist"
diff --git a/cowrie.install b/cowrie.install
deleted file mode 100644
index 599f60171784..000000000000
--- a/cowrie.install
+++ /dev/null
@@ -1,14 +0,0 @@
-post_install() {
- echo '
- u cowrie - "cowrie daemon" /opt/cowrie
- m cowrie cowrie' | \
- systemd-sysusers --replace=/usr/lib/sysusers.d/cowrie.conf -
-
- chown -R cowrie:cowrie /opt/cowrie
-}
-
-post_upgrade() {
- post_install
-}
-
-# vim: ts=2 sw=2 et:
diff --git a/cowrie.sysusers b/cowrie.sysusers
new file mode 100644
index 000000000000..cab2e4fe196e
--- /dev/null
+++ b/cowrie.sysusers
@@ -0,0 +1,2 @@
+u cowrie - "cowrie daemon" /opt/cowrie
+m cowrie cowrie