| 1 | #define svn_url     e:/trees/gettext/trunk | 
|---|
| 2 | %define svn_url     http://svn.netlabs.org/repos/ports/gettext/trunk | 
|---|
| 3 | %define svn_rev     1641 | 
|---|
| 4 |  | 
|---|
| 5 | %define with_jar 0 | 
|---|
| 6 | %define with_java 0 | 
|---|
| 7 | %define with_check 0 | 
|---|
| 8 | %define with_git 0 | 
|---|
| 9 | %define with_emacs 0 | 
|---|
| 10 |  | 
|---|
| 11 | %global archiveversion 0.19.8 | 
|---|
| 12 |  | 
|---|
| 13 | Summary: GNU libraries and utilities for producing multi-lingual messages | 
|---|
| 14 | Name: gettext | 
|---|
| 15 | Version: 0.19.8.1 | 
|---|
| 16 | Release: 3%{?dist} | 
|---|
| 17 | License: GPLv3+ and LGPLv2+ | 
|---|
| 18 | Group: Development/Tools | 
|---|
| 19 | URL: http://www.gnu.org/software/gettext/ | 
|---|
| 20 | Vendor: bww bitwise works GmbH | 
|---|
| 21 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip | 
|---|
| 22 | Source1: gettext-legacy-os2.zip | 
|---|
| 23 |  | 
|---|
| 24 | BuildRequires: autoconf >= 2.62 | 
|---|
| 25 | BuildRequires: automake | 
|---|
| 26 | BuildRequires: libtool, bison | 
|---|
| 27 | %if %{with_java} | 
|---|
| 28 | # libintl.jar requires gcj >= 4.3 to build | 
|---|
| 29 | BuildRequires: gcc-java, libgcj | 
|---|
| 30 | # For javadoc | 
|---|
| 31 | BuildRequires: java-1.6.0-openjdk-devel | 
|---|
| 32 | %if %{with_jar} | 
|---|
| 33 | BuildRequires: %{_bindir}/fastjar | 
|---|
| 34 | # require zip and unzip for brp-java-repack-jars | 
|---|
| 35 | BuildRequires: zip, unzip | 
|---|
| 36 | %endif | 
|---|
| 37 | %endif | 
|---|
| 38 | # for po-mode.el | 
|---|
| 39 | %if %{with_emacs} | 
|---|
| 40 | BuildRequires: emacs | 
|---|
| 41 | %endif | 
|---|
| 42 | %if %{with_git} | 
|---|
| 43 | # for autopoint: | 
|---|
| 44 | BuildRequires: git | 
|---|
| 45 | %endif | 
|---|
| 46 | #BuildRequires: chrpath | 
|---|
| 47 |  | 
|---|
| 48 | # following suggested by DEPENDENCIES: | 
|---|
| 49 | BuildRequires: ncurses-devel | 
|---|
| 50 | BuildRequires: libxml2-devel | 
|---|
| 51 | BuildRequires: glib2-devel | 
|---|
| 52 | #BuildRequires: libcroco-devel | 
|---|
| 53 | #BuildRequires: libunistring-devel | 
|---|
| 54 | #Requires(post): info | 
|---|
| 55 | #Requires(preun): info | 
|---|
| 56 | Requires: %{name}-libs = %{version}-%{release} | 
|---|
| 57 |  | 
|---|
| 58 | %description | 
|---|
| 59 | The GNU gettext package provides a set of tools and documentation for | 
|---|
| 60 | producing multi-lingual messages in programs. Tools include a set of | 
|---|
| 61 | conventions about how programs should be written to support message | 
|---|
| 62 | catalogs, a directory and file naming organization for the message | 
|---|
| 63 | catalogs, a runtime library which supports the retrieval of translated | 
|---|
| 64 | messages, and stand-alone programs for handling the translatable and | 
|---|
| 65 | the already translated strings. Gettext provides an easy to use | 
|---|
| 66 | library and tools for creating, using, and modifying natural language | 
|---|
| 67 | catalogs and is a powerful and simple method for internationalizing | 
|---|
| 68 | programs. | 
|---|
| 69 |  | 
|---|
| 70 |  | 
|---|
| 71 | %package common-devel | 
|---|
| 72 | Summary: Common development files for %{name} | 
|---|
| 73 | Group: Development/Tools | 
|---|
| 74 | # autopoint archive | 
|---|
| 75 | License: GPLv3+ | 
|---|
| 76 | BuildArch: noarch | 
|---|
| 77 |  | 
|---|
| 78 | %description common-devel | 
|---|
| 79 | This package contains common architecture independent gettext development files. | 
|---|
| 80 |  | 
|---|
| 81 |  | 
|---|
| 82 | %package devel | 
|---|
| 83 | Summary: Development files for %{name} | 
|---|
| 84 | Group: Development/Tools | 
|---|
| 85 | # autopoint is GPLv3+ | 
|---|
| 86 | License: LGPLv2+ and GPLv3+ | 
|---|
| 87 | Requires: %{name} = %{version}-%{release} | 
|---|
| 88 | Requires: %{name}-libs = %{version}-%{release} | 
|---|
| 89 | #Requires(post): info | 
|---|
| 90 | #Requires(preun): info | 
|---|
| 91 | %if %{with_git} | 
|---|
| 92 | # for autopoint | 
|---|
| 93 | Requires: git | 
|---|
| 94 | %endif | 
|---|
| 95 | Obsoletes: gettext-autopoint < 0.18.3.2-1 | 
|---|
| 96 | Provides: gettext-autopoint = %{version}-%{release} | 
|---|
| 97 |  | 
|---|
| 98 | %description devel | 
|---|
| 99 | This package contains all development related files necessary for | 
|---|
| 100 | developing or compiling applications/libraries that needs | 
|---|
| 101 | internationalization capability. You also need this package if you | 
|---|
| 102 | want to add gettext support for your project. | 
|---|
| 103 |  | 
|---|
| 104 |  | 
|---|
| 105 | %package libs | 
|---|
| 106 | Summary: Libraries for %{name} | 
|---|
| 107 | Group: System Environment/Libraries | 
|---|
| 108 | # libasprintf is LGPLv2+ | 
|---|
| 109 | # libgettextpo is GPLv3+ | 
|---|
| 110 | License: LGPLv2+ and GPLv3+ | 
|---|
| 111 |  | 
|---|
| 112 | %description libs | 
|---|
| 113 | This package contains libraries used internationalization support. | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 | %if %{with_emacs} | 
|---|
| 117 | %package -n emacs-%{name} | 
|---|
| 118 | Summary: Support for editing po files within GNU Emacs | 
|---|
| 119 | Group: Applications/Editors | 
|---|
| 120 | BuildArch: noarch | 
|---|
| 121 | # help users find po-mode.el | 
|---|
| 122 | Provides: emacs-po-mode | 
|---|
| 123 | Requires: emacs(bin) >= %{_emacs_version} | 
|---|
| 124 | Provides: emacs-%{name}-el = %{version}-%{release} | 
|---|
| 125 | Obsoletes: emacs-%{name}-el < %{version}-%{release} | 
|---|
| 126 |  | 
|---|
| 127 | %description -n emacs-%{name} | 
|---|
| 128 | This package provides a major mode for editing po files within GNU Emacs. | 
|---|
| 129 | %endif | 
|---|
| 130 |  | 
|---|
| 131 |  | 
|---|
| 132 | %package legacy | 
|---|
| 133 | Summary: The old gettext library. | 
|---|
| 134 |  | 
|---|
| 135 | %description legacy | 
|---|
| 136 | The old gettext library. | 
|---|
| 137 |  | 
|---|
| 138 |  | 
|---|
| 139 | %debug_package | 
|---|
| 140 |  | 
|---|
| 141 |  | 
|---|
| 142 | %prep | 
|---|
| 143 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0} | 
|---|
| 144 | %setup -q | 
|---|
| 145 | %else | 
|---|
| 146 | %setup -n "%{name}-%{version}" -Tc -a 1 | 
|---|
| 147 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force | 
|---|
| 148 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" | 
|---|
| 149 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}") | 
|---|
| 150 | %endif | 
|---|
| 151 |  | 
|---|
| 152 |  | 
|---|
| 153 | %build | 
|---|
| 154 | %if %{with_java} | 
|---|
| 155 | export JAVAC=gcj | 
|---|
| 156 | %if %{with_jar} | 
|---|
| 157 | export JAR=fastjar | 
|---|
| 158 | %endif | 
|---|
| 159 | %endif | 
|---|
| 160 |  | 
|---|
| 161 | export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp" ; \ | 
|---|
| 162 | export LIBS="-lurpo -lmmap" ; \ | 
|---|
| 163 |  | 
|---|
| 164 | autogen.sh --skip-gnulib | 
|---|
| 165 |  | 
|---|
| 166 | %configure \ | 
|---|
| 167 | --without-included-gettext --enable-nls \ | 
|---|
| 168 | --with-libxml2-prefix=/@unixroot/usr/include/libxml2 \ | 
|---|
| 169 | --disable-csharp \ | 
|---|
| 170 | --disable-rpath \ | 
|---|
| 171 | --enable-shared --disable-static \ | 
|---|
| 172 | %if %{with_java} | 
|---|
| 173 | --enable-java \ | 
|---|
| 174 | %else | 
|---|
| 175 | --disable-java --disable-native-java \ | 
|---|
| 176 | %endif | 
|---|
| 177 | %if !%{with_git} | 
|---|
| 178 | --disable-git | 
|---|
| 179 | %endif | 
|---|
| 180 |  | 
|---|
| 181 | cd gettext-tools/gnulib-lib | 
|---|
| 182 | make fcntl.h | 
|---|
| 183 | cd ../.. | 
|---|
| 184 |  | 
|---|
| 185 | make %{?_smp_mflags} %{?with_java:GCJFLAGS="-findirect-dispatch"} | 
|---|
| 186 |  | 
|---|
| 187 |  | 
|---|
| 188 | %install | 
|---|
| 189 | rm -rf %{buildroot} | 
|---|
| 190 | make install DESTDIR=${RPM_BUILD_ROOT} \ | 
|---|
| 191 | lispdir=%{_datadir}/emacs/site-lisp/gettext \ | 
|---|
| 192 | aclocaldir=%{_datadir}/aclocal EXAMPLESFILES="" | 
|---|
| 193 |  | 
|---|
| 194 |  | 
|---|
| 195 | # OS/2 specific files | 
|---|
| 196 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/charset.alias | 
|---|
| 197 | rm -f ${RPM_BUILD_ROOT}%{_datadir}/locale/locale.alias | 
|---|
| 198 | cp -p kintl.dll %{buildroot}%{_libdir} | 
|---|
| 199 |  | 
|---|
| 200 |  | 
|---|
| 201 | # make preloadable_libintl.so executable | 
|---|
| 202 | #chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/preloadable_libintl.so | 
|---|
| 203 |  | 
|---|
| 204 | rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir | 
|---|
| 205 |  | 
|---|
| 206 | # doc relocations | 
|---|
| 207 | for i in gettext-runtime/man/*.html; do | 
|---|
| 208 | rm ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/`basename $i` | 
|---|
| 209 | done | 
|---|
| 210 | rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/javadoc* | 
|---|
| 211 |  | 
|---|
| 212 | rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/examples | 
|---|
| 213 |  | 
|---|
| 214 | rm -rf htmldoc | 
|---|
| 215 | mkdir htmldoc | 
|---|
| 216 | mv ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/* ${RPM_BUILD_ROOT}/%{_datadir}/doc/libasprintf/* htmldoc | 
|---|
| 217 | rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/libasprintf | 
|---|
| 218 | rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext | 
|---|
| 219 |  | 
|---|
| 220 | ## note libintl.jar does not build with gcj < 4.3 | 
|---|
| 221 | ## since it would not be fully portable | 
|---|
| 222 | %if %{with_jar} | 
|---|
| 223 | ### this is no longer needed since examples not packaged | 
|---|
| 224 | ## set timestamp of examples ChangeLog timestamp for brp-java-repack-jars | 
|---|
| 225 | #for i in `find ${RPM_BUILD_ROOT} examples -newer ChangeLog -type f -name ChangeLog`; do | 
|---|
| 226 | #  touch -r ChangeLog  $i | 
|---|
| 227 | #done | 
|---|
| 228 | %else | 
|---|
| 229 | # in case another java compiler is installed | 
|---|
| 230 | rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/libintl.jar | 
|---|
| 231 | %endif | 
|---|
| 232 |  | 
|---|
| 233 | rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/gettext.jar | 
|---|
| 234 |  | 
|---|
| 235 | # own this directory for third-party *.its files | 
|---|
| 236 | mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/its | 
|---|
| 237 |  | 
|---|
| 238 | # remove unpackaged files from the buildroot | 
|---|
| 239 | rm ${RPM_BUILD_ROOT}%{_libdir}/lib*.la | 
|---|
| 240 |  | 
|---|
| 241 | # move po-mode initialization elisp file to the right place, and remove byte | 
|---|
| 242 | # compiled file | 
|---|
| 243 | %if %{with_emacs} | 
|---|
| 244 | install -d ${RPM_BUILD_ROOT}%{_emacs_sitestartdir} | 
|---|
| 245 | mv ${RPM_BUILD_ROOT}%{_emacs_sitelispdir}/%{name}/start-po.el ${RPM_BUILD_ROOT}%{_emacs_sitestartdir} | 
|---|
| 246 | rm ${RPM_BUILD_ROOT}%{_emacs_sitelispdir}/%{name}/start-po.elc | 
|---|
| 247 | %endif | 
|---|
| 248 |  | 
|---|
| 249 | %find_lang %{name}-runtime | 
|---|
| 250 | %find_lang %{name}-tools | 
|---|
| 251 | cat %{name}-*.lang > %{name}.lang | 
|---|
| 252 |  | 
|---|
| 253 | # cleanup rpaths | 
|---|
| 254 | #for i in $RPM_BUILD_ROOT%{_bindir}/* `find $RPM_BUILD_ROOT%{_libdir} -type f`; do | 
|---|
| 255 | #  if file $i | grep "ELF 64-bit" >/dev/null; then | 
|---|
| 256 | #     chrpath -l $i && chrpath --delete $i | 
|---|
| 257 | #  fi | 
|---|
| 258 | #done | 
|---|
| 259 |  | 
|---|
| 260 |  | 
|---|
| 261 | %clean | 
|---|
| 262 | rm -rf ${RPM_BUILD_ROOT} | 
|---|
| 263 |  | 
|---|
| 264 |  | 
|---|
| 265 | %if %{with_check} | 
|---|
| 266 | %check | 
|---|
| 267 | # this takes quite a lot of time to run | 
|---|
| 268 |  | 
|---|
| 269 | # override LIBUNISTRING to prevent reordering of lib objects | 
|---|
| 270 | make check LIBUNISTRING=-lunistring | 
|---|
| 271 | %endif | 
|---|
| 272 |  | 
|---|
| 273 |  | 
|---|
| 274 | %post | 
|---|
| 275 | #/sbin/ldconfig | 
|---|
| 276 | #/sbin/install-info %{_infodir}/gettext.info.gz %{_infodir}/dir || : | 
|---|
| 277 |  | 
|---|
| 278 |  | 
|---|
| 279 | %preun | 
|---|
| 280 | if [ "$1" = 0 ]; then | 
|---|
| 281 | #  /sbin/install-info --delete %{_infodir}/gettext.info.gz %{_infodir}/dir || : | 
|---|
| 282 | fi | 
|---|
| 283 |  | 
|---|
| 284 |  | 
|---|
| 285 | #%postun -p /sbin/ldconfig | 
|---|
| 286 |  | 
|---|
| 287 |  | 
|---|
| 288 | %post devel | 
|---|
| 289 | #/sbin/ldconfig | 
|---|
| 290 | #/sbin/install-info %{_infodir}/autosprintf.info %{_infodir}/dir || : | 
|---|
| 291 |  | 
|---|
| 292 |  | 
|---|
| 293 | %preun devel | 
|---|
| 294 | if [ "$1" = 0 ]; then | 
|---|
| 295 | #  /sbin/install-info --delete %{_infodir}/autosprintf.info %{_infodir}/dir || : | 
|---|
| 296 | fi | 
|---|
| 297 |  | 
|---|
| 298 |  | 
|---|
| 299 | #%postun devel -p /sbin/ldconfig | 
|---|
| 300 |  | 
|---|
| 301 | #%post libs -p /sbin/ldconfig | 
|---|
| 302 | #%postun libs -p /sbin/ldconfig | 
|---|
| 303 |  | 
|---|
| 304 | %files -f %{name}.lang | 
|---|
| 305 | %defattr(-,root,root,-) | 
|---|
| 306 | %doc AUTHORS gettext-runtime/BUGS | 
|---|
| 307 | %doc COPYING gettext-tools/misc/DISCLAIM README | 
|---|
| 308 | %doc NEWS THANKS | 
|---|
| 309 | %doc gettext-runtime/man/*.1.html | 
|---|
| 310 | %doc gettext-runtime/intl/COPYING* | 
|---|
| 311 | %{_bindir}/* | 
|---|
| 312 | %exclude %{_bindir}/autopoint | 
|---|
| 313 | %exclude %{_bindir}/gettextize | 
|---|
| 314 | %{_infodir}/gettext* | 
|---|
| 315 | %exclude %{_mandir}/man1/autopoint.1* | 
|---|
| 316 | %{_mandir}/man1/* | 
|---|
| 317 | %{_libdir}/%{name} | 
|---|
| 318 | %if %{with_java} | 
|---|
| 319 | %exclude %{_libdir}/%{name}/gnu.gettext.* | 
|---|
| 320 | %endif | 
|---|
| 321 | %dir %{_datadir}/%{name} | 
|---|
| 322 | %dir %{_datadir}/%{name}/its | 
|---|
| 323 | %{_datadir}/%{name}/ABOUT-NLS | 
|---|
| 324 | %{_datadir}/%{name}/po | 
|---|
| 325 | %{_datadir}/%{name}/styles | 
|---|
| 326 | %dir %{_datadir}/%{name}-%{archiveversion} | 
|---|
| 327 | %{_datadir}/%{name}-%{archiveversion}/its | 
|---|
| 328 |  | 
|---|
| 329 | %files common-devel | 
|---|
| 330 | %{_datadir}/%{name}/archive.*.tar.xz | 
|---|
| 331 |  | 
|---|
| 332 |  | 
|---|
| 333 | %files devel | 
|---|
| 334 | %defattr(-,root,root,-) | 
|---|
| 335 | %doc gettext-runtime/man/*.3.html ChangeLog | 
|---|
| 336 | %{_bindir}/autopoint | 
|---|
| 337 | %{_bindir}/gettextize | 
|---|
| 338 | %{_datadir}/%{name}/projects/ | 
|---|
| 339 | %{_datadir}/%{name}/config.rpath | 
|---|
| 340 | %{_datadir}/%{name}/*.h | 
|---|
| 341 | %{_datadir}/%{name}/msgunfmt.tcl | 
|---|
| 342 | %{_datadir}/aclocal/* | 
|---|
| 343 | %{_includedir}/* | 
|---|
| 344 | %{_infodir}/autosprintf* | 
|---|
| 345 | %{_libdir}/*.a | 
|---|
| 346 | %{_mandir}/man1/autopoint.1* | 
|---|
| 347 | %{_mandir}/man3/* | 
|---|
| 348 | %{_datadir}/%{name}/intl | 
|---|
| 349 | %{_datadir}/%{name}/javaversion.class | 
|---|
| 350 | %if %{with_java} | 
|---|
| 351 | %doc gettext-runtime/intl-java/javadoc* | 
|---|
| 352 | %{_libdir}/%{name}/gnu.gettext.* | 
|---|
| 353 | %endif | 
|---|
| 354 |  | 
|---|
| 355 | %files libs | 
|---|
| 356 | %defattr(-,root,root,-) | 
|---|
| 357 | %{_libdir}/*.dll | 
|---|
| 358 | %exclude %{_libdir}/kintl.dll | 
|---|
| 359 | %if %{with_jar} | 
|---|
| 360 | %{_datadir}/%{name}/libintl.jar | 
|---|
| 361 | %endif | 
|---|
| 362 |  | 
|---|
| 363 | %if %{with_emacs} | 
|---|
| 364 | %files -n emacs-%{name} | 
|---|
| 365 | %defattr(-,root,root,-) | 
|---|
| 366 | %dir %{_emacs_sitelispdir}/%{name} | 
|---|
| 367 | %{_emacs_sitelispdir}/%{name}/*.elc | 
|---|
| 368 | %{_emacs_sitelispdir}/%{name}/*.el | 
|---|
| 369 | %{_emacs_sitestartdir}/*.el | 
|---|
| 370 | %endif | 
|---|
| 371 |  | 
|---|
| 372 | %files legacy | 
|---|
| 373 | %defattr(-,root,root) | 
|---|
| 374 | %{_libdir}/kintl.dll | 
|---|
| 375 |  | 
|---|
| 376 | %changelog | 
|---|
| 377 | * Thu Jun 30 2016 yd <yd@os2power.com> 0.19.8.1-3 | 
|---|
| 378 | - r1641, disable drive letter mapping. ticket#109. | 
|---|
| 379 |  | 
|---|
| 380 | * Thu Jun 30 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 0.19.8.1-2 | 
|---|
| 381 | - r1635, remove a ABI break from upstream, fixes ticket #108. | 
|---|
| 382 | - r1633, use dll names as in upstream gettext, remove our changes. | 
|---|
| 383 |  | 
|---|
| 384 | * Mon Jun 27 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 0.19.8.1-1 | 
|---|
| 385 | - updated to version 0.19.8.1 | 
|---|
| 386 |  | 
|---|
| 387 | * Sat Jun 18 2016 yd <yd@os2power.com> 0.18.3.2-2 | 
|---|
| 388 | - rebuild for glib2 2.33. | 
|---|
| 389 |  | 
|---|
| 390 | * Fri Feb 13 2015 yd <yd@os2power.com> 0.18.3.2-1 | 
|---|
| 391 | - r1005 and others, updated source code to 0.18.3.2. | 
|---|
| 392 |  | 
|---|
| 393 | * Mon Feb 02 2015 yd <yd@os2power.com> 0.18.1.1-7 | 
|---|
| 394 | - rebuilt with gcc 4.9.2. | 
|---|
| 395 |  | 
|---|
| 396 | * Sun Jan 25 2015 yd | 
|---|
| 397 | - r982, revert r981, ignore pthreads rwlock(), they are only stubs. | 
|---|
| 398 |  | 
|---|
| 399 | * Sat Jan 24 2015 yd | 
|---|
| 400 | - r981, ignore pthreads rwlock(), they are only stubs. | 
|---|
| 401 |  | 
|---|
| 402 | * Wed Jan 14 2015 yd | 
|---|
| 403 | - r963, rebuilt with new libtool, which gave new dll names | 
|---|
| 404 | - added legacy package. | 
|---|
| 405 | - added debug package with symbolic info for exceptq. | 
|---|