diff --git a/po-debconf.spec b/po-debconf.spec new file mode 100644 index 0000000..2f8a33f --- /dev/null +++ b/po-debconf.spec @@ -0,0 +1,115 @@ + +# Handle Debian +nmu version suffixes +# As they are non-numeric we move them to the release part +# Per Fedora policy: +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_release_and_post_release_versions +%global posttag nmu1 +%global release_posttag %{?posttag:.%{posttag}} +%global tarball_posttag %{?posttag:+%{posttag}} +%global debian_fqn %{name}_%{version}%{tarball_posttag} + +# Some self tests are failing. For now make it optional. +# To try it, simply run: mock --with=check +%bcond_with check + +Name: po-debconf +Version: 1.0.21 +Release: 1%{release_posttag} +Summary: Tool for managing templates file translations with gettext + +License: GPLv2+ +URL: https://tracker.debian.org/pkg/po-debconf +Source0: https://ftp.debian.org/debian/pool/main/p/%{name}/%{name}_%{version}%{tarball_posttag}.tar.xz + +BuildArch: noarch + +BuildRequires: make +BuildRequires: po4a +BuildRequires: dpkg-dev +BuildRequires: /usr/bin/pod2html + +# Needed for check +%if %{with check} +BuildRequires: perl-generators +BuildRequires: perl(Test) +BuildRequires: perl(Test::Harness) +BuildRequires: debconf +BuildRequires: intltool +%endif + +Requires: perl-interpreter +Requires: intltool +Requires: gettext + +# Debian optional run-time features +Recommends: perl(Compress::Zlib) +Recommends: perl(Mail::Sendmail) +Recommends: perl(Mail::Box::Manager) + +%description +This package is an alternative to debconf-utils, and provides +tools for managing translated debconf templates files with +common gettext utilities. + +%prep +%setup -q -n %{name}-%{version}%{tarball_posttag} + +# Fix upstream +chmod -x COPYING + + +%build +%make_build + + +%install +mkdir -p \ + %{buildroot}/%{_bindir} \ + %{buildroot}/%{_datadir}/%{name}/ + +for prog in debconf-gettextize debconf-updatepo po2debconf podebconf-display-po podebconf-report-po; do + install -pm 755 $prog %{buildroot}/%{_bindir} +done + +# I don't know what to do with these +rm -rf doc/vi + +for lang_man in `find doc/ -name "*.1" -exec dirname {} \; | sort -u`; do + lang_id=$(basename $lang_man | sed -e 's/en//g') + mkdir -p %{buildroot}/%{_mandir}/man1/ + mkdir -p "%{buildroot}/%{_mandir}/$lang_id/man1" + for man in $lang_man/*.1; do + dest_name=$(basename $man | sed -e "s/\.$lang_id\././") + install -pm 644 "$man" "%{buildroot}/%{_mandir}/$lang_id/man1/$dest_name" + done +done + +install -pm 644 encodings %{buildroot}%{_datadir}/%{name}/ +install -pm 644 pot-header %{buildroot}%{_datadir}/%{name}/ +cp -a podebconf-report-po_templates/ %{buildroot}%{_datadir}/%{name}/templates +# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1345764 +# https://bugzilla.redhat.com/show_bug.cgi?id=591389#c18 +ln -s ../bin %{buildroot}%{_datadir}/intltool-debian + +%find_lang po-debconf --without-mo --with-man --all-name + +%if %{with check} +%check +( cd ./tests && PODEBCONF_LIB=/usr/bin ./run.pl ) +%endif + +%files -f po-debconf.lang +%doc README README-trans +%license COPYING +%{_mandir}/man1/*.1* +%{_bindir}/debconf-gettextize +%{_bindir}/debconf-updatepo +%{_bindir}/po2debconf +%{_bindir}/podebconf-display-po +%{_bindir}/podebconf-report-po +%{_datadir}/%{name} +%{_datadir}/intltool-debian + +%changelog +* Wed Jan 24 2024 Dongxing Wang - 1.0.21-1.nmu1 +- Initial package diff --git a/po-debconf_1.0.21+nmu1.tar.xz b/po-debconf_1.0.21+nmu1.tar.xz new file mode 100644 index 0000000..895fc53 Binary files /dev/null and b/po-debconf_1.0.21+nmu1.tar.xz differ