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