Bug 669311 - Review Request: mupdf - A lightweight PDF viewer and toolkit written in portable C
Summary: Review Request: mupdf - A lightweight PDF viewer and toolkit written in port...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mohamed El Morabity
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 668959
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-13 10:01 UTC by Pavel Zhukov
Modified: 2013-09-05 12:14 UTC (History)
7 users (show)

Fixed In Version: mupdf-0.7-7.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-08 21:19:32 UTC
pikachu.2014: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)
Patch to enable shared lib build (3.36 KB, patch)
2011-01-13 12:48 UTC, Mohamed El Morabity
no flags Details | Diff
Patch to enable share library build (3.50 KB, patch)
2011-01-13 14:23 UTC, Mohamed El Morabity
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Ghostscript 691884 None None None Never
Ghostscript 691885 None None None Never
Ghostscript 691887 None None None Never

Description Pavel Zhukov 2011-01-13 10:01:36 UTC
Spec URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf.spec
SRPM URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf-0.7-1.fc14.src.rpm

mock: ok 
koji: none because depends on https://bugzilla.redhat.com/668959

Description: 
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
The renderer in MuPDF is tailored for high quality anti-aliased
graphics.  MuPDF renders text with metrics and spacing accurate to
within fractions of a pixel for the highest fidelity in reproducing
the look of a printed page on screen.
MuPDF has a small footprint.  A binary that includes the standard
Roman fonts is only one megabyte.  A build with full CJK support
(including an Asian font) is approximately five megabytes.
MuPDF has support for all non-interactive PDF 1.7 features, and the
toolkit provides a simple API for accessing the internal structures of
the PDF document.  Example code for navigating interactive links and
bookmarks, encrypting PDF files, extracting fonts, images, and
searchable text, and rendering pages to image files is provided.

Comment 1 Mohamed El Morabity 2011-01-13 11:01:09 UTC
I will review this package.

Comment 2 Mohamed El Morabity 2011-01-13 12:47:08 UTC
* You can remove libX11-devel from the BuildRequires, since it is already
  required by libXext-devel

* The compilation logs are not very verbose. Especially compilation flags cannot
  be checked. Fortunately the Makefile provides a "verbose" variable to view all
  compilation commands. Please enable it:
     %build
     make %{?_smp_mflags} verbose=1

* The fix on the previous point leads to see that standard Fedora compilation
  flags ("%{optflags}") are not used att all. They *must* be called by the
  compiler:
     http://fedoraproject.org/wiki/PackagingGuidelines#Compiler_flags
  I suggest you the following fix:
  - add the following line in %prep:
       %prep
       [...]
       sed -i "s/CFLAGS := /CFLAGS ?=\nCFLAGS += /" Makerules
    It will allow passing custom CFLAGS values. Since it is a small fix, I
    thought using sed would be more appropriate than a patch.
  - add the following on in %build:
       %build
       export CFLAGS="%{optflags}"
       make %{?_smp_mflags} verbose=1

* You have removed the static library libmupdf.a, and it's probably a good thing
  according to the guidelines. Unfortunately there is no corresponding shared
  library (.so file), and so your -devel package is completely useless. I
  suggest you to report also this issue to upstream.

  I attach to this review a patch to build a dynamic version of libmupdf.a
  (libmupdf.so), and to link the executables to this one, instead of embedding
  the static lib. Anyway it is maybe not usable as is: it is not versionned and
  that's a things to be discussed with upstream.

Comment 3 Mohamed El Morabity 2011-01-13 12:48:28 UTC
Created attachment 473308 [details]
Patch to enable shared lib build

Comment 4 Mohamed El Morabity 2011-01-13 14:21:52 UTC
Since your .desktop file has a MimeType entry, you should update the desktop
database as described here:
   http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#desktop-database

It seems that mupdf cannot be launched from the menu: it expects necessarily a
PDF path as argument. The .desktop file should not be displayed anyway, even if
it is required to allow opening PDFs from the file explorer by a right-click. I
suggest you to add the following line:
   NoDisplay=true
to mupdf.desktop file.

I've also update the shared library path to include a versionned library (set to
mupdf version). Anyway, as said above, it would need upstream validation.

Comment 5 Mohamed El Morabity 2011-01-13 14:23:54 UTC
Created attachment 473330 [details]
Patch to enable share library build

Comment 6 Pavel Zhukov 2011-01-13 15:48:23 UTC
- Fixed shared libs
- fixed desktop file
- fixed CFLAGS
- fixed desktop database

Spec URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf.spec
SRPM URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf-0.7-2.fc14.src.rpm

Comment 7 Susi Lehtola 2011-01-13 16:28:26 UTC
A few comments:

