source: projects/vine-rpm-helper/trunk/plugins/Perl-NoArch @ 6900

Revision 6900, 1.1 KB checked in by yasumichi, 12 years ago (diff)

fixed ticket id 2451

 http://mantis.vinelinux.org/view.php?id=2451

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