]> git.pld-linux.org Git - packages/php-xhp.git/blame - php-xhp.spec
up to 1.5, drop ac support
[packages/php-xhp.git] / php-xhp.spec
CommitLineData
fbe30978
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
bf17b0aa 5%define php_name php%{?php_suffix}
fbe30978
ER
6%define modname xhp
7Summary: Inline XML For PHP
bf17b0aa 8Name: %{php_name}-%{modname}
2ca64c80
ER
9Version: 1.5
10Release: 1
fbe30978
ER
11License: PHP 3.01
12Group: Development/Languages/PHP
bf17b0aa 13Source0: https://github.com/facebook/xhp/archive/%{version}/php-%{modname}-%{version}.tar.gz
2ca64c80 14# Source0-md5: b9a552d6cd823a82f2e57037aed42a69
1f1f835a 15URL: http://github.com/facebook/xhp/wiki
6e3d2a79 16Patch0: optflags.patch
bf17b0aa 17BuildRequires: %{php_name}-devel >= 4:5.2.0
7302cb23 18%{?with_tests:BuildRequires: /usr/bin/php}
f04da752 19# if you use git checkout:
42231c7a 20#BuildRequires: bison >= 2.3
21#BuildRequires: flex >= 2.5.35
d6e96913 22BuildRequires: libstdc++-devel >= 5:4.0
7302cb23 23%{?with_tests:BuildRequires: php-pcre}
fbe30978 24BuildRequires: re2c >= 0.13.5
586950e0 25BuildRequires: rpm >= 4.4.9-56
bf17b0aa 26BuildRequires: rpmbuild(macros) >= 1.666
fbe30978 27%{?requires_php_extension}
40ffe404 28Requires(post,postun): /sbin/ldconfig
fbe30978
ER
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32XHP is a PHP extension which augments the syntax of the language such
33that XML document fragments become valid PHP expressions. This allows
34you to use PHP as a stricter templating engine and offers much more
35straightforward implementation of reusable components.
36
7a55dfb0
ER
37%package devel
38Summary: Header files for xhp
39Summary(pl.UTF-8): Pliki nagłówkowe biblioteki xhp
40Group: Development/Libraries
41Requires: %{name} = %{version}-%{release}
42Requires: php-devel >= 4:5.2.0
43
44%description devel
45Header files for xhp.
46
fbe30978 47%prep
63bc4ce6 48%setup -q -n %{modname}-%{version}
6e3d2a79 49%patch0 -p1
fbe30978 50
0ae8397a
ER
51# disable failing tests
52mv tests/idx-01.phpt{,.fail}
53mv tests/trait.phpt{,.fail}
54
fbe30978 55%build
1f1f835a
ER
56%{__make} -C xhp \
57 libdir=%{_libdir} \
58 CXX="%{__cxx}" \
c33315ec 59 OPTFLAGS="%{rpmcxxflags} -fpermissive"
1f1f835a 60
fbe30978
ER
61phpize
62%configure
63%{__make} \
1f1f835a 64 CC="%{__cc}" \
fbe30978 65 CXX="%{__cxx}" \
c33315ec 66 CXXFLAGS="%{rpmcxxflags} -fpermissive"
fbe30978 67
1f1f835a
ER
68%if %{with tests}
69cat <<'EOF' > run-tests.sh
70#!/bin/sh
71export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
72unset TZ LANG LC_ALL || :
73%{__make} test \
74 RUN_TESTS_SETTINGS="-q $*"
75EOF
76chmod +x run-tests.sh
77./run-tests.sh -w failed.log -s test.log
0ae8397a 78test ! -s failed.log
1f1f835a 79%endif
fbe30978
ER
80
81%install
82rm -rf $RPM_BUILD_ROOT
fbe30978 83%{__make} install \
1f1f835a
ER
84 EXTENSION_DIR=%{php_extensiondir} \
85 INSTALL_ROOT=$RPM_BUILD_ROOT
86
87install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
fbe30978
ER
88cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
89; Enable %{modname} extension module
90extension=%{modname}.so
91EOF
92
4c4f9a10
ER
93install -d $RPM_BUILD_ROOT%{php_data_dir}/xhp
94cp -a php-lib/* $RPM_BUILD_ROOT%{php_data_dir}/xhp
40ffe404 95install -p xhp/libxhp.so $RPM_BUILD_ROOT%{_libdir}
4c4f9a10 96
3dd4785f
ER
97# files used by hiphop-php
98install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
44edbd7e 99cp -p xhp/libxhp.a $RPM_BUILD_ROOT%{_libdir}
3dd4785f 100cp -p xhp/xhp_preprocess.hpp $RPM_BUILD_ROOT%{_includedir}
35491a30 101
fbe30978
ER
102%clean
103rm -rf $RPM_BUILD_ROOT
104
40ffe404 105
fbe30978 106%post
40ffe404 107/sbin/ldconfig
fbe30978
ER
108%php_webserver_restart
109
110%postun
40ffe404 111/sbin/ldconfig
fbe30978
ER
112if [ "$1" = 0 ]; then
113 %php_webserver_restart
114fi
115
116%files
117%defattr(644,root,root,755)
bf17b0aa 118%doc README.textile INSTALL
fbe30978
ER
119%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
120%attr(755,root,root) %{php_extensiondir}/%{modname}.so
40ffe404 121%{_libdir}/libxhp.so
4c4f9a10 122%{php_data_dir}/xhp
7a55dfb0
ER
123
124%files devel
125%defattr(644,root,root,755)
3dd4785f 126%{_includedir}/xhp_preprocess.hpp
44edbd7e 127%{_libdir}/libxhp.a
This page took 0.237101 seconds and 4 git commands to generate.