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

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