Bug 188785 - [patch] graphics/libwmf - fix stage as non-root & use OPTIONS helpers
Summary: [patch] graphics/libwmf - fix stage as non-root & use OPTIONS helpers
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: Rene Ladan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-19 06:20 UTC by John Hein
Modified: 2014-04-23 23:20 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (403 bytes, patch)
2014-04-19 06:20 UTC, John Hein
no flags Details | Diff
file.diff (656 bytes, patch)
2014-04-19 06:20 UTC, John Hein
no flags Details | Diff
libwmf.diff (1.08 KB, patch)
2014-04-23 20:44 UTC, Antoine Brodin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2014-04-19 06:20:00 UTC
part 1
======
The ${CHOWN} in the post-install in print/ghostscript9/Makefile is not
needed - the created package specifies @owner root for packages that
have been created via the staging process.

Without this change, 'make stage' fails as a regular user (noticed
when using portmaster with PM_SU_CMD=/usr/local/bin/sudo).

part 2
======
Update port to use OPTIONS helpers.  No change in functionality.


Maybe this should have been 2 PRs.  Commit the changes in two commits
as desired.

Fix: No need to bump portrevision.

patch for part 1:
===================
===================


patch for part 2:
===================
Comment 1 Rene Ladan freebsd_committer freebsd_triage 2014-04-22 19:34:24 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rene

Take
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-04-22 19:40:27 UTC
Author: rene
Date: Tue Apr 22 18:40:24 2014
New Revision: 351871
URL: http://svnweb.freebsd.org/changeset/ports/351871
QAT: https://qat.redports.org/buildarchive/r351871/

Log:
  - Fix package build as non-root
  - Use option helpers
  
  Note that the CONFLICT with the -nox11 variant is not registered anymore.
  PR:		ports/188785
  Submitted by:	John Hein <john.hein@microsemi.com>

Modified:
  head/graphics/libwmf/Makefile

Modified: head/graphics/libwmf/Makefile
==============================================================================
--- head/graphics/libwmf/Makefile	Tue Apr 22 18:31:13 2014	(r351870)
+++ head/graphics/libwmf/Makefile	Tue Apr 22 18:40:24 2014	(r351871)
@@ -29,20 +29,12 @@ PORTDOCS=	*
 
 OPTIONS_DEFINE=	X11
 OPTIONS_DEFAULT=X11
+OPTIONS_SUB=	yes
 
+X11_USE=	XORG=x11
+X11_CONFIGURE_OFF=--with-x=no
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MX11}
-USE_XORG=	x11
-PLIST_SUB+=	X11=""
-CONFLICTS+=	libwmf-nox11-0.*
-.else
-PKGNAMESUFFIX=	-nox11
-CONFIGURE_ARGS+=	--with-x=no
-PLIST_SUB+=	X11="@comment "
-CONFLICTS+=	libwmf-0.*
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e 's|src include fonts doc|src include fonts|g' \
 		${WRKSRC}/Makefile.in
@@ -57,7 +49,6 @@ post-install:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	@${TAR} -C ${WRKSRC}/doc --exclude '*Makefile*' -cf - . | \
 		${TAR} -C ${STAGEDIR}${DOCSDIR} --unlink -xf -
-	@${CHOWN} -R ${SHAREOWN}:${SHAREGROUP} ${STAGEDIR}${DOCSDIR}
 .endif
 
 .include <bsd.port.mk>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Rene Ladan freebsd_committer freebsd_triage 2014-04-22 19:40:28 UTC
State Changed
From-To: open->closed

Committed, thanks
Comment 4 John Hein 2014-04-22 23:53:31 UTC
I have a followup patch which restores the conflict registration with
libwmf-nox11 (and the pkg name suffix for libwmf-nox11).  I was
unaware of the slave port when I did the first patch.

If you want me to open a new PR, just let me know.  Otherwise,
here you go:

Index: libwmf/Makefile
===================================================================
--- libwmf/Makefile	(revision 351873)
+++ libwmf/Makefile	(working copy)
@@ -10,6 +10,12 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tools and library for converting Microsoft WMF (windows metafile)
 
+.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == -nox11
+CONFLICTS+=	libwmf-[0-9]*
+.else
+CONFLICTS+=	libwmf-nox11-[0-9]*
+.endif
+
 LICENSE=	GPLv2
 
 BUILD_DEPENDS=	freetype-config:${PORTSDIR}/print/freetype2
Index: libwmf-nox11/Makefile
===================================================================
--- libwmf-nox11/Makefile	(revision 351873)
+++ libwmf-nox11/Makefile	(working copy)
@@ -1,6 +1,7 @@
 # Created by: mm@FreeBSD.org
 # $FreeBSD$
 
+PKGNAMESUFFIX=	-nox11
 PORTSCOUT=	ignore:1
 
 MASTERDIR=	${.CURDIR}/../libwmf
Comment 5 Rene Ladan freebsd_committer freebsd_triage 2014-04-23 12:07:35 UTC
I re-added the conflicts line, thanks

René


