Created
December 22, 2014 10:28
-
-
Save meghprkh/066d9477881f168c77b4 to your computer and use it in GitHub Desktop.
RPM (Fedora) PHP Channel SPEC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} | |
%global pear_channel pear.example.org | |
%global pear_channel_name example | |
Name: php-channel-%{pear_channel_name} | |
# Use REST version | |
Version: 1.3 | |
Release: 1%{?dist} | |
Summary: Adds %{pear_channel_name} channel to PEAR | |
Group: Development/Languages | |
License: MIT | |
URL: http://%{pear_channel} | |
Source0: http://%{pear_channel}/channel.xml | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |
BuildArch: noarch | |
BuildRequires: php-pear >= 1:1.4.9-1.2 | |
Requires: php-common >= 5.1.4 | |
Requires: php-pear(PEAR) | |
Requires(post): %{__pear} | |
Requires(postun): %{__pear} | |
Provides: php-channel(%{pear_channel}) | |
%description | |
This package adds the %{pear_channel_name} 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 $RPM_BUILD_ROOT | |
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir} | |
install -pm 644 %{SOURCE0} $RPM_BUILD_ROOT%{pear_xmldir}/%{name}.xml | |
%clean | |
rm -rf $RPM_BUILD_ROOT | |
%post | |
if [ $1 -eq 1 ] ; then | |
%{__pear} channel-add %{pear_xmldir}/%{name}.xml > /dev/null || : | |
else | |
%{__pear} channel-update %{pear_xmldir}/%{name}.xml > /dev/null ||: | |
fi | |
%postun | |
if [ $1 -eq 0 ] ; then | |
%{__pear} channel-delete %{pear_channel} > /dev/null || : | |
fi | |
%files | |
%defattr(-,root,root,-) | |
%{pear_xmldir}/%{name}.xml | |
%changelog | |
* Mon Dec 15 2014 Megh Parikh <[email protected]> 1.3-1 | |
- Initial Release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment