summaryrefslogtreecommitdiff
path: root/pear/PEAR-Horde-Channel/PEAR-Horde-Channel.spec
blob: bb68d471c6228a6d5c25777f67f95b1bb63605b7 (plain)
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
%define pear_xmldir  %{l_prefix}/var/pear

Name:           PEAR-Horde-Channel
Version:        1.0
Release:        20081210
Summary:        Adds pear.horde.org channel to PEAR

Group:          Development/Languages
License:        N/A
URL:            http://pear.horde.org/
Source0:        http://pear.horde.org/channel.xml

# Build Info
Prefix:		%{l_prefix}
BuildRoot:	%{l_buildroot}

BuildPreReq:    php, php::with_pear = yes
Requires:       php, php::with_pear = yes

Obsoletes:      php-channel-horde

%description
This package adds the pear.horde.org channel which allows PEAR packages
from this channel to be installed.


%prep
%setup -q -c -T

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{SOURCE0} $RPM_BUILD_ROOT%{pear_xmldir}/pear.horde.org.xml
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 

%clean
rm -rf $RPM_BUILD_ROOT

%post

env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off"                                               \
  %{l_prefix}/bin/pear -d php_dir=%{l_prefix}/lib/php channel-add    %{pear_xmldir}/pear.horde.org.xml || \
  echo "Channel already exists!" && sleep 1
env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off"                                               \
  %{l_prefix}/bin/pear -d php_dir=%{l_prefix}/lib/php channel-update %{pear_xmldir}/pear.horde.org.xml || \
  echo "Could not update channel pear.horde.org!" && sleep 1

%postun
env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off"                                               \
  %{l_prefix}/bin/pear -d php_dir=%{l_prefix}/lib/php channel-delete pear.horde.org ||                    \
  echo "Could not delete channel pear.horde.org!" && sleep 1

%files -f files