]> git.pld-linux.org Git - packages/rpm.git/blob - find-java-prov.sh
- based on find-java-req.sh
[packages/rpm.git] / find-java-prov.sh
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 #
5 # Based on rpm-4.4.2/scripts/find-req.pl
6 # Authors: Elan Ruusamäe <glen@pld-linux.org>
7
8 export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
9
10 IGNORE_DEPS="@"
11 BUILDROOT="/"
12
13 # Loop over all args
14 while :; 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
51 done
52
53 for file in $(cat -); do
54         case $file in
55         *.jar)
56                 unzip -p $file | javadeps --provides --rpmformat --keywords --starprov -
57         ;;
58         *.class)
59                 javadeps --provides --rpmformat --keywords --starprov $file
60         ;;
61         esac
62 done | sort -u | egrep -v \'$IGNORE_DEPS\'
This page took 0.039908 seconds and 4 git commands to generate.