summaryrefslogtreecommitdiffstats
path: root/php-channel-nrk.spec
blob: 615d1e312d3db30a61d21982adb52e16520fd4f3 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# spec file for php-channel-nrk
#
# Copyright (c) 2013 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Please, preserve the %changelog entries
#
%global channel pear.nrk.io
Name:           php-channel-nrk
# REST version
Version:        1.3
Release:        1%{?dist}
Summary:        Adds pear.nrk.io channel to PEAR

Group:          Development/Languages
License:        Public Domain
URL:            http://%{channel}/
Source0:        http://%{channel}/channel.xml

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch:      noarch
BuildRequires:  php-pear

Requires:       php-pear(PEAR)
Requires(post): /usr/bin/pear
Requires(postun): /usr/bin/pear

Provides:       php-channel(%{channel})

%description
This package adds the %{channel} channel which allows PEAR packages
from this channel to be installed.


%prep
%setup -q -c -T


%build
# Empty build section, nothing to build


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{SOURCE0} %{buildroot}%{pear_xmldir}/%{channel}.xml


%clean
rm -rf %{buildroot}


%post
if [ $1 -eq  1 ] ; then
   %{__pear} channel-add %{pear_xmldir}/%{channel}.xml > /dev/null || :
else
   %{__pear} channel-update %{pear_xmldir}/%{channel}.xml > /dev/null ||:
fi


%postun
if [ $1 -eq 0 ] ; then
   %{__pear} channel-delete %{channel} > /dev/null || :
fi


%files
%defattr(-,root,root,-)
%{pear_xmldir}/%{channel}.xml


%changelog
* Wed Jun 05 2013 Remi Collet <remi@fedoraproject.org> - 1.3-1
- Initial package