diff --git a/gettext.spec b/gettext.spec index 502f3a0c5e003b28ff20a145f80e205f71b8b191..ec84a3b83fbbe95a287b49d7f2a0a704e446b56e 100644 --- a/gettext.spec +++ b/gettext.spec @@ -1,89 +1,43 @@ -%define anolis_release 3 +%define anolis_release 4 %bcond_with jar %bcond_with java -Summary: Gettext tools and documentation for developers and translators Name: gettext Version: 0.21.1 Release: %{anolis_release}%{?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+ +Summary: Gettext tools and documentation for developers and translators License: GPLv3+ and LGPLv2+ and GFDL URL: http://www.gnu.org/software/gettext/ -Source: https://ftp.gnu.org/pub/gnu/gettext/%{name}-%{version}.tar.xz +Source: https://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.xz Source2: msghack.py Source3: msghack.1 -Patch1: %{name}-%{version}-disable-libtextstyle.patch -Patch2: %{name}-%{version}-covscan.patch -Patch3: %{name}-java17-2062407.patch - -# Disable gnulib test-execute.sh test, as it always fail on koji/an23 -Patch101: gettext-0.21.1-disable-gnulib-test-execute-sh.patch - -# for bootstrapping -# BuildRequires: autoconf >= 2.62 -BuildRequires: automake -BuildRequires: libtool - -BuildRequires: gcc-c++ +BuildRequires: automake libtool 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 +BuildRequires: %{_bindir}/fastjar 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 -# Depend on the exact version of the library sub package -Requires: %{name}-libs = %{version}-%{release} -Provides: bundled(gnulib) -Provides: bundled(libcroco) = 0.6.12 -Requires: %{name}-runtime = %{version}-%{release} +BuildRequires: emacs git xz +BuildRequires: teckit texlive-dvips texlive-dvipdfmx texinfo-tex texlive-xetex +BuildRequires: ncurses-devel libxml2-devel glib2-devel libacl-devel libunistring-devel +BuildRequires: glibc-langpack-de glibc-langpack-en glibc-langpack-fa glibc-langpack-fr +BuildRequires: glibc-langpack-ja glibc-langpack-tr glibc-langpack-zh +Provides: bundled(gnulib) bundled(libcroco) = 0.6.12 +Requires: %{name}-runtime = %{version}-%{release} %{name}-libs = %{version}-%{release} + +Patch1: %{name}-%{version}-disable-libtextstyle.patch +Patch2: %{name}-%{version}-covscan.patch +Patch3: %{name}-java17-2062407.patch + +# Disable gnulib test-execute.sh test, as it always fail on koji/an23 +Patch101: %{name}-0.21.1-disable-gnulib-test-execute-sh.patch %description -The GNU gettext package provides a set of tools and documentation for +The GNU %{name} 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 @@ -94,76 +48,51 @@ library and tools for creating, using, and modifying natural language catalogs and is a powerful and simple method for internationalizing programs. -%package runtime -Summary: GNU runtime libraries and programs for producing multi-lingual messages -License: GPLv3+ and LGPLv2+ -# Depend on the exact version of the library sub package -Requires: %{name}-libs = %{version}-%{release} -Requires: %{name}-envsubst = %{version}-%{release} -Conflicts: %{name} < 0.21.1 - -%description runtime -The GNU gettext-runtime package provides an easy to use runtime libraries and -programs for creating, using, and modifying natural language catalogs -and is a powerful and simple method for internationalizing programs. - -%package doc -Summary: Documentation files for %{name} -Requires: %{name} = %{version}-%{release} -BuildArch: noarch - -%description doc -The %{name}-doc package contains documentation files for %{name}. - -%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 libs +Summary: Libraries for %{name} +License: LGPLv2+ and GPLv3+ +Obsoletes: libtextstyle < %{version}-%{release} +%description libs +This package contains libraries used internationalization support. %package devel Summary: Development files for %{name} -# autopoint is GPLv3+ -# libasprintf is LGPLv2+ -# libgettextpo is GPLv3+ License: LGPLv2+ and GPLv3+ and GFDL Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-common-devel = %{version}-%{release} -Requires: xz -Requires: diffutils -Obsoletes: gettext-autopoint < 0.18.1.1-3 -Provides: gettext-autopoint = %{version}-%{release} +Requires: xz diffutils +Obsoletes: %{name}-autopoint < 0.18.1.1-3 Obsoletes: libtextstyle-devel < %{version}-%{release} +Provides: %{name}-autopoint = %{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. +want to add %{name} support for your project. +%package common-devel +Summary: Common development files for %{name} +License: GPLv3+ +BuildArch: noarch -%package libs -Summary: Libraries for %{name} -# libasprintf is LGPLv2+ -# libgettextpo is GPLv3+ -License: LGPLv2+ and GPLv3+ -Obsoletes: libtextstyle < %{version}-%{release} +%description common-devel +This package contains common architecture independent %{name} development files. -%description libs -This package contains libraries used internationalization support. +%package envsubst +Summary: Substitutes the values of environment variables +Conflicts: %{name} < 0.21.1 + +%description envsubst +Substitutes the values of environment variables. %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} +Provides: emacs-%{name}-el = %{version}-%{release} emacs-po-mode Obsoletes: emacs-%{name}-el < %{version}-%{release} %description -n emacs-%{name} @@ -177,24 +106,32 @@ BuildArch: noarch This program can be used to alter .po files in ways no sane mind would think about. -%package envsubst -Summary: Substitutes the values of environment variables +%package runtime +Summary: GNU runtime libraries and programs for producing multi-lingual messages +License: GPLv3+ and LGPLv2+ +Requires: %{name}-libs = %{version}-%{release} +Requires: %{name}-envsubst = %{version}-%{release} Conflicts: %{name} < 0.21.1 - -%description envsubst -Substitutes the values of environment variables. +%description runtime +The GNU %{name}-runtime package provides an easy to use runtime libraries and +programs for creating, using, and modifying natural language catalogs +and is a powerful and simple method for internationalizing programs. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%autosetup -p1 +%autosetup -n %{name}-%{version} -p1 %build -# Refresh autotools files to latest versions autoreconf -fi -# Defeat libtextstyle attempt to bundle libxml2. The comments -# indicate this is done because the libtextstyle authors do not want -# applications using their code to suffer startup delays due to the sed -e 's/\(gl_cv_libxml_force_included=\)yes/\1no/' \ -i libtextstyle/configure @@ -205,9 +142,7 @@ export JAR=fastjar %endif %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 \ @@ -218,8 +153,6 @@ export LIBS="-lxml2" %endif --with-xz -# 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|' \ @@ -227,60 +160,43 @@ sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ %make_build %{?with_java:GCJFLAGS="-findirect-dispatch"} - %install %make_install \ - lispdir=%{_datadir}/emacs/site-lisp/gettext \ + lispdir=%{_datadir}/emacs/site-lisp/%{name} \ aclocaldir=%{_datadir}/aclocal EXAMPLESFILES="" +install -pm 755 %SOURCE2 %{buildroot}/%{_bindir}/msghack +install -pm 644 %SOURCE3 %{buildroot}/%{_mandir}/man1/msghack.1 -install -pm 755 %SOURCE2 ${RPM_BUILD_ROOT}/%{_bindir}/msghack -install -pm 644 %SOURCE3 ${RPM_BUILD_ROOT}/%{_mandir}/man1/msghack.1 +chmod 755 %{buildroot}%{_libdir}/preloadable_libintl.so - -# make preloadable_libintl.so executable -chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/preloadable_libintl.so - -# doc relocations -for i in gettext-runtime/man/*.html; do - rm ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/`basename $i` +for i in %{name}-runtime/man/*.html; do + rm %{buildroot}%{_datadir}/doc/%{name}/`basename $i` done -rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/javadoc* +rm -r %{buildroot}%{_datadir}/doc/%{name}/javadoc* -rm -rf ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/examples +rm -rf %{buildroot}%{_datadir}/doc/%{name}/examples rm -rf htmldoc mkdir htmldoc -mv ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext/* ${RPM_BUILD_ROOT}/%{_datadir}/doc/libasprintf/* htmldoc -rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/libasprintf -rm -r ${RPM_BUILD_ROOT}%{_datadir}/doc/gettext +mv %{buildroot}%{_datadir}/doc/%{name}/* %{buildroot}/%{_datadir}/doc/libasprintf/* htmldoc +rm -r %{buildroot}%{_datadir}/doc/libasprintf +rm -r %{buildroot}%{_datadir}/doc/%{name} -## note libintl.jar does not build with gcj < 4.3 -## since it would not be fully portable %if %{with jar} -### this is no longer needed since examples not packaged -## set timestamp of examples ChangeLog timestamp for brp-java-repack-jars -#for i in `find ${RPM_BUILD_ROOT} examples -newer ChangeLog -type f -name ChangeLog`; do -# touch -r ChangeLog $i -#done -%else -# in case another java compiler is installed -rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/libintl.jar +rm -f %{buildroot}%{_datadir}/%{name}/libintl.jar %endif -rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/gettext.jar +rm -f %{buildroot}%{_datadir}/%{name}/%{name}.jar # own this directory for third-party *.its files -mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/its +mkdir -p %{buildroot}%{_datadir}/%{name}/its -# remove internal .so lib files -rm ${RPM_BUILD_ROOT}%{_libdir}/libgettext{src,lib}.so +rm %{buildroot}%{_libdir}/libgettext{src,lib}.so -# move po-mode initialization elisp file to the right place, and remove byte -# compiled file -install -d ${RPM_BUILD_ROOT}%{_emacs_sitestartdir} -mv ${RPM_BUILD_ROOT}%{_emacs_sitelispdir}/%{name}/start-po.el ${RPM_BUILD_ROOT}%{_emacs_sitestartdir} -rm ${RPM_BUILD_ROOT}%{_emacs_sitelispdir}/%{name}/start-po.elc +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 @@ -288,36 +204,18 @@ rm ${RPM_BUILD_ROOT}%{_emacs_sitelispdir}/%{name}/start-po.elc %generate_compatibility_deps %check -# adapt to rpath removal -export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$PWD/gettext-tools/intl/.libs +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$PWD/%{name}-tools/intl/.libs -# override LIBUNISTRING to prevent reordering of lib objects make check LIBUNISTRING=-lunistring %files -f %{name}-tools.lang %license COPYING -%doc gettext-tools/misc/DISCLAIM -%doc gettext-tools/man/msg*.1.html -%doc gettext-tools/man/recode*.1.html -%doc gettext-tools/man/xgettext.1.html -%doc gettext-tools/doc/FAQ.html -%doc gettext-tools/doc/tutorial.html -%{_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}/recode-sr-latin -%{_bindir}/xgettext +%doc %{name}-tools/misc/DISCLAIM +%doc %{name}-tools/man/msg*.1.html +%doc %{name}-tools/man/recode*.1.html +%doc %{name}-tools/man/xgettext.1.html +%doc %{name}-tools/doc/FAQ.html +%doc %{name}-tools/doc/tutorial.html %{abidir}/msgattrib-option.list %{abidir}/msgcat-option.list %{abidir}/msgcmp-option.list @@ -334,6 +232,22 @@ make check LIBUNISTRING=-lunistring %{abidir}/msguniq-option.list %{abidir}/recode-sr-latin-option.list %{abidir}/xgettext-option.list +%{_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}/recode-sr-latin +%{_bindir}/xgettext %{_infodir}/gettext* %{_mandir}/man1/msgattrib.1* %{_mandir}/man1/msgcat.1* @@ -353,7 +267,7 @@ make check LIBUNISTRING=-lunistring %{_mandir}/man1/xgettext.1* %{_libdir}/%{name} %if %{with java} -%exclude %{_libdir}/%{name}/gnu.gettext.* +%exclude %{_libdir}/%{name}/gnu.%{name}.* %endif %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/its @@ -363,50 +277,38 @@ make check LIBUNISTRING=-lunistring %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/its -%files runtime -f %{name}-runtime.lang -%license COPYING -%doc gettext-runtime/BUGS -%doc gettext-runtime/man/gettext.1.html -%doc gettext-runtime/man/ngettext.1.html -%doc gettext-runtime/intl/COPYING* -%{_bindir}/gettext -%{_bindir}/gettext.sh -%{_bindir}/ngettext -%{abidir}/gettext-option.list -%{abidir}/gettext.sh-option.list -%{abidir}/ngettext-option.list -%{_mandir}/man1/gettext.1* -%{_mandir}/man1/ngettext.1* - -%files envsubst -%license COPYING -%doc gettext-runtime/man/envsubst.1.html -%{_bindir}/envsubst -%{abidir}/envsubst-option.list -%{_mandir}/man1/envsubst.1* - -%files doc -%doc AUTHORS gettext-runtime/BUGS README NEWS THANKS - -%files common-devel -%{_datadir}/%{name}/archive.*.tar.xz +%files libs +%dir %{abidir} +%{abidir}/libasprintf.dump +%{abidir}/libgettextpo.dump +%{abidir}/libgettextlib-0.*.dump +%{abidir}/libgettextsrc-0.*.dump +%{_libdir}/libasprintf.so.0* +%{_libdir}/libgettextpo.so.0* +%{_libdir}/libgettextlib-0.*.so +%{_libdir}/libgettextsrc-0.*.so +%if %{with jar} +%{_datadir}/%{name}/libintl.jar +%endif %files devel -%doc gettext-runtime/man/*.3.html ChangeLog -%doc gettext-tools/man/autopoint.1.html -%doc gettext-tools/man/gettextize.1.html -%{_bindir}/autopoint -%{_bindir}/gettextize +%doc %{name}-runtime/intl-java/javadoc* +%doc %{name}-runtime/man/*.3.html ChangeLog +%doc %{name}-tools/man/autopoint.1.html +%doc %{name}-tools/man/gettextize.1.html %{abidir}/autopoint-option.list %{abidir}/gettextize-option.list %{abidir}/preloadable_libintl.dump +%{_bindir}/autopoint +%{_bindir}/gettextize +%{_datadir}/aclocal/* %{_datadir}/%{name}/projects/ %{_datadir}/%{name}/config.rpath %{_datadir}/%{name}/*.h %{_datadir}/%{name}/msgunfmt.tcl -%{_datadir}/aclocal/* +%{_datadir}/%{name}/javaversion.class %{_includedir}/autosprintf.h -%{_includedir}/gettext-po.h +%{_includedir}/%{name}-po.h %{_infodir}/autosprintf* %{_libdir}/libasprintf.so %{_libdir}/libgettextpo.so @@ -414,25 +316,19 @@ make check LIBUNISTRING=-lunistring %{_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.* +%{_libdir}/%{name}/gnu.%{name}.* %endif -%files libs -%dir %{abidir} -%{_libdir}/libasprintf.so.0* -%{_libdir}/libgettextpo.so.0* -%{_libdir}/libgettextlib-0.*.so -%{_libdir}/libgettextsrc-0.*.so -%{abidir}/libasprintf.dump -%{abidir}/libgettextpo.dump -%{abidir}/libgettextlib-0.*.dump -%{abidir}/libgettextsrc-0.*.dump -%if %{with jar} -%{_datadir}/%{name}/libintl.jar -%endif +%files common-devel +%{_datadir}/%{name}/archive.*.tar.xz + +%files envsubst +%license COPYING +%doc %{name}-runtime/man/envsubst.1.html +%{_bindir}/envsubst +%{abidir}/envsubst-option.list +%{_mandir}/man1/envsubst.1* %files -n emacs-%{name} %dir %{_emacs_sitelispdir}/%{name} @@ -445,7 +341,28 @@ make check LIBUNISTRING=-lunistring %{_bindir}/msghack %{_mandir}/man1/msghack.1* +%files runtime -f %{name}-runtime.lang +%license COPYING +%doc %{name}-runtime/BUGS +%doc %{name}-runtime/man/%{name}.1.html +%doc %{name}-runtime/man/ngettext.1.html +%doc %{name}-runtime/intl/COPYING* +%{abidir}/%{name}-option.list +%{abidir}/%{name}.sh-option.list +%{abidir}/ngettext-option.list +%{_bindir}/%{name} +%{_bindir}/%{name}.sh +%{_bindir}/ngettext +%{_mandir}/man1/%{name}.1* +%{_mandir}/man1/ngettext.1* + +%files doc +%doc AUTHORS %{name}-runtime/BUGS README NEWS THANKS + %changelog +* Sat Apr 15 2023 Jing Zhang - 0.21.1-4 +- Refact spec + * Thu Mar 23 2023 Chunmei Xu - 0.21.1-3 - Bump version to rebuild