]> git.pld-linux.org Git - packages/php-facebook-sdk.git/blob - php-facebook-sdk.spec
b1b3f74869517fa475ff23afaf9599abc5237130
[packages/php-facebook-sdk.git] / php-facebook-sdk.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build with tests
4
5 %if "%(cat /etc/resolv.conf >/dev/null 2>/dev/null; echo $?)" != "0"
6 %undefine       with_tests
7 %endif
8
9 %define         php_min_version 5.2.0
10 %include        /usr/lib/rpm/macros.php
11 Summary:        PHP SDK for the Facebook API
12 Name:           php-facebook-sdk
13 Version:        3.2.3
14 Release:        1
15 License:        Apache v2.0
16 Group:          Development/Languages/PHP
17 Source0:        https://github.com/facebookarchive/facebook-php-sdk/archive/v%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  fc8edc0afea0cbe8e64b539f491f5a19
19 Patch0:         class-nps.patch
20 URL:            https://github.com/facebookarchive/facebook-php-sdk
21 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
22 BuildRequires:  rpmbuild(macros) >= 1.654
23 %if %{with tests}
24 BuildRequires:  %{php_name}-curl
25 BuildRequires:  %{php_name}-hash
26 BuildRequires:  %{php_name}-json
27 BuildRequires:  %{php_name}-pecl-xdebug
28 BuildRequires:  %{php_name}-session
29 BuildRequires:  php-PHPUnit >= 3.5
30 %endif
31 Requires:       php(core) >= %{php_min_version}
32 Requires:       php(curl)
33 Requires:       php(hash)
34 Requires:       php(json)
35 Suggests:       php(session)
36 BuildArch:      noarch
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         _noautoreq_pear base_facebook.php
40
41 %description
42 Open Source PHP SDK that allows you to utilize the The Facebook
43 Platform which is a set of APIs that make your application more
44 social.
45
46 %prep
47 %setup -qn facebook-php-sdk-%{version}
48 cp -p src/facebook.php src/facebook.nps.php
49 %patch0 -p1
50
51 %build
52 %if %{with tests}
53 phpunit \
54         -d session.save_handler="files" \
55         -d session.save_path="$(pwd)" \
56         -d include_path=".:$(pwd):%{php_pear_dir}" \
57         --colors \
58         --coverage-html coverage \
59         --verbose \
60         --stderr \
61         --bootstrap tests/bootstrap.php \
62         tests/tests.php
63 %endif
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT%{php_data_dir}
68 cp -a src/*facebook*.php $RPM_BUILD_ROOT%{php_data_dir}
69
70 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
71 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %files
77 %defattr(644,root,root,755)
78 %doc readme.md changelog.md
79 %{php_data_dir}/facebook.php
80 %{php_data_dir}/facebook.nps.php
81 %{php_data_dir}/base_facebook.php
82 %{_examplesdir}/%{name}-%{version}
This page took 0.058866 seconds and 2 git commands to generate.