shamela-native
The PKGBUILD downloads a prebuilt AppImage (inside a tar.xz) from archive.org — a third-party mirror/archive host rather than the official shamela.ws distribution channel. The AppImage is then executed during the prepare() phase (`./shamela.AppImage --appimage-extract`) to extract its squashfs contents. This means arbitrary code bundled in the AppImage runs at build time. While archive.org is a reputable hosting service and a sha1sum is provided (though SHA-1 is weak), the source is not the official vendor host, making this a genuine supply-chain concern: if the archive.org copy were replaced or tampered with, the sha1sum check would be the only guard (and SHA-1 is collision-vulnerable). Additionally, shamela.py is sourced locally (SKIP checksum) and installed as an executable wrapper, which is another unverified code vector. The combination of an executed binary from a non-official host with a weak/skipped integrity check justifies a MEDIUM rating.
Triggered rules
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:21
"shamela-linux-${pkgver}.tar.xz::https://archive.org/download/shamela_download/shamela-linux-${pkgver}.tar.xz"
llm_review
An AI model (anthropic/claude-4.6-sonnet-20260217) reviewed this and agrees it is MEDIUM (confidence 72%): The PKGBUILD downloads a prebuilt AppImage (inside a tar.xz) from archive.org — a third-party mirror/archive host rather than the official shamela.ws distribution channel. The AppImage is then executed during the prepare() phase (`./shamela.AppImage --appimage-extract`) to extract its squashfs contents. This means arbitrary code bundled in the AppImage runs at build time. While archive.org is a reputable hosting service and a sha1sum is provided (though SHA-1 is weak), the source is not the official vendor host, making this a genuine supply-chain concern: if the archive.org copy were replaced or tampered with, the sha1sum check would be the only guard (and SHA-1 is collision-vulnerable). Additionally, shamela.py is sourced locally (SKIP checksum) and installed as an executable wrapper, which is another unverified code vector. The combination of an executed binary from a non-official host with a weak/skipped integrity check justifies a MEDIUM rating.
PKGBUILD
1 offending line(s) highlightedpkgname=shamela-native
pkgver=1447.11
pkgrel=3
pkgdesc="Al-Maktaba Al-Shamela — Arabic and Islamic digital library"
arch=('x86_64')
url="https://shamela.ws"
license=('LicenseRef-shamela')
depends=(
'fuse2'
'libselinux'
'libxcrypt-compat'
'python'
)
makedepends=(
'squashfs-tools'
)
conflicts=('shamela' 'shamela-bin')
options=('!strip')
source=(
"shamela.py"
"shamela-linux-${pkgver}.tar.xz::https://archive.org/download/shamela_download/shamela-linux-${pkgver}.tar.xz"
)
sha1sums=(
'SKIP'
'cbe0e8282bd8470b1a30c8bb55be9fc205b8f394'
)
prepare() {
cd "${srcdir}/shamela"
# ── Extract squashfs from the AppImage (requires FUSE) ────────────────
# AppImage extraction uses the built-in --appimage-extract mechanism
chmod +x shamela.AppImage
./shamela.AppImage --appimage-extract
sed -i '/^Exec=/c\Exec=/usr/bin/shamela' squashfs-root/shamela.desktop
}
package() {
# ── Upstream tarball seed (/opt) ─────────────────────────────────────
# Store the upstream tar.xz as-is for first-run seeding by /usr/bin/shamela
install -d "${pkgdir}/opt/shamela"
install -Dm644 "${srcdir}/shamela-linux-${pkgver}.tar.xz" \
"${pkgdir}/opt/shamela/shamela.tar.xz"
# ── Wrapper / lifecycle manager (/usr/bin) ─────────────────────────────
install -Dm755 shamela.py \
"${pkgdir}/usr/bin/shamela"
# ── System .desktop entry (/usr/share/applications) ───────────────────
# The app's own shortcut generation is suppressed at first seed via a
# settings db patch (shortcut_desktop=false, shortcut_start=false in
# database/user/data.db), making this the permanent and only .desktop
install -Dm644 "${srcdir}/shamela/squashfs-root/shamela.desktop" \
"${pkgdir}/usr/share/applications/shamela.desktop"
# System icon (96×96 RGBA PNG, extracted from AppImage squashfs)
# Referenced as Icon=shamela in the .desktop file
install -Dm644 \
"${srcdir}/shamela/squashfs-root/usr/share/icons/hicolor/96x96/apps/shamela.png" \
"${pkgdir}/usr/share/icons/hicolor/96x96/apps/shamela.png"
# ── Licenses ───────────────────────────────────────────────────────────
install -Dm644 \
shamela/app/linux/64/jre/2/legal/java.base/LICENSE \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 \
shamela/app/linux/64/jre/2/legal/java.base/ADDITIONAL_LICENSE_INFO \
"${pkgdir}/usr/share/licenses/${pkgname}/ADDITIONAL_LICENSE_INFO"
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-17 00:27:14 | Medium | 2 |
| 2026-09-16 00:03:17 | Medium | 2 |
| 2026-09-15 00:25:31 | Medium | 2 |
| 2026-09-14 00:27:57 | Medium | 2 |
| 2026-09-13 00:19:54 | Medium | 2 |
| 2026-09-12 00:25:17 | Medium | 2 |
| 2026-09-11 00:19:22 | Medium | 2 |
| 2026-09-10 00:22:44 | Medium | 2 |
| 2026-09-09 00:04:09 | Medium | 2 |
| 2026-09-08 00:18:08 | Medium | 2 |
| 2026-09-07 00:30:15 | Medium | 2 |
| 2026-09-06 00:17:06 | Medium | 2 |
| 2026-09-05 00:16:27 | Medium | 2 |
| 2026-09-04 00:03:13 | Medium | 2 |
| 2026-09-03 00:15:47 | Medium | 2 |
| 2026-09-02 00:02:31 | Medium | 2 |
| 2026-09-01 00:11:19 | Medium | 2 |
| 2026-08-31 00:19:57 | Medium | 2 |
| 2026-08-30 00:04:14 | Medium | 2 |
| 2026-08-29 00:29:17 | Medium | 2 |