%bcond_with jar %bcond_with java Summary: GNU libraries and utilities for producing multi-lingual messages Name: gettext Version: 0.22.3 Release: 1%{?dist} # The following are licensed under LGPLv2+: # - libintl and its headers # - libasprintf and its headers # - libintl.jar # - GNU.Gettext.dll # - gettext.sh # The following are licensed under GFDL: # - gettext-tools/doc/FAQ.html # - gettext-tools/doc/tutorial.html # - gettext info files # - libasprintf info files # - libtextstyle info files # Everything else is GPLv3+ License: GPLv3+ and LGPLv2+ and GFDL URL: https://www.gnu.org/software/gettext/ Source: https://ftp.gnu.org/pub/gnu/gettext/%{name}-%{version}.tar.xz Source2: msghack.py Source3: msghack.1 Patch1: gettext-0.21-CVE-2020-12825.patch # for bootstrapping # BuildRequires: autoconf >= 2.62 BuildRequires: automake # BuildRequires: libtool # BuildRequires: bison BuildRequires: gcc-c++ %if %{with java} # libintl.jar requires gcj >= 4.3 to build BuildRequires: gcc-java, libgcj # For javadoc BuildRequires: java-1.6.0-openjdk-devel %if %{with jar} BuildRequires: %{_bindir}/fastjar # require zip and unzip for brp-java-repack-jars BuildRequires: zip, unzip %endif %endif # for po-mode.el BuildRequires: emacs # for autosetup BuildRequires: git # ensure 'ARCHIVE_FORMAT=dirxz' BuildRequires: xz # for documentation BuildRequires: teckit BuildRequires: texlive-dvips BuildRequires: texlive-dvipdfmx BuildRequires: texinfo-tex BuildRequires: texlive-xetex # following suggested by DEPENDENCIES: BuildRequires: ncurses-devel BuildRequires: libxml2-devel BuildRequires: glib2-devel BuildRequires: libacl-devel BuildRequires: libunistring-devel # for the tests BuildRequires: glibc-langpack-de BuildRequires: glibc-langpack-en BuildRequires: glibc-langpack-fa BuildRequires: glibc-langpack-fr BuildRequires: glibc-langpack-ja BuildRequires: glibc-langpack-tr BuildRequires: glibc-langpack-zh BuildRequires: make # Depend on the exact version of the library sub package Requires: %{name}-libs%{_isa} = %{version}-%{release} Provides: bundled(gnulib) Provides: bundled(libcroco) = 0.6.12 %description The GNU gettext package provides a set of tools and documentation for producing multi-lingual messages in programs. Tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs, a runtime library which supports the retrieval of translated messages, and stand-alone programs for handling the translatable and the already translated strings. Gettext provides an easy to use library and tools for creating, using, and modifying natural language catalogs and is a powerful and simple method for internationalizing programs. %package common-devel Summary: Common development files for %{name} # autopoint archive License: GPLv3+ BuildArch: noarch %description common-devel This package contains common architecture independent gettext development files. %package devel Summary: Development files for %{name} # autopoint is GPLv3+ # libasprintf is LGPLv2+ # libgettextpo is GPLv3+ License: LGPLv2+ and GPLv3+ and GFDL Requires: diffutils Requires: xz Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-common-devel = %{version}-%{release} Provides: gettext-autopoint = %{version}-%{release} Obsoletes: gettext-autopoint < 0.18.1.1-3 Obsoletes: libtextstyle-devel < %{version}-%{release} %description devel This package contains all development related files necessary for developing or compiling applications/libraries that needs internationalization capability. You also need this package if you want to add gettext support for your project. %package libs Summary: Libraries for %{name} # libasprintf is LGPLv2+ # libgettextpo is GPLv3+ License: LGPLv2+ and GPLv3+ Obsoletes: libtextstyle < %{version}-%{release} %description libs This package contains libraries used internationalization support. %package -n emacs-%{name} Summary: Support for editing po files within GNU Emacs BuildArch: noarch # help users find po-mode.el Provides: emacs-po-mode Requires: emacs(bin) >= %{_emacs_version} Provides: emacs-%{name}-el = %{version}-%{release} Obsoletes: emacs-%{name}-el < %{version}-%{release} %description -n emacs-%{name} This package provides a major mode for editing po files within GNU Emacs. %package -n msghack Summary: Alter PO files in ways BuildArch: noarch %description -n msghack This program can be used to alter .po files in ways no sane mind would think about. %prep %autosetup -S git %build # REMOVED stack-protector # vasnprintf.c: In function 'vasnprintf': # vasnprintf.c:147:22: warning: stack protector not protecting local variables: variable length buffer [-Wstack-protector] # 147 | # define VASNPRINTF vasnprintf # | ^~~~~~~~~~ %global build_cflags %{build_cflags} -fno-stack-protector %global build_cxxflags %{build_cxxflags} -fno-stack-protector # cc1: error '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] %global build_cflags %{build_cflags} -Wformat %global build_cxxflags %{build_cxxflags} -Wformat %if %{with java} export JAVAC=gcj %if %{with jar} export JAR=fastjar %endif %endif %ifarch ppc ppc64 ppc64le # prevent test-isinf from failing with gcc-5.3.1 on ppc64le (#1294016) export CFLAGS="$RPM_OPT_FLAGS -D__SUPPORT_SNAN__" %endif # Fedora's libxml2-devel package has an extra "libxml2" path component. export CPPFLAGS="-I%{_includedir}/libxml2" # Side effect of unbundling libxml2 from libtextstyle. export LIBS="-lxml2" %configure \ --enable-nls \ --disable-static \ --enable-shared \ --disable-csharp \ --disable-rpath \ --without-cvs \ --without-included-gettext \ --without-included-libxml \ %if %{with java} --enable-java \ %else --disable-java --disable-native-java \ %endif --with-xz \ --disable-werror # Eliminate hardcoded rpaths; workaround libtool reordering -Wl,--as-needed after all the libraries. sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ -e 's|CC=.g..|& -Wl,--as-needed|' \ -i $(find . -name libtool) %{make_build} %{?with_java:GCJFLAGS="-findirect-dispatch"} %install %make_install \ lispdir=%{_datadir}/emacs/site-lisp/gettext \ aclocaldir=%{_datadir}/aclocal EXAMPLESFILES="" install -pm 755 %{SOURCE2} %{buildroot}%{_bindir}/msghack install -pm 644 %{SOURCE3} %{buildroot}%{_mandir}/man1/msghack.1 # make preloadable_libintl.so executable chmod 755 %{buildroot}%{_libdir}/preloadable_libintl.so rm -f %{buildroot}%{_infodir}/dir # doc relocations for i in gettext-runtime/man/*.html; do rm %{buildroot}%{_datadir}/doc/gettext/`basename $i` done rm -r %{buildroot}%{_datadir}/doc/gettext/javadoc* rm -rf %{buildroot}%{_datadir}/doc/gettext/examples rm -rf htmldoc mkdir htmldoc mv %{buildroot}%{_datadir}/doc/gettext/* %{buildroot}%{_datadir}/doc/libasprintf/* htmldoc rm -r %{buildroot}%{_datadir}/doc/libasprintf rm -r %{buildroot}%{_datadir}/doc/gettext # note libintl.jar does not build with gcj < 4.3 since it would not be fully portable %if %{without jar} # in case another java compiler is installed rm -f %{buildroot}%{_datadir}/%{name}/libintl.jar %endif rm -f %{buildroot}%{_datadir}/%{name}/gettext.jar # own this directory for third-party *.its files mkdir -p %{buildroot}%{_datadir}/%{name}/its # remove .la files rm %{buildroot}%{_libdir}/lib*.la # remove internal .so lib files rm %{buildroot}%{_libdir}/libgettext{src,lib}.so # move po-mode initialization elisp file to the right place, and remove byte compiled file install -d %{buildroot}%{_emacs_sitestartdir} mv %{buildroot}%{_emacs_sitelispdir}/%{name}/start-po.el %{buildroot}%{_emacs_sitestartdir} rm %{buildroot}%{_emacs_sitelispdir}/%{name}/start-po.elc %find_lang %{name}-runtime %find_lang %{name}-tools cat %{name}-*.lang > %{name}.lang %check # disable failing test-signbit test on x86_64 %ifarch x86_64 sed -i -e 's/XFAIL_TESTS =/XFAIL_TESTS = test-signbit$(EXEEXT)/g' %{_builddir}/%{name}-%{version}/gettext-tools/gnulib-tests/Makefile %endif # this takes quite a lot of time to run # adapt to rpath removal export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$PWD/gettext-tools/intl/.libs # adapt for Test failure # error while loading shared libraries: libgnuintl.so.8: cannot open shared object file: No such file or directory export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_builddir}/%{name}-%{version}/gettext-runtime/intl/.libs/ # override LIBUNISTRING to prevent reordering of lib objects make check LIBUNISTRING=-lunistring %ldconfig_scriptlets libs %files -f %{name}.lang %license COPYING %doc AUTHORS gettext-runtime/BUGS %doc gettext-tools/misc/DISCLAIM README %doc NEWS THANKS %doc gettext-runtime/man/*.1.html %doc gettext-runtime/intl/COPYING* %{_bindir}/envsubst %{_bindir}/gettext %{_bindir}/gettext.sh %{_bindir}/msgattrib %{_bindir}/msgcat %{_bindir}/msgcmp %{_bindir}/msgcomm %{_bindir}/msgconv %{_bindir}/msgen %{_bindir}/msgexec %{_bindir}/msgfilter %{_bindir}/msgfmt %{_bindir}/msggrep %{_bindir}/msginit %{_bindir}/msgmerge %{_bindir}/msgunfmt %{_bindir}/msguniq %{_bindir}/ngettext %{_bindir}/recode-sr-latin %{_bindir}/xgettext %{_infodir}/gettext* %exclude %{_mandir}/man1/autopoint.1* %exclude %{_mandir}/man1/gettextize.1* %exclude %{_mandir}/man1/msghack.1* %{_mandir}/man1/* %{_libdir}/%{name} %if %{with java} %exclude %{_libdir}/%{name}/gnu.gettext.* %endif %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/its %{_datadir}/%{name}/ABOUT-NLS %{_datadir}/%{name}/po %{_datadir}/%{name}/styles %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/its %files common-devel %{_datadir}/%{name}/archive.*.tar.xz %files devel %doc gettext-runtime/man/*.3.html ChangeLog %{_bindir}/autopoint %{_bindir}/gettextize %{_datadir}/%{name}/projects/ %{_datadir}/%{name}/config.rpath %{_datadir}/%{name}/*.h %{_datadir}/%{name}/msgunfmt.tcl %{_datadir}/aclocal/* %{_includedir}/textstyle/* %{_includedir}/autosprintf.h %{_includedir}/gettext-po.h %{_includedir}/textstyle.h %{_infodir}/autosprintf* %{_infodir}/libtextstyle* %{_libdir}/libasprintf.so %{_libdir}/libgettextpo.so %{_libdir}/libtextstyle.so %{_libdir}/preloadable_libintl.so %{_mandir}/man1/autopoint.1* %{_mandir}/man1/gettextize.1* %{_mandir}/man3/* %{_datadir}/%{name}/javaversion.class %doc gettext-runtime/intl-java/javadoc* %if %{with java} %{_libdir}/%{name}/gnu.gettext.* %endif %files libs %{_defaultdocdir}/libtextstyle %{_libdir}/libasprintf.so.0* %{_libdir}/libgettextpo.so.0* %{_libdir}/libgettextlib-0.*.so %{_libdir}/libgettextsrc-0.*.so %{_libdir}/libtextstyle.so.0* %if %{with jar} %{_datadir}/%{name}/libintl.jar %endif %files -n emacs-%{name} %dir %{_emacs_sitelispdir}/%{name} %{_emacs_sitelispdir}/%{name}/*.elc %{_emacs_sitelispdir}/%{name}/*.el %{_emacs_sitestartdir}/*.el %files -n msghack %license COPYING %{_bindir}/msghack %{_mandir}/man1/msghack.1*