fdroid 823 Bytes
Newer Older
Sheogorath's avatar
Sheogorath committed
1
2
#!/bin/bash

3
4
5
set -e
[ "$DEBUG" = "1" ] && set -x

Sheogorath's avatar
Sheogorath committed
6
if ! podman image exists localhost/fdroid:cli; then
7
8
9
  TMP_BUILD_LOG="$(mktemp)"
  [ "$DEBUG" = "1" ] && echo "Fdroid CLI image missing, building my own… Log file: $TMP_BUILD_LOG"
  podman build -t localhost/fdroid:cli - > "$TMP_BUILD_LOG" 2>&1 <<EOF
Sheogorath's avatar
Sheogorath committed
10
11
12
13
14
15
16
17
18
19
FROM docker.io/library/debian:10

RUN true \
    && apt-get update \
    && apt-get install -y fdroidserver apksigner \
    && mkdir -p /repo \
    && true

RUN true \
    && rm /usr/bin/apksigner \
20
    && printf '#!/bin/sh\njava -jar /usr/lib/android-sdk/build-tools/debian/apksigner.jar -- $@' > /usr/bin/apksigner \
Sheogorath's avatar
Sheogorath committed
21
22
23
24
25
26
27
28
    && true

WORKDIR /repo

ENTRYPOINT ["fdroid"]

CMD ["--help"]
EOF
29
  rm "$TMP_BUILD_LOG"
Sheogorath's avatar
Sheogorath committed
30
31
32
fi


33
podman run --dns 127.0.0.53 --rm -v "$(pwd):$(pwd):z" -w "$(pwd)" --network host localhost/fdroid:cli $@