You are not logged in.

#1 2025-05-30 20:27:47

WayfarerCodes
Member
Registered: 2025-05-30
Posts: 2

[Fixed] PKGBUILD error, attempts to put a file in the wrong directory

I'm trying to package software that I've been working on (hosted here), but I'm new to making my own PKGBUILDs and have run into an error I can't figure out how to solve. This is the output of makepkg -si in the same directory as the PKGBUILD:

==> Making package: storyfork 0.1.0-1 (Fri 30 May 2025 04:04:58 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found v0.1.0.zip
==> Validating source files with sha512sums...
v0.1.0.zip ... Skipped
==> Extracting sources...
-> Extracting v0.1.0.zip with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
cp: cannot create regular file '/home/username/tempfolder/pkg/storyfork/usr/bin/storyfork': No such file or directory
==> ERROR: A failure occurred in package().
Aborting...

And this is the PKGBUILD so far:

pkgname="storyfork"
pkgver="0.1.0"
pkgrel="1"
pkgdesc="A tool for reading CYOA stories written in text files"
arch=("any")
url="https://codeberg.org/wayfarer/StoryFork"
license=("GPL-3.0-only")
groups=("wayfarer")
depends=("python-pyqt6" "python3")
makedepends=("xdg-utils")
source=("$url/archive/v$pkgver.zip")
sha512sums=("SKIP")

package() {
	cp -T "${srcdir}/storyfork/src/storyfork.py" "${pkgdir}/usr/bin/storyfork"
	chmod +x "${pkgdir}/usr/bin/storyfork"
	xdg-mime install "${srcdir}/storyfork/build/mime-type.xml"
	cp "${srcdir}/storyfork/build/StoryFork.desktop" "${pkgdir}/usr/share/applications/StoryFork.desktop"
	cp "${srcdir}/storyfork/icons/storyfork-logo.png" "${pkgdir}/usr/share/icons/storyfork.png"
}

Last edited by WayfarerCodes (2025-05-30 22:01:43)

Offline

#2 2025-05-30 20:35:36

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,848
Website

Re: [Fixed] PKGBUILD error, attempts to put a file in the wrong directory

$pkgdir/ is empty at the start of the package() function, i.e. it doesn't contain a usr/bin directory. You can create it, copy the storyfork.py file there, and set the permissions in one command using 'install'. e.g.

install -Dm755 "${srcdir}/storyfork/src/storyfork.py" "${pkgdir}/usr/bin/storyfork"

Last edited by WorMzy (2025-05-30 20:37:32)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2025-05-30 22:00:48

WayfarerCodes
Member
Registered: 2025-05-30
Posts: 2

Re: [Fixed] PKGBUILD error, attempts to put a file in the wrong directory

That worked. Thanks for the help.

Offline

Board footer

Powered by FluxBB