Draft: [3.19] user/mumble-{web, proxy}: move from unmaintained #814

Open
forge wants to merge 6 commits from mumble-web/enable-319 into v3.19
15 changed files with 372 additions and 91 deletions

View file

@ -108,7 +108,7 @@ set_repositories_for() {
[ "$repo" = "$target_repo" ] && break
done
doas sh -c "printf '%s\n' $repos >> /etc/apk/repositories"
doas apk update
doas apk update || true
}
apply_offset_limit() {

41
.forgejo/bin/check_ver.sh Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
# expects the following env variables:
# downstream: downstream repo
repo=${downstream/*\/}
curl --silent $downstream/x86_64/APKINDEX.tar.gz | tar -O -zx APKINDEX > APKINDEX
if [ "$ALL_PACKAGES" == "true" ]; then
owned_by_you=$(awk -F ':' '{if($1=="o"){print $2}}' APKINDEX | sort | uniq)
echo "Found $(printf '%s\n' $owned_by_you | wc -l ) packages"
else
owned_by_you=$(awk -v RS= -v ORS="\n\n" '/m:Antoine Martin \(ayakael\) <dev@ayakael.net>/' APKINDEX | awk -F ':' '{if($1=="o"){print $2}}' | sort | uniq)
echo "Found $(printf '%s\n' $owned_by_you | wc -l ) packages owned by you"
fi
rm -f out_of_date not_in_anitya
for pkg in $owned_by_you; do
upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Alpine" | jq -r '.items.[].stable_version')
downstream_version=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}' | sort -V | tail -n 1)
downstream_version=${downstream_version/-*}
# special cases
case $pkg in
freetube) upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Alpine" | jq -r '.items.[].version' | sed "s|-beta||");;
dotnet9-sdk|dotnet9-stage0) upstream_version=${upstream_version/-*};;
esac
if [ -z "$upstream_version" ]; then
echo "$pkg not in anitya"
echo "$pkg" >> not_in_anitya
elif [ "$downstream_version" != "$(printf '%s\n' $upstream_version $downstream_version | sort -V | head -n 1)" ]; then
echo "$pkg higher downstream"
continue
elif [ "$upstream_version" != "$downstream_version" ]; then
echo "$pkg upstream version $upstream_version does not match downstream version $downstream_version"
echo "$pkg $downstream_version $upstream_version $repo" >> out_of_date
fi
done

17
.forgejo/bin/clear-repo.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
TARGET_REPO=$1
ARCH=$2
curl --silent $TARGET_REPO/$ARCH/APKINDEX.tar.gz | tar -O -zx APKINDEX > APKINDEX
pkgs=$(awk -F ':' '{if($1=="o"){print $2}}' APKINDEX | sort | uniq)
for pkg in $pkgs; do
pkgvers=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}')
for pkgver in $pkgvers; do
echo "Deleting $pkg-$pkgver of arch $ARCH from $TARGET_REPO"
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$ARCH/$pkg-$pkgver.apk
done
done

165
.forgejo/bin/create_issue.sh Executable file
View file

@ -0,0 +1,165 @@
#!/bin/bash
# expects:
# env variable FORGEJO_TOKEN
# file out_of_date
IFS='
'
repo=${downstream/*\/}
does_it_exist() {
name=$1
downstream_version=$2
upstream_version=$3
repo=$4
query="$repo/$name: upgrade to $upstream_version"
query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )"
result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
if [ "$result" == "[]" ]; then
return 1
fi
}
is_it_old() {
name=$1
downstream_version=$2
upstream_version=$3
repo=$4
query="$repo/$name: upgrade to"
query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )"
result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
result_title="$(echo $result | jq -r '.[].title' )"
result_id="$(echo $result | jq -r '.[].number' )"
result_upstream_version="$(echo $result_title | awk '{print $4}')"
if [ "$upstream_version" != "$result_upstream_version" ]; then
echo $result_id
else
echo 0
fi
}
update_title() {
name=$1
downstream_version=$2
upstream_version=$3
repo=$4
id=$5
result=$(curl --silent -X 'PATCH' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
-d "{
\"title\": \"$repo/$name: upgrade to $upstream_version\"
}"
)
return 0
}
create_issue() {
name=$1
downstream_version=$2
upstream_version=$3
repo=$4
result=$(curl --silent -X 'POST' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
-d "{
\"title\": \"$repo/$name: upgrade to $upstream_version\",
\"labels\": [
$LABEL_NUMBER
]
}")
return 0
}
if [ -f out_of_date ]; then
out_of_date="$(cat out_of_date)"
echo "Detected $(wc -l out_of_date) out-of-date packages, creating issues"
for pkg in $out_of_date; do
name="$(echo $pkg | awk '{print $1}')"
downstream_version="$(echo $pkg | awk '{print $2}')"
upstream_version="$(echo $pkg | awk '{print $3}')"
repo="$(echo $pkg | awk '{print $4}')"
if does_it_exist $name $downstream_version $upstream_version $repo; then
echo "Issue for $repo/$name already exists"
continue
fi
id=$(is_it_old $name $downstream_version $upstream_version $repo)
if [ "$id" != "0" ] && [ -n "$id" ]; then
echo "Issue for $repo/$name needs updating"
update_title $name $downstream_version $upstream_version $repo $id
continue
fi
echo "Creating issue for $repo/$name"
create_issue $name $downstream_version $upstream_version $repo
done
fi
if [ -f not_in_anitya ]; then
query="Add missing $repo packages to anitya"
query="$(echo $query | sed 's| |%20|g')"
result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN"
)"
if [ "$result" == "[]" ]; then
echo "Creating anitya issue"
result=$(curl --silent -X 'POST' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
-d "{
\"title\": \"Add missing $repo packages to anitya\",
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\",
\"labels\": [
$LABEL_NUMBER
]
}")
else
echo "Updating anitya issue"
result_id="$(echo $result | jq -r '.[].number' )"
result=$(curl --silent -X 'PATCH' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \
-H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \
-H 'Content-Type: application/json' \
-d "{
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\"
}"
)
fi
fi

View file

@ -0,0 +1,28 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
jobs:
check-backports:
name: Check backports repo
runs-on: x86_64
container:
image: alpine:latest
env:
downstream: https://ayakael.net/api/packages/forge/alpine/v3.21/backports
FORGEJO_TOKEN: ${{ secrets.forgejo_token }}
LABEL_NUMBER: 1
ALL_PACKAGES: true
steps:
- name: Environment setup
run: apk add grep coreutils gawk curl wget bash nodejs git jq sed
- name: Get scripts
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check out-of-date packages
run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh
- name: Create issues
run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh

View file

@ -0,0 +1,27 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
jobs:
check-community:
name: Check community repo
runs-on: x86_64
container:
image: alpine:latest
env:
downstream: https://dl-cdn.alpinelinux.org/alpine/edge/community
FORGEJO_TOKEN: ${{ secrets.forgejo_token }}
LABEL_NUMBER: 4
steps:
- name: Environment setup
run: apk add grep coreutils gawk curl wget bash nodejs git jq sed
- name: Get scripts
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check out-of-date packages
run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh
- name: Create issues
run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh

View file

@ -0,0 +1,27 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
jobs:
check-community:
name: Check testing repo
runs-on: x86_64
container:
image: alpine:latest
env:
downstream: https://dl-cdn.alpinelinux.org/alpine/edge/testing
FORGEJO_TOKEN: ${{ secrets.forgejo_token }}
LABEL_NUMBER: 4
steps:
- name: Environment setup
run: apk add grep coreutils gawk curl wget bash nodejs git jq sed
- name: Get scripts
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check out-of-date packages
run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh
- name: Create issues
run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh

View file

@ -0,0 +1,27 @@
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
jobs:
check-user:
name: Check user repo
runs-on: x86_64
container:
image: alpine:latest
env:
downstream: https://ayakael.net/api/packages/forge/alpine/edge/user
FORGEJO_TOKEN: ${{ secrets.forgejo_token }}
LABEL_NUMBER: 4
steps:
- name: Environment setup
run: apk add grep coreutils gawk curl wget bash nodejs git jq sed
- name: Get scripts
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check out-of-date packages
run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh
- name: Create issues
run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh

View file

@ -1,51 +0,0 @@
# Maintainer: Edouard Lafon <dev+arch@elafon.98.wf>
pkgname=mumble-web-proxy
pkgver=0.1.1
pkgrel=1
pkgdesc="mumble-web-proxy is a Mumble to WebSocket+WebRTC proxy"
arch='x86_64'
url="https://github.com/johni0702/mumble-web-proxy"
license='AGLP-3.0'
makedepends='rustup libnice-dev openssl-dev clang cargo'
source="$pkgname-$pkgver.tar.gz mumble-web-proxy.initd mumble-web-proxy.conf"
_giturl="https://github.com/johni0702/mumble-web-proxy"
_gittag="cfae6178c70c1436186f16723b18a2cbb0f06138"
builddir="$srcdir/$pkgname"
options="!check"
subpackages="${pkgname}-openrc"
snapshot() {
mkdir -p "$srcdir"
cd "${srcdir}"
if ! [ -d $pkgname.git ]; then
git clone $_giturl $pkgname.git || return 1
cd $pkgname.git
else
cd $pkgname.git
git fetch || return 1
fi
echo "Checking out"
git checkout $_gittag
echo "Repo archive"
git archive --prefix="$pkgname/" -o $pkgname.tar --format "tar" $_gittag
gzip $pkgname.tar -c > "$SRCDEST"/$pkgname-$pkgver.tar.gz
ln -s "$SRCDEST"/$pkgname-$pkgver.tar.gz "$startdir"/$pkgname-$pkgver.tar.gz
}
build() {
cd $builddir
export CARGO_HOME="$builddir"/cargo
cargo build --release
}
package() {
install -Dm755 "${builddir}"/target/release/mumble-web-proxy "${pkgdir}"/usr/bin/mumble-web-proxy
install -Dm755 "${srcdir}"/mumble-web-proxy.initd "${pkgdir}"/etc/init.d/mumble-web-proxy
install -Dm644 "${srcdir}"/mumble-web-proxy.conf "${pkgdir}"/etc/mumble-web-proxy.conf
}
sha512sums="08d522fdc625c231b7f931bdb3c788f4c5dabf0ed14a3d76b9bd0e0cb56f8fce0fb72f531670b3004f9105650c36ed15386c2677753c355bbe76e7a56a3ce8b5 mumble-web-proxy-0.1.1.tar.gz
ab470bd12df5a3c9b5d2526c27f8a7e2dc437fc2bfb943b9e98c975d87b2bfa5e7e906001cb66c6c26e505df17a5d335a556b52f534e973ef6b49b14b26468a5 mumble-web-proxy.initd
bbb197930295448c4cbb59b0ba9fbae75d5d2bd0868c96327840b00a69c7755831080a771d487348fe204d09636a95947aaea5d83714126032a38f8a5fce8bd3 mumble-web-proxy.conf"

View file

@ -1,26 +0,0 @@
Compiling tokio-tungstenite v0.13.0
error[E0282]: type annotations needed
--> /var/build/build/apk/v3.15/main/mumble-web-proxy/src/mumble-web-proxy/cargo/git/checkouts/rtp-23e67d7854ed482f/6c0223d/src/rfc3711.rs:477:19
|
476 | let iv = iv ^ (BigUint::from(1_u8) << (context.session_encr_key.len() * 8));
| -- consider giving `iv` a type
477 | let iv = &iv.to_bytes_be()[1..context.session_encr_key.len() + 1];
| ^^ cannot infer type
|
= note: type must be known at this point
error[E0282]: type annotations needed
--> /var/build/build/apk/v3.15/main/mumble-web-proxy/src/mumble-web-proxy/cargo/git/checkouts/rtp-23e67d7854ed482f/6c0223d/src/rfc3711.rs:511:19
|
510 | let iv = iv ^ (BigUint::from(1_u8) << (context.session_encr_key.len() * 8));
| -- consider giving `iv` a type
511 | let iv = &iv.to_bytes_be()[1..context.session_encr_key.len() + 1];
| ^^ cannot infer type
|
= note: type must be known at this point
For more information about this error, try `rustc --explain E0282`.
error: could not compile `rtp` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

View file

@ -0,0 +1,33 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=mumble-web-proxy
pkgver=0.1.1
_gittag=3f7f3d04f04c5349f3e3b1d1d2dc368c0f50e671
pkgrel=1
pkgdesc="mumble-web-proxy is a Mumble to WebSocket+WebRTC proxy"
arch='x86_64'
url="https://github.com/maurges/mumble-web-proxy"
license='AGPL-3.0'
makedepends='rustup libnice-dev openssl-dev clang cargo'
source="
$pkgname-$_gittag.tar.gz::https://github.com/maurges/mumble-web-proxy/archive/$_gittag.tar.gz
mumble-web-proxy.initd
mumble-web-proxy.conf
"
builddir="$srcdir"/$pkgname-$_gittag
options="!check"
subpackages="$pkgname-openrc"
build() {
CARGO_HOME="$builddir"/cargo cargo build --release
}
package() {
install -Dm755 "$builddir"/target/release/mumble-web-proxy "$pkgdir"/usr/bin/mumble-web-proxy
install -Dm755 "$srcdir"/mumble-web-proxy.initd "$pkgdir"/etc/init.d/mumble-web-proxy
install -Dm644 "$srcdir"/mumble-web-proxy.conf "$pkgdir"/etc/mumble-web-proxy.conf
}
sha512sums="
2c06e532df384853a98704a363374f6a5a177bbf859a294ab2be551c8447c0307e4d850283d48abf2e6679775e73c1de1f433f55648ac740548afd2e1fa25d05 mumble-web-proxy-3f7f3d04f04c5349f3e3b1d1d2dc368c0f50e671.tar.gz
ab470bd12df5a3c9b5d2526c27f8a7e2dc437fc2bfb943b9e98c975d87b2bfa5e7e906001cb66c6c26e505df17a5d335a556b52f534e973ef6b49b14b26468a5 mumble-web-proxy.initd
bbb197930295448c4cbb59b0ba9fbae75d5d2bd0868c96327840b00a69c7755831080a771d487348fe204d09636a95947aaea5d83714126032a38f8a5fce8bd3 mumble-web-proxy.conf
"

View file

@ -1,15 +1,14 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=mumble-web
pkgver=0.5.1
pkgrel=1
pkgdesc="An HTML5 Mumble client - stable"
arch='noarch'
url="https://github.com/johni0702/mumble-web"
license='custom:ISC'
license='ISC'
makedepends='npm jq'
source="https://registry.npmjs.org/mumble-web/-/mumble-web-$pkgver.tgz LICENSE"
source="https://registry.npmjs.org/mumble-web/-/mumble-web-$pkgver.tgz"
subpackages="$pkgname-doc"
options="!check"
@ -27,16 +26,10 @@ package() {
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
# Install license since the package doesn't include it
install -Dm 644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Move README to doc
install -dm 755 $pkgdir/usr/share/doc/$pkgname/
mv "$pkgdir/usr/lib/node_modules/$pkgname/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
# npm gives ownership of ALL FILES to build user
# https://bugs.archlinux.org/task/63396
chown -R root:root "$pkgdir"
}
sha512sums="87de66921c5ac00cfd91c6dde064d3427dbbc979c6e94f18cc3e84e77799e9f2bba361818f08ceedc08ded91865decde24da306e6e3d74f3a42ec5d231105bf6 mumble-web-0.5.1.tgz
a9e2bbe2ae661a0a39852414100ae3b25f5e5915c0d3f6eda4bd17ce3fbc8fc48418315a936d5305212ca4a550ddb1054206a450d1ffbcdb6281d59402afa8ef LICENSE"
sha512sums="
87de66921c5ac00cfd91c6dde064d3427dbbc979c6e94f18cc3e84e77799e9f2bba361818f08ceedc08ded91865decde24da306e6e3d74f3a42ec5d231105bf6 mumble-web-0.5.1.tgz
"