Bump to gettext 0.19.7
[platform/upstream/gettext.git] / packaging / gettext.spec
1 # The split of gettext into two packages is suggested by upstream (see
2 # the PACKAGING file). Here we name gettext-runtime as
3 # gettext-lib. Please be noted that gettext-runtime is LGPL while the
4 # others parts are of GPL. You should be careful of the license when
5 # adding files into these sub-packages.
6
7
8 %define enable_testing 0
9
10 Name:           gettext
11 Version:        0.19.7
12 Release:        1
13 License:        GPL-3.0+ and LGPL-2.0+
14 Summary:        GNU libraries and utilities for producing multi-lingual messages
15 Url:            http://www.gnu.org/software/gettext/
16 Group:          Development/Tools
17 Source:         ftp://ftp.gnu.org/gnu/gettext/%{name}-%{version}.tar.gz
18 Source2:        msghack.py
19 Source1001:     gettext.manifest
20
21 BuildRequires:  autoconf >= 2.5
22 BuildRequires:  bison
23 # need expat for xgettext on glade
24 BuildRequires:  expat-devel
25 BuildRequires:  gcc-c++
26 BuildRequires:  libtool
27 #needed for ANSI to UTF8 conversion using msgconn
28 BuildRequires:  libunistring
29 BuildRequires:  glibc-locale
30
31 %description
32 The GNU gettext package provides a set of tools and documentation for
33 producing multi-lingual messages in programs. Tools include a set of
34 conventions about how programs should be written to support message
35 catalogs, a directory and file naming organization for the message
36 catalogs, a runtime library which supports the retrieval of translated
37 messages, and stand-alone programs for handling the translatable and
38 the already translated strings. Gettext provides an easy to use
39 library and tools for creating, using, and modifying natural language
40 catalogs and is a powerful and simple method for internationalizing
41 programs.
42
43 MeeGo's gettext is split into two packages: gettext-libs and
44 gettext-devel. gettext-libs is an LGPLv2+ package that contains
45 libraries and runtime needed by i18n programs; gettext-devel is used
46 only for development and building -- and shouldn't be needed by end
47 users.  This gettext package is a meta-package that depends on
48 gettext-devel for transition.
49
50 %package tools
51 License:        GPL-3.0+
52 Summary:        Development files for %{name}
53 Group:          Development/Tools
54 Requires:       %{name}-runtime = %{version}
55 Obsoletes:      gettext-devel <= 0.18.1.1-1.15
56 Provides:       gettext-devel
57
58 %description tools
59 This package contains all development related files necessary for
60 developing or compiling applications/libraries that needs
61 internationalization capability. You also need this package if you
62 want to add gettext support for your project.
63
64 %package runtime
65 License:        LGPL-2.0+
66 Summary:        Libraries for %{name}
67 Group:          System/Libraries
68 Obsoletes:      gettext-libs <= 0.18.1.1-1.15
69 Provides:       gettext-libs
70
71 %description runtime
72 This package contains libraries used internationalization support.
73
74 %prep
75 %setup -q
76
77
78 %build
79 cp %{SOURCE1001} .
80 [ -f  %{_datadir}/automake/depcomp ] && cp -f %{_datadir}/automake/{depcomp,ylwrap} .
81
82 %ifarch %arm
83 # We add a compile flag for ARM to deal with a bug in qemu (msgmerge using pthread/gomp)
84 # msgmerge will lockup during execution.
85 %define addconfflag --without-libpth-prefix --disable-openmp
86 %else
87 %endif
88
89 mkdir -p gettext-tools/intl
90
91 %reconfigure --without-included-gettext --enable-nls --disable-static \
92     --enable-shared --with-pic-=yes --disable-csharp --without-libpth-prefix --disable-openmp
93 make %{?_smp_mflags} GCJFLAGS="-findirect-dispatch"
94
95 %check
96 make check
97
98 %install
99 make install DESTDIR=%{buildroot} INSTALL="install -p" \
100     lispdir=%{_datadir}/emacs/site-lisp \
101     aclocaldir=%{_datadir}/aclocal EXAMPLESFILES=""
102
103 install -pm 755 %{SOURCE2} %{buildroot}%{_bindir}/msghack
104
105 # make preloadable_libintl.so executable
106 chmod 755 %{buildroot}%{_libdir}/preloadable_libintl.so
107
108 rm -f %{buildroot}%{_infodir}/dir
109
110 # doc relocations
111 for i in gettext-runtime/man/*.html; do
112   rm %{buildroot}%{_datadir}/doc/gettext/`basename $i`
113 done
114 rm -r %{buildroot}%{_datadir}/doc/gettext/javadoc*
115
116 rm -rf %{buildroot}%{_datadir}/doc/gettext/examples
117
118 rm -rf htmldoc
119 mkdir htmldoc
120 mv %{buildroot}%{_datadir}/doc/gettext/* %{buildroot}%{_datadir}/doc/libasprintf/* htmldoc
121 rm -r %{buildroot}%{_datadir}/doc/libasprintf
122 rm -r %{buildroot}%{_datadir}/doc/gettext
123
124 # remove unpackaged files from the buildroot
125 rm -rf %{buildroot}%{_datadir}/emacs
126 rm %{buildroot}%{_libdir}/lib*.la
127
128
129 %find_lang %{name}-runtime
130 %find_lang %{name}-tools
131 cat %{name}-*.lang > %{name}.lang
132
133 %docs_package
134
135 %post runtime -p /sbin/ldconfig
136
137 %postun runtime -p /sbin/ldconfig
138
139 %post tools -p /sbin/ldconfig
140
141 %postun tools -p /sbin/ldconfig
142
143 %files tools -f %{name}.lang
144 %manifest %{name}.manifest
145 %defattr(-,root,root,-)
146 %license COPYING
147 %{_datadir}/%{name}/projects/*
148 %{_datadir}/%{name}/config.rpath
149 %{_datadir}/%{name}/*.h
150 %{_datadir}/%{name}/intl
151 %{_datadir}/%{name}/po
152 %{_datadir}/%{name}/msgunfmt.tcl
153 %{_datadir}/aclocal/*
154 %{_includedir}/*
155 %{_libdir}/libasprintf.so
156 %{_libdir}/libgettextpo.so
157 %{_libdir}/libgettextlib*.so
158 %{_libdir}/libgettextsrc*.so
159 %{_libdir}/preloadable_libintl.so
160 %{_libdir}/gettext/hostname
161 %{_libdir}/gettext/project-id
162 %{_libdir}/gettext/urlget
163 %{_libdir}/gettext/user-email
164 %{_libdir}/gettext/cldr-plurals
165 %{_libdir}/libgettextpo.so.*
166 %{_datadir}/%{name}/javaversion.class
167 %{_datadir}/%{name}/archive*.tar.xz
168 %{_datadir}/%{name}/styles
169 %{_bindir}/autopoint
170 %{_bindir}/gettextize
171 %{_bindir}/msgattrib
172 %{_bindir}/msgcat
173 %{_bindir}/msgcmp
174 %{_bindir}/msgcomm
175 %{_bindir}/msgconv
176 %{_bindir}/msgen
177 %{_bindir}/msgexec
178 %{_bindir}/msgfilter
179 %{_bindir}/msgfmt
180 %{_bindir}/msggrep
181 %{_bindir}/msghack
182 %{_bindir}/msginit
183 %{_bindir}/msgmerge
184 %{_bindir}/msgunfmt
185 %{_bindir}/msguniq
186 %{_bindir}/recode-sr-latin
187 %{_bindir}/xgettext
188
189 # Don't include language files here since that may inadvertently
190 # involve unneeded files. If you need to include a file in -libs, list
191 # it here explicitly
192 %files runtime
193 %manifest %{name}.manifest
194 %defattr(-,root,root,-)
195 # Files listed here should be of LGPL license only, refer to upstream
196 # statement in PACKAGING file
197 %license gettext-runtime/intl/COPYING*
198 %doc %{_datadir}/gettext/ABOUT-NLS
199 %{_bindir}/gettext
200 %{_bindir}/ngettext
201 %{_bindir}/envsubst
202 %{_bindir}/gettext.sh
203 %{_libdir}/libasprintf.so.*