add packaging
[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
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 %reconfigure --without-included-gettext --enable-nls --disable-static \
89     --enable-shared --with-pic-=yes --disable-csharp --without-libpth-prefix --disable-openmp
90 make %{?_smp_mflags} GCJFLAGS="-findirect-dispatch"
91
92 %check
93 make check
94
95 %install
96 make install DESTDIR=%{buildroot} INSTALL="install -p" \
97     lispdir=%{_datadir}/emacs/site-lisp \
98     aclocaldir=%{_datadir}/aclocal EXAMPLESFILES=""
99
100 install -pm 755 %{SOURCE2} %{buildroot}%{_bindir}/msghack
101
102 # make preloadable_libintl.so executable
103 chmod 755 %{buildroot}%{_libdir}/preloadable_libintl.so
104
105 rm -f %{buildroot}%{_infodir}/dir
106
107 # doc relocations
108 for i in gettext-runtime/man/*.html; do
109   rm %{buildroot}%{_datadir}/doc/gettext/`basename $i`
110 done
111 rm -r %{buildroot}%{_datadir}/doc/gettext/javadoc*
112
113 rm -rf %{buildroot}%{_datadir}/doc/gettext/examples
114
115 rm -rf htmldoc
116 mkdir htmldoc
117 mv %{buildroot}%{_datadir}/doc/gettext/* %{buildroot}%{_datadir}/doc/libasprintf/* htmldoc
118 rm -r %{buildroot}%{_datadir}/doc/libasprintf
119 rm -r %{buildroot}%{_datadir}/doc/gettext
120
121 # remove unpackaged files from the buildroot
122 rm -rf %{buildroot}%{_datadir}/emacs
123 rm %{buildroot}%{_libdir}/lib*.la
124
125
126 %find_lang %{name}-runtime
127 %find_lang %{name}-tools
128 cat %{name}-*.lang > %{name}.lang
129
130 %docs_package
131
132 %post runtime -p /sbin/ldconfig
133
134 %postun runtime -p /sbin/ldconfig
135
136
137 %files tools -f %{name}.lang
138 %manifest gettext.manifest
139 %defattr(-,root,root,-)
140 %doc COPYING
141 %{_datadir}/%{name}/projects/*
142 %{_datadir}/%{name}/config.rpath
143 %{_datadir}/%{name}/*.h
144 %{_datadir}/%{name}/intl
145 %{_datadir}/%{name}/po
146 %{_datadir}/%{name}/msgunfmt.tcl
147 %{_datadir}/aclocal/*
148 %{_includedir}/*
149 %{_libdir}/libasprintf.so
150 %{_libdir}/libgettextpo.so
151 %{_libdir}/libgettextlib*.so
152 %{_libdir}/libgettextsrc*.so
153 %{_libdir}/preloadable_libintl.so
154 %{_libdir}/gettext/hostname
155 %{_libdir}/gettext/project-id
156 %{_libdir}/gettext/urlget
157 %{_libdir}/gettext/user-email
158 %{_libdir}/libgettextpo.so.*
159 %{_datadir}/%{name}/javaversion.class
160 %{_datadir}/%{name}/archive*.tar.gz
161 %{_datadir}/%{name}/styles
162 %{_bindir}/autopoint
163 %{_bindir}/gettextize
164 %{_bindir}/msgattrib
165 %{_bindir}/msgcat
166 %{_bindir}/msgcmp
167 %{_bindir}/msgcomm
168 %{_bindir}/msgconv
169 %{_bindir}/msgen
170 %{_bindir}/msgexec
171 %{_bindir}/msgfilter
172 %{_bindir}/msgfmt
173 %{_bindir}/msggrep
174 %{_bindir}/msghack
175 %{_bindir}/msginit
176 %{_bindir}/msgmerge
177 %{_bindir}/msgunfmt
178 %{_bindir}/msguniq
179 %{_bindir}/recode-sr-latin
180 %{_bindir}/xgettext
181
182 # Don't include language files here since that may inadvertently
183 # involve unneeded files. If you need to include a file in -libs, list
184 # it here explicitly
185 %files runtime
186 %manifest gettext.manifest
187 %defattr(-,root,root,-)
188 # Files listed here should be of LGPL license only, refer to upstream
189 # statement in PACKAGING file
190 %doc gettext-runtime/intl/COPYING*
191 %doc %{_datadir}/gettext/ABOUT-NLS
192 %{_bindir}/gettext
193 %{_bindir}/ngettext
194 %{_bindir}/envsubst
195 %{_bindir}/gettext.sh
196 %{_libdir}/libasprintf.so.*