Bug 190071 - [stage] japanese/k12: Remove use of pkg-req
Summary: [stage] japanese/k12: Remove use of pkg-req
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-21 15:10 UTC by WATANABE Kazuhiro
Modified: 2014-09-06 17:56 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (8.37 KB, patch)
2014-05-21 15:10 UTC, WATANABE Kazuhiro
no flags Details | Diff
a new patch for japanese/k12 that uses @fontsdir (8.55 KB, patch)
2014-08-24 13:19 UTC, WATANABE Kazuhiro
no flags Details | Diff
poudriere ja-kaname12-1.1_3.log (with the new patch) (9.06 KB, text/x-log)
2014-08-25 14:05 UTC, WATANABE Kazuhiro
no flags Details
Update patch for japanese/k12 (7.40 KB, patch)
2014-09-02 14:03 UTC, WATANABE Kazuhiro
no flags Details | Diff
poudriere testport log (9.1-RELEASE amd64) (12.03 KB, text/x-log)
2014-09-02 14:05 UTC, WATANABE Kazuhiro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description WATANABE Kazuhiro 2014-05-21 15:10:00 UTC
* Use pkg-install/pkg-deinstall scripts instead of pkg-req.
* Add staging support.
* Use OPTIONS_DEFINE=DOCS instead of NOPORTDOCS.
* Remove a URL which has gone from MASTER_SITES.
* Remove a verbose dependency from RUN_DEPENDS.
* Remove fonts.alias update command (@unexec) from pkg-plist.
  It's done by pkg-deinstall.  
* Remove fonts.alias from pkg-plist.
  It's handled by pkg-install/pkg-deinstall.  

These modification are derived from japanese/elisa8x8.  Thanks!
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-06-21 21:48:15 UTC
Thank you for the patch.

I believe pkg-install and pkg-deinstall are superfluous here -- replacing all the manual mkfont{dir,scale} handling with the @fontsdir keyword as described in http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-keywords.html should allow you to trim even more fat from the port.
Comment 2 John Marino freebsd_committer freebsd_triage 2014-07-26 14:45:46 UTC
in other words, a new patch is expected to be submitted in order to progress.
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-11 12:23:29 UTC
rakuco, if it's up to me I'd close the PR as the port is going to be removed in 2 weeks.  Maybe you want to salvage it?
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-08-11 18:13:47 UTC
Nah, I already have way too many things to do. Closing.
Comment 5 WATANABE Kazuhiro 2014-08-24 13:19:48 UTC
Created attachment 146212 [details]
a new patch for japanese/k12 that uses @fontsdir
Comment 6 WATANABE Kazuhiro 2014-08-24 13:26:06 UTC
Hello.

I've created (and posted) a new patch that uses @fontsdir in pkg-plist.
And I want to take ownership of this port.

Would you consider committing the new patch?  Sorry for my slow reply.
Comment 7 John Marino freebsd_committer freebsd_triage 2014-08-24 15:58:53 UTC
change you paste output of "make check-plist" followed by "make stage-qa" ?
Comment 8 WATANABE Kazuhiro 2014-08-25 07:28:10 UTC
With the old patch the following tests are finished normally.
Only with the new patch (@fontsdir in pkg-plist) "make check-plist" says error like this:

root@aquarius-vm:/usr/ports/japanese/k12 # make check-plist
===>  Found saved configuration for ja-kaname12-1.1_3
===>   ja-kaname12-1.1_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by ja-kaname12-1.1_3 for building
===>  Extracting for ja-kaname12-1.1_3
===>  Found saved configuration for ja-kaname12-1.1_3
===>   ja-kaname12-1.1_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by ja-kaname12-1.1_3 for building
=> SHA256 Checksum OK for kaname_k12_bdf.tar.gz.
=> SHA256 Checksum OK for knm_new_linux.tar.gz.
===>  Patching for ja-kaname12-1.1_3
===>  Applying FreeBSD patches for ja-kaname12-1.1_3
===>   ja-kaname12-1.1_3 depends on executable: bdftopcf - found
===>  Configuring for ja-kaname12-1.1_3
===>  Building for ja-kaname12-1.1_3
bdftopcf knmhn12x.bdf > knmhn12x.pcf
gzip -9 -nf knmhn12x.pcf
===>  Staging for ja-kaname12-1.1_3
===>   ja-kaname12-1.1_3 depends on executable: mkfontdir - found
===>   Generating temporary packing list
if [ ! -d /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local ] ; then  /bin/mkdir -p /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local ; fi
install  -o root -g wheel -m 444 kaname-latin1.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
install  -o root -g wheel -m 444 knm12p.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
install  -o root -g wheel -m 444 knm12pb.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
install  -o root -g wheel -m 444 knmhn12x.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
install  -o root -g wheel -m 444 knmzn12x.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
install  -o root -g wheel -m 444 knmzn12xb.pcf.gz /FreeBSD/ports/japanese/k12/work/stage/usr/local/lib/X11/fonts/local
====> Compressing man pages (compress-man)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for directories owned by MTREEs
Error: Owned by MTREE: @dirrmtry %%FONTSDIR%%
===> Checking for directories handled by dependencies
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** [check-plist] Error code 1

