You are not logged in.

#1 2021-04-19 21:00:21

pmeier
Member
Registered: 2021-04-19
Posts: 2

Help with first PKGBUILD

Hey y'all,

I'm working on my first AUR package. This is the PKGBUILD so far:

# Maintainer: Philip Meier <meier.philip@posteo.de>
pkgname='timeular'
pkgver='3.8.0'
pkgrel=1
epoch=1
pkgdesc='A proprietary time tracking service'
arch=('x86_64')
url='https://timeular.com'
license=('unknown')
source=('https://s3.amazonaws.com/timeular-desktop-packages/linux/production/Timeular.AppImage'
	'timeular.png'
        'timeular.desktop')
sha512sums=('2de29f4b585ad993d076d514195fb6b76341e850dde27ac26eaa14eb7223aede756a2c010ee3dde63f4de6782933835a6c6f671bcccc6d54fc81750f536ca438'
	    'SKIP'
            'SKIP')

package() {
    # No idea why, but the install command below corrupts the file, so we do it manually instead.
    # If you read this and know how to fix it, please let me know.
    # install -Dm755 "${srcdir}/Timeular.AppImage" "${pkgdir}/opt/timeular/Timeular.AppImage" 
    mkdir -p "${pkgdir}/opt/timeular"
    mv "${srcdir}/Timeular.AppImage" "${pkgdir}/opt/timeular/Timeular.AppImage"
    chmod 755 "${pkgdir}/opt/timeular/Timeular.AppImage"
    
    install -Dm644 "${srcdir}/timeular.png" "${pkgdir}/usr/share/pixmaps/timeular.png"
    install -Dm644 "${srcdir}/timeular.desktop" "${pkgdir}/usr/share/applications/timeular.desktop"

    mkdir -p "${pkgdir}/usr/bin"
    ln -s "${pkgdir}/opt/timeular/Timeular.AppImage" "${pkgdir}/usr/bin/timeular"
}

I have two problems:

  1. Using the install command for the appimage within the PKGBUILD corrupts the file and makes it unusable. If I perform the same command manually, it works just fine.

  2. Using makepkg locally works fine with this, but installing it through a AUR helper breaks the symlink to /usr/bin/timeular.

Could someone give me some hints on what I'm doing wrong here? Other comments to improve this are also much appreciated.

Offline

#2 2021-04-19 21:31:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Help with first PKGBUILD

First is the license issue.  There should be a license, or no one can legally use this.  I checked the upstream url and this is paid software.  Who owns / runs the s3 instance you are downloading from?  Do they have rights to distribute this?  I doubt it.

Last edited by Trilby (2021-04-20 21:47:51)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-04-19 22:17:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Help with first PKGBUILD

I would guess the corruption is coming later, when makepkg strips things. Try with the !strip option. For the symlink, you're making a symlink that points to the temporary dir where things are staged. The target needs to be where the file actually gets installed by the package.

Side note, brand new packages shouldn't have an epoch.

Offline

#4 2021-04-19 22:20:10

a821
Member
Registered: 2012-10-31
Posts: 381

Re: Help with first PKGBUILD

The download link is right there in their webpage, and since it is there I guess it should be OK™. It looks like a trial or demo.

I would rename the appimage file because it may not change on updates (see here).

Offline

#5 2021-04-19 23:10:52

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: Help with first PKGBUILD

Trilby wrote:

First is the license issue.  There should be a license, or no one can legally use this.  I checked the upstream url and this is paid software.  Who owns / runs the s3 instance you are downloading from?  Do they have rights to distribute this?  I doubt it.

Trilby,

Just to clarify, the download link that a821 is using was found on their main download page. As strange as the URL is, this appears to be entirely legit as far as I'm concerned.

Though, from a licensing standpoint, this definitely looks proprietary (not inherently a problem in the AUR, but should be marked as-such in the license field).

All the best,

-HG

Offline

#6 2021-04-20 03:19:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Help with first PKGBUILD

Ah, sorry I missed that on their page - I was only getting to the purchase links.  But if it is from that website, they do list their license which should be included in the package:
https://timeular.com/sa/


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2021-04-20 21:20:18

pmeier
Member
Registered: 2021-04-19
Posts: 2

Re: Help with first PKGBUILD

@Scimmia: You were right about the stripping that causes the corruption.
@a821: Thanks for the hint of unique filenames.
@Trilby: Thanks for pointing out the license on their website. I completely missed that.

The PKGBUILD now looks like this:

# Maintainer: Philip Meier <meier.philip@posteo.de>
pkgname='timeular'
pkgver='3.8.0'
pkgrel=2
pkgdesc='A proprietary time tracking service'
arch=('x86_64')
url='https://timeular.com'
license=('custom')
depends=('zlib')
options=('!strip')
source=('https://s3.amazonaws.com/timeular-desktop-packages/linux/production/Timeular.AppImage'
	'LICENSE'
	'timeular.png'
        'timeular.desktop')
sha512sums=('2de29f4b585ad993d076d514195fb6b76341e850dde27ac26eaa14eb7223aede756a2c010ee3dde63f4de6782933835a6c6f671bcccc6d54fc81750f536ca438'
	    'SKIP'
	    'SKIP'
            'SKIP')

package() {
    target="/opt/${pkgname}/${pkgname}-${pkgver}.appimage"
    install -Dm755 "${srcdir}/Timeular.AppImage" "${pkgdir}/${target}" 
    mkdir -p "${pkgdir}/usr/bin"
    ln -s ${target} "${pkgdir}/usr/bin/timeular"
    
    install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 "${srcdir}/timeular.png" "${pkgdir}/usr/share/pixmaps/timeular.png"
    install -Dm644 "${srcdir}/timeular.desktop" "${pkgdir}/usr/share/applications/timeular.desktop"
}

Thanks a lot for the swift and helpful support.

Offline

#8 2021-04-20 21:49:06

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Help with first PKGBUILD

I suggest quoting $target (`ln -s ...').

Offline

#9 2021-04-22 17:53:25

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

Re: Help with first PKGBUILD

The quoting is unnecessary, but does no harm -- the value of ${target} is statically coded and doesn't contain spaces.

I'd recommend license=('custom:Proprietary') although at some point a couple of TUs would like to propose a new standard for licenses using the SPDX identifiers.


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

Offline

#10 2021-04-22 20:14:02

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: Help with first PKGBUILD

Why do you skip 3/4 source file checksums?
Just provide the checksums of the other files as well.

Offline

#11 2021-04-22 21:15:01

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Help with first PKGBUILD

Also, the $target variable should be declared as local to the function (`local target[=...]') or renamed to ${_target}.  (The Package Guidelines require the latter but I do not see no harm in the former.)

Offline

#12 2021-04-23 01:36:34

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

Re: Help with first PKGBUILD

schard wrote:

Why do you skip 3/4 source file checksums?
Just provide the checksums of the other files as well.

This is cosmetics and helps you avoid getting into the habit of skipping important files sourced from an URL. But if you successfully downloaded one file via git, it's unlikely any other files are damaged in the process...

respiranto wrote:

Also, the $target variable should be declared as local to the function (`local target[=...]') or renamed to ${_target}.  (The Package Guidelines require the latter but I do not see no harm in the former.)

There is mostly no difference, but, if makepkg errors out then the traps it runs are going to run inside the function scope.

So, if you clash with variables such as srclinks or logpipe for example, makepkg might try to treat them as filenames to remove...


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

Offline

Board footer

Powered by FluxBB