Bug 179812 - Extract the python part from dns/ldns into dns/py-ldns
Summary: Extract the python part from dns/ldns into dns/py-ldns
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: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-21 15:20 UTC by Mathieu Arnold
Modified: 2013-07-11 14:23 UTC (History)
0 users

See Also:


Attachments
ldns.diff (3.21 KB, patch)
2013-06-21 15:20 UTC, Mathieu Arnold
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer freebsd_triage 2013-06-21 15:20:00 UTC
Right now, when dns/ldns is compiled with python support, it changes name and
becomes dns/py-ldns. Some ports depends on the former, some depend on the
later, and it's a bit of a mess.

Fix: This part makes dns/py-ldns install only the python bits, and removes those
bits from dns/ldns.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-21 15:20:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-21 15:20:10 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-21 15:20:10 UTC
Maintainer of dns/ldns,

Please note that PR ports/179812 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179812

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 4 Jaap Akkerhuis 2013-07-01 22:53:38 UTC
    > Maintainer of dns/ldns,
    > 
    > Please note that PR ports/179812 has just been submitted.
    > 
    > If it contains a patch for an upgrade, an enhancement or a bug fix
    > you agree on, reply to this email stating that you approve the patch
    > and a committer will take care of it.
    > 
    > The full text of the PR can be found at:
    >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179812

This seems to be a fine approach to the problem. However I had to
make a small adjustment to make it work (See the snipped of the
Makefile below). With this change, I'll approve.

	jaap

------

post-build:
.if ${PORT_OPTIONS:MEXAMPLES} && !defined(BUILD_PYLDNS)
	 @(cd ${WRKSRC}/examples; ${GMAKE})
.endif
.if ${PORT_OPTIONS:MDRILL}
	 @(cd ${WRKSRC}/drill; ${GMAKE})
.endif

post-install:
.if ${PORT_OPTIONS:MEXAMPLES} && !defined(BUILD_PYLDNS)
	@(cd ${WRKSRC}/examples; ${GMAKE} install)
.endif
.if ${PORT_OPTIONS:MDRILL}
	@(cd ${WRKSRC}/drill; ${GMAKE} install)
.endif
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2013-07-02 00:31:19 UTC
State Changed
From-To: feedback->open

maintainer has replied with updated patch.
Comment 6 Mathieu Arnold 2013-07-02 12:05:40 UTC
Hi,

Ah, yes, I missed that part.

What about enclosing the post-configure, post-build and post-install inside
a .if !defined(BUILD_PYLDNS) ?
There's no point of adding them if they're empty anyway.

-- 
Mathieu Arnold
Comment 7 Jaap Akkerhuis 2013-07-02 13:12:49 UTC
Hi,
    
   >What about enclosing the post-configure, post-build and post-install inside
   >a .if !defined(BUILD_PYLDNS) ?
   >There's no point of adding them if they're empty anyway.

I personally dislike nested .if statements and try to avoid them
but yes, it likely works just as well.

	jaap
Comment 8 Mathieu Arnold 2013-07-02 17:21:49 UTC
+--On 2 juillet 2013 14:12:49 +0200 Jaap Akkerhuis <jaap@NLnetLabs.nl>
wrote:
| Hi,
|     
|    >What about enclosing the post-configure, post-build and post-install
| inside    >a .if !defined(BUILD_PYLDNS) ?
|    >There's no point of adding them if they're empty anyway.
| 
| I personally dislike nested .if statements and try to avoid them
| but yes, it likely works just as well.

Well, I've thought about it for a while when I was cooking the patch, it's
either :
- what I did with nested .if's
- extract what's not needed by the python part in another file and include
it (ugly)
- copying stuffs to dns/py-ldns so that they're no longer master/slave but
it'd be twice the load for each upgrade.

-- 
Mathieu Arnold
Comment 9 Jaap Akkerhuis 2013-07-02 17:47:05 UTC
  > +--On 2 juillet 2013 14:12:49 +0200 Jaap Akkerhuis <jaap@NLnetLabs.nl>
  > wrote:
  > | Hi,
  > |     
  > |    >What about enclosing the post-configure, post-build and post-install
  > | inside    >a .if !defined(BUILD_PYLDNS) ?
  > |    >There's no point of adding them if they're empty anyway.
  > | 
  > | I personally dislike nested .if statements and try to avoid them
  > | but yes, it likely works just as well.
  > 
  > Well, I've thought about it for a while when I was cooking the patch, it's
  > either :
  > - what I did with nested .if's
  > - extract what's not needed by the python part in another file and include
  > it (ugly)
  > - copying stuffs to dns/py-ldns so that they're no longer master/slave but
  > it'd be twice the load for each upgrade.

