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