Commit d85e5f69 authored by Carlo Landmeter's avatar Carlo Landmeter

main/sprunge: use dedicated script per service

parent 6eda8680
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sprunge
pkgver=0.5
pkgver=0.6
pkgrel=0
pkgdesc="Helper script to paste things to http://sprunge.us"
url="http://sprunge.us"
......@@ -14,51 +14,49 @@ subpackages="tpaste dpaste ix"
source=""
_builddir="$srcdir"
prepare() {
return 0
}
build() {
cd "$_builddir"
cat >"$_builddir"/sprunge<<EOF
#!/bin/sh
case \${0##*/} in
sprunge)
exec curl -F 'sprunge=<-' http://sprunge.us;;
tpaste)
exec curl -F 'tpaste=<-' http://tpaste.us;;
dpaste)
exec curl --silent -F 'content=<-' https://dpaste.de/api/ \
| sed -e 's/"//g' -e 's/\$/\/raw\n/';;
ix)
exec curl $opts -F f:1='<-' ix.io/;;
esac
EOF
}
package() {
cd "$_builddir"
install -Dm755 sprunge "$pkgdir"/usr/bin/sprunge || return 1
mkdir -p "$pkgdir"/usr/bin
printf "#!/bin/sh\n\nexec curl -F 'sprunge=<-' http://sprunge.us" > \
"$pkgdir"/usr/bin/sprunge || return 1
chmod 755 "$pkgdir"/usr/bin/sprunge || return 1
}
tpaste() {
cd "$_builddir"
pkgdesc="Alpine Linux self hosted paste service"
url="http://tpaste.us"
install sprunge -Dm755 "$subpkgdir"/usr/bin/tpaste || return 1
pkgdesc="Helper script to paste things to $url"
mkdir -p "$subpkgdir"/usr/bin
printf "#!/bin/sh\n\nexec curl -F 'tpaste=<-' http://tpaste.us" > \
"$subpkgdir"/usr/bin/tpaste || return 1
chmod 755 "$subpkgdir"/usr/bin/tpaste || return 1
}
dpaste() {
cd "$_builddir"
pkgdesc="Paste service written in python"
url="http://dpaste.com"
install sprunge -Dm755 "$subpkgdir"/usr/bin/dpaste || return 1
pkgdesc="Helper script to paste things to $url"
mkdir -p "$subpkgdir"/usr/bin
printf "#!/bin/sh\n\nexec curl --silent -F 'content=<-' https://dpaste.de/api/ | sed -e 's/\"//g' -e 's/\$/\/raw\\\n/'" > \
"$subpkgdir"/usr/bin/dpaste || return 1
chmod 755 "$subpkgdir"/usr/bin/dpaste || return 1
}
ix() {
cd "$_builddir"
pkgdesc="Command line pastebin"
url="http://ix.io"
install sprunge -Dm755 "$subpkgdir"/usr/bin/ix || return 1
pkgdesc="Helper script to paste things to $url"
mkdir -p "$subpkgdir"/usr/bin
printf "#!/bin/sh\n\nexec curl -F f:1='<-' ix.io/" > \
"$subpkgdir"/usr/bin/ix || return 1
chmod 755 "$subpkgdir"/usr/bin/ix || return 1
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment