You are not logged in.

#1 2023-09-22 12:48:38

raffaem
Member
Registered: 2023-07-04
Posts: 22

How to pack updated daily binary files

I would like to distribute BoBoTiG's dictionaries through the AUR.

The "problem" is that they are updated daily.

So I have two questions:
1. What should I use for checksumming? Just skip it?
2. What should I use for pkgver? Technically the pkgver is the date of today.

But I'm not going to upload a new PKGBUILD every day, obviously.

Offline

#2 2023-09-23 06:42:41

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

I came up with the following:

# Maintainer: Xiao Pan <gky44px1999@gmail.com>
pkgname=stardict-bobotig-en
pkgver=1
pkgrel=1
pkgdesc='Wiktionary English-English Dictionary for StarDict'
arch=('any')
url='https://www.dictinfo.com/'
license=('cc-by-sa-3.0')
source=("https://github.com/BoboTiG/ebook-reader-dict/releases/download/en/dict-en-en.zip")
b2sums=('SKIP')

package()
{
	install -Dm644 dict-data.dict.dz  dict-data.idx  dict-data.ifo  dict-data.syn -t "$pkgdir/usr/share/stardict/dic/bobotig-en"
	install -Dm644 ./res/* -t "$pkgdir/usr/share/stardict/dic/bobotig-en/res"
}

Waiting for your suggestions

Offline

#3 2023-09-23 07:35:02

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

Re: How to pack updated daily binary files

Why don't you just create a VCS package?

Offline

#4 2023-09-23 08:47:36

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

Because those files are not under VCS. They are downloaded every day from Wiktionary and packed. That's my understanding.

Offline

#5 2023-09-23 09:40:14

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

Re: How to pack updated daily binary files

So AFAICT, upstream just creates daily dumps of Wikidict and force pushes to github with no tracking whatsoever... Not sure if it's worth packaging for the AUR.

That said, if you really want to, you would need to update the PKGBUILD every day IMHO. Look at the "nightly" packages in the AUR, they use a script+timer/action to automatize the task.

Offline

#6 2023-09-23 10:04:18

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

No I'm not able to upload a PKGBUILD every day.

Also if a day I don't the PKGBUILD won't work because the checksums have changed.

Maybe we can write an installer that downloads/updates the dictionaries, and pack that wrapper for the AUR

Last edited by raffaem (2023-09-23 10:05:00)

Offline

#7 2023-09-23 10:15:02

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

I think we can leave it like that.

Most people won't have the need to update the dictionary every day. They can just re-install the package now and then anyway, so almost surely when they reinstall the package the dictionary has been updated upstream.

Offline

#8 2023-09-27 17:46:28

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

The maintainer is releasing checksum files for his package. See here.

But I still think that's not good enough, since the checksum must be hardcoded into the PKGBUILD.

When I am inside the `prepare()` function, makepkg has already decompressed the file for me.

Am I right? How can we arrange that?

Offline

#9 2023-09-27 18:14:57

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

Re: How to pack updated daily binary files

You can use a VCS-style PKGBUILD even if the source isn't technically a VCS.  But this sacrifices the ability to use any checksums (at least in any meaningful way).

You can call this a -devel package, and use a pkgver function that extracts the date from one of the files in the bundle, e.g., `sed -n 's/^date=//p' dict-data.ifo`.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2023-09-28 03:00:19

raffaem
Member
Registered: 2023-07-04
Posts: 22

Re: How to pack updated daily binary files

Is this good enough?

# Maintainer: Raffaele Mancuso <raffaelemancuso532@gmail.com>
_lang=en
_langfull=English
pkgname="stardict-bobotig-${_lang}"
pkgver=2023_09_20
pkgrel=1
pkgdesc="${_langfull} monolingual dictionary, based on Wiktionary, StarDict file format, BoboTiG's daily dumps"
arch=("any")
url="https://github.com/BoboTiG/ebook-reader-dict"
license=('cc-by-sa-3.0')
source=("https://github.com/BoboTiG/ebook-reader-dict/releases/download/${_lang}/dict-${_lang}-${_lang}.zip")
b2sums=("SKIP")

pkgver() {
	sed -n 's/^date=//p' dict-data.ifo | sed 's/-/_/g'
}

package() {
	install -Dm644 dict-data.dict.dz dict-data.idx dict-data.ifo -t "${pkgdir}/usr/share/stardict/dic/bobotig-${_lang}"
	if [ -f dict-data.syn ]; then
		install -Dm644 dict-data.syn -t "${pkgdir}/usr/share/stardict/dic/bobotig-${_lang}"
	fi
	if [ -d ./res ]; then
		install -Dm644 ./res/* -t "${pkgdir}/usr/share/stardict/dic/bobotig-${_lang}/res"
	fi
}

Offline

Board footer

Powered by FluxBB