You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
php-pear-PHP-CodeSniffer/php-pear-PHP-CodeSniffer.spec

157 lines
4.5 KiB

%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%define pear_name PHP_CodeSniffer
Name: php-pear-PHP-CodeSniffer
Version: 1.1.0
Release: 2%{?dist}
Summary: PHP coding standards enforcement tool
Group: Development/Tools
License: BSD
URL: http://pear.php.net/package/PHP_CodeSniffer
Source0: http://pear.php.net/get/PHP_CodeSniffer-%{version}.tgz
Source1: PHP_CodeSniffer-licence.txt
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php-pear >= 1:1.4.9-1.2
Requires: php-pear(PEAR)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides: php-pear(%{pear_name}) = %{version}
%description
PHP_CodeSniffer provides functionality to verify that code conforms to
certain standards, such as PEAR, or user-defined.
%package -n phpcs
Summary: Command-line utility for PHP-CodeSniffer
Group: Development/Tools
Requires: php-pear(%{pear_name}) = %{version}
Requires: php-cli
%description -n phpcs
This package includes a utility to run PHP_CodeSniffer from command line.
%prep
%setup -q -c
[ -f package2.xml ] || mv package.xml package2.xml
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml
%build
# Empty build section,
%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{pear_name}.xml
# Move documentation
mkdir -p docdir
mv $RPM_BUILD_ROOT%{pear_datadir}/%{pear_name}/*.sample.conf docdir/
# Remove phpcs-svn-pre-commit: we'll add it to docs
mv -f $RPM_BUILD_ROOT%{_bindir}/scripts/phpcs-svn-pre-commit .
chmod 0644 phpcs-svn-pre-commit
rm -rf $RPM_BUILD_ROOT%{_bindir}/scripts
cp %{SOURCE1} .
# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
# Install XML package description
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{__pear} install --nodeps --soft --force --register-only \
%{pear_xmldir}/%{pear_name}.xml >/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
%{__pear} uninstall --nodeps --ignore-errors --register-only \
%{pear_name} >/dev/null || :
fi
%files
%defattr(-,root,root,-)
%doc %{pear_name}-%{version}/PHP_CodeSniffer-licence.txt
%doc %{pear_name}-%{version}/docdir/*
%{pear_xmldir}/%{pear_name}.xml
%{pear_testdir}/%{pear_name}
%dir %{pear_phpdir}/PHP
%{pear_phpdir}/PHP/*
%dir %{pear_datadir}/%{pear_name}
%files -n phpcs
%defattr(-,root,root,-)
%doc %{pear_name}-%{version}/PHP_CodeSniffer-licence.txt
%doc %{pear_name}-%{version}/phpcs-svn-pre-commit
%{_bindir}/phpcs
%changelog
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Mar 05 2009 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.1.0-1
- Belatedly update to 1.1.0 final.
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-0.2.RC2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Jun 30 2008 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.1.0-0.1.RC2
- Upstream 1.1.0RC2
* Sun Feb 17 2008 Konstantin Ryabitsev <icon@fedoraproject.org> - 1.0.1-1
- Upstream 1.0.1
- Move sample config into docs
* Fri Aug 17 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.8.0-1
- Upstream 0.8.0
* Mon Jun 11 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.7.0-1
- Upstream 0.7.0
- Drop Requirement on php-common (php-pear pulls that in)
* Mon Jun 11 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6.0-1
- Upstream 0.6.0
- Fix owner on phpcs
* Tue Apr 17 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.5.0-1
- Upstream 0.5.0
* Tue Feb 20 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.4.0-1
- Upstream 0.4.0
* Mon Jan 29 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-1
- Rename to php-pear-PHP-CodeSniffer
- Own all dirs we create
- Require php-common > 5.1.0
* Mon Jan 29 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-1
- Split phpcs into a separate package (so we don't require php-cli)
* Fri Jan 12 2007 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.3.0-0.1
- Upstream 0.3.0
* Mon Oct 23 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.2.0-0.1
- Upstream 0.2.0
* Mon Sep 25 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.1.1-0.1
- Upstream update.
* Fri Sep 22 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.1.0-0.1
- Initial packaging.