3 %bcond_without tests # build without tests
5 %if "%{pld_release}" == "ac"
6 # add suffix, but allow ccache, etc in ~/.rpmmacros
7 %{expand:%%define __cc %(echo '%__cc' | sed -e 's,-gcc,-gcc4,')}
8 %{expand:%%define __cxx %(echo '%__cxx' | sed -e 's,-g++,-g++4,')}
9 %{expand:%%define __cpp %(echo '%__cpp' | sed -e 's,-gcc,-gcc4,')}
12 %define php_name php%{?php_suffix}
14 Summary: Inline XML For PHP
15 Name: %{php_name}-%{modname}
19 Group: Development/Languages/PHP
20 Source0: https://github.com/facebook/xhp/archive/%{version}/php-%{modname}-%{version}.tar.gz
21 # Source0-md5: 98d56ee6b5bc22f76be4106a224c5875
22 URL: http://github.com/facebook/xhp/wiki
23 Patch0: optflags.patch
24 BuildRequires: %{php_name}-devel >= 4:5.2.0
25 %{?with_tests:BuildRequires: /usr/bin/php}
26 # if you use git checkout:
27 #BuildRequires: bison >= 2.3
28 #BuildRequires: flex >= 2.5.35
29 BuildRequires: libstdc++-devel >= 5:4.0
30 %{?with_tests:BuildRequires: php-pcre}
31 BuildRequires: re2c >= 0.13.5
32 BuildRequires: rpm >= 4.4.9-56
33 BuildRequires: rpmbuild(macros) >= 1.666
34 %{?requires_php_extension}
35 # gcc4 might be installed, but not current __cc
36 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "4.0"
37 BuildRequires: __cc >= 4.0
39 Requires(post,postun): /sbin/ldconfig
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 XHP is a PHP extension which augments the syntax of the language such
44 that XML document fragments become valid PHP expressions. This allows
45 you to use PHP as a stricter templating engine and offers much more
46 straightforward implementation of reusable components.
49 Summary: Header files for xhp
50 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki xhp
51 Group: Development/Libraries
52 Requires: %{name} = %{version}-%{release}
53 Requires: php-devel >= 4:5.2.0
59 %setup -q -n %{modname}-%{version}
62 # disable failing tests
63 mv tests/idx-01.phpt{,.fail}
64 mv tests/trait.phpt{,.fail}
66 %ifarch alpha sparc ppc
67 %{__sed} -i -e 's/-minline-all-stringops//' xhp/Makefile
74 OPTFLAGS="%{rpmcxxflags} -fpermissive"
81 CXXFLAGS="%{rpmcxxflags} -fpermissive"
84 cat <<'EOF' > run-tests.sh
86 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
87 unset TZ LANG LC_ALL || :
89 RUN_TESTS_SETTINGS="-q $*"
92 ./run-tests.sh -w failed.log -s test.log
97 rm -rf $RPM_BUILD_ROOT
99 EXTENSION_DIR=%{php_extensiondir} \
100 INSTALL_ROOT=$RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
103 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
104 ; Enable %{modname} extension module
105 extension=%{modname}.so
108 install -d $RPM_BUILD_ROOT%{php_data_dir}/xhp
109 cp -a php-lib/* $RPM_BUILD_ROOT%{php_data_dir}/xhp
110 install -p xhp/libxhp.so $RPM_BUILD_ROOT%{_libdir}
112 # files used by hiphop-php
113 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
114 cp -p xhp/libxhp.a $RPM_BUILD_ROOT%{_libdir}
115 cp -p xhp/xhp_preprocess.hpp $RPM_BUILD_ROOT%{_includedir}
118 rm -rf $RPM_BUILD_ROOT
123 %php_webserver_restart
127 if [ "$1" = 0 ]; then
128 %php_webserver_restart
132 %defattr(644,root,root,755)
133 %doc README.textile INSTALL
134 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
135 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
140 %defattr(644,root,root,755)
141 %{_includedir}/xhp_preprocess.hpp