94c41a3
%global tag_version release-%%(echo "%version" | tr '~' '-')
be0aa2a
#%%global is_official 0%%(echo %%{tag_version} | grep -qE 'alpha|beta|final'; echo $?)
e4b2932
#%%global is_official 0
cdaedb6
%global is_official 0
c440983
7353138
Name:       cldr-emoji-annotation
1d8419e
Version:    45
a3b7c13
Release:    %autorelease
d25b5e4
%if 0%{?fedora:1}%{?rhel:0}
4ab0268
Epoch:      1
d25b5e4
%endif
7353138
# Annotation files are in Unicode license
7353138
Summary:    Emoji annotation files in CLDR
1050a9e
License:    Unicode-DFS-2016
4ab0268
URL:        https://unicode.org/cldr
2d77c9c
%if %is_official
12ba8ad
Source0:    https://github.com/unicode-org/cldr/releases/download/%{tag_version}/cldr-core-%{version}.zip
2d77c9c
%else
42e9a76
Source0:    https://github.com/unicode-org/cldr/archive/refs/tags/%{tag_version}.zip#/cldr-%{tag_version}.zip
2d77c9c
%endif
2c2eb77
#Patch0:     %%{name}-HEAD.patch
2c2eb77
BuildRequires: autoconf
2c2eb77
BuildRequires: automake
7353138
BuildArch:  noarch
56a045a
Requires:  %{name}-dtd
7353138
7353138
%description
7353138
This package provides the emoji annotation file by language in CLDR.
7353138
56a045a
%package dtd
56a045a
Summary:    DTD files of CLDR common
d25b5e4
Requires:   %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
56a045a
BuildArch:  noarch
56a045a
56a045a
%description dtd
56a045a
This package contains DTD files of CLDR common which are required by
56a045a
cldr-emoji-annotations.
56a045a
7353138
%package devel
7353138
Summary:    Files for development using cldr-annotations
d25b5e4
Requires:   %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
7353138
Requires:   pkgconfig
e606e17
BuildArch:  noarch
7353138
7353138
%description devel
7353138
This package contains the pkg-config files for development
56a045a
when building programs that use cldr-emoji-annotations.
7353138
7353138
7353138
%prep
2d77c9c
%if %is_official
8a8b2ef
%autosetup -c -n cldr-%{tag_version}
2d77c9c
%else
8a8b2ef
%autosetup -n cldr-%{tag_version}
2d77c9c
%endif
7353138
7353138
7353138
%install
4ab0268
pushd $PWD
4ab0268
ANNOTATION_DIR=common/annotations
4ab0268
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
4ab0268
pushd $ANNOTATION_DIR
4ab0268
for xml in *.xml ; do
4ab0268
    install -pm 644 -D $xml $RPM_BUILD_ROOT$CLDR_DIR/$xml
4ab0268
done
4ab0268
popd
4ab0268
4ab0268
ANNOTATION_DIR=common/annotationsDerived
4ab0268
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
4ab0268
pushd $ANNOTATION_DIR
4ab0268
for xml in *.xml ; do
4ab0268
    install -pm 644 -D $xml $RPM_BUILD_ROOT$CLDR_DIR/$xml
4ab0268
done
4ab0268
popd
4ab0268
4ab0268
DTD_DIR=common/dtd
4ab0268
CLDR_DIR=%{_datadir}/unicode/cldr/$DTD_DIR
4ab0268
pushd $DTD_DIR
4ab0268
for dtd in *.dtd ; do
4ab0268
    install -pm 644 -D $dtd $RPM_BUILD_ROOT$CLDR_DIR/$dtd
4ab0268
done
4ab0268
popd
4ab0268
4ab0268
install -pm 755 -d $RPM_BUILD_ROOT%{_datadir}/pkgconfig
4ab0268
cat >> $RPM_BUILD_ROOT%{_datadir}/pkgconfig/%{name}.pc <<_EOF
4ab0268
prefix=/usr
4ab0268
bcfeac5
Name: cldr-emoji-annotations
4ab0268
Description: annotation files in CLDR
4ab0268
Version: %{version}
4ab0268
_EOF
4ab0268
7353138
56a045a
%check
4ab0268
ANNOTATION_DIR=common/annotations
4ab0268
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
4ab0268
for xml in $ANNOTATION_DIR/*.xml ; do
4ab0268
    xmllint --noout --valid --postvalid $xml
4ab0268
done
4ab0268
4ab0268
ANNOTATION_DIR=common/annotationsDerived
4ab0268
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
4ab0268
for xml in $ANNOTATION_DIR/*.xml ; do
4ab0268
    xmllint --noout --valid --postvalid $xml
4ab0268
done
4ab0268
56a045a
7353138
%files
af418e2
%if %is_official
af418e2
%doc README-common.md
af418e2
%license LICENSE.txt
af418e2
%else
af418e2
%doc README.md
8eb32ff
%license LICENSE
af418e2
%endif
56a045a
%{_datadir}/unicode/cldr/common/annotations
56a045a
%{_datadir}/unicode/cldr/common/annotationsDerived
56a045a
56a045a
%files dtd
56a045a
%dir %{_datadir}/unicode
56a045a
%dir %{_datadir}/unicode/cldr
56a045a
%dir %{_datadir}/unicode/cldr/common
56a045a
%{_datadir}/unicode/cldr/common/dtd
7353138
7353138
%files devel
7353138
%{_datadir}/pkgconfig/*.pc
7353138
7353138
%changelog
a3b7c13
%autochangelog
94c41a3