You are not logged in.

#1 2020-08-08 15:04:47

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

PKGBUILD review request: SoulAnchor

Hi, please review my first PKGBUILD for my SoulAnchor - X11 Bible tool, must have app for Arch if i may say so myself wink

# Maintainer: Anchorman <soulanchor at protonmail dot com>
pkgname=soulanchor
pkgver=0.8.0
pkgrel=1
pkgdesc="X11 Bible tool"
arch=('x86_64')
url="https://www.dropbox.com/sh/jhuutnchr7pxru3/AAA7rtTic8LdeUFTKEtsW2hPa?dl=0"
license=('custom:soulanchor')
depends=(qt5-base qt5-multimedia)
source=("https://www.dropbox.com/s/zaqi0bnhhk682f3/$pkgname-$pkgver.tar.gz")
md5sums=("90dc5bf9f876b6d53724efdb5bdedb66")

package() {
	cd "$srcdir/$pkgname-$pkgver"
	cp -a usr "$pkgdir/"
	install -Dm644 usr/share/soulanchor/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	echo "Name[$LANG]=SoulAnchor" >> "$pkgname.desktop"
	install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
	install -Dm644 "$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}

2nd version without the echo line and with the --no-preserve

# Maintainer: Anchorman <soulanchor at protonmail dot com>
pkgname=soulanchor
pkgver=0.8.0
pkgrel=1
pkgdesc="X11 Bible tool"
arch=('x86_64')
url="https://www.dropbox.com/sh/jhuutnchr7pxru3/AAA7rtTic8LdeUFTKEtsW2hPa?dl=0"
license=('custom:soulanchor')
depends=(qt5-base qt5-multimedia)
source=("https://www.dropbox.com/s/zaqi0bnhhk682f3/$pkgname-$pkgver.tar.gz")
md5sums=("90dc5bf9f876b6d53724efdb5bdedb66")
Name=SoulAnchor

package() {
	cd "$srcdir/$pkgname-$pkgver"
	cp -a --no-preserve=ownership usr "$pkgdir/"
	install -Dm644 usr/share/soulanchor/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
	install -Dm644 "$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}

Last edited by Anchorman (2020-08-08 18:14:45)

Offline

#2 2020-08-08 15:35:42

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: PKGBUILD review request: SoulAnchor

	cp -a usr "$pkgdir/"

Adding --no-preserve=ownership ensure the files will be owned by root in case the originals were not (not an issue in this case)

	echo "Name[$LANG]=SoulAnchor" >> "$pkgname.desktop"

Why not have Name=SoulAnchor in soulanchor.desktop?  You are only providing one version of the string,  if $LANG is unset or different between the build user and the executing user you will get an unexpected result.  It also makes the build unreproducible.

Offline

#3 2020-08-08 15:48:02

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

About the soulanchor.desktop file: there is already a name line but i noticed unexpected behaviour of automatic addition of another Name line with the value SoulAnchor.desktop which resulted in the menu name: SoulAnchor.desktop. So i hope to prevent it in this manner.

Edit: ok this is weird... now it's gone i see...
Edit2: no it's not, i was right, it is in the .desktop file

Last edited by Anchorman (2020-08-08 16:02:13)

Offline

#4 2020-08-08 16:34:07

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: PKGBUILD review request: SoulAnchor

After you have installed soulanchor-0.8.0-1-x86_64.pkg.tar.zst does `pacman -Qkk` show /usr/share/applications/soulanchor.desktop as being modified?

Offline

#5 2020-08-08 17:15:55

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

zst? i get an xz
The output of pacman -Qkk soulanchor is: soulanchor: 60 total files, 0 altered files
I'm thinking it's something that runs in the xfce4 environment that sometimes changes my desktop file...

EDIT: confirmed, if i rename a file to .desktop in thunar, it automatically adds the name[lang]=soulanchor.desktop line.
If i remove the line, it will auto remove the .desktop extension. Thanks thunar/xfce!
EDIT2: the filename is not changed if i check with a terminal but thunar just displays it with the Name value

Last edited by Anchorman (2020-08-08 18:17:42)

Offline

#6 2020-08-09 10:26:26

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

I guess this is a simple PKGBUILD and there are no more improvements?

Offline

#7 2020-08-09 11:13:53

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: PKGBUILD review request: SoulAnchor

There is no way Thunar or any other part of Xfce could modify this file. They have no write access to anything in “/usr”. Unless you are running your DE as root, which would be a serious problem on its own.

I am also unable to reproduce that behaviour. When changing a name of a file, to which Thunar has write access, it never modified it contents. It displays it as “filename.desktop” if the Name entry is missing (which may include the name being invalid or some syntax error occuring), but the file remains unmodified.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#8 2020-08-09 11:41:35

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

mpan wrote:

There is no way Thunar or any other part of Xfce could modify this file. They have no write access to anything in “/usr”. Unless you are running your DE as root, which would be a serious problem on its own.

I'm not talking about changing anything in /usr once it's installed. Just in a regular directory.

I am also unable to reproduce that behaviour. When changing a name of a file, to which Thunar has write access, it never modified it contents. It displays it as “filename.desktop” if the Name entry is missing (which may include the name being invalid or some syntax error occuring), but the file remains unmodified.

Yes Thunar will display a different filename than it's actual filename which i think is very confusing. As to modifying it's contents, i think this happened:

I create a soulanchor.desktop file. After a while i notice that it's missing the .desktop extension in thunar and why would i assume that it's not the actual filename right? So i change it back to filename.desktop only now this gets added without me realizing: Name[en_US.UTF-8]=SoulAnchor.desktop.

So once i installed that on the system from the package i got a SoulAnchor.desktop menu entry.

Last edited by Anchorman (2020-08-09 11:42:58)

Offline

#9 2020-08-09 19:22:11

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

I think i've done the git thing correctly, since it's now on the AUR!

Offline

#10 2020-08-09 20:08:14

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PKGBUILD review request: SoulAnchor

The Name= variable seems to not be used by anything?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2020-08-09 20:28:29

Anchorman
Member
Registered: 2020-07-26
Posts: 49
Website

Re: PKGBUILD review request: SoulAnchor

It was a first version of the PKGBUILD based on a misunderstanding of weird behaviour by thunar. It was adding a localized Name entry to the .desktop file.

Offline

Board footer

Powered by FluxBB