[Bug 859246] Review Request: cmap - Adobe pdf character mapping data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Product: Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=859246

--- Comment #1 from Michael Schwendt <mschwendt@xxxxxxxxx> ---
I'm afraid I'm not familiar with this or poppler-data to help.

It could be an idea to talk to the poppler-data maintainers (it's a separate
poppler-data src.rpm) and also figure out whether there are any requirements
related to the names of the directories where the files are stored. For
poppler-data the files are stored in a private path /usr/share/poppler/cMap/.
The paths of this package don't have much in common.

  $ rpmls poppler-data |grep Adobe-CNS1-0
  lrwxrwxrwx  /usr/share/ghostscript/9.06/Resource/CMap/Adobe-CNS1-0
  -rw-r--r--  /usr/share/poppler/cMap/Adobe-CNS1/Adobe-CNS1-0

  $ rpmls -p cmap-1.6-0.fc19.noarch.rpm |grep Adobe-CNS1-0
  -rw-r--r--  /usr/share/cmap/ac16/CMap/Adobe-CNS1-0

It's also unlikely that anything knows where to find the files due to those
extra topdir below /usr/share/cmap/, such as "ac16". Likely some symlinking
magic will be necessary.

The texlive-adobemapping package (subpackage of texlive) also contains cmap
files.

[...]

The packaging is somewhat strange. If one examines the rpmbuild output:

Executing(%prep): ...
+ umask 022
+ cd /home/misc/tmp/rpm/BUILD
+ cd /home/misc/tmp/rpm/BUILD
+ mkdir -p cmap-1.6
+ cd /home/misc/tmp/rpm/BUILD
+ rm -rf cmap-1.6
+ /usr/bin/mkdir -p cmap-1.6
+ cd cmap-1.6
...
and so on. There are some redundancies. Let's see:

> %prep
> cd %{_builddir}

Not necessary. At the beginning of %prep, you are automatically inside
%_builddir.

> mkdir -p %{name}-%{version}

Not necessary. The following line creates this directory, too:

> %setup -n cmap-1.6 -q -c

"-n cmap-1.6" is the default for your package, because "-n %{name}-%{version}"
is the default.

> %setup -n cmap-1.6 -q -T -D -a 1
> %setup -n cmap-1.6 -q -T -D -a 2
> %setup -n cmap-1.6 -q -T -D -a 3
> %setup -n cmap-1.6 -q -T -D -a 4

There's also an inconsistency in that you mix %{name}-%{version} and the
hardcoded cmap-1.6. It looks a bit like a result of trial-and-error.

The following %prep section could replace all your individual lines:

  %prep
  %setup -q -c -a 1 -a 2 -a 3 -a 4

[...]

> BuildRequires:  tar

Not needed.  https://fedoraproject.org/wiki/Packaging:Guidelines#Exceptions_2


> %install
> ...
> cp -r %{_builddir}/%{name}-%{version}/* %{buildroot}%{_datadir}/%{name}

At the beginning of %install, you're not just in %_builddir already but in the
directory as specified during %setup. You could reduce the cp line to:

   cp -pr * %{buildroot}%{_datadir}/%{name}

Option -p is typically used to preserve timestamps of pre-existing files.


> %doc %{_docdir}/%{name}/

Files below %_docdir are automatically marked as %doc. One could argue whether
to install documentation in a non-versioned /usr/share/cmap directory and not a
versioned dir like thousands of other packages do it. There are packaging
tricks to achieve that even for separate doc %SOURCE files. For example:

  %install
  ...
  rm -rf _tmpdoc ; mkdir _tmpdoc
  install -p -m0644 %SOURCE5 %SOURCE6 _tmpdoc
  ...

  %files
  ...
  %doc _tmpdoc/*


> a better versioning system used? (Snapshot style)?

Certainly sounds like a good idea, IMO. "Version: 0" and the download/checkout
date as part of "Release".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=Ojh9lxxtVS&a=cc_unsubscribe
_______________________________________________
package-review mailing list
package-review@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/package-review



[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]