]> git.pld-linux.org Git - packages/php-pecl-translit.git/blame - php-pecl-translit.spec
run tests
[packages/php-pecl-translit.git] / php-pecl-translit.spec
CommitLineData
1e67d643
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
382d2064 5%define php_name php%{?php_suffix}
fba179d7 6%define modname translit
99d98d5e
ER
7Summary: %{modname} - transliterates non-latin character sets to latin
8Summary(pl.UTF-8): %{modname} - translitacja alfabetów niełacińskich do łacińskiego
382d2064 9Name: %{php_name}-pecl-%{modname}
3a9bf2c3
ER
10Version: 0.6.2
11Release: 1
0b399c4b
AG
12License: PHP
13Group: Development/Languages/PHP
3a9bf2c3
ER
14Source0: https://github.com/derickr/pecl-translit/archive/RELEASE_0_6_2.tar.gz
15# Source0-md5: 599a00bb624d1ebc8440698aa89585dc
16URL: https://github.com/derickr/pecl-translit
6aaad9c6 17BuildRequires: %{php_name}-devel >= 3:5.0.4
f3dfaad1 18BuildRequires: libtool
bde1698e 19BuildRequires: rpmbuild(macros) >= 1.650
1e67d643
ER
20%if %{with tests}
21BuildRequires: %{php_name}-cli
22BuildRequires: %{php_name}-iconv
23%endif
f03978c1 24%{?requires_php_extension}
382d2064 25Requires: %{php_name}-iconv
3831f6a4 26Provides: php(%{modname}) = %{version}
6aaad9c6 27Obsoletes: php-pecl-translit < 0.6.1-8
0b399c4b
AG
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
0b399c4b
AG
30%description
31This extension allows you to transliterate text in non-latin
32characters (such as Chinese, Cyrillic, Greek etc) to latin characters.
33Besides the transliteration the extension also contains filters to
34upper- and lowercase latin, cyrillic and greek, and perform special
35forms of transliteration such as converting ligatures such as the
76d977d1
JB
36Norwegian "ae" ligature to separate "ae" characters and normalizing
37punctuation and spacing.
0b399c4b 38
39336f6a
JR
39%description -l pl.UTF-8
40To rozszerzenie umożliwia transliterację tekstu ze znaków
41niełacińskich (takich jak chińskie, cyrilica, greckie) na znaki
42łacińskie. Oprócz transliteracji rozszerzenie zawiera także filtry na
43wielkie i małe litery łacińskie, cyrylicę i greckie oraz wykonuje
76d977d1
JB
44specjalne formy transliteracji, takie jak konwersja ligatur takich jak
45norweska ligatura "ae" na oddzielne znaki "ae" oraz normalizacja
39336f6a 46znaków przestankowych i odstępów.
76d977d1 47
0b399c4b 48%prep
99d98d5e 49%setup -qc
3a9bf2c3 50mv pecl-translit-*/* .
0b399c4b
AG
51
52%build
0b399c4b
AG
53phpize
54%configure
55%{__make}
56
1e67d643
ER
57%if %{with tests}
58# simple module load test
59%{__php} -n -q \
60 -d extension_dir=modules \
61 -d extension=%{php_extensiondir}/iconv.so \
62 -d extension=%{modname}.so \
63 -m > modules.log
64grep %{modname} modules.log
65
66cat <<'EOF' > run-tests.sh
67#!/bin/sh
68export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
69exec %{__make} test \
70 PHP_EXECUTABLE=%{__php} \
71 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="iconv" \
72 RUN_TESTS_SETTINGS="-q $*"
73EOF
74chmod +x run-tests.sh
75
76./run-tests.sh
77%endif
78
0b399c4b
AG
79%install
80rm -rf $RPM_BUILD_ROOT
2623f792 81install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
0b399c4b 82
99d98d5e
ER
83install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
84cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
85; Enable %{modname} extension module
86extension=%{modname}.so
f03978c1 87EOF
0b399c4b
AG
88
89%clean
90rm -rf $RPM_BUILD_ROOT
91
92%post
2623f792 93%php_webserver_restart
0b399c4b 94
f03978c1
ER
95%postun
96if [ "$1" = 0 ]; then
2623f792 97 %php_webserver_restart
0b399c4b
AG
98fi
99
100%files
101%defattr(644,root,root,755)
99d98d5e
ER
102%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
103%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.094805 seconds and 4 git commands to generate.