2014-04-23 0:53 GMT+02:00 John Hein <john.hein@microsemi.com>:

> I have a followup patch which restores the conflict registration with
> libwmf-nox11 (and the pkg name suffix for libwmf-nox11).  I was
> unaware of the slave port when I did the first patch.
>
> If you want me to open a new PR, just let me know.  Otherwise,
> here you go:
>
> Index: libwmf/Makefile
> ===================================================================
> --- libwmf/Makefile     (revision 351873)
> +++ libwmf/Makefile     (working copy)
> @@ -10,6 +10,12 @@
>  MAINTAINER=    ports@FreeBSD.org
>  COMMENT=       Tools and library for converting Microsoft WMF (windows
> metafile)
>
> +.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == -nox11
> +CONFLICTS+=    libwmf-[0-9]*
> +.else
> +CONFLICTS+=    libwmf-nox11-[0-9]*
> +.endif
> +
>  LICENSE=       GPLv2
>
>  BUILD_DEPENDS= freetype-config:${PORTSDIR}/print/freetype2
> Index: libwmf-nox11/Makefile
> ===================================================================
> --- libwmf-nox11/Makefile       (revision 351873)
> +++ libwmf-nox11/Makefile       (working copy)
> @@ -1,6 +1,7 @@
>  # Created by: mm@FreeBSD.org
>  # $FreeBSD$
>
> +PKGNAMESUFFIX= -nox11
>  PORTSCOUT=     ignore:1
>
>  MASTERDIR=     ${.CURDIR}/../libwmf
>
>



-- 
http://www.rene-ladan.nl/
Comment 6 John Hein 2014-04-23 15:00:39 UTC
I thought we generally are trying to get away from having
PKGNAMESUFFIX be dependent on OPTIONS settings.  That's why I put the
-nox11 suffix in the libwmf-nox11 Makefile - to make the pkg name
static (and match the origin directory).  So installing
graphics/libwmf with the X11 option turned off vs. on would not change
the package name.  It would only have a different pkg name if you
explicitly built the libwmf-nox11 port.

It's also a little confusing when someone first installs libwmf
with the X11 option turned off, then tries to update=20
the port down the road - maybe using
portmaster - and tries to install libwmf-nox11.  The ensuing error
message would be confusing:

=3D=3D=3D>  Installing for libwmf-nox11-0.2.8.4=5F11
=3D=3D=3D>  Checking if graphics/libwmf-nox11 already installed
=3D=3D=3D>   libwmf-nox11-0.2.8.4=5F11 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of graphics/libwmf-n=
ox11
      without deleting it first, set the variable "FORCE=5FPKG=5FREGIST=
ER"
      in your environment or the "make install" command line.

At which point the user gets confused because he is just trying to use
portmaster to update a port that is installed which should normally
work just fine.  He'd have to look at the origin to see that last time
he installed the libwmf port (even though the package name looks
otherwise) and that's why there's a conflict.

If we don't vary the name based on an OPTION setting, then the error
message becomes more clear:

=3D=3D=3D>  libwmf-nox11-0.2.8.4=5F11 conflicts with installed package(=
s):=20
      libwmf-0.2.8.4=5F11

      They install files into the same place.
      You may want to stop build with Ctrl + C.

And this error message shows up earlier (at the check-conflicts stage
before it tries to build the port).  The earlier error above doesn't
show up until after the build stage when it is trying to install.


It seems better to me to not have the package name vary based on an
option, but maybe I am only imagining this guideline=3F

Other than this subtle detail, it looks good.  Thanks.

Ren=E9 Ladan wrote at 13:07 +0200 on Apr 23, 2014:
 > I re-added the conflicts line, thanks
 >
 > Ren=E9
 >
 > 2014-04-23 0:53 GMT+02:00 John Hein <john.hein@microsemi.com>:
 >
 >     I have a followup patch which restores the conflict registration=
 with
 >     libwmf-nox11 (and the pkg name suffix for libwmf-nox11).  I was
 >     unaware of the slave port when I did the first patch.
 >
 >     If you want me to open a new PR, just let me know.  Otherwise,
 >     here you go:
 >
 >     Index: libwmf/Makefile
 >     =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 >     --- libwmf/Makefile     (revision 351873)
 >     +++ libwmf/Makefile     (working copy)
 >     @@ -10,6 +10,12 @@
 >      MAINTAINER=3D    ports@FreeBSD.org
 >      COMMENT=3D       Tools and library for converting Microsoft WMF=
 (windows metafile)
 >
 >     +.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} =3D=3D -nox11
 >     +CONFLICTS+=3D    libwmf-[0-9]*
 >     +.else
 >     +CONFLICTS+=3D    libwmf-nox11-[0-9]*
 >     +.endif
 >     +
 >      LICENSE=3D       GPLv2
 >
 >      BUILD=5FDEPENDS=3D freetype-config:${PORTSDIR}/print/freetype2
 >     Index: libwmf-nox11/Makefile
 >     =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 >     --- libwmf-nox11/Makefile       (revision 351873)
 >     +++ libwmf-nox11/Makefile       (working copy)
 >     @@ -1,6 +1,7 @@
 >      # Created by: mm@FreeBSD.org
 >      # $FreeBSD$
 >
 >     +PKGNAMESUFFIX=3D -nox11
 >      PORTSCOUT=3D     ignore:1
 >
 >      MASTERDIR=3D     ${.CURDIR}/../libwmf
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2014-04-23 15:05:39 UTC
Hi,

