/
perl.spec
150 lines (129 loc) · 4.81 KB
/
perl.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
%global sname perl
%define syssbindir /usr/sbin
Name: perl%{plv}
Version: %(echo %{version})
Release: 5.%{etime}%{dist}
Summary: Practical Extraction and Reporting Language
Group: Development/Languages
License: GPL+ or Artistic
Url: http://www.perl.org/
Source0: http://cpan.metacpan.org/src/perl-%{version}.tar.bz2
BuildRequires: db4-devel
BuildRequires: groff
BuildRequires: tcsh
BuildRequires: zlib-devel
BuildRequires: bzip2-devel
BuildRequires: systemtap-sdt-devel
BuildRequires: procps
BuildRequires: rsyslog
BuildRequires: man
BuildRequires: gdbm-devel
Requires(post): %{syssbindir}/update-alternatives
Requires(postun): %{syssbindir}/update-alternatives
Provides: iov-%{sname}
Provides: %{sname}%{plv}(:WITH_ITHREADS)
Provides: %{sname}%{plv}(:WITH_PERLIO)
# List of dual-life bin files. Update %ghost entries in %files if you update
# this list.
%if 0%{?plv} >= 522
%define dualbin corelist cpan json_pp pod2usage podchecker podselect prove shasum xsubpp enc2xs piconv encguess zipdetails
%else
%define dualbin config_data corelist cpan json_pp pod2usage podchecker podselect prove shasum xsubpp enc2xs piconv zipdetails
%endif
# Filter requires on RPM 4.8.
# http://www.redhat.com/archives/rpm-list/2005-August/msg00034.html
# http://richdawe.livejournal.com/3102.html
%define _use_internal_dependency_generator 0
%define __find_provides bin/filter-provides perl%{plv}
%define __find_requires bin/filter-requires perl%{plv} 'Mac\\|VMS\\|perl >=\\|perl(Locale::Codes::\\|perl(unicore::Name\\|FCGI\\|DBD::SQLite\\|DBIx::Simple\\|Your::Module::Here)'
%description
Perl is a high-level programming language with roots in C, sed, awk and shell
scripting. Perl is good at handling processes and files, and is especially
good at handling text. Perl's hallmarks are practicality and efficiency. While
it is used to do a lot of different things, Perl's most common applications
are system administration utilities and web programming. A large proportion of
the CGI scripts on the web are written in Perl. You need the perl package
installed on your system so that your system can handle Perl scripts.
%prep
%setup -q -n %{sname}-%{version}
%build
sh Configure -des \
-Dprefix=%{_prefix} \
-Dsiteprefix=%{_prefix} \
-Dsiteman1dir=%{sitemandir}/man1 \
-Dsiteman3dir=%{sitemandir}/man3 \
-Dvendorprefix=%{_prefix} \
-Dvendorman1dir=%{vendormandir}/man1 \
-Dvendorman3dir=%{vendormandir}/man3 \
%if %{?admin_email:1}%{!?admin_email:0}
-Dperladmin=%{admin_email} \
-Dcf_email=%{admin_email} \
%endif
-Duseshrplib \
-Dusemultiplicity \
-Duseithreads
# Remove the version from @INC paths. Must be system Perl.
/usr/bin/perl -i -pe 's{/\Q%{version}}{}g' config.sh
make %{?_smp_mflags}
%check
JOBS=$(printf '%%s' "%{?_smp_mflags}" | sed 's/.*-j\([0-9][0-9]*\).*/\1/')
LC_ALL=C TEST_JOBS=$JOBS make test_harness
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Rename dual-life binfiles.
for binfile in %{dualbin}; do
%{__mv} %{buildroot}%{_bindir}/$binfile %{buildroot}%{_bindir}/%{plv}$binfile
touch %{buildroot}%{_bindir}/$binfile
done
%post
# Install dual-life binfile alternatives.
for binfile in %{dualbin}; do
%{syssbindir}/update-alternatives --install %{_bindir}/$binfile $binfile \
%{_bindir}/%{plv}$binfile 10
done
%postun
if [ $1 -eq 0 ] ; then
# Remove dual-life binfile alternatives.
for binfile in %{dualbin}; do
%{syssbindir}/update-alternatives --remove $binfile %{_bindir}/%{plv}$binfile
done
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%doc Artistic AUTHORS Copying README Changes
%if 0%{?plv} >= 522
%ghost %{_bindir}/encguess
%else
%ghost %{_bindir}/config_data
%endif
%ghost %{_bindir}/corelist
%ghost %{_bindir}/cpan
%ghost %{_bindir}/instmodsh
%ghost %{_bindir}/json_pp
%ghost %{_bindir}/pod2usage
%ghost %{_bindir}/podchecker
%ghost %{_bindir}/podselect
%ghost %{_bindir}/prove
%ghost %{_bindir}/shasum
%ghost %{_bindir}/xsubpp
%ghost %{_bindir}/enc2xs
%ghost %{_bindir}/piconv
%ghost %{_bindir}/zipdetails
%{_prefix}/*
%changelog
* Mon Aug 24 2015 David E. Wheeler <david.wheeler@iovation.com> - %{version}-5
- Ghost dual-life script zipdetails, provided by IO-Compress.
- Only ghost dual-life script encguess on 5.22 and higher.
- Only ghost dual-life script config_data on 5.20 and lower.
* Fri May 8 2015 David E. Wheeler <david.wheeler@iovation.com> - %{version}-4
- Ghost dual-life scripts xsubpp, enc2xs, and piconv, provided by
ExtUtils-ParseXS and Encode.
* Fri May 1 2015 David E. Wheeler <david.wheeler@iovation.com> - %{version}-3
- Remove version from @INC paths so that any minor version uses the same
modules.
* Tue Nov 4 2014 David E. Wheeler <david.wheeler@iovation.com> - %{version}-2
- Ghost instmodsh.
* Wed Jul 16 2014 David E. Wheeler <david.wheeler@iovation.com> - %{version}-1
- Let's build a modern Perl.