]> git.pld-linux.org Git - packages/php-phpquery.git/blob - php-phpquery.spec
use virtual names for php deps
[packages/php-phpquery.git] / php-phpquery.spec
1 %define         pkgname phpQuery
2 %define         php_min_version 5.2.0
3 %include        /usr/lib/rpm/macros.php
4 Summary:        phpQuery - jQuery port to PHP
5 Name:           php-phpquery
6 Version:        0.9.5.386
7 Release:        0.13
8 License:        The MIT License
9 Group:          Development/Languages/PHP
10 Source0:        https://phpquery.googlecode.com/files/phpQuery-%{version}.zip
11 # Source0-md5:  3ddab515c82a1a102a87f90ab319e7d1
12 Patch0:         svn.patch
13 Patch1:         sys-mbstring.patch
14 Patch2:         cli.patch
15 URL:            https://code.google.com/p/phpquery/
16 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
17 BuildRequires:  rpmbuild(macros) >= 1.610
18 BuildRequires:  sed >= 4.0
19 BuildRequires:  unzip
20 Requires:       php(core) >= %{php_min_version}
21 Requires:       php(date)
22 Requires:       php(dom)
23 Requires:       php(json)
24 Requires:       php(mbstring)
25 Requires:       php(pcre)
26 Requires:       php-pear
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 # bad depsolver
31 %define         _noautopear     pear(phpQuery.php/phpQuery/.*) pear(phpQuery/plugins/Scripts/__config.php)
32
33 # put it together for rpmbuild
34 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
35
36 %description
37 phpQuery is a server-side, chainable, CSS3 selector driven Document
38 Object Model (DOM) API based on jQuery JavaScript Library.
39
40 %prep
41 %setup -qc
42 mv phpQuery .pq; mv .pq/* .
43 %patch0 -p1
44 %patch1 -p1
45 %patch2 -p1
46
47 # fix shebang
48 %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' cli/phpquery
49
50 # use ext
51 rm %{pkgname}/%{pkgname}/compat/mbstring.php
52 rmdir %{pkgname}/%{pkgname}/compat
53
54 # use Zend packages directly
55 mv %{pkgname}/%{pkgname}/Zend .
56
57 # separate examples
58 install -d examples/plugins/Scripts
59 mv %{pkgname}/%{pkgname}/bootstrap.example.php examples
60 mv %{pkgname}/%{pkgname}/plugins/Scripts/*example.php examples/plugins/Scripts
61 mv %{pkgname}/%{pkgname}/plugins/*example.php examples/plugins
62 mv demo.php examples
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{php_data_dir}/%{pkgname},%{_bindir},%{_examplesdir}/%{name}-%{version}}
67
68 cp -a %{pkgname}/* $RPM_BUILD_ROOT%{php_data_dir}
69 install -p cli/phpquery $RPM_BUILD_ROOT%{_bindir}
70 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %files
76 %defattr(644,root,root,755)
77 %attr(755,root,root) %{_bindir}/phpquery
78 %{php_data_dir}/phpQuery.php
79 %{php_data_dir}/phpQuery
80 %{_examplesdir}/%{name}-%{version}
This page took 0.039766 seconds and 3 git commands to generate.