]> git.pld-linux.org Git - SPECS.git/blob - php-pecl-uri_template.spec
SPECS updated Tue 30 Apr 15:06:09 CEST 2024
[SPECS.git] / php-pecl-uri_template.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname uri_template
7 Summary:        Implementation of URI Template(RFC6570) specification for PHP
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        1.0
10 Release:        4
11 License:        PHP 3.01
12 Group:          Development/Languages/PHP
13 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5:  652dbdb85da3c820f369526155355522
15 URL:            http://pecl.php.net/package/uri_template
16 %{?with_tests:BuildRequires:    %{php_name}-cli}
17 BuildRequires:  %{php_name}-devel >= 4:5.3.1
18 BuildRequires:  rpmbuild(macros) >= 1.686
19 %{?requires_php_extension}
20 Provides:       php(%{modname}) = %{version}
21 Obsoletes:      php-pecl-uri_template < 1.0-3
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 URI Template PHP Extension implementation of RFC-6570.
26
27 %prep
28 %setup -qc
29 mv %{modname}-%{version}/* .
30
31 %build
32 phpize
33 %configure
34 %{__make}
35
36 %if %{with tests}
37 # simple module load test
38 %{__php} -n -q \
39         -d extension_dir=modules \
40         -d extension=%{modname}.so \
41         -m > modules.log
42 grep %{modname} modules.log
43
44 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
45 unset TZ LANG LC_ALL || :
46 %{__make} test \
47         PHP_EXECUTABLE=%{__php}
48 %endif
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 %{__make} install \
53         EXTENSION_DIR=%{php_extensiondir} \
54         INSTALL_ROOT=$RPM_BUILD_ROOT
55
56 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
57 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
58 ; Enable %{modname} extension module
59 extension=%{modname}.so
60 EOF
61
62 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
63 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
64
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 %post
69 %php_webserver_restart
70
71 %postun
72 if [ "$1" = 0 ]; then
73         %php_webserver_restart
74 fi
75
76 %files
77 %defattr(644,root,root,755)
78 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
79 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
80 %{_examplesdir}/%{name}-%{version}
This page took 0.56562 seconds and 3 git commands to generate.