Line | |
---|
1 | # |
---|
2 | # Plugin for Perl package |
---|
3 | # |
---|
4 | # vi:syntax=sh |
---|
5 | # |
---|
6 | |
---|
7 | source ${pluginsdir}/Perl |
---|
8 | |
---|
9 | # |
---|
10 | # output dependency |
---|
11 | # |
---|
12 | OutputDependency() |
---|
13 | { |
---|
14 | OutputDependency_common |
---|
15 | echo 'BuildArch: noarch' >> ${SPECFILE} |
---|
16 | echo >> ${SPECFILE} |
---|
17 | } |
---|
18 | |
---|
19 | # |
---|
20 | # Output build section |
---|
21 | # |
---|
22 | OutputBuild() |
---|
23 | { |
---|
24 | echo '%build' >> ${SPECFILE} |
---|
25 | echo '%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"' >> ${SPECFILE} |
---|
26 | echo '%{__make} %{?_smp_mflags}' >> ${SPECFILE} |
---|
27 | echo '' >> ${SPECFILE} |
---|
28 | } |
---|
29 | |
---|
30 | # |
---|
31 | # Output install section |
---|
32 | # |
---|
33 | OutputInstall() |
---|
34 | { |
---|
35 | cat >> ${SPECFILE} << 'EOL' |
---|
36 | %install |
---|
37 | %{__rm} -rf ${RPM_BUILD_ROOT} |
---|
38 | %{__make} pure_install DESTDIR=${RPM_BUILD_ROOT} |
---|
39 | |
---|
40 | # remove unnecessary files. |
---|
41 | find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -exec %{__rm} -f {} ';' |
---|
42 | find ${RPM_BUILD_ROOT} -type f -name .packlist -exec %{__rm} -f {} ';' |
---|
43 | if [ -d ${RPM_BUILD_ROOT}%{_mandir} ]; then |
---|
44 | find ${RPM_BUILD_ROOT}%{_mandir} -type f -exec %{__rm} -f {} ';' |
---|
45 | fi |
---|
46 | find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; |
---|
47 | |
---|
48 | # generate file list |
---|
49 | find $RPM_BUILD_ROOT -type f -print | |
---|
50 | sed "s@^$RPM_BUILD_ROOT@@g" > %{name}.files |
---|
51 | |
---|
52 | if [ "$(cat %{name}.files)X" = "X" ] ; then |
---|
53 | echo "ERROR: EMPTY FILE LIST" |
---|
54 | exit -1 |
---|
55 | fi |
---|
56 | |
---|
57 | EOL |
---|
58 | } |
---|
59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.