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