Yes maybe the PKGNAMESUFFIX= -nox11 belongs to the slave port only.
I had to do a quick fix before the weekly builds because the previous
change was breaking it (2 different ports producing the same package
name)

Cheers,

Antoine
Comment 8 John Hein 2014-04-23 16:20:30 UTC
Antoine Brodin wrote at 16:05 +0200 on Apr 23, 2014:
 > Yes maybe the PKGNAMESUFFIX= -nox11 belongs to the slave port only.
 > I had to do a quick fix before the weekly builds because the previous
 > change was breaking it (2 different ports producing the same package
 > name)

Understood.  Thanks for committing a fix.  That was my fault - I
failed to notice there was a slave port when I did the first patch.

Here's my current diff:

Index: graphics/libwmf/Makefile
===================================================================
--- graphics/libwmf/Makefile	(revision 351935)
+++ graphics/libwmf/Makefile	(working copy)
@@ -10,6 +10,12 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tools and library for converting Microsoft WMF (windows metafile)
 
+.if defined(PKGNAMESUFFIX) && ${PKGNAMESUFFIX} == -nox11
+CONFLICTS+=	libwmf-[0-9]*
+.else
+CONFLICTS+=	libwmf-nox11-[0-9]*
+.endif
+
 LICENSE=	GPLv2
 
 BUILD_DEPENDS=	freetype-config:${PORTSDIR}/print/freetype2
@@ -35,13 +41,6 @@
 X11_CONFIGURE_OFF=--with-x=no
 .include <bsd.port.options.mk>
 
-.if ! ${PORT_OPTIONS:MX11}
-PKGNAMESUFFIX=	-nox11
-CONFLICTS+=	libwmf-[0-9]*
-.else
-CONFLICTS+=	libwmf-nox11-[0-9]*
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e 's|src include fonts doc|src include fonts|g' \
 		${WRKSRC}/Makefile.in
Index: graphics/libwmf-nox11/Makefile
===================================================================
--- graphics/libwmf-nox11/Makefile	(revision 351935)
+++ graphics/libwmf-nox11/Makefile	(working copy)
@@ -1,6 +1,7 @@
 # Created by: mm@FreeBSD.org
 # $FreeBSD$
 
+PKGNAMESUFFIX=	-nox11
 PORTSCOUT=	ignore:1
 
 MASTERDIR=	${.CURDIR}/../libwmf
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2014-04-23 20:44:00 UTC
I have the attached patch which is simpler I think
Comment 10 John Hein 2014-04-23 23:09:43 UTC
Antoine Brodin wrote at 21:44 +0200 on Apr 23, 2014:
 > I have the attached patch which is simpler I think
 > Index: graphics/libwmf/Makefile
 > ===================================================================
 > --- graphics/libwmf/Makefile	(revision 351966)
 > +++ graphics/libwmf/Makefile	(working copy)
 > @@ -17,6 +17,8 @@
 >  		libpng.so:${PORTSDIR}/graphics/png \
 >  		libfreetype.so:${PORTSDIR}/print/freetype2
 >  
 > +CONFLICTS?=	libwmf-nox11-[0-9]*
 > +
 >  USE_AUTOTOOLS=	libtool
 >  USE_GNOME=	libxml2
 >  GNU_CONFIGURE=	yes
 > @@ -33,15 +35,9 @@
 >  
 >  X11_USE=	XORG=x11
 >  X11_CONFIGURE_OFF=--with-x=no
 > +
 >  .include <bsd.port.options.mk>
 >  
 > -.if ! ${PORT_OPTIONS:MX11}
 > -PKGNAMESUFFIX=	-nox11
 > -CONFLICTS+=	libwmf-[0-9]*
 > -.else
 > -CONFLICTS+=	libwmf-nox11-[0-9]*
 > -.endif
 > -
 >  post-patch:
 >  	@${REINPLACE_CMD} -e 's|src include fonts doc|src include fonts|g' \
 >  		${WRKSRC}/Makefile.in
 > Index: graphics/libwmf-nox11/Makefile
 > ===================================================================
 > --- graphics/libwmf-nox11/Makefile	(revision 351966)
 > +++ graphics/libwmf-nox11/Makefile	(working copy)
 > @@ -7,4 +7,7 @@
 >  OPTIONS_EXCLUDE=	X11
 >  OPTIONS_FILE_UNSET=	X11
 >  
 > +PKGNAMESUFFIX=	-nox11
 > +CONFLICTS=	libwmf-[0-9]*
 > +
 >  .include        "${MASTERDIR}/Makefile"

Agreed.  Looks great.