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