- I think you can safely drop the unnecessary "written in portable C" part of the summary.

- Mixing %{name} and "mupdf" in %files (and %install) is bad style. Please stick choose a convention and stick with it.

- There's also no need to use %{__chmod} for chmod, although there is currently no guideline forbidding it.

- In general, one can override variables such as CFLAGS with e.g.
 make verbose=1 CFLAGS="%{optflags}"
However, in this case the Makefile is badly written as includes are made part of CFLAGS. Thus one would either have to manually append the necessary includes to the overriding definition, or apply a patch.

Running sed may result in the same thing, but it also can break silently. Using patches is a lot safer in this respect.

- The -devel package should have
 Requires:  %{name} = %{version}-%{release}
instead of the plain
 Requires:  %{name} = %{version}

Comment 8 Pavel Zhukov 2011-01-13 20:43:57 UTC
Thank you for comment
- droped
- fixed 
- I'm prefer to use %{__command} instead bash command. It's not fobidden by GuideLnes
- fixed (Patch3), as I see CFLAGS is eq. %{optflags}. Please check it.
- fixed Requires
- created upstream bugs for all patches (please see related bugs)
- fixed so name 

Spec URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf.spec
SRPM URL: http://landgraf.fedorapeople.org/packages/requested/mupdf/mupdf-0.7-2.fc14.src.rpm

Comment 9 Jason Tibbitts 2011-01-13 20:54:22 UTC
Is there any particular reason you want to use %{__foo}?  The extra typing and reduced readability is somehow enjoyable?

Honestly, I'm trying to understand this because FPC has talked about recommending against using pointless macros, and if there's actually a reasonable argument for them I'd certainly like to hear it.

Comment 10 Peter Lemenkov 2011-01-13 21:03:00 UTC
I'm afraid that mupdf-libdir.patch won't fix installation on x86_64.

Instead of adding

LIBDIR := $(prefix)/lib

you need to add 

LIBDIR ?= $(prefix)/lib

Comment 11 Pavel Zhukov 2011-01-13 21:28:28 UTC
Peter,
I've checked it:

rpm -ql mupdf | grep libmupdf
/usr/lib64/libmupdf.so.0.7

rpm -ql mupdf-devel | grep libmupdf
/usr/lib64/libmupdf.so

mupdf works perfectly.
So, do I have to replace "LIBDIR := $(prefix)/lib" anyway?


Jason, I read http://fedoraproject.org/wiki/Packaging/ReviewGuidelines (MUST: Each package must consistently use macros.). After this I've replaced all my foo to %{__foo}. Is it wrong? I'll fix if It's

Comment 12 Susi Lehtola 2011-01-13 22:19:37 UTC
(In reply to comment #11)
> Jason, I read http://fedoraproject.org/wiki/Packaging/ReviewGuidelines (MUST:
> Each package must consistently use macros.). After this I've replaced all my
> foo to %{__foo}. Is it wrong? I'll fix if It's

The review guideline refers to
http://fedoraproject.org/wiki/Packaging/Guidelines#Macros

The consistency means that you should not mix using %{buildroot} and $RPM_BUILD_ROOT, or %{optflags} and $RPM_OPT_FLAGS, since these mean the same thing.

Comment 13 Pavel Zhukov 2011-01-14 06:30:14 UTC
Jussi,
I have NOT mixed %{buildroot} and $RPM_BUILD_ROOT, or %{optflags} and $RPM_OPT_FLAGS in my packages. I'm using macros %{__foo} instead foo according review guidelines. Please point me reasons to don't use it

