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