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

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

update method to treat unnecessary files.

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