From acb6a6c27333ca45488ec09143a9a86270008ece Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Thu, 13 Apr 2023 16:41:24 +0800 Subject: [PATCH] Refact spec Signed-off-by: Jing Zhang --- jbigkit.spec | 124 ++++++++++++++++++++++++--------------------------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/jbigkit.spec b/jbigkit.spec index a7d2ad9..26e648b 100644 --- a/jbigkit.spec +++ b/jbigkit.spec @@ -1,54 +1,48 @@ -%define anolis_release 16 +%define anolis_release 17 + Name: jbigkit Version: 2.1 Release: %{anolis_release}%{?dist} Summary: JBIG1 lossless image compression tools - License: GPLv2+ -URL: http://www.cl.cam.ac.uk/~mgk25/jbigkit/ -Source0: https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-%{version}.tar.gz -Patch0: 0001-jbigkit-2.1-shlib.patch -Patch1: 0002-jbigkit-2.0-warnings.patch -Patch2: 0003-jbigkit-ldflags.patch -# patch for coverity issues - backported from upstream -Patch3: 0004-jbigkit-covscan.patch - -# gcc is no longer in buildroot by default -# gcc needed for libjbig library and several filters - jbigtopbm, pbmtojbig e.g. -BuildRequires: gcc -# uses make -BuildRequires: make - -Requires: jbigkit-libs = %{version}-%{release} +URL: http://www.cl.cam.ac.uk/~mgk25/%{name}/ +Source0: https://www.cl.cam.ac.uk/~mgk25/%{name}/download/%{name}-%{version}.tar.gz -%package libs -Summary: JBIG1 lossless image compression library +Patch0: 0001-%{name}-2.1-shlib.patch +Patch1: 0002-%{name}-2.0-warnings.patch +Patch2: 0003-%{name}-ldflags.patch +Patch3: 0004-%{name}-covscan.patch -%package devel -Summary: JBIG1 lossless image compression library -- development files -Requires: jbigkit-libs = %{version}-%{release} +BuildRequires: gcc make -%description libs -JBIG-KIT provides a portable library of compression and decompression -functions with a documented interface that you can include very easily -into your image or document processing software. In addition, JBIG-KIT -provides ready-to-use compression and decompression programs with a -simple command line interface (similar to the converters found in netpbm). +Requires: %{name}-libs = %{version}-%{release} -JBIG-KIT implements the specification: - ISO/IEC 11544:1993 and ITU-T Recommendation T.82(1993): - Information technology — Coded representation of picture and audio - information — Progressive bi-level image compression +%description +JBIG-KIT is a software implementation of the JBIG1 data compression +standard (ITU-T T.82), which was designed for bi-level image data, +such as scanned documents. This library is available in portable C +code. It is widely used in fax products, printer firmware, printer +drivers, document management systems and imaging software. + +The package includes two variant implementations: jbig.c implements +nearly all options of the standard, but has to keep the full +uncompressed image in memory, whereas jbig85.c implements just the +ITU-T T.85 profile, with memory management optimized for embedded +and fax applications, buffering only a few lines of the uncompressed +image in memory, able to stream images of initially unknown height. -which is commonly referred to as the “JBIG1 standard” +%package libs +Summary: Libraries for %{name} -%description devel -The jbigkit-devel package contains files needed for development using -the JBIG-KIT image compression library. +%description libs +The %{name}-libs provides libraries for %{name}. -%description -The jbigkit package contains tools for converting between PBM and JBIG1 -formats. +%package devel +Summary: Files for %{name} development +Requires: %{name}-libs = %{version}-%{release} + +%description devel +The %{name}-devel package contains files needed for %{name} development. %package doc Summary: Documentation files for %{name} @@ -59,35 +53,30 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n jbigkit-2.1 -%patch0 -p1 -b .shlib -%patch1 -p1 -b .warnings -%patch2 -p1 -b .ldflags -# covscan issues - backported from upstream -%patch3 -p1 -b .covscan +%autosetup -n %{name}-%{version} -p1 %build %set_build_flags %make_build %install -mkdir -p $RPM_BUILD_ROOT%{_libdir} -mkdir -p $RPM_BUILD_ROOT%{_includedir} -mkdir -p $RPM_BUILD_ROOT%{_bindir} -mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +mkdir -p %{buildroot}%{_libdir} +install -p -m0755 libjbig/libjbig.so.%{version} %{buildroot}/%{_libdir} +install -p -m0755 libjbig/libjbig85.so.%{version} %{buildroot}/%{_libdir} +ln -sf libjbig.so.%{version} %{buildroot}/%{_libdir}/libjbig.so +ln -sf libjbig85.so.%{version} %{buildroot}/%{_libdir}/libjbig85.so -install -p -m0755 libjbig/libjbig.so.%{version} $RPM_BUILD_ROOT/%{_libdir} -install -p -m0755 libjbig/libjbig85.so.%{version} $RPM_BUILD_ROOT/%{_libdir} -ln -sf libjbig.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/libjbig.so -ln -sf libjbig85.so.%{version} $RPM_BUILD_ROOT/%{_libdir}/libjbig85.so +mkdir -p %{buildroot}%{_includedir} +install -p -m0644 libjbig/jbig.h %{buildroot}%{_includedir} +install -p -m0644 libjbig/jbig85.h %{buildroot}%{_includedir} +install -p -m0644 libjbig/jbig_ar.h %{buildroot}%{_includedir} -install -p -m0644 libjbig/jbig.h $RPM_BUILD_ROOT%{_includedir} -install -p -m0644 libjbig/jbig85.h $RPM_BUILD_ROOT%{_includedir} -install -p -m0644 libjbig/jbig_ar.h $RPM_BUILD_ROOT%{_includedir} +mkdir -p %{buildroot}%{_bindir} +install -p -m0755 pbmtools/???to??? %{buildroot}%{_bindir} +install -p -m0755 pbmtools/???to???85 %{buildroot}%{_bindir} -install -p -m0755 pbmtools/???to??? $RPM_BUILD_ROOT%{_bindir} -install -p -m0755 pbmtools/???to???85 $RPM_BUILD_ROOT%{_bindir} -install -p -m0644 pbmtools/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 +mkdir -p %{buildroot}%{_mandir}/man1 +install -p -m0644 pbmtools/*.1 %{buildroot}%{_mandir}/man1 %generate_compatibility_deps @@ -95,24 +84,27 @@ install -p -m0644 pbmtools/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 make test %files +%license COPYING %{_bindir}/???to* %{_mandir}/man1/* -%license COPYING + +%files devel +%{_libdir}/libjbig*.so +%{_includedir}/jbig*.h %files libs +%license COPYING %dir %{abidir} -%{_libdir}/libjbig*.so.%{version} %{abidir}/libjbig*.dump -%license COPYING +%{_libdir}/libjbig*.so.%{version} %files doc %doc ANNOUNCE TODO CHANGES -%files devel -%{_libdir}/libjbig*.so -%{_includedir}/jbig*.h - %changelog +* Thu Apr 13 2023 Jing Zhang - 2.1-17 +- Refact spec + * Tue Mar 28 2023 mgb01105731 - 2.1-16 - Del Specific Fields -- Gitee