ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/glimpse.spec
Revision: 1.7
Committed: Sun Sep 17 11:05:30 2006 UTC (18 years, 7 months ago) by elmer
Branch: MAIN
Changes since 1.6: +14 -11 lines
Log Message:
Remove part about GLIMPSE_DIR in "share" area and related check.
Add a missing "cms/cmssw"
Add check for presence of glimpse indices.
Finished -full option (prints full path to file)

File Contents

# Content
1 ### RPM external glimpse 4.18.5
2 Source: http://webglimpse.net/trial/glimpse-%{v}.tar.gz
3
4 %prep
5 %setup -n glimpse-%v
6 %build
7 ./configure --prefix=%{i}
8 make
9
10 %install
11 make install
12 cat <<\EOF_CMS_GLIMPSE >%{i}/bin/cmsglimpse
13 #!/bin/bash
14 CURRENT_SCRAM_PROJECT=$(echo $SCRAMRT_SET | cut -d: -f2)
15 args=
16 action=
17
18 while [ $# -gt 0 ]
19 do
20 case $1 in
21 -full )
22 action=full; shift;;
23 -help )
24 echo "cmsglimpse [-H <CMSSW_TAG>] [-full] [glimpse-options] <search term>"
25 echo ""
26 echo " -H <CMSSW_TAG> - specify the CMSSW tag for the release you "
27 echo " would like to search (e.g. 'CMSSW_1_0_0'). "
28 echo " If you do not specify the -H option it will "
29 echo " default to the release corresponding to "
30 echo " your current scram runtime environment. "
31 echo ""
32 echo " -full - Print the full path to the source files. The "
33 echo " default is to print the relative path "
34 echo " beginning with the CMSSW subsystem. "
35 echo ""
36 echo " [glimpse-options] - any of the glimpse options can also be "
37 echo " specified, except for -H, which is used "
38 echo " as described above. See 'glimpse --help'. "
39 exit
40 ;;
41 -H )[ $# -gt 1 ] || { echo "Option \`$1' requires an argument" 1>&2; exit 1; }
42 CURRENT_SCRAM_PROJECT=$2; shift; shift ;;
43 * ) args="$args $1"; shift;;
44 esac
45 done
46
47 if [ "$CURRENT_SCRAM_PROJECT" == "" ]
48 then
49 echo "No project specified. "
50 echo "Please eval some scram runtime or use -H option."
51 exit 1
52 fi
53
54 case $action in
55 full )
56 if [ ! -e @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src/.glimpse_full/.glimpse_index ]
57 then
58 echo "Glimpse index not found. Expected it in directory:"
59 echo " @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src/.glimpse_full/"
60 exit 1
61 fi
62 glimpse -H @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src/.glimpse_full/ $args
63 ;;
64 * )
65 if [ ! -e @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src/.glimpse_index ]
66 then
67 echo "Glimpse index not found. Expected it in directory:"
68 echo " @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src/"
69 exit 1
70 fi
71 glimpse -H @INSTROOT@/@CMSPLATF@/cms/cmssw/$CURRENT_SCRAM_PROJECT/src $args
72 ;;
73 esac
74 EOF_CMS_GLIMPSE
75 perl -p -i -e "s|\@CMSPLATF\@|%cmsplatf|g" %{i}/bin/cmsglimpse
76 chmod +x %{i}/bin/cmsglimpse
77 %post
78 perl -p -i -e "s|\@INSTROOT\@|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/%{pkgrel}/bin/cmsglimpse