]> git.pld-linux.org Git - packages/rpm.git/blame - find-java-req.sh
- pass FCFLAGS (for Fortran >77)
[packages/rpm.git] / find-java-req.sh
CommitLineData
95593bd3
ER
1#!/bin/sh
2# This script reads filenames from STDIN and outputs any relevant provides
3# information that needs to be included in the package.
4
5export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
6PATH=${PATH}:$(dirname $0)
7
8javadeps_args='--requires --rpmformat --keywords'
9
10IGNORE_DEPS="@"
11BUILDROOT="/"
12
13# Loop over all args
14while :; do
15# Break out if there are no more args
16 case $# in
17 0)
18 break
19 ;;
20 esac
21
22# Get the first arg, and shuffle
23 option=$1
24 shift
25
26# Make all options have two hyphens
27 orig_option=$option # Save original for error messages
28 case $option in
29 --*) ;;
30 -*) option=-$option ;;
31 esac
32
33 case $option in
34 --buildroot)
35 BUILDROOT=$1
36 shift
37 ;;
38 --ignore_deps)
39 IGNORE_DEPS=$1
40 shift
41 ;;
42 --help)
43 echo $usage
44 exit 0
45 ;;
46 *)
47 echo "$0: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
48 exit 1
49 ;;
50 esac
51done
52
53javaclassversion() {
54 local file="$1"
55
56 tmp=$(mktemp -d)
57 unzip -q -d $tmp $file >&2
58 classver=$(find $tmp -name '*.class' | xargs file | grep -o 'compiled Java class data, version [0-9.]*' | awk '{print $NF}' | sort -u)
59 rm -rf $tmp
60 [ "$classver" ] || return
61 echo "java(ClassDataVersion) >= $classver"
62}
63
64for file in $(cat -); do
65 case $file in
66 *.jar)
67 javaclassversion $file
68 ;;
69 esac
70done | sort -u | egrep -v \'$IGNORE_DEPS\'
This page took 0.05398 seconds and 4 git commands to generate.