forked from neomutt/management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aur.sh
executable file
·44 lines (34 loc) · 818 Bytes
/
aur.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
#!/bin/bash
set -o errexit # set -e
set -o nounset # set -u
eval SRC_DIR="${1:-~/n8}"
GH_URL="https://github.com/neomutt/neomutt/archive"
AUR_DIR="aur"
pushd "$SRC_DIR"
TAG="$(git tag -l --sort='-authordate' 'neomutt-*' | head -1)"
VERSION="${TAG#neomutt-}"
popd
FILE="$TAG.tar.gz"
if [ ! -f "$FILE" ]; then
wget "$GH_URL/$FILE"
fi
MD5SUM=$(md5sum "$FILE" | sed 's/ .*//')
echo "AUR"
echo
echo "Version: $VERSION"
echo "Md5sum: $MD5SUM"
echo "Archive: $GH_URL/$FILE"
echo
echo "Edit:"
echo " PKGBUILD"
sed -i \
-e "s/^\(pkgver\)=.*/\1=$VERSION/" \
-e "s/^\(md5sums\)=('.*/\1=('$MD5SUM')/" \
"$AUR_DIR/PKGBUILD"
echo " .SRCINFO"
sed -i \
-e "s/^\(\tpkgver\) =.*/\1 = $VERSION/" \
-e "s/^\(\tmd5sums\) =.*/\1 = $MD5SUM/" \
-e "s!^\(\tsource\) =.*!\1 = $GH_URL/$FILE!" \
"$AUR_DIR/.SRCINFO"
echo