#1 Spec cleanups and a fix for bug 1536211
Opened 3 years ago by tibbs. Modified 2 years ago
rpms/ tibbs/gv master  into  rawhide

file modified
+3 -3
@@ -1,7 +1,7 @@ 

- diff --git a/gv/src/ps.c b/gv/src/ps.c

+ diff --git a/src/ps.c b/src/ps.c

  index 2428bcc..822b65a 100644

- --- a/gv/src/ps.c

- +++ b/gv/src/ps.c

+ --- a/src/ps.c

+ +++ b/src/ps.c

  @@ -357,7 +357,7 @@ static int parse_boundingbox(const char *l, int *boundingbox) {

   	while (*p == ' ' || *p == '\t')

   		p++;

file modified
+50 -26
@@ -1,39 +1,60 @@ 

  Summary: A X front-end for the Ghostscript PostScript(TM) interpreter

  Name: gv

  Version: 3.7.4

- Release: 16%{?dist}

+ Release: 17%{?dist}

  License: GPLv3+

  Group: Applications/Publishing

+ 

+ # <= EL7 does not have ghostscript-x11

+ %if (0%{?rhel} && 0%{?rhel} <= 7)

+ Requires: ghostscript

+ %else

  Requires: ghostscript-x11

+ %endif

  URL: http://www.gnu.org/software/gv/

- Source0: ftp://ftp.gnu.org/gnu/gv/gv-%{version}.tar.gz

- #Source0: ftp://alpha.gnu.org/gnu/gv/gv-%{version}.tar.gz

+ Source0: https://ftp.gnu.org/gnu/gv/gv-%{version}.tar.gz

  Source1: gv.png

+ 

  # Check for null pointers in resource requests

  # https://savannah.gnu.org/bugs/?38727

  Patch0:  gv-resource.patch

+ 

  # Change tab to space in gv_user_res.dat

  # http://savannah.gnu.org/patch/?7998

  Patch1:  gv-dat.patch

+ 

  # Support aarch64

  Patch2:  gv-aarch64.patch

+ 

  # Fix bounding box recognition

  Patch3:  gv-bounding-box.patch

+ 

  # Fix NULL access segfault

  # https://bugzilla.redhat.com/show_bug.cgi?id=1071238

  Patch4:  gv-bug1071238.patch

+ 

+ # Use ps2write instead of old pswrite driver (which was remove in GS9)

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1536211

+ # This should work fine even on EL6

+ Patch5:  gv-pswrite.patch

+ 

  BuildRequires: /usr/bin/makeinfo

  BuildRequires: Xaw3d-devel

- %if 0%{?rhel} != 04

  BuildRequires: libXinerama-devel

- %endif

  BuildRequires: zlib-devel, bzip2-devel

  BuildRequires: desktop-file-utils

- Requires(post): /sbin/install-info, /usr/bin/update-mime-database

- Requires(post): /usr/bin/update-desktop-database

+ 

+ # Fedora 27 needs info scriptlets; F28+ needs no scriptlets

+ %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 27)

+ Requires(post): /sbin/install-info

  Requires(preun): /sbin/install-info

+ %endif

+ %if (0%{?rhel} && 0%{?rhel} <= 7)

+ Requires(post): /usr/bin/update-mime-database

+ Requires(post): /usr/bin/update-desktop-database

  Requires(postun): /usr/bin/update-mime-database

  Requires(postun): /usr/bin/update-desktop-database

+ %endif

  

  

  %description
@@ -42,27 +63,20 @@ 

  

  

  %prep

- %setup -q

- %patch0 -p1 -b .resource

- %patch1 -p1 -b .resdat

- %patch2 -p1 -b .aarch64

- %patch3 -p2 -b .bounding-box

- %patch4 -p1 -b .bug1071238

+ %autosetup -p1

  

  

  %build

  %configure

- make %{?_smp_mflags}

- 

+ %make_build

  

  %install

- rm -rf $RPM_BUILD_ROOT

- make install DESTDIR=$RPM_BUILD_ROOT

+ %make_install

  

  #Still provide link

- ln $RPM_BUILD_ROOT%{_bindir}/gv $RPM_BUILD_ROOT%{_bindir}/ghostview

+ ln %{buildroot}%{_bindir}/gv %{buildroot}%{_bindir}/ghostview

  

- mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications

+ mkdir -p %{buildroot}%{_datadir}/applications

  

  cat > gv.desktop <<EOF

  [Desktop Entry]
@@ -83,18 +97,19 @@ 

         gv.desktop

  

  #Icon

- mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps

- cp -p %SOURCE1 $RPM_BUILD_ROOT%{_datadir}/pixmaps

+ mkdir -p %{buildroot}%{_datadir}/pixmaps

+ cp -p %SOURCE1 %{buildroot}%{_datadir}/pixmaps

  

  # Remove info dir file

- rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir

- 

- 

+ rm -f %{buildroot}%{_infodir}/dir

  

+ %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 27)

  %post

  /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

+ %if (0%{?rhel} && 0%{?rhel} <= 7)

  /usr/bin/update-mime-database /usr/share/mime > /dev/null 2>&1 || :

  /usr/bin/update-desktop-database /usr/share/applications > /dev/null 2>&1 || :

+ %endif

  

  

  %preun
@@ -103,15 +118,19 @@ 

  fi

  

  

+ %if (0%{?rhel} && 0%{?rhel} <= 7)

  %postun

  if [ $1 = 0 ]; then

      /usr/bin/update-mime-database /usr/share/mime > /dev/null 2>&1 || :

      /usr/bin/update-desktop-database /usr/share/applications > /dev/null 2>&1 || :

  fi

+ %endif

+ %endif

  

  

  %files

- %doc AUTHORS ChangeLog COPYING NEWS README

+ %license COPYING

+ %doc AUTHORS ChangeLog NEWS README

  %{_bindir}/ghostview

  %{_bindir}/gv

  %{_bindir}/gv-update-userconfig
@@ -124,6 +143,11 @@ 

  

  

  %changelog

+ * Thu Jun 14 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.7.4-17

+ - Fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1536211

+ - Clean up spec a bit.

+ - Conditionalize scriptlet bits which shouldn't exist on various releases.

+ 

  * Thu Jun 14 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.7.4-16

  - Change dependency from ghostscript to ghostscript-x11 to match the

    reorganized ghostscript package.
@@ -369,7 +393,7 @@ 

  * Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>

  - handle compressed man pages

  

- * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 

+ * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>

  - auto rebuild in the new build environment (release 7)

  

  * Mon Jan 25 1999 Michael Maher <mike@redhat.com>

For some reason I spent some time and cleaned up the spec a bit and fixed https://bugzilla.redhat.com/show_bug.cgi?id=1536211 as well.

My previous commit wasn't actually compatible with EL6 and EL7 as they don't have the ghostscript-x11 package., I know you prefer one spec for everything, so this should fix that. I also conditionalized the scriptlets and scriptlet dependencies; F28+ needs none of the scriptlets, F27 just needs the info one. Of course EPEL needs them all.

I tested as well as I am able on F28, F27, EPEL7 and EPEL6 and it appears to work fine on all of them.

Hope this helps. If you just want me to commit this myself, just let me know.

@tibbs this looks good to me, but I'm afraid it needs a rebase now.

Metadata