Skip to content

Commit

Permalink
Add PKGBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
MetroWind committed Sep 30, 2024
1 parent 61d7bf0 commit df80abd
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
47 changes: 47 additions & 0 deletions packages/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pkgname=planck-blog-git
pkgver=0.1
pkgrel=1
pkgdesc="A naively simple blog server that is barely enough"
arch=('x86_64')
url="https://github.com/MetroWind/plank-blog"
license=('MIT')
groups=()
depends=('sqlite' 'curl' 'cmark' 'asciidoctor')
makedepends=('git' 'cmake' 'gcc')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=("etc/planck-blog.yaml")
options=(!debug)
install=planck-blog.install
source=('git+https://github.com/MetroWind/planck-blog.git' "sysusers-${pkgname%-git}.conf" "${pkgname%-git}.service" "${pkgname%-git}.yaml")
noextract=()
sha256sums=('SKIP' "cbd783eda38d6ba8b30ab73e2edbce2b2acea9734647e58aeb52f0121a384e93"
"f9cb98d275baa20d552dfaf17f5cfa250c06ad077d6e5bb6537306b6194566fd"
"7e6b4ebb9b942642ec7bf3a435197ae11d5dd0576a2fe4506041c097657d0101")

pkgver()
{
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build()
{
cd "$srcdir/${pkgname%-git}"
cmake -B build \
-DCMAKE_BUILD_TYPE='None' \
-DCMAKE_INSTALL_PREFIX='/usr' \
-Wno-dev .
cmake --build build
}

package()
{
install -Dm755 -t "$pkgdir/usr/bin" "${srcdir}/${pkgname%-git}/build/${pkgname%-git}"
mkdir -pv "$pkgdir/var/lib/${pkgname%-git}/attachments"
cp -r "${srcdir}/${pkgname%-git}/"{statics,templates,themes} "${pkgdir}/var/lib/${pkgname%-git}"
install -Dm644 -t "$pkgdir/etc" "${srcdir}/${pkgname%-git}.yaml"
install -Dm644 "${srcdir}/sysusers-${pkgname%-git}.conf" "${pkgdir}/usr/lib/sysusers.d/${pkgname%-git}.conf"
install -Dm644 "${srcdir}/${pkgname%-git}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service"
}
9 changes: 9 additions & 0 deletions packages/arch/planck-blog.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
post_install()
{
chown -R planck:planck var/lib/planck-blog
}

post_upgrade()
{
chown -R planck:planck var/lib/planck-blog
}
12 changes: 12 additions & 0 deletions packages/arch/planck-blog.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=PlanckBlog service
After=network.target

[Service]
User=planck
Group=planck
ExecStart=/usr/bin/planck-blog
Restart=on-failure

[Install]
WantedBy=multi-user.target
12 changes: 12 additions & 0 deletions packages/arch/planck-blog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data-dir: "/var/lib/planck-blog"
attachment-dir: "/var/lib/planck-blog/attachments"
listen-address: localhost
listen-port: 8080
# client-id:
# client-secret:
# openid-url-prefix:
base-url: http://localhost:8080
languages:
- en-US
blog-title: My Blog
default-theme: planck-light
1 change: 1 addition & 0 deletions packages/arch/sysusers-planck-blog.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u planck - "PlanckBlog service user" - -

0 comments on commit df80abd

Please sign in to comment.