You are not logged in.
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
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
Why don't you just create a VCS package?
Offline
Because those files are not under VCS. They are downloaded every day from Wiktionary and packed. That's my understanding.
Offline
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
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
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
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
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
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