diff --git a/apache-tika-3.2.yaml b/apache-tika-3.2.yaml new file mode 100644 index 00000000000..ef5eb5bf739 --- /dev/null +++ b/apache-tika-3.2.yaml @@ -0,0 +1,96 @@ +package: + name: apache-tika-3.2 + version: "3.2.0" + epoch: 0 + description: The Apache Tika toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF). + copyright: + - license: Apache-2.0 + dependencies: + runtime: + - dash-binsh + - openjdk-21-default-jvm + provides: + - apache-tika=${{package.full-version}} + +environment: + contents: + packages: + - bash + - build-base + - busybox + - coreutils + - fontconfig-config + - fontconfig-dev + - lcms2 + - libfontconfig1 + - libjpeg-turbo + - maven + - openjdk-21-default-jdk + +pipeline: + - uses: fetch + with: + uri: https://downloads.apache.org/tika/${{package.version}}/tika-${{package.version}}-src.zip + expected-sha512: 3882a1c1e4dc38de6491b1b9cf686ec703e958a38f4d09821c422ecacdbc0f5c8490c511c9d3875b8e8bfe79176a3febf37e62dcf3897ec3e1f413b99955f218 + extract: false + + - runs: | + unzip tika-${{package.version}}-src.zip + mv tika-${{package.version}}/* . + rm tika-${{package.version}}-src.zip + rmdir tika-${{package.version}} + + - uses: auth/maven + + - runs: | + mvn clean install -am -DskipTests -Dossindex.skip + mkdir -p "${{targets.contextdir}}"/usr/share/java/ + cp -r tika-server/tika-server-standard/target/tika-server-standard-${{package.version}}.jar "${{targets.contextdir}}"/usr/share/java/tika-server-standard-${{package.version}}.jar + +subpackages: + - name: "${{package.name}}-compat" + description: "Compatibility package to place binaries in the root folder" + pipeline: + - runs: | + mkdir -p "${{targets.subpkgdir}}" + ln -sf /usr/share/java/tika-server-standard-${{package.version}}.jar ${{targets.subpkgdir}}/tika-server-standard.jar + +update: + enabled: true + release-monitor: + identifier: 15703 + version-filter-contains: 3.2. + +test: + environment: + contents: + packages: + - curl + - ${{package.name}}-compat + - openjdk-21-default-jvm + pipeline: + - uses: test/daemon-check-output + with: + start: java -jar /tika-server-standard.jar + expected_output: | + Started Apache Tika server + post: | + fail() { echo "FATAL: $*"; exit 1; } + tmpd=$(mktemp -d) + trap "rm -Rf $tmpd" EXIT + + url=http://localhost:9998/ + curl -s "$url" > "$tmpd/req.out" 2>"$tmpd/req.err" || + fail "[$?] curl -s $url" + grep -q "Welcome to the Apache Tika" "$tmpd/req.out" || + fail "curl $url - no Welcome message" + + msg="this is a test file" + echo "$msg" > "$tmpd/sample.txt" || + fail "failed writing a file" + curl -X PUT --data-binary "@$tmpd/sample.txt" \ + -H "Content-Type: text/plain" "http://localhost:9998/tika" \ + > "$tmpd/post.out" || + fail "failed PUT to curl $url/tika" + grep -q "$msg" "$tmpd/post.out" || + fail "did not find $msg in output of PUT"