summaryrefslogtreecommitdiff
path: root/test/fixtures/libremakepkg/PKGBUILD-distcc
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixtures/libremakepkg/PKGBUILD-distcc')
-rw-r--r--test/fixtures/libremakepkg/PKGBUILD-distcc24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/fixtures/libremakepkg/PKGBUILD-distcc b/test/fixtures/libremakepkg/PKGBUILD-distcc
index 5127ae6..e9f1d72 100644
--- a/test/fixtures/libremakepkg/PKGBUILD-distcc
+++ b/test/fixtures/libremakepkg/PKGBUILD-distcc
@@ -5,19 +5,25 @@ url='https://parabola.nu'
pkgrel=1
arch=(any)
-depends=(sh)
-build() {
+build() (
cd "$srcdir"
- echo '#!/bin/sh' > hello.sh
- echo 'echo Hello, world!' >> hello.sh
- # I don't like hard-coding in an implementation detail, but
- # this is the simplest way to verify that `distcc-tool
- # odaemon` started correctly.
+ set -x
+
+ # Check that the odaemon socket exists
[[ -S /socket ]]
-}
+
+ # ... and that it works
+ printf 'GET / HTTP/1.1\r\nHost: parabola.nu\r\n\r\n' | distcc-tool client parabola.nu 80 > http.txt
+ [[ "$(sed 1q http.txt)" == HTTP/* ]]
+
+ # ... and that idaemon talks to it
+ socat TCP-CONNECT:"${DISTCC_HOSTS}" STDIO < /dev/null > hello.txt
+ [[ "$(cat hello.txt)" == 'Hello, I am a distcc server' ]]
+)
package() {
cd "$srcdir"
- install -Dm755 hello.sh "$pkgdir"/usr/bin/libretools-hello
+ install -Dm644 hello.txt "$pkgdir"/usr/share/hello.txt
+ install -Dm644 http.txt "$pkgdir"/usr/share/http.txt
}