diff --git a/libpaper-2.0.9-x-to-1-fix.patch b/libpaper-2.0.9-x-to-1-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..bf18342d7f330670b48d1ec2e5a66692f2a69bc7 --- /dev/null +++ b/libpaper-2.0.9-x-to-1-fix.patch @@ -0,0 +1,24 @@ +diff -up libpaper-2.0.9/configure.ac.fix libpaper-2.0.9/configure.ac +--- libpaper-2.0.9/configure.ac.fix 2023-02-23 15:03:28.780772074 -0500 ++++ libpaper-2.0.9/configure.ac 2023-02-23 15:03:34.308841516 -0500 +@@ -134,6 +134,9 @@ AC_PATH_PROG([HELP2MAN], [help2man], [he + CROSS_COMPILING=$cross_compiling + AC_SUBST([CROSS_COMPILING]) + ++dnl Perl is needed for x-to-1 ++AC_PATH_PROG([PERL], [perl], [perl]) ++ + dnl Create files + AC_CONFIG_HEADERS([config.h]) + AC_CONFIG_FILES([ +diff -up libpaper-2.0.9/man/Makefile.am.fix libpaper-2.0.9/man/Makefile.am +--- libpaper-2.0.9/man/Makefile.am.fix 2023-02-23 15:03:57.583133885 -0500 ++++ libpaper-2.0.9/man/Makefile.am 2023-02-23 15:04:39.738663438 -0500 +@@ -37,6 +37,6 @@ paper.1.in: $(abs_top_srcdir)/src/paper. + ## Exit gracefully if $@ is not writeable, such as during distcheck! + $(AM_V_GEN)if ( touch $@.w && rm -f $@.w; ) >/dev/null 2>&1; then \ + $(top_builddir)/build-aux/x-to-1 \ +- $(PERL) $(HELP2MAN) --no-info --no-discard-stderr \ ++ $(PERL) "$(HELP2MAN) --no-info --no-discard-stderr" \ + $(abs_top_builddir)/src/paper$(EXEEXT) paper.x $@; \ + fi diff --git a/libpaper-2.1.0.tar.gz b/libpaper-2.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..01b7a5046d9ee86789c945fc85f0303acfa695fc Binary files /dev/null and b/libpaper-2.1.0.tar.gz differ diff --git a/libpaper-file-leak.patch b/libpaper-file-leak.patch deleted file mode 100644 index 47b878bebc290c10fdb667c7156733c7eb212d96..0000000000000000000000000000000000000000 --- a/libpaper-file-leak.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up libpaper-1.1.24+nmu5/lib/paper.c.file-leak libpaper-1.1.24+nmu5/lib/paper.c ---- libpaper-1.1.24+nmu5/lib/paper.c.file-leak 2018-03-09 16:21:01.028345956 +0100 -+++ libpaper-1.1.24+nmu5/lib/paper.c 2018-03-09 16:40:57.824279357 +0100 -@@ -140,7 +140,7 @@ char* systempapername(void) { - char* paperstr; - char* paperenv; - const char* paperdef; -- FILE* ps; -+ FILE* ps = NULL; - struct stat statbuf; - const struct paper* pp; - int c; -@@ -224,6 +224,9 @@ PAPERSIZEVAR, fall-back to the old behav - } - } - -+ if (ps) -+ fclose(ps); -+ - paperdef = defaultpapername(); - paperstr = malloc((strlen(paperdef) + 1) * sizeof(char)); - diff --git a/libpaper-useglibcfallback.patch b/libpaper-useglibcfallback.patch deleted file mode 100644 index 1216055ed9014c69a0a89535db949d6e70282283..0000000000000000000000000000000000000000 --- a/libpaper-useglibcfallback.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff -up libpaper-1.1.24+nmu3/lib/paper.c.useglibcfallback libpaper-1.1.24+nmu3/lib/paper.c ---- libpaper-1.1.24+nmu3/lib/paper.c.useglibcfallback 2010-04-24 08:12:11.000000000 -0400 -+++ libpaper-1.1.24+nmu3/lib/paper.c 2014-04-22 15:58:33.120039001 -0400 -@@ -20,6 +20,9 @@ - - #include - -+#include -+#include -+ - #include "paper.h" - - struct paper { -@@ -108,6 +111,27 @@ in PAPERCONFVAR, fall-back to the old be - } - - const char* defaultpapername(void) { -+#if defined(LC_PAPER) && defined(_GNU_SOURCE) -+ -+#define NL_PAPER_GET(x) \ -+ ((union { char *string; unsigned int word; })nl_langinfo(x)).word -+ -+#define PT_TO_MM(v) (unsigned int)((v * 2.54 * 10 / 72) + 0.5) -+ -+ const struct paper* pp; -+ -+ unsigned int w = NL_PAPER_GET(_NL_PAPER_WIDTH); -+ unsigned int h = NL_PAPER_GET(_NL_PAPER_HEIGHT); -+ -+ for (pp = paperfirst(); pp; pp = papernext(pp)) { -+ if ( -+ PT_TO_MM(pp->pswidth) == w && -+ PT_TO_MM(pp->psheight) == h -+ ) { -+ return pp->name; -+ } -+ } -+#endif - return PAPERSIZE; - } - -diff -up libpaper-1.1.24+nmu3/man/paperconf.1.in.useglibcfallback libpaper-1.1.24+nmu3/man/paperconf.1.in ---- libpaper-1.1.24+nmu3/man/paperconf.1.in.useglibcfallback 2014-04-22 15:58:33.121038995 -0400 -+++ libpaper-1.1.24+nmu3/man/paperconf.1.in 2014-04-22 16:00:15.973428376 -0400 -@@ -48,10 +48,12 @@ looking in order at the - .B @PAPERSIZEVAR@ - environment variable, at the contents of the file specified by the - .B @PAPERCONFVAR@ --environment variable, at the contents of -+environment variable, at the contents of the file - .B @PAPERCONF@ --or by using --.B letter -+, consulting the values controlled by the -+.B LC_PAPER -+locale setting, or by using -+.B @PAPERSIZE@ - as a fall-back value if none of the other alternatives are successful. - By default, width and height of the paper are printed in PostScript points. - .SH OPTIONS -diff -up libpaper-1.1.24+nmu3/src/paperconf.c.useglibcfallback libpaper-1.1.24+nmu3/src/paperconf.c ---- libpaper-1.1.24+nmu3/src/paperconf.c.useglibcfallback 2012-05-03 15:05:12.000000000 -0400 -+++ libpaper-1.1.24+nmu3/src/paperconf.c 2014-04-22 15:58:33.121038995 -0400 -@@ -13,6 +13,7 @@ - #include - - #include -+#include - - - /* needed for GNU/Hurd */ -@@ -99,6 +100,8 @@ int main(int argc, char** argv) - - const char* progname; - -+ setlocale(LC_ALL, ""); -+ - progname = strrchr(*argv, '/'); - if (progname) { - ++progname; diff --git a/libpaper.spec b/libpaper.spec index 56f8b9f936d4662966a0730e267eb5b029cdde81..3602158120b9d08c728e79722f895e4d4eadd013 100644 --- a/libpaper.spec +++ b/libpaper.spec @@ -1,25 +1,30 @@ Name: libpaper -Version: 1.1.28 -Release: 2 +Version: 2.1.0 +Release: 1 Summary: Library for handling paper characteristics -License: GPLv2 -URL: http://packages.qa.debian.org/libp/libpaper.html -Source0: http://ftp.debian.org/debian/pool/main/libp/libpaper/%{name}_%{version}.tar.gz -Patch0: libpaper-useglibcfallback.patch -Patch1: libpaper-file-leak.patch - +License: LGPL-2.1-or-later +URL: https://github.com/rrthomas/libpaper +Source0: https://github.com/rrthomas/libpaper/archive/v%{version}/%{name}-%{version}.tar.gz + +Patch0: libpaper-2.0.9-x-to-1-fix.patch + BuildRequires: gcc, libtool, gettext, gawk +BuildRequires: git, autoconf, automake +BuildRequires: help2man, tar, gnupg2, perl-interpreter, gnulib-devel +BuildRequires: libpaper %description -The libpaper paper-handling library automates recognition of many different -paper types and sizes for programs that need to deal with printed output. +The libpaper package enables users to indicate their preferred paper +size and specifies system-wide and per-user paper size catalogues, which can +also be used directly (see paperspecs(5)). %package devel -Summary: Development files for using libpaper +Summary: Headers/Libraries for developing programs that use libpaper Requires: %{name} = %{version}-%{release} %description devel -This package contains the development files. +This package contains headers and libraries that programmers will need +to develop applications which use libpaper. %package help Summary: Documents for libpaper @@ -33,13 +38,13 @@ Man pages and other related documents for libpaper. %autosetup -n %{name}-%{version} -p1 libtoolize +sed -i 's|gnulib_tool=$gnulib_path/gnulib-tool|gnulib_tool=%{_bindir}/gnulib-tool|g' bootstrap +sed -i 's|./gnulib/gnulib-tool|%{_bindir}/gnulib-tool|g' bootstrap.conf +sed -i '/doc\/INSTALL/d' bootstrap +./bootstrap --gnulib-srcdir=%{_datadir}/gnulib/ --skip-git + %build -touch AUTHORS NEWS -aclocal -autoreconf -fi -automake -a %configure --disable-static -%disable_rpath %make_build %install @@ -48,23 +53,26 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} echo '# Simply write the paper name. See papersize(5) for possible values' > $RPM_BUILD_ROOT%{_sysconfdir}/papersize mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/libpaper.d +%if 0 for i in cs da de es fr gl hu it ja nl pt_BR sv tr uk vi; do mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/; msgfmt debian/po/$i.po -o $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/%{name}.mo; done %find_lang %{name} +%endif +cp -p %{_libdir}/%{name}.so.1* %{buildroot}%{_libdir} %ldconfig_scriptlets -%files -f %{name}.lang +%files %doc ChangeLog README %license COPYING %config(noreplace) %{_sysconfdir}/papersize +%config(noreplace) %{_sysconfdir}/paperspecs %dir %{_sysconfdir}/libpaper.d +%{_bindir}/paper %{_bindir}/paperconf -%{_libdir}/libpaper.so.1.1.2 -%{_libdir}/libpaper.so.1 -%{_sbindir}/paperconfig +%{_libdir}/libpaper.so.* %files devel %{_includedir}/paper.h @@ -73,10 +81,14 @@ done %files help %{_mandir}/man1/* %{_mandir}/man5/* -%{_mandir}/man8/* -%{_mandir}/man3/* %changelog +* Thu Apr 20 2023 fuanan - 2.1.0-1 +- Type:update +- ID:NA +- SUG:NA +- DESC:update version to 2.1.0 + * Thu Oct 27 2022 dongyuzhen - 1.1.28-2 - Rebuild for next release diff --git a/libpaper.yaml b/libpaper.yaml index 4e73430729cf1480f9d3272665aa12aaee6c35e8..c5842404e2b978e7716980bd8b09b8fcbf45eda0 100644 --- a/libpaper.yaml +++ b/libpaper.yaml @@ -1,4 +1,4 @@ version_control: github -src_repo: metalink-dev/libmetalink -tag_prefix: ^release- -seperator: +src_repo: rrthomas/libpaper +tag_prefix: ^v +seperator: . diff --git a/libpaper_1.1.28.tar.gz b/libpaper_1.1.28.tar.gz deleted file mode 100644 index f22b0a9377f067d2b78924e014b4ff0b9c8d2e11..0000000000000000000000000000000000000000 Binary files a/libpaper_1.1.28.tar.gz and /dev/null differ