You are not logged in.
Hi,
I'm having a go at writing my first PKGBUILD for littlefedi and am using the following to guide my learning...
[ul]
[li]Arch Wiki : Creating Packages[/li]
[li]Arch Wiki : PKGBUILD[/li]
[/ul]
I've come up with the following, the .service files that come with the package point to /usr/local/bin so I tweak these to point to /usr/bin
# Maintainer: slackline <slackline at mymail dot com>
pkgname=littlefedi
pkgrel=1
pkgdesc="A small ActivityPub server written in Go with SQLite, local media storage and a web interface that
works without JavaScript."
url="https://littlefedi.org/"
license=('MIT')
makedepends=('go')
install=
changelog=
source=("${url}/downloads/${pkgname}-${pkgver}-source.tar.gz")
noextract=()
sha256sums=('55a8e305893dc7f72f2062406a941b9efb397c6548d909213a621fabb9d17f44')
validpgpkeys=()
build() {
cd "${pkgname}-${pkgver}"
make build-blog
}
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}/packaging/linux"
# .service files look for binaries in /usr/local/bin/ switch to /usr/bin/
sed -i "s/local\///" *.service
# Switch user to root in service file (unclear how to create user/groups post_install() doesn't appear to run)
sed -i "s/=littlefedi/=root/" littlefedi.service
}
package() {
install -Dm 755 "${pkgname}-${pkgver}/littlefedi-blog" "${pkgdir}/usr/bin/littlefedi"
install -Dm 644 "${pkgname}-${pkgver}/config/littlefedi.toml.example"
"${pkgdir}/etc/littlefedi/littlefedi.toml.example"
install -Dm 644 "${pkgname}-${pkgver}/config/config.go" "${pkgdir}/etc/littlefedi/config.go"
install -Dm 644 "${pkgname}-${pkgver}/config/littlemesh-directory.toml.example"
"${pkgdir}/etc/littlefedi/littlemesh-directory.toml.example"
install -Dm 644 "${pkgname}-${pkgver}/packaging/linux/littlefedi.service"
"${pkgdir}/usr/lib/systemd/system/littlefedi.service"
install -Dm 644 "${pkgname}-${pkgver}/packaging/linux/littlefedi-directory.service"
"${pkgdir}/usr/lib/systemd/system/littlefedi-directory.service"
install -Dm 644 "${pkgname}-${pkgver}/packaging/linux/littlefedi-lighthouse.service"
"${pkgdir}/usr/lib/systemd/system/littlefedi-lighthouse.service"
touch "${pkgdir}/etc/littlefedi/littlefedi.env"
install -Dm 644 "${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/littlefedi/LICENSE"
mkdir -p "${pkgdir}/var/lib/littlefedi"
}
post_install() {
useradd --no-create-home --user-group littlefedi
chown -R littleffedi:littlefedi /var/lib/littlefedi
echo ""
echo "LittleFedi"
echo "=========="
echo ""
echo "To get started with LittleFedi answer the prompts to..."
echo ""
echo " littlefedi init [--config /etc/littlefedi/littlefedi.toml]"
echo ""
echo "The resulting configuration file can be edited and you should"
echo "consult the '/etc/littlefedi/littlefedi.toml.example for more"
echo "options."
echo ""
echo "See also the official documentation for mor information : "
echo ""
echo "https://littlefedi.org/docs.html"
}Running makepkg completes but with a warning...
❱ makepkg -f
==> Making package: littlefedi 26.10.13-1 (Sun 25 Oct 2026 12:06:12 GMT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found littlefedi-26.10.13-source.tar.gz
==> Validating source files with sha256sums...
littlefedi-26.10.13-source.tar.gz ... Passed
==> Extracting sources...
-> Extracting littlefedi-26.10.13-source.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X brew.bsd.cafe/littlecomputerpeople/littlef
edi/internal/version.Version=26.10.13" -tags " blog" -o littlefedi-blog ./cmd/littlefedi
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
-> Removing libtool files...
-> Removing static library files...
-> Purging unwanted files...
-> Stripping unneeded symbols from binaries and libraries...
Error while writing index for `/home/neil/aur/littlefedi/pkg/littlefedi/usr/bin/littlefedi': No debugging symbols
gdb-add-index: No index was created for ./usr/bin/littlefedi
gdb-add-index: [Was there no debuginfo? Was there already an index?]
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "littlefedi"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Creating package "littlefedi-debug"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: littlefedi 26.10.13-1 (Sun 25 Oct 2026 12:06:15 GMT)I see there is an error here but the package built.
Trying in a clean chroot environment with pkgctl build it
❱ pkgctl build
==> Updating pacman database cache
:: Synchronizing package databases...
core downloading...
extra downloading...
multilib downloading...
==> Building littlefedi
-> repo: extra
-> arch: x86_64
-> worker: neil-5
==> Building littlefedi for [extra] (x86_64)
Place your finger on the fingerprint reader
^C[sudo] password for neil:
Note: in a future version of systemd-nspawn the default set of permitted socket address families will be restricted to A
F_INET, AF_INET6 and AF_UNIX. Use --restrict-address-families= to configure the set of permitted socket address families
, or set RestrictAddressFamilies= in a .nspawn file.
:: Synchronizing package databases...
core downloading...
extra downloading...
:: Starting full system upgrade...
there is nothing to do
==> Building in chroot for [extra] (x86_64)...
==> Synchronizing chroot copy [/var/lib/archbuild/extra-x86_64/root] -> [neil-5]...done
==> Making package: littlefedi 26.10.13-1 (Sun Oct 25 17:37:27 2026)
==> Retrieving sources...
-> Found littlefedi-26.10.13-source.tar.gz
==> Validating source files with sha256sums...
littlefedi-26.10.13-source.tar.gz ... Passed
Note: in a future version of systemd-nspawn the default set of permitted socket address families will be restricted to A
F_INET, AF_INET6 and AF_UNIX. Use --restrict-address-families= to configure the set of permitted socket address families
, or set RestrictAddressFamilies= in a .nspawn file.
==> Making package: littlefedi 26.10.13-1 (Sun Oct 25 17:37:30 2026)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...
Package (1) New Version Net Change
extra/go 2:1.27.3-1 226.64 MiB
Total Installed Size: 226.64 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
:: Processing package changes...
installing go...
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
-> Found littlefedi-26.10.13-source.tar.gz
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
-> Extracting littlefedi-26.10.13-source.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="-s -w -buildid= -X brew.bsd.cafe/littlecomputerpeople/littlef
edi/internal/version.Version=26.10.13" -tags " blog" -o littlefedi-blog ./cmd/littlefedi
go: downloading github.com/go-chi/chi/v5 v5.3.1
go: downloading github.com/google/uuid v1.6.0
go: downloading golang.org/x/term v0.44.0
go: downloading github.com/pquerna/otp v1.5.0
go: downloading golang.org/x/crypto v0.53.0
go: downloading github.com/microcosm-cc/bluemonday v1.0.27
go: downloading github.com/yuin/goldmark v1.8.2
go: downloading golang.org/x/net v0.56.0
go: downloading github.com/BurntSushi/toml v1.6.0
go: downloading github.com/bbrks/go-blurhash v1.2.0
go: downloading github.com/disintegration/imaging v1.6.2
go: downloading golang.org/x/image v0.45.0
go: downloading golang.org/x/sys v0.47.0
go: downloading github.com/uptrace/bun v1.2.18
go: downloading github.com/coder/websocket v1.8.15
go: downloading modernc.org/sqlite v1.53.0
go: downloading github.com/gowebpki/jcs v1.0.1
go: downloading github.com/piprate/json-gold v0.8.0
go: downloading github.com/uptrace/bun/dialect/sqlitedialect v1.2.18
go: downloading github.com/uptrace/bun/extra/bundebug v1.2.18
go: downloading github.com/aymerick/douceur v0.2.0
go: downloading golang.org/x/text v0.41.0
go: downloading github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc
go: downloading github.com/gorilla/css v1.0.1
go: downloading github.com/fatih/color v1.18.0
go: downloading github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc
go: downloading github.com/jinzhu/inflection v1.0.0
go: downloading github.com/puzpuzpuz/xsync/v3 v3.5.1
go: downloading github.com/vmihailenco/msgpack/v5 v5.4.1
go: downloading github.com/cayleygraph/quad v1.3.0
go: downloading github.com/pquerna/cachecontrol v0.2.0
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/vmihailenco/tagparser/v2 v2.0.0
go: downloading modernc.org/libc v1.73.4
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
-> Removing libtool files...
-> Removing static library files...
-> Purging unwanted files...
-> Stripping unneeded symbols from binaries and libraries...
Error while writing index for `/build/littlefedi/pkg/littlefedi/usr/bin/littlefedi': No debugging symbols
gdb-add-index: No index was created for ./usr/bin/littlefedi
gdb-add-index: [Was there no debuginfo? Was there already an index?]
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "littlefedi"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Creating package "littlefedi-debug"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: littlefedi 26.10.13-1 (Sun Oct 25 17:38:23 2026)
==> Installing package littlefedi with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...
Package (2) New Version Net Change
littlefedi 26.10.13-1 27.57 MiB
littlefedi-debug 26.10.13-1 0.00 MiB
Total Installed Size: 27.57 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
:: Processing package changes...
installing littlefedi...
installing littlefedi-debug...
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
Skipped: Current root is not booted.
(2/2) Arming ConditionNeedsUpdate...
resolving dependencies...
looking for conflicting packages...
Package (6) New Version Net Change
core/licenses 20240728-1 1.54 MiB
extra/pyalpm 0.12.0-1 0.24 MiB
extra/python-boolean.py 5.0-2 0.36 MiB
extra/python-license-expression 30.4.4-2 1.24 MiB
extra/python-pyelftools 0.33-1 2.57 MiB
extra/namcap 3.6.0-3 1.00 MiB
Total Installed Size: 6.95 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
:: Processing package changes...
installing licenses...
installing pyalpm...
installing python-boolean.py...
installing python-license-expression...
installing python-pyelftools...
installing namcap...
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
Checking PKGBUILD
Checking littlefedi-26.10.13-1-any.pkg.tar.zst
littlefedi E: ELF file ('usr/bin/littlefedi') found in an 'any' package.
littlefedi W: ELF file ('usr/bin/littlefedi') lacks FULL RELRO, check LDFLAGS.
littlefedi W: ELF file ('usr/bin/littlefedi') lacks PIE.
littlefedi W: Directory (var/lib/littlefedi) is empty
Checking littlefedi-debug-26.10.13-1-any.pkg.tar.zst
littlefedi-debug E: ELF file ('usr/lib/debug/usr/bin/littlefedi.debug') found in an 'any' package.
littlefedi-debug W: Directory (usr/src/debug/littlefedi) is empty
==> Running checkpkg
error: target not found: littlefediI see the same error as with makepkg but also some others which appear concerning. Looking at the namcap log files
littlefedi-26.10.13-1-any.pkg.tar.zst-namcap.log
littlefedi E: ELF file ('usr/bin/littlefedi') found in an 'any' package.
littlefedi W: ELF file ('usr/bin/littlefedi') lacks FULL RELRO, check LDFLAGS.
littlefedi W: ELF file ('usr/bin/littlefedi') lacks PIE.
littlefedi W: Directory (var/lib/littlefedi) is emptyLast warning isn't a problem I created that deliberately but I've no idea about the ELF error or warnings.
I'm also confused why the post_install() section doesn't run. The packages included systemd service file expects the database to be under /var/lib/littlefedi/ and owned by the littlefedi account, hence trying to create it and change permissions (and also add some output so users have pointers on how to configure things).
Questions
1. What is the cause of the ELF file warnings and how to mitigate them?
2. How to create a user/group post install and show users info on configuration?
3. Quite likely I've made other dumb/naive mistakes please don't hold back!
Offline
As this is a go package you should check the archlinux go package guidelines
Your PKGBUILD misses an arch=('x86_64') field so makepkg defaults to arch=(any) . platform specific binaries are not allowed in arch=(any) packages.
The FULL RELRO & PIE messages are present because your build()/package() functions doesn't use the flags archlinux sets in /etc/makepkg.conf .
There's a good chance that following the go package guidelines will solve this.
Please remove fields without content like changelog= .
PKGBUILDs / Makepkg support only selected functions , details in https://wiki.archlinux.org/title/Creati … _functions
post_install only has meaning in a separate .install-file that's run upon install/update/remove of a package by pacman .
In 99.9 % of cases .install files are not needed anymore and there are methods to create a user/group for a specific package/purpose, but I've never needed them.
Others will have to answer that part.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline