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