-
Notifications
You must be signed in to change notification settings - Fork 104
/
template.spec
72 lines (63 loc) · 1.96 KB
/
template.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
Summary: PEAR: @summary@
Name: @rpm_package@
Version: @version@
Release: 1
License: @release_license@
Group: Development/Libraries
Source: http://@master_server@/get/@package@-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
URL: http://@master_server@/package/@package@
Prefix: %{_prefix}
BuildArchitectures: @arch@
@extra_headers@
%description
@description@
%prep
rm -rf %{buildroot}/*
%setup -c -T
# XXX Source files location is missing here in pear cmd
pear -v -c %{buildroot}/pearrc \
-d php_dir=%{_libdir}/php/pear \
-d doc_dir=/docs \
-d bin_dir=%{_bindir} \
-d data_dir=%{_libdir}/php/pear/data \
-d test_dir=%{_libdir}/php/pear/tests \
-d ext_dir=%{_libdir} \@extra_config@
-s
%build
echo BuildRoot=%{buildroot}
%postun
# if refcount = 0 then package has been removed (not upgraded)
if [ "$1" -eq "0" ]; then
pear uninstall --nodeps -r @possible_channel@@package@
rm @rpm_xml_dir@/@[email protected]
fi
%post
# if refcount = 2 then package has been upgraded
if [ "$1" -ge "2" ]; then
pear upgrade --nodeps -r @rpm_xml_dir@/@[email protected]
else
pear install --nodeps -r @rpm_xml_dir@/@[email protected]
fi
%install
pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
$RPM_SOURCE_DIR/@package@-%{version}.tgz
rm %{buildroot}/pearrc
rm %{buildroot}/%{_libdir}/php/pear/.filemap
rm %{buildroot}/%{_libdir}/php/pear/.lock
rm -rf %{buildroot}/%{_libdir}/php/pear/.registry
if [ "@doc_files@" != "" ]; then
mv %{buildroot}/docs/@package@/* .
rm -rf %{buildroot}/docs
fi
mkdir -p %{buildroot}@rpm_xml_dir@
tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package@[email protected]
cp -p package@[email protected] %{buildroot}@rpm_xml_dir@/@[email protected]
#rm -rf %{buildroot}/*
#pear -q install -R %{buildroot} -n package@[email protected]
#mkdir -p %{buildroot}@rpm_xml_dir@
#cp -p package@[email protected] %{buildroot}@rpm_xml_dir@/@[email protected]
%files
%defattr(-,root,root)
%doc @doc_files@
/