Add dafsa conditional for bootstrapping

This commit is contained in:
Michael Simacek 2017-02-23 16:30:15 +01:00 committed by Yaakov Selkowitz
parent fdc1a224fe
commit 8043dd3c38

View File

@ -1,3 +1,5 @@
%bcond_without dafsa
%global revdate 20170206 %global revdate 20170206
Name: publicsuffix-list Name: publicsuffix-list
@ -13,7 +15,9 @@ Source2: https://github.com/publicsuffix/list/raw/master/tests/test_psl.t
BuildArch: noarch BuildArch: noarch
%if %{with dafsa}
BuildRequires: psl-make-dafsa BuildRequires: psl-make-dafsa
%endif
%description %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 cookies may and may not be set, protecting the user from being
tracked across sites. tracked across sites.
%if %{with dafsa}
%package dafsa %package dafsa
Summary: Cross-vendor public domain suffix database in DAFSA form 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 This package includes a DAFSA representation of the Public Suffix List
for runtime loading. for runtime loading.
%endif
%prep %prep
@ -46,13 +52,17 @@ cp -av %{SOURCE1} COPYING
%build %build
%if %{with dafsa}
LC_CTYPE=C.UTF-8 \ LC_CTYPE=C.UTF-8 \
psl-make-dafsa --output-format=binary \ psl-make-dafsa --output-format=binary \
public_suffix_list.dat public_suffix_list.dafsa public_suffix_list.dat public_suffix_list.dafsa
%endif
%install %install
%if %{with dafsa}
install -m 644 -p -D public_suffix_list.dafsa $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/public_suffix_list.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 %{SOURCE0} $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/public_suffix_list.dat
install -m 644 -p -D %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/publicsuffix/test_psl.txt 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 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/public_suffix_list.dat
%{_datadir}/publicsuffix/test_psl.txt %{_datadir}/publicsuffix/test_psl.txt
%if %{with dafsa}
%files dafsa %files dafsa
%license COPYING %license COPYING
%dir %{_datadir}/publicsuffix %dir %{_datadir}/publicsuffix
%{_datadir}/publicsuffix/public_suffix_list.dafsa %{_datadir}/publicsuffix/public_suffix_list.dafsa
%endif
%changelog %changelog