Yes, it is a devilish dilemma. When I said "dislike" it doesn't
mean I'm dead against it. I can go either way, either the big .if
or the repeated !defined(BUILD_PYLDNS). You pick.

	jaap
Comment 10 Mathieu Arnold freebsd_committer freebsd_triage 2013-07-11 13:30:52 UTC
Responsible Changed
From-To: freebsd-python->mat

Take that back.
Comment 11 dfilter service freebsd_committer freebsd_triage 2013-07-11 13:41:08 UTC
Author: mat
Date: Thu Jul 11 12:40:54 2013
New Revision: 322766
URL: http://svnweb.freebsd.org/changeset/ports/322766

Log:
  Have dns/py-ldns only install the Python bits.
  
  PR:		ports/179812
  Submitted by:	mat
  Approved by:	maintainer

Added:
  head/dns/py-ldns/pkg-plist   (contents, props changed)
Modified:
  head/UPDATING
  head/dns/ldns/Makefile
  head/dns/ldns/pkg-plist
  head/dns/py-ldns/Makefile

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Thu Jul 11 12:14:56 2013	(r322765)
+++ head/UPDATING	Thu Jul 11 12:40:54 2013	(r322766)
@@ -5,6 +5,21 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20130711:
+  AFFECTS: users of dns/py-ldns
+  AUTHOR: mat@FreeBSD.org
+
+  The dns/py-ldns port now only installs the Python bits, and depends on
+  dns/ldns. Because of that, you can't just do a regular upgrade, it'd install
+  dns/ldns overwritting existing files and removing them when removing the old
+  version of dns/py-ldns.
+
+  # pkg_delete -f py-ldns-\*
+  # cd /usr/ports/dns/py-ldns && make clean && make install clean
+    or
+  # pkg delete -fg py-ldns-\*
+  # pkg install -f dns/py-ldns
+
 20130707:
   AFFECTS: users of www/ajaxplorer
   AUTHOR: madpilot@FreeBSD.org

Modified: head/dns/ldns/Makefile
==============================================================================
--- head/dns/ldns/Makefile	Thu Jul 11 12:14:56 2013	(r322765)
+++ head/dns/ldns/Makefile	Thu Jul 11 12:40:54 2013	(r322766)
@@ -3,6 +3,7 @@
 
 PORTNAME=	ldns
 PORTVERSION=	1.6.16
+PORTREVISION=	1
 CATEGORIES=	dns
 MASTER_SITES=	http://www.nlnetlabs.nl/downloads/ldns/ \
 		CRITICAL
@@ -17,23 +18,32 @@ USE_GMAKE=	yes
 USE_OPENSSL=	yes
 USE_LDCONFIG=	yes
 
-OPTIONS_DEFINE=	DOXYGEN EXAMPLES DRILL GOST PYLDNS
+.if !defined(BUILD_PYLDNS)
+OPTIONS_DEFINE=	DOXYGEN EXAMPLES DRILL
 OPTIONS_DEFAULT=	EXAMPLES DRILL
 
 DRILL_DESC=	With drill program
+.endif
+
+OPTIONS_DEFINE+=	GOST
+
 GOST_DESC=	GOST signatures enabled, requires openssl >= 1.0.0
-PYLDNS_DESC=	${PYTHON_DESC}
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MPYLDNS}
+.if defined(BUILD_PYLDNS)
 USE_PYTHON=	yes
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-CONFLICTS=	ldns-[0-9]*
-.else
-CONFLICTS=	py*-ldns-[0-9]*
-.endif
+ALL_TARGET=	pyldns
+INSTALL_TARGET=	install-pyldns
 
+CONFIGURE_ARGS+=--with-pyldns
+LIB_DEPENDS+=	ldns:${PORTSDIR}/dns/ldns
+BUILD_DEPENDS+=	${LOCALBASE}/bin/swig:${PORTSDIR}/devel/swig13
+
+post-patch:
+	@${SED} -i '' -e 's=-I./include/ldns=-I${LOCALBASE}/include/ldns=' ${WRKSRC}/Makefile.in
+.else
 ALL_TARGET=	all
 INSTALL_TARGET=	install-lib install-h install-config
 
