]> git.pld-linux.org Git - packages/php-pecl-uri_template.git/blob - php-pecl-uri_template.spec
b525b068bbadfd899df01050a6b852fc1c228573
[packages/php-pecl-uri_template.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:        2
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.666
19 %{?requires_php_extension}
20 Provides:       php(%{modname}) = %{version}
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %description
24 URI Template PHP Extension implementation of RFC-6570.
25
26 %prep
27 %setup -qc
28 mv %{modname}-%{version}/* .
29
30 %build
31 phpize
32 %configure
33 %{__make}
34
35 %if %{with tests}
36 # simple module load test
37 %{__php} -n -q \
38         -d extension_dir=modules \
39         -d extension=%{modname}.so \
40         -m > modules.log
41 grep %{modname} modules.log
42
43 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
44 unset TZ LANG LC_ALL || :
45 %{__make} test \
46         PHP_EXECUTABLE=%{__php}
47 %endif
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 %{__make} install \
52         EXTENSION_DIR=%{php_extensiondir} \
53         INSTALL_ROOT=$RPM_BUILD_ROOT
54
55 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
56 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
57 ; Enable %{modname} extension module
58 extension=%{modname}.so
59 EOF
60
61 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
62 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %post
68 %php_webserver_restart
69
70 %postun
71 if [ "$1" = 0 ]; then
72         %php_webserver_restart
73 fi
74
75 %files
76 %defattr(644,root,root,755)
77 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
78 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
79 %{_examplesdir}/%{name}-%{version}
This page took 0.051252 seconds and 3 git commands to generate.