Comment 14 Susi Lehtola 2011-01-14 08:18:57 UTC
(In reply to comment #13)
> Jussi,
> I have NOT mixed %{buildroot} and $RPM_BUILD_ROOT, or %{optflags} and
> $RPM_OPT_FLAGS in my packages.

I know.

(In reply to comment #11)
> Jason, I read http://fedoraproject.org/wiki/Packaging/ReviewGuidelines (MUST:
> Each package must consistently use macros.). After this I've replaced all my
> foo to %{__foo}. Is it wrong? I'll fix if It's

It's not wrong, it's just bad style since it makes spec files a lot harder to read (Jason put it aptly in comment #9 ).

Comment 15 Pavel Zhukov 2011-01-14 10:52:18 UTC
I haven't any additional reasons to use %{_foo} aginst foo. 
There is  example in Guidelines with %{__sed} (not sed) using and I prefer to use it for correct packaging according FPG

Comment 17 Jason Tibbitts 2011-01-14 13:35:36 UTC
I found a single instance of %{__sed} in the main packaging guidelines, which I have converted to "sed".  If you were referring to something else, please let me know.

Comment 18 Pavel Zhukov 2011-01-14 13:51:51 UTC
Ok. I'll use command instead pointless macros. I've replaced the spec file already. 
Thank you and sorry for confusion.

Comment 19 Mohamed El Morabity 2011-01-19 15:41:30 UTC
Thanks to all contributors who made comments on this review. The RPM looks quite fine now.
Just a small comment: you should use %{_prefix} instead of /usr explicitely:
     make DESTDIR=%{buildroot} install prefix=%{buildroot}/%{_prefix} LIBDIR=%{buildroot}%{_libdir}

Anyway the shared library issue is still there, and an upstream approval for the corresponding patch is necessary; even if the patch does its job, it can certainly be improved, moreover the choice of the ABI version belongs to the mupad developers.
The approval of this package will depend on the upstream answer, whatever it is.
Pavel, I invite you to report it to mupad devs as soon as possible, by explaining our current policy concerning static libraries.

Comment 20 Mohamed El Morabity 2011-01-19 15:44:46 UTC
Sorry for the NEEDINFO, I've just seen your bug report about the shared libs:
   http://bugs.ghostscript.com/show_bug.cgi?id=691887
So let's wait :)

Comment 21 Pavel Zhukov 2011-02-02 19:55:57 UTC
upstream bug 691884 - fixed
ipstream bug 691887 - shared library patch has been rejected please see http://bugs.ghostscript.com/show_bug.cgi?id=691887

Do i have close this bug as CANTFIX or UPSTREAM?

Comment 22 Pavel Zhukov 2011-02-02 20:59:50 UTC
Bug closed. Upstream rejects patch for shared libraries without any reasons.

Comment 23 Mohamed El Morabity 2011-02-03 11:12:56 UTC
Do you really want to give up this review? Static libraries are not completely forbidden in Fedora, only discouraged. And I believe that the fact that upstream doesn't want to support shared libraries is a good reason to provide anyway static libs in this package.
There was a similar case some months ago:
   https://bugzilla.redhat.com/show_bug.cgi?id=602279

If you're willing to re-open this review, I suggest you to carefully consider the guidelines relative to static libs:
   http://fedoraproject.org/wiki/Packaging/Guidelines#Packaging_Static_Libraries

mupdf is interesting enough to be distributed through the Fedora repos, in spite of the static lib.

Comment 24 Pavel Zhukov 2011-02-03 11:59:13 UTC
Mohamed, 
I am sorry for irascibility

Mupdf is good software and I'm using it but I Has been surprised by behaviour of developers.

So, Do I rebuild mupdf to use static libraries and build mudpf-static package?

Comment 25 Mohamed El Morabity 2011-02-05 13:06:46 UTC
(In reply to comment #24)
> Mohamed, 
> I am sorry for irascibility
No problem, in fact I didn't felt any irascibility here :)

> So, Do I rebuild mupdf to use static libraries and build mudpf-static package?
Yes. Just keep in mind that since we will only provide a static library, no mupdf-static subpackage is needed; the mupdf-devel package will embed the static library.

Comment 27 Mohamed El Morabity 2011-02-07 09:35:10 UTC
The devel subpackage needs to provide also mupdf-static, as described in the guidelines, since it contains only a static library:
   %package devel
   Summary:        Development files for %{name}
   Group:          Development/Libraries
   Requires:       %{name} = %{version}-%{release}
   Provides:       %{name}-static = %{version}-%{release}

rpmlint detects bad rights on libmupdf.a:
   mupdf-devel.x86_64: W: spurious-executable-perm /usr/lib64/libmupdf.a
You should set its rights to 0644 in %install.

(In reply to comment #19)
> Just a small comment: you should use %{_prefix} instead of /usr explicitely:
>      make DESTDIR=%{buildroot} install prefix=%{buildroot}/%{_prefix} LIBDIR=%{buildroot}%{_libdir}
Don't forget this too ;)

Comment 29 Mohamed El Morabity 2011-02-07 10:45:52 UTC
At line 90 of your .spec:
   %attr(0644,root,root.-) %{_libdir}/libmupdf.a
Using %attr is maybe excessive. Calling « chmod 0644 %{buildroot}%{_libdir}/libmupdf.a » in %install should be safer and more simple.

Once this last issue fixed, I will (at last!) approve this package :)

Comment 30 Pavel Zhukov 2011-02-07 11:04:44 UTC
fixed 
Use tHe same links. 
Koji ok.
https://koji.fedoraproject.org/koji/taskinfo?taskID=2766703

Comment 31 Mohamed El Morabity 2011-02-07 15:13:20 UTC
Here is the review :)

MUST: rpmlint must be run on every package.
->OK, no significant warnings

MUST: The package must be named according to the Package Naming Guidelines.
->OK

MUST: The spec file name must match the base package %{name}, in the format
      %{name}.spec unless your package has an exemption.
->OK

MUST: The package must meet the Packaging Guidelines.
->OK

MUST: The package must be licensed with a Fedora approved license and meet the
      Licensing Guidelines.
->OK

MUST: The License field in the package spec file must match the actual license.
->OK

MUST: If (and only if) the source package includes the text of the license(s) in
      its own file, then that file, containing the text of the license(s) for
      the package must be included in %doc.
->OK

MUST: The spec file must be written in American English.
->OK

MUST: The spec file for the package MUST be legible.
->OK

MUST: The sources used to build the package must match the upstream source, as
      provided in the spec URL.
->OK, md5sum = 83adc4d14eb17835df791a9a0d1e8fa9

MUST: The package MUST successfully compile and build into binary rpms on at
      least one primary architecture.
->OK

MUST: If the package does not successfully compile, build or work on an
      architecture, then those architectures should be listed in the spec in
      ExcludeArch.
->N/A

MUST: All build dependencies must be listed in BuildRequires, except for any
      that are listed in the exceptions section of the Packaging Guidelines ;
      inclusion of those as BuildRequires is optional.
->OK

MUST: The spec file MUST handle locales properly. This is done by using the
      %find_lang macro. Using %{_datadir}/locale/* is strictly forbidden.
->N/A

MUST: Every binary RPM package (or subpackage) which stores shared library files
      (not just symlinks) in any of the dynamic linker's default paths, must
      call ldconfig in %post and %postun.
->N/A

MUST: Packages must NOT bundle copies of system libraries.
->OK

MUST: If the package is designed to be relocatable, the packager must state this
      fact in the request for review, along with the rationalization for
      relocation of that specific package. Without this, use of Prefix: /usr is
      considered a blocker.
->N/A

MUST: A package must own all directories that it creates. If it does not create
      a directory that it uses, then it should require a package which does
      create that directory.
>OK

MUST: A Fedora package must not list a file more than once in the spec file's
      %files listings. 
->OK

MUST: Permissions on files must be set properly. Executables should be set with
      executable permissions, for example. Every %files section must include a
      %defattr(...) line.
->OK

MUST: Each package must consistently use macros.
->OK

MUST: The package must contain code, or permissable content.
->OK

MUST: Large documentation files must go in a -doc subpackage.
->N/A

MUST: If a package includes something as %doc, it must not affect the runtime of
      the application. To summarize: If it is in %doc, the program must run
      properly if it is not present.
->OK

MUST: Header files must be in a -devel package.
->OK

MUST: Static libraries must be in a -static package.
->OK

MUST: If a package contains library files with a suffix (e.g. libfoo.so.1.1),
      then library files that end in .so (without suffix) must go in a -devel
      package.
->N/A

MUST: In the vast majority of cases, devel packages must require the base
      package using a fully versioned dependency: Requires: %{name} =
      %{version}-%{release}.
->OK

MUST: Packages must NOT contain any .la libtool archives, these must be removed
      in the spec if they are built.
->OK

MUST: Packages containing GUI applications must include a %{name}.desktop file,
      and that file must be properly installed with desktop-file-install in the
      %install section.
->OK

MUST: Packages must not own files or directories already owned by other
      packages.
->OK

MUST: All filenames in rpm packages must be valid UTF-8.
->OK

This package is approved.

Comment 32 Pavel Zhukov 2011-02-07 15:17:00 UTC
Thank you for review. 



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 33 Pavel Zhukov 2011-02-07 15:18:23 UTC
New Package CVS Request
=======================
Package Name: mupdf
Short Description: A lightweight PDF viewer and toolkit
Owners: landgraf
Branches: F-13 F-14
InitialCC: 




-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 34 Bill Nottingham 2011-02-08 20:05:48 UTC
Git done (by process-git-requests).

Comment 35 Fedora Update System 2011-02-08 20:42:47 UTC
mupdf-0.7-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mupdf-0.7-6.fc14

Comment 36 Fedora Update System 2011-02-08 21:16:14 UTC
mupdf-0.7-7.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mupdf-0.7-7.fc13

Comment 37 Fedora Update System 2011-02-18 01:49:03 UTC
mupdf-0.7-7.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 38 Pavel Zhukov 2013-09-05 07:16:10 UTC
Package Change Request
======================
Package Name: mupdf
New Branches: el6
Owners: landgraf

Comment 39 Gwyn Ciesla 2013-09-05 12:14:03 UTC
Git done (by process-git-requests).


Note You need to log in before you can comment on or make changes to this bug.