diff --git a/publicsuffix-list.spec b/publicsuffix-list.spec index 1719c76..f35ab1e 100644 --- a/publicsuffix-list.spec +++ b/publicsuffix-list.spec @@ -1,3 +1,5 @@ +%bcond_without dafsa + %global revdate 20170206 Name: publicsuffix-list @@ -13,7 +15,9 @@ Source2: https://github.com/publicsuffix/list/raw/master/tests/test_psl.t BuildArch: noarch +%if %{with dafsa} BuildRequires: psl-make-dafsa +%endif %description @@ -24,6 +28,7 @@ Software using the Public Suffix List will be able to determine where cookies may and may not be set, protecting the user from being tracked across sites. +%if %{with dafsa} %package dafsa Summary: Cross-vendor public domain suffix database in DAFSA form @@ -37,6 +42,7 @@ tracked across sites. This package includes a DAFSA representation of the Public Suffix List for runtime loading. +%endif %prep @@ -46,13 +52,17 @@ cp -av %{SOURCE1} COPYING %build +%if %{with dafsa} LC_CTYPE=C.UTF-8 \ psl-make-dafsa --output-format=binary \ public_suffix_list.dat public_suffix_list.dafsa +%endif %install +%if %{with dafsa} install -m 644 -p -D public_suffix_list.dafsa $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/public_suffix_list.dafsa +%endif install -m 644 -p -D %{SOURCE0} $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/public_suffix_list.dat install -m 644 -p -D %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/test_psl.txt ln -s public_suffix_list.dat $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/effective_tld_names.dat @@ -65,10 +75,12 @@ ln -s public_suffix_list.dat $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/effective_ %{_datadir}/publicsuffix/public_suffix_list.dat %{_datadir}/publicsuffix/test_psl.txt +%if %{with dafsa} %files dafsa %license COPYING %dir %{_datadir}/publicsuffix %{_datadir}/publicsuffix/public_suffix_list.dafsa +%endif %changelog