forked from dtcooper/raspotify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-apt-repo.sh
executable file
·54 lines (40 loc) · 1.1 KB
/
make-apt-repo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
if [ "$INSIDE_DOCKER_CONTAINER" != "1" ]; then
echo "Must be run in docker container"
exit 1
fi
echo 'Making apt repo in Docker container'
set -e
cd /mnt/raspotify
if [ -z "$GPG_KEY" ]; then
echo "Set environment variable GPG_KEY"
exit 1
fi
DEB_PKG_NAME="$(ls -1 *.deb | head -n 1)"
if [ -z "$DEB_PKG_NAME" ]; then
echo 'No .deb package found! Exiting.'
exit 1
fi
echo "Using package: $DEB_PKG_NAME"
cd apt-repo
# Clear out old stuff
rm -rf conf db pool dists
mkdir conf
# Keep jessie for backward compatibility
cat <<EOF > conf/distributions
Codename: jessie
Components: main
Architectures: armhf
SignWith: $GPG_KEY
Codename: raspotify
Components: main
Architectures: armhf
SignWith: $GPG_KEY
EOF
reprepro includedeb jessie "../$DEB_PKG_NAME"
reprepro includedeb raspotify "../$DEB_PKG_NAME"
rm -rf conf db
ln -fs "$(find . -name '*.deb' -type f -printf '%P\n' -quit)" raspotify-latest.deb
# Perm fixup. Not needed on macOS, but is on Linux
chown -R "$PERMFIX_UID:$PERMFIX_GID" /mnt/raspotify/* 2> /dev/null
echo "Repo created in directory apt-repo with package $DEB_PKG_NAME"