Bug 186466

Summary: [PATCH] book.xml Stripping Binaries and Shared Libraries
Product: Documentation Reporter: Rusmir Dusko <nemysis>
Component: Books & ArticlesAssignee: Jason Helfman <jgh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
porters-handbook_book.xml.diff none

Description Rusmir Dusko freebsd_committer freebsd_triage 2014-02-04 23:00:00 UTC
Here I have changed so that the user can see how to patch for striping executables and libraries on more than one file.

Porter's Handbook

5.15.2. Stripping Binaries and Shared Libraries

Fix: Please commit enclosed porters-handbook_book.xml.diff

I have sent one email to freebsd-doc@ but here is newer diff. Please use only this.

Patch attached with submission follows:
Comment 1 Jason Helfman freebsd_committer freebsd_triage 2014-02-05 00:58:16 UTC
Responsible Changed
From-To: freebsd-doc->jgh

I'll take it.
Comment 2 Warren Block 2014-02-05 03:15:54 UTC
On Tue, 4 Feb 2014, nemysis wrote:

> Index: en_US.ISO8859-1/books/porters-handbook/book.xml
> ===================================================================
> --- en_US.ISO8859-1/books/porters-handbook/book.xml	(revision 43779)
> +++ en_US.ISO8859-1/books/porters-handbook/book.xml	(working copy)
> @@ -5096,8 +5096,16 @@
> 	  example:</para>
>
> 	<programlisting>post-install:
> -	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xdl</programlisting>
> +	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}</programlisting>
>
> +	<para>If you need to strip more files, here shared libraries.
> +	 For example:</para>

Please try to avoid the informal "you".
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/book.html#writing-style-be-clear)

Suggestion:

   <para>When more than one file needs to be stripped, like several
     shared libraries, loop through them:</para>

> +
> +	<programlisting>post-install:
> +	 .for l in geometry media body track world
> +	 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}-${l}.so.0
> +	 .endfor</programlisting>
> +
> 	<para>Use the &man.file.1; command on the installed executable
> 	  to check whether the binary is stripped or not.  If it does

It's a bit redundant.  Suggestion:

   <para>Use &man.file.1; on the installed executable
     to check whether it has been stripped.

> 	  not say <literal>not stripped</literal>, it is stripped.

That last sentence has a double negative that makes it confusing. 
Assuming it is there to tell the port programmer what string to expect:

   Binaries that have not been stripped will be reported by &man.file.1;
   as <literal>not stripped</literal>.
Comment 3 Rusmir Dusko freebsd_committer freebsd_triage 2014-02-05 14:31:32 UTC
> On Tue, 4 Feb 2014, nemysis wrote:
> 
> Index: en_US.ISO8859-1/books/porters-handbook/book.xml
> > ===================================================================
> > --- en_US.ISO8859-1/books/porters-handbook/book.xml	(revision 43779)
> > +++ en_US.ISO8859-1/books/porters-handbook/book.xml	(working copy)
> > @@ -5096,8 +5096,16 @@
> > 	  example:</para>
> >
> > 	<programlisting>post-install:
> > -	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xdl</programlisting>
> > +	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}</programlisting>
> >
> > +	<para>If you need to strip more files, here shared libraries.
> > +	 For example:</para>

> Please try to avoid the informal "you".
> (http://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/book.html#writing-style-be-clear)

Thanks for the link, I have read it a few more times.

> Suggestion:

> <para>When more than one file needs to be stripped, like several
> shared libraries, loop through them:</para>

Yes this is very good, thanks.

> > +
> > +	<programlisting>post-install:
> > +	 .for l in geometry media body track world
> > +	 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}-${l}.so.0
> > +	 .endfor</programlisting>
> > +
> > 	<para>Use the &man.file.1; command on the installed executable
> > 	  to check whether the binary is stripped or not.  If it does

> It's a bit redundant. Suggestion:

> <para>Use &man.file.1; on the installed executable
> to check whether it has been stripped.

Yes this is very good.

> > 	  not say <literal>not stripped</literal>, it is stripped.

> That last sentence has a double negative that makes it confusing.
> Assuming it is there to tell the port programmer what string to expect:

Yes this is double negative.

> Binaries that have not been stripped will be reported by &man.file.1;
> as <literal>not stripped</literal>.

Yes this is very good.

I accept all your Sugestion thanks Warren Block.

-- 
Best regards,
Rusmir Dusko
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-02-08 01:05:36 UTC
Author: jgh
Date: Sat Feb  8 01:05:28 2014
New Revision: 43827
URL: http://svnweb.freebsd.org/changeset/doc/43827

Log:
  - include example on how to strip multiple files
  
  PR:		186466
  Submitted by:	nemysis@
  Approved by:	wblock (mentor)

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/book.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/book.xml	Fri Feb  7 23:45:41 2014	(r43826)
+++ head/en_US.ISO8859-1/books/porters-handbook/book.xml	Sat Feb  8 01:05:28 2014	(r43827)
@@ -5122,11 +5122,19 @@ PORTVERSION=	1.0</programlisting>
 	<programlisting>post-install:
 	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xdl</programlisting>
 
-	<para>Use the &man.file.1; command on the installed executable
-	  to check whether the binary is stripped or not.  If it does
-	  not say <literal>not stripped</literal>, it is stripped.
-	  Additionally, &man.strip.1; will not strip a previously
-	  stripped program; it will instead exit cleanly.</para>
+	<para>When multiple files need to be stripped:</para>
+
+	<programlisting>post-install:
+	  .for l in geometry media body track world
+	  ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}-${l}.so.0
+	  .endfor</programlisting>
+
+	<para>Use &man.file.1; on a file to determine if it has been
+	  stripped.  Binaries are reported by &man.file.1; as
+	  <literal>stripped</literal>, or
+	  <literal>not stripped</literal>.  Additionally, &man.strip.1;
+	  will detect programs that have already been stripped and
+	  exit cleanly.</para>
       </sect2>
 
       <sect2 xml:id="install-copytree">
_______________________________________________
svn-doc-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "svn-doc-all-unsubscribe@freebsd.org"
Comment 5 Jason Helfman freebsd_committer freebsd_triage 2014-02-08 01:05:49 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!