Stop in /FreeBSD/ports/japanese/k12.
root@aquarius-vm:/usr/ports/japanese/k12 # make stage-qa
====> Running Q/A tests (stage-qa)
root@aquarius-vm:/usr/ports/japanese/k12 #
Comment 9 John Marino freebsd_committer freebsd_triage 2014-08-25 09:12:56 UTC
I suspect you can remove these lines now:

@exec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir
@unexec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir
@unexec if [ `wc -c %D/%%FONTSDIR%%/fonts.dir | awk '{print $1}'` = 2 ]; then rm  -f %D/%%FONTSDIR%%/fonts.dir; fi
@unexec if [ ! -s %D/%%FONTSDIR%%/fonts.alias ]; then rm -f %D/%%FONTSDIR%%/fonts.alias; fi 

and it should build without stage-qa errors
Comment 10 WATANABE Kazuhiro 2014-08-25 14:05:45 UTC
Created attachment 146253 [details]
poudriere ja-kaname12-1.1_3.log (with the new patch)

First, thanks for your many fix about japanese/alias-fonts!
BTW...

(In reply to John Marino from comment #9)
> I suspect you can remove these lines now:
> 
> @exec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir
> @unexec cd %D/%%FONTSDIR%% ; %D/bin/mkfontdir
> @unexec if [ `wc -c %D/%%FONTSDIR%%/fonts.dir | awk '{print $1}'` = 2 ];
> then rm  -f %D/%%FONTSDIR%%/fonts.dir; fi
> @unexec if [ ! -s %D/%%FONTSDIR%%/fonts.alias ]; then rm -f
> %D/%%FONTSDIR%%/fonts.alias; fi 
> 
> and it should build without stage-qa errors

Of course it has been done by the new patch.
I attach a poudriere's log (testport with the new patch).
It says the same error.
Comment 11 John Marino freebsd_committer freebsd_triage 2014-08-25 21:23:59 UTC
Try restoring this:

RUN_DEPENDS=    mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \
                mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale

I see this in x11-fonts/montecarlo_fonts and emulators/pcemu, two ports that use @fontsdir.
Comment 12 WATANABE Kazuhiro 2014-08-27 13:22:25 UTC
(In reply to John Marino from comment #11)
> Try restoring this:
(snip)
> I see this in x11-fonts/montecarlo_fonts and emulators/pcemu, two ports that
> use @fontsdir.

There is no difference. Same error.

FreeBSD Porter's Handbook say:
| 7.6.3. @fontsdir directory
|
|  Add a @dirrmtry entry for the directory passed as an argument, and run
|  mkfontscale and mkfontdir on that directory after installation and
|  deinstallation. Additionally, on deinstallation, it removes the
|  fonts.scale and fonts.dir cache files if they are empty.

Ports that uses @fontsdir, @fc and @fcfontsdir (currently 24 ports are found) 
creates its own directory (e.g. ${PREFIX}/lib/X11/fonts/${PORTNAME}/),
and install fonts to it. 
If the ports are deleted, that directory should be deleted (via @dirrmtry
described above).

The k12 port installs fonts to ${PREFIX}/lib/X11/fonts/local/.
It's a standard (?) X11 site-local font directory.
Even if this port is deleted, this directory should not be deleted.

So "make check-plist" said "Error: Owned by MTREE: @dirrmtry %%FONTSDIR%%".

I think the use of "@fontsdir %%FONTSDIR%%" in this port is a bit difficult.  
It may be a better choice to run mkfontdir manually (like my previous patch).
Comment 13 John Marino freebsd_committer freebsd_triage 2014-08-27 19:58:49 UTC
so you are saying the problem is that the directory fontsdir is defined as happens to be an MTREE directory, correct?

In other words, if the port used a different directory for fontsdir, we wouldn't see the error.


Is K12 correct to use a standard directory?
Comment 14 WATANABE Kazuhiro 2014-08-30 09:29:01 UTC
When I setup FreeBSD with X, I always find the lib/X11/fonts/local directory.
So I have believed that the directory is a part of X11.
But it seems that it isn't.

It seems that this directory appears a generally-created directory
in many cases on the web.
In the FreeBSD ports collection many ports install fonts to the directory.
This directory is shared with these ports.

In fact the FreeBSD Porter's Handbook say:
| 6.9.3. X11 Fonts
|  If your port installs fonts for the X Window System, put them in
|  LOCALBASE/lib/X11/fonts/local.
(But this description is old..?)

(In reply to John Marino from comment #13)
> so you are saying the problem is that the directory fontsdir is defined as
> happens to be an MTREE directory, correct?

Only this directory has been described in BSD.local.dist since 2007 [1],
and the other similar directories (misc, TTF, etc.) are not described.
I cannot find any discussion about this without [2].

As a result, @fontsdir for the directory always causes a mtree-related error by
@dirrmtry (spawned by @fontsdir) with "make check-plist".

> In other words, if the port used a different directory for fontsdir, we
> wouldn't see the error.
> 
> Is K12 correct to use a standard directory?

In recent FreeBSD, many of ports that installs fonts, especially TrueType
fonts, create its own directory and install fonts to it (manually or 
automatically by bsd.xorg.mk).

I don't mind changing the install directory.  Do you want me to do it?
If so, I'll create a new patch.

[1] http://lists.freebsd.org/pipermail/freebsd-x11/2005-February/001646.html
[2] http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-February/272418.h
tml
Comment 15 John Marino freebsd_committer freebsd_triage 2014-08-30 11:25:44 UTC
(In reply to WATANABE Kazuhiro from comment #14)
> When I setup FreeBSD with X, I always find the lib/X11/fonts/local directory.
> So I have believed that the directory is a part of X11.
> But it seems that it isn't.

Actually, it is.
See /usr/ports/Templates/BSD.local.dist

You don't attempt to remove files installed by mtree.


> Only this directory has been described in BSD.local.dist since 2007 [1],
> and the other similar directories (misc, TTF, etc.) are not described.
> I cannot find any discussion about this without [2].
> 
> As a result, @fontsdir for the directory always causes a mtree-related error
> by @dirrmtry (spawned by @fontsdir) with "make check-plist".


okay, so you already figured that out.


> I don't mind changing the install directory.  Do you want me to do it?
> If so, I'll create a new patch.

Sure, why not?  Especially if all the other ports that use @fontsdir use it with no-mtree directories.  If the directory is not sacred then it's nice if the port builds cleanly.
Comment 16 WATANABE Kazuhiro 2014-09-02 14:03:37 UTC
Created attachment 146683 [details]
Update patch for japanese/k12

* Remove pkg-req.
* Add staging support.
* Change the install directory.
* Use @fontsdir in pkg-plist.
* Remove fonts.alias update command (@unexec) from pkg-plist.
  Simply install it via Makefile.

* Use OPTIONS_DEFINE=DOCS instead of NOPORTDOCS.
* Remove a URL which has gone from MASTER_SITES.
* Remove a verbose dependency from RUN_DEPENDS.

* Take maintainership.
Comment 17 WATANABE Kazuhiro 2014-09-02 14:05:45 UTC
Created attachment 146684 [details]
poudriere testport log (9.1-RELEASE amd64)
Comment 18 John Marino freebsd_committer freebsd_triage 2014-09-02 14:21:37 UTC
Thanks, that looks much better.  I'm moving this to the patch-ready pool now.
Comment 19 commit-hook freebsd_committer freebsd_triage 2014-09-06 17:55:00 UTC
A commit references this bug:

Author: marino
Date: Sat Sep  6 17:54:32 UTC 2014
New revision: 367460
URL: http://svnweb.freebsd.org/changeset/ports/367460

Log:
  Stage and revamp japanese/k12, assign maintainership to submitter

   * Add stage support
   * Replace NOPORTDOCS with option DOCS
   * Remove bad URL from MASTER_SITES
   * Convert to @fontsdir keywork (affects dependencies and pkg-plist)
   * Remove pkg-req (@fontsdir takes over its task)
   * Install directory has changed as a result (lib/X11/fonts/kaname12)

  PR:		190071
  Submitted by:	WATANABE Kazuhiro

Changes:
  head/japanese/k12/Makefile
  head/japanese/k12/files/fonts.alias
  head/japanese/k12/files/patch-aa
  head/japanese/k12/files/pkg-message.in
  head/japanese/k12/pkg-plist
  head/japanese/k12/pkg-req
Comment 20 John Marino freebsd_committer freebsd_triage 2014-09-06 17:56:19 UTC
All the post-install commands were masked so I unsuppressed them and wrapped at 80-columns in one case.

Thanks for the contribution!