ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/rpm.spec
Revision: 1.104
Committed: Fri Jan 21 03:20:45 2011 UTC (14 years, 3 months ago) by fwyzard
Branch: MAIN
CVS Tags: CMSSW_4_4_4-ports, sm20120309-ports, TW20120302a, sm20120228-44X-ports, sm120220-ports, CMSSW_4_4_3_patch1-ports, vs20120215-44X-ports, da20120205-44X-ports, da20120201-42X-ports, daFor428p7rootfix-ports, CMSSW_4_4_3-ports, sm120124-ports, da20120123-44X-ports, CMSSW_4_4_2_patch10-ports, azFor442patch10gcc451, CMSSW_4_4_2_patch9-ports, vsFor442patch9gcc451, CMSSW_4_4_2_patch8-ports, vs20111130-42X-ports, vs20111130-44X-ports, CMSSW_4_4_2_patch7-ports, azFor442patch7gcc451, CMSSW_4_4_2_patch6-ports, azFor442patch6gcc451, az20111110-42X-ports, CMSSW_4_4_2_patch5-ports, azFor442patch5gcc451, CMSSW_4_4_2_patch4-ports, azFor442patch4gcc451, az20111109b-44X-ports, az20111109-44X-ports, CMSSW_4_4_2_patch3-ports, azFor442patch3gcc451, CMSSW_4_4_2_patch2-ports, CMSSW_4_4_2_patch1-ports, azFor442patch1gcc451, bld_1320341101_PHEDEX-combined-agents_slc5_amd64_gcc434, bld_1320248863_PHEDEX-combined-agents_slc5_amd64_gcc434, az20111031-42X-ports, CMSSW_4_4_2-ports, azFor442gcc451, CMSSW_4_4_0_patch4-ports, azFor440patch4gcc451, CMSSW_4_4_1-ports, azFor441gcc451, TW20111010c, TW20111010b, TW20111010a, CMSSW_4_4_0_patch3-ports, CMSSW_4_2_8_patch6-ports, azFor440patch3gcc451, CMSSW_4_4_0_patch2-ports, azFor440patch2gcc451, builder_2011-10-04_16-25-49_das, bld_1317721310_stagemanager-agent_slc5_amd64_gcc434, CMSSW_4_4_0_patch1-ports, azFor440patch1gcc451a, azFor440patch1gcc451, CMSSW_4_2_8_patch5-ports, builder_2011-09-30_15-50-42_PHEDEX-combined-agents, CMSSW_4_2_9_HLT3-ports, builder_2011-09-29_13-07-19_cmsweb, builder_2011-09-29_12-57-04_cmsweb, HG1109e, builder_2011-09-29_09-05-43_crab-server3, builder_2011-09-29_09-05-42_asyncstageout, builder_2011-09-29_05-49-40_wmagent, builder_2011-09-28_19-05-55_PHEDEX-combined-agents, builder_2011-09-28_16-45-33_das, builder_2011-09-28_16-05-45_das, TW20110928b, builder_2011-09-28_12-04-32_stagemanager-agent, builder_2011-09-28_12-04-32_stagemanager, TW20110928a, builder_2011-09-28_11-09-39_stagemanager-agent, builder_2011-09-27_17-51-30_reqmon, builder_2011-09-26_18-50-48_stagemanager-agent, builder_2011-09-26_18-50-48_stagemanager, HG1109d, builder_2011-09-23_12-46-40_cmsweb, builder_2011-09-23_12-37-00_cmsweb, builder_2011-09-23_12-09-06_wmagent, CMSSW_4_4_0-ports, azFor440gcc451, builder_2011-09-22_12-03-59_asyncstageout, builder_2011-09-22_11-25-57_crab-server3, builder_2011-09-22_11-24-38_asyncstageout, builder_2011-09-22_09-46-05_cmsweb, builder_2011-09-22_09-36-11_cmsweb, builder_2011-09-22_05-26-44_wmagent, builder_2011-09-21_18-06-30_asyncstageout, builder_2011-09-21_15-26-46_wmagent, builder_2011-09-21_12-53-09_crab-server3, builder_2011-09-21_12-53-09_asyncstageout, builder_2011-09-21_12-47-08_crab-server3, builder_2011-09-21_12-45-23_asyncstageout, az20110921-44X-ports, CMSSW_4_2_9_HLT2-ports, builder_2011-09-20_21-03-55_regsvc, builder_2011-09-19_17-53-10_cmsweb, builder_2011-09-19_12-05-14_workqueue, CMSSW_4_2_8_patch4-ports, builder_2011-09-15_17-45-48_PHEDEX-combined-agents, CMSSW_4_2_9_HLT1_patch1-ports, az20110914-44X-ports, builder_2011-09-14_13-06-06_cmsweb, builder_2011-09-13_22-04-02_filemover, TW20110913b, TW20110913a, az20110913-44X-ports, builder_2011-09-13_12-46-32_cmsweb, HG1109c, LT20110913a, builder_2011-09-13_10-10-02_cmsweb, LT20110912a, az20110912-44X-ports, TW20110911a, CMSSW_4_4_0_pre10-ports, azFor440pre10gcc451, TW20110909d, TW20110909c, builder_2011-09-09_17-05-31_dbs3-client, az20110909b-44X-ports, TW20110909b, az20110909a-44X-ports, az20110909-44X-ports, TW20110909a, builder_2011-09-08_22-46-50_reqmgr, HG1109b, builder_2011-09-07_19-00-35_cmsweb, builder_2011-09-06_22-45-07_globalmonitor, builder_2011-09-06_16-09-09_stagemanager-agent, builder_2011-09-06_15-53-16_stagemanager-agent, az20110906-44X-ports, az20110904-50X-ports, az20110902b-50X-ports, az20110902-50X-ports, CMSSW_4_2_8_patch3-ports, azFor428patch3gcc451, builder_2011-09-01_12-14-12_wmagent, az20110831-50X-ports, HG1109a, CMSSW_4_4_0_pre9-ports, builder_2011-08-29_19-08-40_cmsweb, azFor440pre9gcc451, az20110827-50X-ports, builder_2011-08-27_00-05-05_asyncstageout, CMSSW_4_2_9_HLT1_hltpatch1-ports, builder_2011-08-26_19-05-27_crab-server3, az20110826b-50X-ports, az20110825-50X-ports, az20110823-50X-ports, CMSSW_4_2_8_patch2-ports, az20110821-44X-ports, CMSSW_4_2_9_HLT1-ports, az20110818a-50X-ports, az20110818-50X-ports, CMSSW_4_2_9_HLT-ports, sm20110816-42X-ports, builder_2011-08-16_12-09-37_cmsweb, HG1108b, CMSSW_4_4_0_pre8-ports, azFor440pre8gcc451, sjg110813b-50X-ports, sjg110813a-50X-ports, builder_2011-08-12_22-56-45_cmsweb, az20110809b-50X-ports, az20110809a-44X-ports, az20110809-50X-ports, az20110809-44X-ports, TW20110808a, CMSSW_4_2_8_patch1-ports, CMSSW_4_4_0_pre7_g494p02-ports, azFor440p7g494p02-g451, az20110804-44X-ports, builder_2011-08-04_18-42-50_stagemanager-agent, builder_2011-08-04_17-25-36_das, builder_2011-08-04_13-25-47_cmsweb, sjg110804-50X-ports, sjg110803-50X-ports, builder_2011-08-02_16-19-02_wmagent, az20110802-42X-ports, CMSSW_4_4_0_pre7-ports, azFor440pre7gcc451, az20110801-44X-ports, CMSSW_4_4_0_pre6-ports, azFor440pre6gcc451, TW20110729a, az20110729-44X-ports, CMSSW_4_2_8-ports, azFor428gcc451, TW20110728d, TW20110728c, TW20110728b, TW20110728a, builder_2011-07-28_00-46-23_cmsweb, DBS_2_1_6-pre1, builder_2011-07-27_18-04-14_reqmgr, HG1108a, az20110726a-44X-ports, az20110726-44X-ports, az20110725c-44X-ports, az20110725b-44X-ports, az20110725a-44X-ports, az20110725-44X-ports, az20110723a-44X-ports, az20110720-42X-ports, CMSSW_4_2_7_patch2-ports, azFor427patch2gcc451, CMSSW_4_4_0_pre5-ports, azFor440pre5gcc451, az20110718-42X-ports, az20110715a-44X-ports, CMSSW_4_2_7_patch1-ports, azFor427patch1g451, az20110714a-44X-ports, az20110714-44X-ports, CMSSW_4_2_7-ports_FWLITE, CMSSW_4_2_7-ports, azFor427g451, az20110713a-44X-ports, az20110712c-44X-ports, az20110712b-44X-ports, az20110712-42X-ports, ge20110712-44X-ports, az20110712-44X-ports, az20110711-43X-ports, ge20110711-44X-ports, ge20110710b-44X-ports, ge20110710-44X-ports, HG1108a-osx, HG1108a-bootstrap, ge20110709b-44X-ports, ge20110709-44X-ports, ge20110708-44X-ports, CMSSW_4_4_0_pre4-ports_FWLITE, CMSSW_4_4_0_pre4-ports, azFor440p4g451, CMSSW_4_3_0_dqmpatch2-ports, sjgFor430dqmp2-ports, CMSSW_4_2_6-ports_FWLITE, CMSSW_4_2_6-ports, az20110706-44X-ports, azFor426gcc451, az20110705-42X-ports, az20110701-44X-ports, CMSSW_4_4_0_pre3-ports, azFor440pre3gcc451, CMSSW_4_3_0_dqmpatch1-ports, az20110629-44X-ports, sjgFor430dqmp1-ports, sjfFor430dqmp1-ports, az20110627a-44X-ports, az20110627-44X-ports, CMSSW_4_3_0-ports, sjgFor430-ports, CMSSW_4_4_0_pre2-ports_FWLITE, CMSSW_4_4_0_pre2-ports, azFor440pre2gcc451, sm20110622a-44X-ports, sm20110622a-43X-ports, sm20110622-43X-ports, sm20110622-44X-ports, CMSSW_4_2_5-ports, sm20110621-42X-ports, sjgFor425b-ports, sm20110620-42X-ports, sjgFor425-ports, sm20110620-44X-ports, sm20110616-44X-ports, CMSSW_4_4_0_pre1-ports, az20110615-43X-ports, azFor20110615-43X-ports, azFor440pre1gcc451, sm20110615-43X-ports, sm20110615-42X-ports, sjgFor430pre6dqmIO-ports, sm20110614b-44X-ports, sm20110614a-44X-ports, sm20110614-44X-ports, sm20110607a-44X-ports, CMSSW_4_3_0_pre7-ports, sjgFor430pre6dp1-ports, sjgFor430pre7-ports, sm20110610-44X-ports, sm20110609-43X-ports, CMSSW_4_2_4_patch1-ports, sm20110608-44X-ports, sm20110607-44X-ports, sm20110606a-ports, CMSSW_4_2_4-ports_FWLITE, CMSSW_4_2_4-ports, azFor424fgcc451, az20110601-for42X-ports, azFor424agcc451, azFor424gcc451, CMSSW_4_2_3_patch5-ports, azFor423patch5gcc451, CMSSW_4_2_3_patch4-ports, azFor423patch4gcc451, CMSSW_4_3_0_pre6-ports, sjgFor430pre6-ports, sm20110528-for42X-ports, sm20110528-for43X-ports, sm20110527-for43X-ports, CMSSW_4_2_3_patch3-ports, azFor423patch3gcc451, sm20110523a-for43X-ports, sm20110523-for43X-ports, sm20110516-for43X-ports, CMSSW_4_2_3_patch2-ports, azFor423patch2gcc451, sjg110514a-for43x-ports, sm20110514a-for43X-ports, ge20110514-for43X-ports, sm20110514-for43X-ports, sjg110513a-for43X-ports, CMSSW_4_3_0_pre5-ports, sjgFor430pre5-ports, CMSSW_4_2_3_patch1-ports, azFor423patch1gcc451, sm20110509a-for43X-ports, CMSSW_4_2_2_patch2-ports, CMSSW_4_2_3-ports_FWLITE, CMSSW_4_2_3-ports, azFor423gcc451, sm20110505-for42X-ports, sm20110504-for43X-ports, sm20110504-for42X-ports, sm20100504-ports, CMSSW_4_3_0_pre4-ports_FWLITE, CMSSW_4_3_0_pre4-ports, CMSSW_4_2_2_patch1-ports, azFor430pre4gcc451, CMSSW_4_2_1_patch2-ports, azFor421patch2gcc451, pe20110427a-for43X-ports, pe20110426a-for43X-ports, CMSSW_4_2_2-ports_FWLITE, CMSSW_4_2_2-ports, azFor422gcc451, azFor422g451, CMSSW_4_2_1_patch1-ports, azFor421patch1gcc451a, azFor421patch1g451, pe20110420b-for43X-ports, sjg110420a-ports, pe20110419a-for43X-ports, pe20110418a-for43X-ports, CMSSW_4_3_0_pre3-ports, sjgFor430pre3-ports, sjg110417a-for43X-ports, sm20110415-for43X-ports, CMSSW_4_2_1-ports_FWLITE, CMSSW_4_2_1-ports, azFor421g451, pe20110413a-for43X-ports, CMSSW_4_2_0-ports_FWLITE, CMSSW_4_2_0-ports, azFor420gcc451, azFor420g451, CMSSW_4_3_0_pre2-ports, sjgFor430pre2-ports, pe20110331b-for43X-ports, pe20110331a-for43X-ports, ge20110430-for43X-ports, pe20110328a-for43X-ports, CMSSW_4_3_0_pre1-ports, sjgFor430pre1-ports, pe20110324b-for43X-ports, pe20110324a-for43X-ports, CMSSW_4_2_0_pre8-ports, azFor420p8g451, pe20110318b-for4XY-ports, pe20110318a-for4XY-ports, pe20110317a-for4XY-ports, pe20110315a-for4XY-ports, pe20110310a-for4XY-ports, CMSSW_4_2_0_pre7-ports, azFor420p7g451, pe20110307a-for4XY-ports, pe20110303-for412-ports, CMSSW_4_2_0_pre6-ports, azFor420p6g451, pe20110228a-for4XY-ports, CMSSW_4_1_0_pre3-ports, pe20110225b-for4XY-ports, pe20110225a-for4XY-ports, pe20110223a-for4XY-ports-osx, pe20110223a-for4XY-ports, CmsTC_0_0_4, CMSSW_4_2_0_pre5-ports, azFor420p5g451a, azFor420p5g451, azFor420pre5gcc451a, azFor420pre5gcc451, CMSSW_4_2_0_pre4-ports, azFor420pre4gcc451, azFor420p4g451, pe20110213a-for4XY-ports, CMSSW_4_2_0_pre3-ports, azFor420pre3gcc451, pe20110210a-for4XY-ports, pe20110208a-for4XY-ports, pe20110207b-for4XY-ports, CMSSW_4_2_0_pre2-ports, azFor420pre2gcc451, pe20110203a-for4XY-ports, pe20110202a-for4XY-ports, pe20110131b-for4XY-ports, pe20110131a-for4XY-ports, pe20110127a-for311X-ports, pe20110126b-for311X-ports, fw20110126a-311X-ports, fw20110122-311X-ports, fw20110121b-311X-ports, fw20110121a-311X-ports
Changes since 1.103: +0 -2 lines
Log Message:
revert to r1.101

