cldr-emoji-annotation/cldr-emoji-annotation.spec

131 lines
3.1 KiB
RPMSpec
Raw Normal View History

2024-03-14 13:20:59 +00:00
%global tag_version release-%%(echo "%version" | tr '~' '-')
2023-09-15 07:05:13 +00:00
#%%global is_official 0%%(echo %%{tag_version} | grep -qE 'alpha|beta|final'; echo $?)
2022-08-04 13:50:13 +00:00
#%%global is_official 0
2023-10-31 04:03:47 +00:00
%global is_official 0
2020-09-11 08:22:23 +00:00
2017-03-06 16:46:08 +00:00
Name: cldr-emoji-annotation
Version: 46
2024-04-05 14:42:06 +00:00
Release: %autorelease
2020-10-22 09:42:25 +00:00
%if 0%{?fedora:1}%{?rhel:0}
Epoch: 1
2020-10-22 09:42:25 +00:00
%endif
2017-03-06 16:46:08 +00:00
# Annotation files are in Unicode license
Summary: Emoji annotation files in CLDR
License: Unicode-DFS-2016
URL: https://unicode.org/cldr
2020-11-04 07:59:34 +00:00
%if %is_official
2023-04-13 04:03:54 +00:00
Source0: https://github.com/unicode-org/cldr/releases/download/%{tag_version}/cldr-core-%{version}.zip
2020-11-04 07:59:34 +00:00
%else
2021-08-24 09:20:20 +00:00
Source0: https://github.com/unicode-org/cldr/archive/refs/tags/%{tag_version}.zip#/cldr-%{tag_version}.zip
2020-11-04 07:59:34 +00:00
%endif
2018-03-09 11:31:37 +00:00
#Patch0: %%{name}-HEAD.patch
BuildRequires: autoconf
BuildRequires: automake
2017-03-06 16:46:08 +00:00
BuildArch: noarch
Requires: %{name}-dtd
2017-03-06 16:46:08 +00:00
%description
This package provides the emoji annotation file by language in CLDR.
%package dtd
Summary: DTD files of CLDR common
2020-10-22 09:42:25 +00:00
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildArch: noarch
%description dtd
This package contains DTD files of CLDR common which are required by
cldr-emoji-annotations.
2017-03-06 16:46:08 +00:00
%package devel
Summary: Files for development using cldr-annotations
2020-10-22 09:42:25 +00:00
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
2017-03-06 16:46:08 +00:00
Requires: pkgconfig
2017-04-21 07:22:51 +00:00
BuildArch: noarch
2017-03-06 16:46:08 +00:00
%description devel
This package contains the pkg-config files for development
when building programs that use cldr-emoji-annotations.
2017-03-06 16:46:08 +00:00
%prep
2020-11-04 07:59:34 +00:00
%if %is_official
%autosetup -c -n cldr-%{tag_version} -p1
2020-11-04 07:59:34 +00:00
%else
%autosetup -n cldr-%{tag_version} -p1
2020-11-04 07:59:34 +00:00
%endif
2017-03-06 16:46:08 +00:00
%install
pushd $PWD
ANNOTATION_DIR=common/annotations
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
pushd $ANNOTATION_DIR
for xml in *.xml ; do
install -pm 644 -D $xml $RPM_BUILD_ROOT$CLDR_DIR/$xml
done
popd
ANNOTATION_DIR=common/annotationsDerived
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
pushd $ANNOTATION_DIR
for xml in *.xml ; do
install -pm 644 -D $xml $RPM_BUILD_ROOT$CLDR_DIR/$xml
done
popd
DTD_DIR=common/dtd
CLDR_DIR=%{_datadir}/unicode/cldr/$DTD_DIR
pushd $DTD_DIR
for dtd in *.dtd ; do
install -pm 644 -D $dtd $RPM_BUILD_ROOT$CLDR_DIR/$dtd
done
popd
install -pm 755 -d $RPM_BUILD_ROOT%{_datadir}/pkgconfig
cat >> $RPM_BUILD_ROOT%{_datadir}/pkgconfig/%{name}.pc <<_EOF
prefix=/usr
2020-09-25 11:39:27 +00:00
Name: cldr-emoji-annotations
Description: annotation files in CLDR
Version: %{version}
_EOF
2017-03-06 16:46:08 +00:00
%check
ANNOTATION_DIR=common/annotations
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
for xml in $ANNOTATION_DIR/*.xml ; do
xmllint --noout --valid --postvalid $xml
done
ANNOTATION_DIR=common/annotationsDerived
CLDR_DIR=%{_datadir}/unicode/cldr/$ANNOTATION_DIR
for xml in $ANNOTATION_DIR/*.xml ; do
xmllint --noout --valid --postvalid $xml
done
2017-03-06 16:46:08 +00:00
%files
%if %is_official
%doc README-common.md
%license LICENSE.txt
%else
%doc README.md
2023-09-15 09:55:13 +00:00
%license LICENSE
%endif
%{_datadir}/unicode/cldr/common/annotations
%{_datadir}/unicode/cldr/common/annotationsDerived
%files dtd
%dir %{_datadir}/unicode
%dir %{_datadir}/unicode/cldr
%dir %{_datadir}/unicode/cldr/common
%{_datadir}/unicode/cldr/common/dtd
2017-03-06 16:46:08 +00:00
%files devel
%{_datadir}/pkgconfig/*.pc
%changelog
2024-04-05 14:42:06 +00:00
%autochangelog
2024-03-14 13:20:59 +00:00