Bug 166693 - [PATCH] security/gnutls: Respect NOPORTEXAMPLES
Summary: [PATCH] security/gnutls: Respect NOPORTEXAMPLES
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: Roman Bogorodskiy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 16:40 UTC by Michael Scheidell
Modified: 2012-04-10 12:10 UTC (History)
0 users

See Also:


Attachments
pr-166693_security_gnutls.patch2 (2.07 KB, text/plain)
2012-04-09 12:05 UTC, Michael Scheidell
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scheidell freebsd_committer 2012-04-06 16:40:06 UTC
currently, if you build gnutls with NOPORTDOCS, it respects this and does not install portdocs.
However, if you define NOPORTEXAMPLES (make.conf, env, cli), it still installs 100K of examples:

Fix: This patch:
After patch:

make deinstall
make -DNOPORTEXAMPLES reinstall

du -ch /usr/local/share/examples/gnutls
du: /usr/local/share/examples/gnutls: No such file or directory
  0B	total

logs:
NOPORTEXAMPLES:
http://people.freebsd.org/~scheidell/gnutls-2.12.18.NOPORTEXAMPLES.log

W PORTEXAMPLES:
http://people.freebsd.org/~scheidell/gnutls-2.12.18.PORTEXAMPLES.log

Question of phylophsy or style:  no PORTREVISION bump? or bump?
Yes, this changes package, but I think PORTREVISION bump is important only if you want to force end user to rebuild.
This saves 100k on target system, but if OP really was concerned, could have done an rm -rd /usr/local/share

- Respect NOPORTEXAMPLES flag
- No PORTREVISION bump



______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________--fDENdWBeJ0eKpXroiBFGIu2deMQhojJwHueS3yRg1O0dnzdH
Content-Type: text/plain; name="gnutls.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="gnutls.patch"

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/gnutls/Makefile,v
retrieving revision 1.100
diff -u -r1.100 Makefile
--- Makefile	25 Mar 2012 15:24:23 -0000	1.100
+++ Makefile	6 Apr 2012 15:22:57 -0000
@@ -67,11 +67,14 @@
 .if !defined(NOPORTDOCS)
 PORTDOCS=		AUTHORS NEWS README THANKS
 .endif
+.if !defined(NOPORTEXAMPLES)
 EXAMPLES=	doc/examples/*.c
-
+.endif
 post-install:
+.if !defined(NOPORTEXAMPLES)
 	@${MKDIR} ${EXAMPLESDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR}
+.endif
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 .for i in ${PORTDOCS}
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/security/gnutls/pkg-plist,v
retrieving revision 1.26
diff -u -r1.26 pkg-plist
--- pkg-plist	5 Jun 2011 18:34:23 -0000	1.26
+++ pkg-plist	6 Apr 2012 15:22:57 -0000
@@ -48,26 +48,26 @@
 lib/libgnutls.so.47
 libdata/pkgconfig/gnutls-extra.pc
 libdata/pkgconfig/gnutls.pc
-%%EXAMPLESDIR%%/ex-alert.c
-%%EXAMPLESDIR%%/ex-cert-select-pkcs11.c
-%%EXAMPLESDIR%%/ex-cert-select.c
-%%EXAMPLESDIR%%/ex-client-psk.c
-%%EXAMPLESDIR%%/ex-client-resume.c
-%%EXAMPLESDIR%%/ex-client-srp.c
-%%EXAMPLESDIR%%/ex-client1.c
-%%EXAMPLESDIR%%/ex-client2.c
-%%EXAMPLESDIR%%/ex-crq.c
-%%EXAMPLESDIR%%/ex-pkcs12.c
-%%EXAMPLESDIR%%/ex-rfc2818.c
-%%EXAMPLESDIR%%/ex-serv-anon.c
-%%EXAMPLESDIR%%/ex-serv-pgp.c
-%%EXAMPLESDIR%%/ex-serv-psk.c
-%%EXAMPLESDIR%%/ex-serv-srp.c
-%%EXAMPLESDIR%%/ex-serv1.c
-%%EXAMPLESDIR%%/ex-session-info.c
-%%EXAMPLESDIR%%/ex-verify.c
-%%EXAMPLESDIR%%/ex-x509-info.c
-%%EXAMPLESDIR%%/tcp.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-alert.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-cert-select-pkcs11.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-cert-select.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-client-psk.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-client-resume.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-client-srp.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-client1.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-client2.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-crq.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-pkcs12.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-rfc2818.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-serv-anon.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-serv-pgp.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-serv-psk.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-serv-srp.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-serv1.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-session-info.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-verify.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ex-x509-info.c
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tcp.c
 %%NLS%%share/locale/cs/LC_MESSAGES/libgnutls.mo
 %%NLS%%share/locale/de/LC_MESSAGES/libgnutls.mo
 %%NLS%%share/locale/en@boldquot/LC_MESSAGES/libgnutls.mo
@@ -80,5 +80,5 @@
 %%NLS%%share/locale/sv/LC_MESSAGES/libgnutls.mo
 %%NLS%%share/locale/vi/LC_MESSAGES/libgnutls.mo
 %%NLS%%share/locale/zh_CN/LC_MESSAGES/libgnutls.mo
-@dirrm %%EXAMPLESDIR%%
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
 @dirrm include/gnutls
How-To-Repeat: 
before patch:
make -DNOPORTEXAMPLES install
du -ch /usr/local/share/examples/gnutls
100K /usr/loca/share/examples/gnutls
100K total
Comment 1 Edwin Groothuis freebsd_committer 2012-04-06 16:40:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->novel

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Chris Rees freebsd_committer 2012-04-09 10:42:46 UTC
pkg-plist can be trimmed a load here using PORTEXAMPLES:

http://www.bayofrum.net/~crees/patches/gnutls-examplesdir.diff

Chris
Comment 3 Michael Scheidell freebsd_committer 2012-04-09 12:05:05 UTC
Chris's patch attached here for audit:
Works as expected.

Tested in tinderbox.
withportexamples:
http://lorie.secnap.net/tb/logs/7-scheidell_I386/gnutls-2.12.18.log
with NOPORTEXAMPLES:
http://lorie.secnap.net/tb/logs/7-SECNAP_I386-nox11/gnutls-2.12.18.log

Again, no portrevision bump since this won't change package for default.

thanks Chris.. learning every day.

-- 
Michael Scheidell, CTO
SECNAP Network Security Corporation
http://people.freebsd.org/~scheidell

______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________  
  
Comment 4 dfilter service freebsd_committer 2012-04-10 12:06:42 UTC
novel       2012-04-10 11:06:28 UTC

  FreeBSD ports repository

  Modified files:
    security/gnutls      Makefile pkg-plist 
  Log:
  Respect NOPORTEXAMPLES.
  
  PR:             166693
  Submitted by:   scheidell, crees
  
  Revision  Changes    Path
  1.101     +5 -4      ports/security/gnutls/Makefile
  1.27      +1 -22     ports/security/gnutls/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Roman Bogorodskiy freebsd_committer 2012-04-10 12:07:41 UTC
State Changed
From-To: open->closed

Committed, thanks!