File Contents

# User Rev Content
1 fwyzard 1.103 ### RPM external rpm 4.8.0
2 eulisse 1.13 ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
3 fwyzard 1.103 ## INITENV SET RPM_CONFIGDIR %{i}/lib/rpm
4    
5     # Warning! While rpm itself seems to work, at the time of writing it
6     # does not seem to be possible to build apt-rpm with
7     Source: http://rpm.org/releases/rpm-%(echo %realversion | cut -f1,2 -d.).x/rpm-%{realversion}.tar.bz2
8 muzaffar 1.77 %define closingbrace )
9 elmer 1.82 %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo false;; esac)
10 ratnik 1.41
11 fwyzard 1.103 Requires: file nspr nss popt bz2lib db4 lua
12 muzaffar 1.76 %if "%online" != "true"
13     Requires: zlib
14 ratnik 1.72 %endif
15    
16    
17 elmer 1.69 # The following two lines are a workaround for an issue seen with gcc4.1.2
18     Provides: perl(Archive::Tar)
19     Provides: perl(Specfile)
20 fwyzard 1.103 # The Module::ScanDeps::DataFeed code is actually contained in perldeps.pl
21     # but it is dumped out in a temporary file and imported from there, AFAICT.
22     # For this reason it does not show up as provided by this package.
23     # In order to work around the problem, we add a fake Provides statement.
24     Provides: perl(Module::ScanDeps::DataFeed)
25    
26     Patch0: rpm-4.8.0-case-insensitive-sources
27     Patch1: rpm-4.8.0-add-missing-__fxstat64
28     Patch2: rpm-4.8.0-fix-glob_pattern_p
29     Patch3: rpm-4.8.0-remove-strndup
30     Patch4: rpm-4.8.0-case-insensitive-fixes
31     Patch5: rpm-4.8.0-allow-empty-buildroot
32     Patch6: rpm-4.8.0-remove-chroot-check
33     Patch7: rpm-4.8.0-fix-missing-libgen
34     Patch8: rpm-4.8.0-fix-find-provides
35     Patch9: rpm-4.8.0-increase-line-buffer
36     Patch10: rpm-4.8.0-increase-macro-buffer
37     Patch11: rpm-4.8.0-improve-file-deps-speed
38 eulisse 1.32
39     # Defaults here
40     %define libdir lib
41     %define soname so
42    
43 eulisse 1.12 %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
44     %define libdir lib64
45     %endif
46 eulisse 1.32
47     # On macosx SONAME is dylib
48     %if "%(echo %{cmsos} | cut -d_ -f 1 | sed -e 's|osx.*|osx|')" == "osx"
49     %define soname dylib
50     Provides: Kerberos
51     %endif
52    
53 fwyzard 1.103 %prep
54     %setup -n %n-%realversion
55     rm -rf lib/rpmhash.*
56     %patch0 -p1
57     %patch1 -p1
58     %patch2 -p1
59     %patch3 -p1
60     %patch4 -p1
61     %patch5 -p1
62 eulisse 1.86 %patch6 -p1
63 eulisse 1.93 %patch7 -p1
64     %patch8 -p1
65 fwyzard 1.103 case %cmsos in
66     osx*)
67 eulisse 1.94 %patch9 -p1
68 eulisse 1.95 %patch10 -p1
69 fwyzard 1.103 ;;
70     esac
71     %patch11 -p1
72 eulisse 1.38
73 eulisse 1.1 %build
74 eulisse 1.74 case %cmsos in
75 muzaffar 1.76 slc*_ia32)
76 fwyzard 1.103 export CFLAGS_PLATF="-fPIC -D_FILE_OFFSET_BITS=64"
77     LIBS_PLATF="-ldl"
78     ;;
79     slc*_amd64)
80     CFLAGS_PLATF="-fPIC"
81     LIBS_PLATF="-ldl"
82     ;;
83     osx*_amd64)
84     export CFLAGS_PLATF="-arch x86_64 -fPIC -fnested-functions"
85     export LIBS_PLATF="-liconv"
86     ;;
87     osx*_i386)
88     export CFLAGS_PLATF="-arch i386 -fPIC -fnested-functions"
89     export LIBS_PLATF="-liconv"
90 eulisse 1.85 ;;
91 muzaffar 1.76 *)
92 fwyzard 1.103 export CFLAGS_PLATF="-fPIC"
93 muzaffar 1.76 ;;
94     esac
95 eulisse 1.74
96 muzaffar 1.80 %if "%online" == "true"
97     case %cmsos in
98     slc5* ) export ZLIB_ROOT=/usr ;;
99     * ) export ZLIB_ROOT= ;;
100     esac
101     %endif
102    
103 fwyzard 1.103 USER_CFLAGS="-ggdb -O0"
104     USER_CXXFLAGS="-ggdb -O0"
105     # On SLCx add $GCC_ROOT to various paths because that's where elflib is to be
106     # found. Not required (and triggers a warning about missing include path) on
107     # mac.
108     case %cmsos in
109     slc*)
110     OS_CFLAGS="-I$GCC_ROOT/include"
111     OS_CXXFLAGS="-I$GCC_ROOT/include"
112     OS_CPPFLAGS="-I$GCC_ROOT/include"
113     OS_LDFLAGS="-L$GCC_ROOT/lib"
114     ;;
115     esac
116    
117     perl -p -i -e's|-O2|-O0|' ./configure
118    
119     # Notice that libelf is now in $GCC_ROOT because also gcc LTO requires it.
120     ./configure --prefix %i \
121     --with-external-db --disable-python --disable-nls \
122     --disable-rpath --with-lua \
123     CXXFLAGS="$USER_CXXFLAGS $OS_CXXFLAGS" \
124     CFLAGS="$CFLAGS_PLATF $USER_CFLAGS -I$NSPR_ROOT/include/nspr \
125     -I$NSS_ROOT/include/nss3 -I$ZLIB_ROOT/include -I$BZ2LIB_ROOT/include \
126     -I$DB4_ROOT/include -I$FILE_ROOT/include -I$POPT_ROOT/include \
127     -I$LUA_ROOT/include $OS_CFLAGS" \
128     LDFLAGS="-L$NSPR_ROOT/lib -L$NSS_ROOT/lib -L$ZLIB_ROOT/lib -L$DB4_ROOT/lib \
129     -L$FILE_ROOT/lib -L$POPT_ROOT/lib -L$BZ2LIB_ROOT/lib -L$LUA_ROOT/lib \
130     $OS_LDFLAGS" \
131     CPPFLAGS="-I$NSPR_ROOT/include/nspr \
132     -I$ZLIB_ROOT/include -I$BZ2LIB_ROOT/include -I$DB4_ROOT/include \
133     -I$FILE_ROOT/include -I$POPT_ROOT/include \
134     $OS_CPPFLAGS \
135     -I$NSS_ROOT/include/nss3 -I$LUA_ROOT/include" \
136     LIBS="-lnspr4 -lnss3 -lnssutil3 -lplds4 -lbz2 -lplc4 -lz -lpopt \
137     -ldb -llua $LIBS_PLATF"
138    
139 fwyzard 1.102 #FIXME: this does not seem to work and we still get /usr/bin/python in some of the files.
140     export __PYTHON="/usr/bin/env python"
141 fwyzard 1.103 #perl -p -i -e "s|^.*WITH_SELINUX.*$||;
142     # s|-lselinux||;
143     #" `find . -name \*.in`
144 eulisse 1.12
145 eulisse 1.5 perl -p -i -e "s|#\!.*perl(.*)|#!/usr/bin/env perl$1|" scripts/get_magic.pl \
146     scripts/rpmdiff.cgi \
147     scripts/cpanflute2 \
148     scripts/perldeps.pl \
149     db/dist/camelize.pl
150 eulisse 1.12
151 eulisse 1.6 %install
152     make install
153 fwyzard 1.103 # We remove pkg-config files for two reasons:
154     # * it's actually not required (macosx does not even have it).
155     # * rpm 4.8 adds a dependency on the system /usr/bin/pkg-config
156     # on linux.
157     # In the case at some point we build a package that can be build
158     # only via pkg-config we have to think on how to ship our own
159     # version.
160     rm -rf %i/lib/pkgconfig
161 eulisse 1.12 perl -p -i -e "s|#\!/usr/bin/python(.*)|#!/usr/bin/env python$1|" %i/lib/rpm/symclash.py
162 eulisse 1.16 # The following patches the rpmrc to make sure that rpm macros are only picked up from
163     # what we distribute and not /etc or ~/
164     perl -p -i -e "s!:/etc/[^:]*!!g;
165     s!~/[^:]*!!g" %i/lib/rpm/rpmrc
166    
167     # This is for compatibility with rpm 4.3.3
168 eulisse 1.17 perl -p -i -e "s!^.buildroot!#%%buildroot!;
169 fwyzard 1.103 s!^%%_dbpath.*lib/rpm!%%_dbpath %{instroot}/%{cmsplatf}/var/lib/rpm!;
170 eulisse 1.17 s!^%%_repackage_dir.*/var/spool/repackage!%%_repackage_dir %{instroot}/%{cmsplatf}/var/spool/repackage!" %i/lib/rpm/macros
171 eulisse 1.59
172     # Removes any reference to /usr/lib/rpm in lib/rpm
173     perl -p -i -e 's|/usr/lib/rpm([^a-zA-Z])|%{i}/lib/rpm$1|g' \
174     %{i}/lib/rpm/check-rpaths \
175     %{i}/lib/rpm/check-rpaths-worker \
176     %{i}/lib/rpm/cpanflute \
177     %{i}/lib/rpm/cpanflute2 \
178     %{i}/lib/rpm/cross-build \
179     %{i}/lib/rpm/find-debuginfo.sh \
180     %{i}/lib/rpm/find-provides.perl \
181     %{i}/lib/rpm/find-requires.perl \
182     %{i}/lib/rpm/freshen.sh \
183     %{i}/lib/rpm/perldeps.pl \
184     %{i}/lib/rpm/rpmdb_loadcvt \
185     %{i}/lib/rpm/rpmrc \
186     %{i}/lib/rpm/trpm \
187     %{i}/lib/rpm/vpkg-provides.sh \
188     %{i}/lib/rpm/vpkg-provides2.sh
189    
190 eulisse 1.60 # Changes the shebang from /usr/bin/perl to /usr/bin/env perl
191     perl -p -i -e 's|^#[!]/usr/bin/perl(.*)|#!/usr/bin/env perl$1|' \
192     %{i}/lib/rpm/perl.prov \
193     %{i}/lib/rpm/perl.req \
194     %{i}/lib/rpm/rpmdiff \
195     %{i}/lib/rpm/sql.prov \
196     %{i}/lib/rpm/sql.req \
197     %{i}/lib/rpm/tcl.req \
198     %{i}/lib/rpm/magic.prov \
199     %{i}/lib/rpm/magic.req \
200     %{i}/lib/rpm/cpanflute
201    
202 eulisse 1.17 mkdir -p %{instroot}/%{cmsplatf}/var/spool/repackage
203 eulisse 1.59
204 fwyzard 1.103 # Generates the dependencies-setup.sh/dependencies-setup.csh which is
205     # automatically sourced by init.sh/init.csh, providing the environment for all
206     # the dependencies.
207 eulisse 1.12 mkdir -p %{i}/etc/profile.d
208 eulisse 1.43
209 eulisse 1.56 echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh
210     echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh
211 eulisse 1.58 echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
212     for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'`
213 eulisse 1.53 do
214 eulisse 1.56 case X$tool in
215     Xdistcc|Xccache )
216     ;;
217     * )
218     toolcap=`echo $tool | tr a-z- A-Z_`
219     eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh
220     eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh
221     ;;
222     esac
223 eulisse 1.53 done
224 eulisse 1.64
225     perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh
226     perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh
227    
228 eulisse 1.43 ln -sf rpm/rpmpopt-%{realversion} %i/lib/rpmpopt
229 fwyzard 1.103 perl -p -i -e 's|.[{]prefix[}]|%instroot|g' %{i}/lib/rpm/macros
230 eulisse 1.65
231 fwyzard 1.103 # Remove some of the path macros defined in macros since they could come from
232     # different places (e.g. from system or from macports) and this would lead to
233     # problems if a developer with macports builds a bootstrap package set.
234 eulisse 1.65 for shellUtil in tar cat chgrp chmod chown cp file gpg id make mkdir mv pgp rm rsh sed ssh gzip cpio perl unzip patch grep
235     do
236     perl -p -i -e "s|^%__$shellUtil\s(.*)|%__$shellUtil $shellUtil|" %i/lib/rpm/macros
237     done
238    
239 fwyzard 1.103 ln -sf rpm %i/bin/rpmdb
240     ln -sf rpm %i/bin/rpmsign
241     ln -sf rpm %i/bin/rpmverify
242     ln -sf rpm %i/bin/rpmquery
243    
244 eulisse 1.7 %post
245 andreasp 1.81 # do not relocate init.[c]sh as these are done by default from cmsBuild
246     perl -p -i -e "s|%instroot|$RPM_INSTALL_PREFIX|g" `grep -I -r %instroot $RPM_INSTALL_PREFIX/%pkgrel | cut -d: -f1 | sort | uniq | grep -v init.csh | grep -v init.sh `
247 eulisse 1.17 %files
248     %{i}
249 eulisse 1.54 %{instroot}/%{cmsplatf}/var/spool/repackage