summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosias2023-10-21 21:19:03 +0200
committerJosias2023-10-21 21:19:03 +0200
commit6e594e9c4dcd409aa9bd6e8a12f8d4d7d2e46afd (patch)
tree97d8f61b0146b3d67de84fb6a9ed4e7e26f1475b
parentab88f5fb2c1d0847401fb490edd054b403fd1700 (diff)
downloadaur-6e594e9c4dcd409aa9bd6e8a12f8d4d7d2e46afd.tar.gz
remove versions from source (adviced by micwoj92); improve install, upgrade and remove hooks
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD41
-rw-r--r--prod.install15
-rw-r--r--versions.txt5
4 files changed, 52 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 64dbee7b4268..736e9da6beef 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = kubo-s3-git
pkgdesc = IPFS Kubo with S3 Datastore Implementation
pkgver = 0.23.0.r0.g3a1a041
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/chixodo-xyz/kubo-s3
install = prod.install
arch = x86_64
@@ -14,13 +14,13 @@ pkgbase = kubo-s3-git
conflicts = kubo-s3
conflicts = kubo
conflicts = ipfs
- source = git+https://github.com/ipfs/kubo#tag=v0.23.0
- source = git+https://github.com/ipfs/go-ds-s3#tag=v0.9.0
+ source = git+https://github.com/ipfs/kubo
+ source = git+https://github.com/ipfs/go-ds-s3
source = versions.txt
source = ipfs.service
b2sums = SKIP
b2sums = SKIP
- b2sums = ba0b7a7ca53a069a58ec6f9dbab98f10120a5ffd2f8ce83fabf21ae8749e29151879d3245a8cf7e6380119c19a57114f7c4696dcaf93c3b712ad3c2eb1c78058
+ b2sums = 359cde527350603760a64d48546f38b92527b6874cba0b6ec2390985d9b446496e35c926ba31504a84c54bbb2669374dc448fd18999642d29b6d80cecf3e6841
b2sums = 3ef6073e708a35ab57107e8c4fb8b07172ffc314719b84565f82ca54c14fadd0ddfcae2b30c8b28c4d60dd9a13ccab463384c5c6140340396afdd0d3505dfc23
pkgname = kubo-s3-git
diff --git a/PKGBUILD b/PKGBUILD
index 54e48cb3af3f..dd385dfc04dc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,10 @@
# Maintainer: Josias <aur at macherstube dot ch>
_pkgname=kubo
+_plgname=go-ds-s3
_pkgplgname=$_pkgname-s3
pkgname=$_pkgplgname-git
pkgver=0.23.0.r0.g3a1a041
-pkgrel=3
+pkgrel=4
pkgdesc="IPFS Kubo with S3 Datastore Implementation"
arch=('x86_64')
url="https://github.com/chixodo-xyz/kubo-s3"
@@ -17,20 +18,20 @@ replaces=()
backup=()
options=()
install='prod.install'
-source=('git+https://github.com/ipfs/kubo#tag=v0.23.0'
- 'git+https://github.com/ipfs/go-ds-s3#tag=v0.9.0'
+source=('git+https://github.com/ipfs/kubo'
+ 'git+https://github.com/ipfs/go-ds-s3'
'versions.txt'
'ipfs.service')
noextract=()
b2sums=('SKIP'
'SKIP'
- 'ba0b7a7ca53a069a58ec6f9dbab98f10120a5ffd2f8ce83fabf21ae8749e29151879d3245a8cf7e6380119c19a57114f7c4696dcaf93c3b712ad3c2eb1c78058'
+ '359cde527350603760a64d48546f38b92527b6874cba0b6ec2390985d9b446496e35c926ba31504a84c54bbb2669374dc448fd18999642d29b6d80cecf3e6841'
'3ef6073e708a35ab57107e8c4fb8b07172ffc314719b84565f82ca54c14fadd0ddfcae2b30c8b28c4d60dd9a13ccab463384c5c6140340396afdd0d3505dfc23')
prepare() {
cd "$srcdir/$_pkgname"
- KuboVersion=$(git describe --tags --abbrev=0)
- printf "\033[34;1mPrepare Kubo %s (%s)\n\033[0m" ${KuboVersion} $(git describe --long --tags --abbrev=7 --match="v*" HEAD |
+ KuboVersion=$(git describe --tags --abbrev=0 --match="v*" --exclude="v*-rc*")
+ printf "\033[34;1mPrepare Kubo %s (%s)\n\033[0m" ${KuboVersion} $(git describe --long --tags --abbrev=7 ${KuboVersion} |
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
git config advice.detachedHead false
git checkout ${KuboVersion} -f
@@ -41,8 +42,9 @@ prepare() {
fi
GoVersion=$(grep "${KuboVersion} " ../versions.txt | awk '{ print $2 }')
+ S3Version=$(grep "${KuboVersion} " ../versions.txt | awk '{ print $3 }')
- if [ -z "$GoVersion" ]; then
+ if [ -z "$GoVersion" ] || [ "$GoVersion" == "*" ]; then
ln -sf $(which go) $srcdir/go
else
printf "\033[34;1mInstalling go version: %s\n\033[0m" ${GoVersion}
@@ -61,28 +63,43 @@ prepare() {
export GOPATH=$GOVERSIONPATH
fi
-
export GO111MODULE=on
- printf "\033[34;1mFetching go-ds-s3 plugin\n\033[0m"
- $srcdir/go get github.com/ipfs/go-ds-s3/plugin@v0.9.0
+ cd "$srcdir/$_plgname"
+ if [ -z "$S3Version" ] || [ "$S3Version" == "*" ]; then
+ S3Version=$(git describe --tags --abbrev=0 --match="go-ds-s3-plugin/v*")
+ fi
+ S3VersionHash=$(git rev-list -n 1 ${S3Version})
+ printf "\033[34;1mPrepare go-ds-s3 plugin %s (%s)\n\033[0m" ${S3Version} $(git describe --long --tags --abbrev=7 ${S3Version} |
+ sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
+ git config advice.detachedHead false
+ git checkout ${S3Version} -f
+
+ cd "$srcdir/$_pkgname"
+ $srcdir/go get github.com/ipfs/go-ds-s3/plugin@${S3VersionHash}
echo -en "\ns3ds github.com/ipfs/go-ds-s3/plugin 0" >> plugin/loader/preload_list
+ printf "Set go version and kubo version\n"
sed -i "s\GOCC ?= go\GOCC ?= ${srcdir}/go\g" Rules.mk
sed -Ei "s/const CurrentVersionNumber = \"(.*)\"/const CurrentVersionNumber = \"\1-s3\"/g" version.go
}
pkgver() {
cd "$srcdir/$_pkgname"
- git describe --long --tags --abbrev=7 --match="v*" HEAD |
+ KuboVersion=$(git describe --tags --abbrev=0 --match="v*" --exclude="v*-rc*")
+ git describe --long --tags --abbrev=7 ${KuboVersion} |
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
cd "$srcdir/$_pkgname"
- printf "\033[34;1mBuild Kubo with S3 Plugin\n\033[0m"
+ printf "\033[34;1mBuild Kubo\n\033[0m"
make build
+
+ printf "Fetch dependencies\n"
$srcdir/go mod tidy
+
+ printf "\033[34;1mBuild Kubo with S3 Plugin\n\033[0m"
make build
if [ $? -ne 0 ]; then
diff --git a/prod.install b/prod.install
index 279c060c6d88..b6c5737b10dd 100644
--- a/prod.install
+++ b/prod.install
@@ -11,6 +11,10 @@ post_install() {
export IPFS_PATH=/opt/ipfs-repo
/usr/bin/ipfs init
EOL
+ post_upgrade $1 0
+}
+
+post_upgrade() {
echo ""
echo "Update Services..."
sudo systemctl daemon-reload
@@ -19,4 +23,15 @@ EOL
echo "sudo systemctl start ipfs"
echo "sudo systemctl enable ipfs #to start ipfs on system startup"
echo ""
+}
+
+post_remove() {
+ echo ""
+ echo "Update Services..."
+ sudo systemctl daemon-reload
+ echo ""
+ echo "Default repository and user won't be deleted! You can do it manually with:"
+ echo "sudo rm -rf /opt/ipfs-repo/"
+ echo "sudo userdel -rf ipfs"
+ echo ""
} \ No newline at end of file
diff --git a/versions.txt b/versions.txt
index cb053c126cb5..d19527157e30 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1 +1,4 @@
-v0.22.0 go1.20.8 \ No newline at end of file
+kubo go go-ds-s3
+-------------|-------------|-------------
+v0.22.0 go1.20.8 v0.9.0
+v0.23.0 * v0.9.0 \ No newline at end of file