Skip to content

Commit af48562

Browse files
filesystem: add %bcond to prevent including any locales
1 parent e9c15c9 commit af48562

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

SPECS/filesystem/filesystem.spec

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
# We can't use iso-codes to generate locales, as it would create a
3+
# "circular dependency" in our toolkit
4+
%bcond locales 0
5+
26
Summary: The basic directory layout for a Linux system
37
Name: filesystem
48
Version: 3.18
@@ -7,10 +11,12 @@ License: LicenseRef-Fedora-Public-Domain
711
Vendor: Microsoft Corporation
812
Distribution: Azure Linux
913
URL: https://pagure.io/filesystem
14+
%if %{with locales}
1015
Source1: https://pagure.io/filesystem/raw/master/f/lang-exceptions
1116
Source2: iso_639.sed
1217
Source3: iso_3166.sed
1318
BuildRequires: iso-codes
19+
%endif
1420

1521
# We don't order the same as Fedora here, although maybe we should.
1622
# If ordering is changed, be sure to coordinate with setup
@@ -33,8 +39,10 @@ rm -f $RPM_BUILD_DIR/filelist
3339
%install
3440
rm -rf %{buildroot}
3541
mkdir %{buildroot}
42+
%if %{with locales}
3643
install -p -c -m755 %SOURCE2 %{buildroot}/iso_639.sed
3744
install -p -c -m755 %SOURCE3 %{buildroot}/iso_3166.sed
45+
%endif
3846

3947
cd %{buildroot}
4048

@@ -63,6 +71,7 @@ ln -snf usr/%{_lib} usr/lib/debug/%{_lib}
6371
ln -snf ../.dwz usr/lib/debug/usr/.dwz
6472
ln -snf usr/sbin usr/lib/debug/sbin
6573

74+
%if %{with locales}
6675
sed -n -f %{buildroot}/iso_639.sed /usr/share/xml/iso-codes/iso_639.xml \
6776
>%{buildroot}/iso_639.tab
6877
sed -n -f %{buildroot}/iso_3166.sed /usr/share/xml/iso-codes/iso_3166.xml \
@@ -105,6 +114,12 @@ rm -f %{buildroot}/iso_639.tab
105114
rm -f %{buildroot}/iso_639.sed
106115
rm -f %{buildroot}/iso_3166.tab
107116
rm -f %{buildroot}/iso_3166.sed
117+
%else
118+
# We provide NO locales
119+
touch $RPM_BUILD_DIR/filelist
120+
# But still own /usr/share/locale
121+
mkdir -p -m 755 %{buildroot}/usr/share/locale
122+
%endif
108123

109124
cat $RPM_BUILD_DIR/filelist | grep "locale" | while read a b ; do
110125
mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES

0 commit comments

Comments
 (0)