@@ -233,13 +243,6 @@ MAN3=	ldns_bget_token.3 ldns_bgetc.3 ldn
 MAN1+=	ldns-config.1
 .endif
 
-.if ${PORT_OPTIONS:MGOST}
-BUILD_DEPENDS+=	openssl>=1.0:${PORTSDIR}/security/openssl
-.else
-NO_GOST=	--disable-gost
-CONFIGURE_ARGS+=${NO_GOST}
-.endif
-
 .if ${PORT_OPTIONS:MDRILL}
 PLIST_SUB+=	DRILLPROG=""
 MAN1+=	drill.1
@@ -262,15 +265,17 @@ MAN1+=	ldns-chaos.1 ldns-compare-zones.1
 PLIST_SUB+=	EXAMPLES="@comment "
 .endif
 
-.if ${PORT_OPTIONS:MPYLDNS}
-CONFIGURE_ARGS+=--with-pyldns
-BUILD_DEPENDS+=	${LOCALBASE}/bin/swig:${PORTSDIR}/devel/swig13
-INSTALL_TARGET+=install-pyldns
-PLIST_SUB+=	PYLDNS=""
+.endif # BUILD_PYLDNS
+
+.if ${PORT_OPTIONS:MGOST}
+BUILD_DEPENDS+=	openssl>=1.0:${PORTSDIR}/security/openssl
 .else
-PLIST_SUB+=	PYLDNS="@comment "
+NO_GOST=	--disable-gost
+CONFIGURE_ARGS+=${NO_GOST}
 .endif
 
+.if !defined(BUILD_PYLDNS)
+
 post-configure:
 .if ${PORT_OPTIONS:MEXAMPLES}
 	@(cd ${WRKSRC}/examples; ./configure --prefix=${PREFIX} \
@@ -299,4 +304,6 @@ post-install:
 	@(cd ${WRKSRC}/drill; ${GMAKE} install)
 .endif
 
+.endif # BUILD_PYLDNS
+
 .include <bsd.port.mk>

Modified: head/dns/ldns/pkg-plist
==============================================================================
--- head/dns/ldns/pkg-plist	Thu Jul 11 12:14:56 2013	(r322765)
+++ head/dns/ldns/pkg-plist	Thu Jul 11 12:40:54 2013	(r322766)
@@ -60,10 +60,4 @@ lib/libldns.a
 lib/libldns.la
 lib/libldns.so
 lib/libldns.so.1
-%%PYLDNS%%%%PYTHON_SITELIBDIR%%/_ldns.so.1
-%%PYLDNS%%%%PYTHON_SITELIBDIR%%/ldns.py
-%%PYLDNS%%%%PYTHON_SITELIBDIR%%/_ldns.so
-%%PYLDNS%%%%PYTHON_SITELIBDIR%%/_ldns.la
-%%PYLDNS%%%%PYTHON_SITELIBDIR%%/_ldns.a
-%%PYLDNS%%@dirrm %%PYTHON_SITELIBDIR%%/ldns
 @dirrm include/ldns

Modified: head/dns/py-ldns/Makefile
==============================================================================
--- head/dns/py-ldns/Makefile	Thu Jul 11 12:14:56 2013	(r322765)
+++ head/dns/py-ldns/Makefile	Thu Jul 11 12:40:54 2013	(r322766)
@@ -3,6 +3,8 @@
 
 MASTERDIR=	${.CURDIR}/../../dns/ldns
 
-OPTIONS_SET=	PYLDNS
+BUILD_PYLDNS=yes
+
+PLIST=	${.CURDIR}/pkg-plist
 
 .include "${MASTERDIR}/Makefile"

Added: head/dns/py-ldns/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/py-ldns/pkg-plist	Thu Jul 11 12:40:54 2013	(r322766)
@@ -0,0 +1,6 @@
+%%PYTHON_SITELIBDIR%%/_ldns.so.1
+%%PYTHON_SITELIBDIR%%/ldns.py
+%%PYTHON_SITELIBDIR%%/_ldns.so
+%%PYTHON_SITELIBDIR%%/_ldns.la
+%%PYTHON_SITELIBDIR%%/_ldns.a
+@dirrm %%PYTHON_SITELIBDIR%%/ldns
_______________________________________________
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 12 Mathieu Arnold freebsd_committer freebsd_triage 2013-07-11 14:23:03 UTC
State Changed
From-To: open->closed

Committed.