From 39206fc146510b3661776665ac2c4634a19d4a1e Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Mon, 17 Sep 2018 11:14:56 +0200 Subject: Add geomyidae-git. --- geomyidae-git/.SRCINFO | 25 ++++++++++ geomyidae-git/PKGBUILD | 84 ++++++++++++++++++++++++++++++++++ geomyidae-git/confd | 3 ++ geomyidae-git/geomyidae-chroot.patch | 12 +++++ geomyidae-git/geomyidae-journald.patch | 17 +++++++ geomyidae-git/service | 20 ++++++++ geomyidae-git/sysusers | 1 + 7 files changed, 162 insertions(+) create mode 100644 geomyidae-git/.SRCINFO create mode 100644 geomyidae-git/PKGBUILD create mode 100644 geomyidae-git/confd create mode 100644 geomyidae-git/geomyidae-chroot.patch create mode 100644 geomyidae-git/geomyidae-journald.patch create mode 100644 geomyidae-git/service create mode 100644 geomyidae-git/sysusers diff --git a/geomyidae-git/.SRCINFO b/geomyidae-git/.SRCINFO new file mode 100644 index 0000000..6b93750 --- /dev/null +++ b/geomyidae-git/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = geomyidae-git + pkgdesc = A gopher server daemon + pkgver = 0.195.c89bef3 + pkgrel = 1 + url = http://r-36.net/scm/geomyidae + arch = i686 + arch = x86_64 + license = MIT + makedepends = git + backup = etc/conf.d/geomyidae + source = git://r-36.net/geomyidae + source = service + source = confd + source = sysusers + source = geomyidae-chroot.patch + source = geomyidae-journald.patch + sha256sums = SKIP + sha256sums = 2e26b4fce0590d68b27c0d70b7d5302ac4c14f9888d52020efc372bc327d6f6b + sha256sums = d8a791643036d8cfccd7ffd64df7a99f2da5a3b3306d32b59a625c0285c1b9a1 + sha256sums = 816de9b6211254663c0e2bbce039f869b1efc4b8fdce8bd4fdb676e8a722cce4 + sha256sums = 813ca5000327453e91259119805474e78d0d31e81404a823cf47171cca1cb76f + sha256sums = caa4378e7b64790d0eeb77682749e81684124065bac826f4b0905c7905bcded5 + +pkgname = geomyidae-git + diff --git a/geomyidae-git/PKGBUILD b/geomyidae-git/PKGBUILD new file mode 100644 index 0000000..d5a7cf0 --- /dev/null +++ b/geomyidae-git/PKGBUILD @@ -0,0 +1,84 @@ +# Maintainer: Deposite Pirate + +_pkgname=geomyidae +pkgname=${_pkgname}-git +pkgver=0.195.c89bef3 +pkgrel=1 +pkgdesc="A gopher server daemon" +arch=('i686' 'x86_64') +url="http://r-36.net/scm/geomyidae" +license=('MIT') +makedepends=('git') +conflicts=('geomyidae') +provides=('geomyidae') +backup=("etc/conf.d/${_pkgname}") +source=("git://r-36.net/${_pkgname}" + 'service' + 'confd' + 'sysusers' + 'geomyidae-chroot.patch' + 'geomyidae-journald.patch') +sha256sums=('SKIP' + '2e26b4fce0590d68b27c0d70b7d5302ac4c14f9888d52020efc372bc327d6f6b' + 'd8a791643036d8cfccd7ffd64df7a99f2da5a3b3306d32b59a625c0285c1b9a1' + '816de9b6211254663c0e2bbce039f869b1efc4b8fdce8bd4fdb676e8a722cce4' + '813ca5000327453e91259119805474e78d0d31e81404a823cf47171cca1cb76f' + 'caa4378e7b64790d0eeb77682749e81684124065bac826f4b0905c7905bcded5') + +pkgver() { + cd "${_pkgname}" + echo "0.$(git rev-list --count HEAD).$(git describe --always)" +} + +prepare() { + cd "${_pkgname}" + + # Fix chroot + patch -p1 -i ../geomyidae-chroot.patch + + # Log with systemd-journald + patch -p1 -i ../geomyidae-journald.patch + + # Arch Linux uses /srv + sed -i 's|/var/gopher|/srv/gopher|g' geomyidae.8 main.c + + # Install to /usr + sed -i 's|/usr/local|/usr|g' Makefile + + # Use Arch Linux standard CFLAGS + sed -i 's|CFLAGS = -O2 -Wall|CFLAGS = $(FLAGS)|g' Makefile +} + +build() { + cd "${_pkgname}" + make FLAGS="${CFLAGS}" +} + +package() { + cd "${_pkgname}" + make install DESTDIR="${pkgdir}" + + install -dm755 "${pkgdir}/srv/gopher" + + install -Dm644 "${srcdir}/confd" \ + "${pkgdir}/etc/conf.d/${_pkgname}" + install -Dm644 "${srcdir}/service" \ + "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service" + install -Dm644 "${srcdir}/sysusers" \ + "${pkgdir}/usr/lib/sysusers.d/${_pkgname}.conf" + + install -Dm644 LICENSE \ + "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" + + install -dm755 "${pkgdir}/usr/share/doc/${_pkgname}" + + install -m644 README CGI LINKS index.gph \ + "${pkgdir}/usr/share/doc/${_pkgname}/" + + install -dm755 "${pkgdir}"/usr/share/vim/vimfiles/{ftdetect,syntax} + + install -m644 gph/vim/ftdetect/gph.vim \ + "${pkgdir}/usr/share/vim/vimfiles/ftdetect" + install -m644 gph/vim/syntax/gph.vim \ + "${pkgdir}/usr/share/vim/vimfiles/syntax" +} diff --git a/geomyidae-git/confd b/geomyidae-git/confd new file mode 100644 index 0000000..928a17a --- /dev/null +++ b/geomyidae-git/confd @@ -0,0 +1,3 @@ +# Parameters to be passed to geomyidae +# See geomyidae(8) for more options +GEOMYIDAE_ARGS="" diff --git a/geomyidae-git/geomyidae-chroot.patch b/geomyidae-git/geomyidae-chroot.patch new file mode 100644 index 0000000..6a115ad --- /dev/null +++ b/geomyidae-git/geomyidae-chroot.patch @@ -0,0 +1,12 @@ +diff -u -r -N geomyidae/main.c geomyidae-debug/main.c +--- geomyidae/main.c 2018-08-26 14:10:15.625690876 +0200 ++++ geomyidae-debug/main.c 2018-08-26 20:29:20.923310089 +0200 +@@ -518,7 +518,7 @@ + perror("chdir"); + return 1; + } +- base = ""; ++ base = "."; + if (chroot(".") < 0) { + perror("chroot"); + return 1; diff --git a/geomyidae-git/geomyidae-journald.patch b/geomyidae-git/geomyidae-journald.patch new file mode 100644 index 0000000..ec52197 --- /dev/null +++ b/geomyidae-git/geomyidae-journald.patch @@ -0,0 +1,17 @@ +diff -r -u -N geomyidae/main.c geomyidae-journald/main.c +--- geomyidae/main.c 2018-08-26 14:10:15.625690876 +0200 ++++ geomyidae-journald/main.c 2018-08-26 18:52:59.695600426 +0200 +@@ -470,7 +470,12 @@ + } + + if (logfile != NULL) { +- glfd = open(logfile, O_APPEND | O_WRONLY | O_CREAT, 0644); ++ if (strncasecmp(logfile, "stdout", 6) == 0) { ++ glfd = 1; ++ } ++ else { ++ glfd = open(logfile, O_APPEND | O_WRONLY | O_CREAT, 0644); ++ } + if (glfd < 0) { + perror("log"); + return 1; diff --git a/geomyidae-git/service b/geomyidae-git/service new file mode 100644 index 0000000..41da8eb --- /dev/null +++ b/geomyidae-git/service @@ -0,0 +1,20 @@ +[Unit] +Description=A gopher server daemon +Documentation=man:geomyidae(8) +After=network.target network-online.target nss-lookup.target + +[Service] +Type=forking +WorkingDirectory=/srv/gopher +ProtectSystem=strict +ProtectHome=true +MemoryDenyWriteExecute=true +SystemCallArchitectures=native +NoNewPrivileges=true +StandardOutput=syslog +SyslogIdentifier=geomyidae +EnvironmentFile=-/etc/conf.d/geomyidae +ExecStart=/usr/bin/geomyidae -c -l stdout -u geomyidae -g geomyidae $GEOMYIDAE_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/geomyidae-git/sysusers b/geomyidae-git/sysusers new file mode 100644 index 0000000..7244cbc --- /dev/null +++ b/geomyidae-git/sysusers @@ -0,0 +1 @@ +u geomyidae - "gopher daemon" -- cgit v1.2.3-70-g09d2