X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=doc%2Fsource%2Fdeveloper-manual.sgml;h=90019ef85d5b3ecaed4e91f04de6d71c2b66bedb;hp=b55305dc05e89e919cfb726d0395c084706537f1;hb=3032d1aecd9453c12fb2163c6477034ee327934e;hpb=b93f35c60fa190ec3ae30879632be6269c4de2b3 diff --git a/doc/source/developer-manual.sgml b/doc/source/developer-manual.sgml index b55305dc..90019ef8 100644 --- a/doc/source/developer-manual.sgml +++ b/doc/source/developer-manual.sgml @@ -1,15 +1,12 @@ + - - - - - + + @@ -18,21 +15,17 @@ ]> - Copyright &my-copy; 2001-2009 by - Privoxy Developers + Copyright + &my-copy; 2001-2020 by + Privoxy Developers - - $Id: developer-manual.sgml,v 2.28 2009/05/16 13:27:21 fabiankeil Exp $ - - - @@ -118,16 +107,16 @@ Hal. I don't like seeing blank space :) So added *something* here. - --> + --> Privoxy, as an heir to - Junkbuster, is a Free Software project + Junkbuster, is a Free Software project and the code is licensed under the GNU General Public License version 2. As such, Privoxy development is potentially open to anyone who has the time, knowledge, and desire to contribute in any capacity. Our goals are simply to continue the mission, to improve Privoxy, and - to make it available to as wide an audience as possible. + to make it available to as wide an audience as possible. One does not have to be a programmer to contribute. Packaging, testing, @@ -138,58 +127,68 @@ Hal. Quickstart to Privoxy Development The first step is to join the developer's mailing list. - You can submit your ideas, or even better patches. Patches are best - submitted to the Sourceforge tracker set up for this purpose, but + url="https://lists.privoxy.org/mailman/listinfo/privoxy-devel">privoxy-devel mailing list. + You can submit your ideas or, even better, patches. Patches are best + submitted to the Sourceforge tracker set up for this purpose, but can be sent to the list for review too. - You will also need to have a cvs package installed, which will - entail having ssh installed as well (which seems to be a requirement of - SourceForge), in order to access the cvs repository. Having the GNU build - tools is also going to be important (particularly, autoconf and gmake). + You will also need to have a git package installed, which will + entail having ssh installed as well, in order to access the git repository. + Having the GNU build tools is also going to be important (particularly, + autoconf and gmake). - For the time being (read, this section is under construction), you can - also refer to the extensive comments in the source code. In fact, + For the time being (read, this section is under construction), you can + also refer to the extensive comments in the source code. In fact, reading the code is recommended in any case. - The CVS Repository + The Git Repository If you become part of the active development team, you will eventually - need write access to our holy grail, the CVS repository. One of the + need write access to our holy grail, the Git repository. One of the team members will need to set this up for you. Please read - this chapter completely before accessing via CVS. + this chapter completely before accessing via Git. - Access to CVS + Access to Git + + The project's Git repository is hosted at the + Privoxy website. + For Privoxy team members with push privileges the Git repository URL is + ssh://git@git.privoxy.org:23/git/privoxy.git. + - The project's CVS repository is hosted on - SourceForge. - Please refer to the chapters 6 and 7 in - SF's site - documentation for the technical access details for your - operating system. For historical reasons, the CVS server is - called ijbswa.cvs.sourceforge.net, the repository is - called ijbswa, and the source tree module is called - current. + Contributors without push privileges can + git clone https://www.privoxy.org/git/privoxy.git. + + + The central repository is called privoxy, and the + source branch is called master. Subfolders exist + within the project for target-dependent build and packaging tools, each + including the name of the target operating system in their name (e.g. + Windows, OSXPackageBuilder, debian). There is a webview of the Git + hierarchy at + + https://www.privoxy.org/gitweb/?p=privoxy.git;a=tree, + which might help with visualizing how these pieces fit together. - + Branches - Within the CVS repository, there are modules and branches. As - mentioned, the sources are in the current - module. Other modules are present for platform specific - issues. There is a webview of the CVS hierarchy at http://ijbswa.cvs.sourceforge.net/ijbswa/, - which might help with visualizing how these pieces fit together. + Whilst the central repository contains only the master branch, developers + are of course free to create branches in their local repositories as they + develop features, fixes, or update the target-dependent tools. Only once + such changes are fully tested ought they be pushed back to the central + repository master branch. + At one time there were two distinct branches: stable and unstable. The - more drastic changes were to be in the unstable branch. These branches - have now been merged to minimize time and effort of maintaining two + more drastic changes were to be in the unstable branch. These branches + have now been merged to minimize time and effort of maintaining two branches. - + --> - CVS Commit Guidelines + Git Commit Guidelines The source tree is the heart of every software project. Every effort must be made to ensure that it is readable, compilable and consistent at all - times. There are differing guidelines for the stable branch and the - main development trunk, and we ask anyone with CVS access to strictly + times. We expect anyone with Git access to strictly adhere to the following guidelines: - + Basic Guidelines, for all branches: - - Please don't commit even + Please don't commit even a small change without testing it thoroughly first. When we're - close to a public release, ask a fellow developer to review your + close to a public release, ask a fellow developer to review your changes. @@ -259,28 +258,27 @@ Hal. If necessary, prepare the commit messages in advance. - Before changing things on CVS, make sure that your changes are in line + Before changing things on Git, make sure that your changes are in line with the team's general consensus on what should be done. Note that near a major public release, we get more cautious. There is always the possibility to submit a patch to the patch + url="https://sourceforge.net/tracker/?atid=311118&group_id=11118&func=browse">patch tracker instead. - + - - + - + Documentation Guidelines All formal documents are maintained in Docbook SGML and located in the doc/source/* directory. You will need - Docbook, the Docbook + Docbook, the Docbook DTD's and the Docbook modular stylesheets (or comparable alternatives), and either jade or openjade (recommended) installed in order to @@ -337,20 +337,20 @@ Hal. privoxy.1 (man page), and config files are also now maintained as Docbook SGML. These files, when built, in the top-level source directory are - generated files! Also, the Privoxy index.html (and a - variation on this file, privoxy-index.html, + generated files! Also, the Privoxy index.html (and a + variation on this file, privoxy-index.html, meant for inclusion with doc packages), are maintained as SGML as well. DO NOT edit these directly. Edit the SGML source, or contact someone involved in the documentation. - + config requires some special handling. The reason it is maintained this way is so that the extensive comments in the file - mirror those in user-manual. But the conversion - process requires going from SGML to HTML to text to special formatting + mirror those in user-manual. But the conversion + process requires going from SGML to HTML to text to special formatting required for the embedded comments. Some of this does not survive so well. Especially some of the examples that are longer than 80 characters. - The build process for this file outputs to config.new, + The build process for this file outputs to config.new, which should be reviewed for errors and mis-formatting. Once satisfied that it is correct, then it should be hand copied to config. @@ -362,32 +362,29 @@ Hal. Packagers are encouraged to include this documentation. For those without the ability to build the docs locally, text versions of each are kept in - CVS. HTML versions are also being kept in CVS under - doc/webserver/*. And PDF version are kept in - doc/pdf/*. + Git. HTML versions are also being kept in Git under + doc/webserver/*. Formal documents are built with the Makefile targets of - make dok, or alternately - make redhat-dok. If you have problems, - try both. The build process uses the document SGML sources in + make dok. + The build process uses the document SGML sources in doc/source/*/* to update all text files in doc/text/ and to update all HTML documents in doc/webserver/. Documentation writers should please make sure documents build - successfully before committing to CVS, if possible. + successfully before committing to Git, if possible. How do you update the webserver (i.e. the pages on privoxy.org)? - + + First, build the docs by running make - dok (or alternately make - redhat-dok). For PDF docs, do make - dok-pdf. + dok. Run make webserver which copies all @@ -395,11 +392,10 @@ Hal. sourceforge webserver via scp. - - Finished docs should be occasionally submitted to CVS - (doc/webserver/*/*.html) so that those without + Finished docs should be occasionally submitted to Git + (doc/webserver/*/*.html) so that those without the ability to build them locally, have access to them if needed. This is especially important just prior to a new release! Please do this after the $VERSION and @@ -411,14 +407,14 @@ Hal. Quickstart to Docbook and SGML - If you are not familiar with SGML, it is a markup language similar to HTML. - Actually, not a mark up language per se, but a language used to define + If you are not familiar with SGML, it is a markup language similar to HTML. + Actually, not a mark up language per se, but a language used to define markup languages. In fact, HTML is an SGML application. Both will use tags to format text and other content. SGML tags can be much more varied, and flexible, but do much of the same kinds of things. The tags, or elements, are definable in SGML. There is no set standards. Since we are using - Docbook, our tags are those that are defined by + Docbook, our tags are those that are defined by Docbook. Much of how the finish document is rendered is determined by the stylesheets. The stylesheets determine how each tag gets translated to HTML, or other @@ -435,26 +431,25 @@ Hal. Our documents use sections for the most part. Sections - will be processed into HTML headers (e.g. h1 for + will be processed into HTML headers (e.g. h1 for sect1). The Docbook stylesheets - will use these to also generate the Table of Contents for each doc. Our - TOC's are set to a depth of three. Meaning sect1, - sect2, and sect3 will have TOC - entries, but sect4 will not. Each section requires - a <title> element, and at least one - <para>. There is a limit of five section - levels in Docbook, but generally three should be sufficient for our + will use these to also generate the Table of Contents for each doc. Our + TOC's are set to a depth of three. Meaning sect1, + sect2, and sect3 will have TOC + entries, but sect4 will not. Each section requires + a <title> element, and at least one + <para>. There is a limit of five section + levels in Docbook, but generally three should be sufficient for our purposes. - Some common elements that you likely will use: + Some common elements that you likely will use: - - <para></para>, paragraph delimiter. Most + <para></para>, paragraph delimiter. Most text needs to be within paragraph elements (there are some exceptions). @@ -468,7 +463,7 @@ Hal. <command></command>, command examples. - <literallayout></literallayout>, like + <literallayout></literallayout>, like <pre>, more or less. @@ -478,27 +473,28 @@ Hal. <listitem></listitem>, member of the above. - <screen></screen>, screen output, implies + <screen></screen>, screen output, implies <literallayout>. - <ulink url="example.com"></ulink>, like + <ulink url="example.com"></ulink>, like HTML <a> tag. - <quote></quote>, for, doh, quoting text. + <quote></quote>, for, doh, quoting text. - Look at any of the existing docs for examples of all these and more. - You might also find Writing Documentation - Using DocBook - A Crash Course useful. + You might also find + + + Writing Documentation Using DocBook - A Crash Course useful. @@ -506,39 +502,41 @@ Hal. <application>Privoxy</application> Documentation Style - It will be easier if everyone follows a similar writing style. This - just makes it easier to read what someone else has written if it + It will be easier if everyone follows a similar writing style. This + just makes it easier to read what someone else has written if it is all done in a similar fashion. Here it is: - All tags should be lower case. - + Tags delimiting a block of text (even small blocks) should be on their own line. Like: + <para> Some text goes here. </para> - + + Tags marking individual words, or few words, should be in-line: + Just to <emphasis>emphasize</emphasis>, some text goes here. - - - + + Tags should be nested and step indented for block text like: (except - in-line tags) + in-line tags) + <para> <itemizedlist> @@ -549,51 +547,52 @@ Hal. </para> </itemizedlist> </para> - + + This makes it easier to find the text amongst the tags ;-) - + - Use white space to separate logical divisions within a document, - like between sections. Running everything together consistently + Use white space to separate logical divisions within a document, + like between sections. Running everything together consistently makes it harder to read and work on. - + - Do not hesitate to make comments. Comments can either use the - <comment> element, or the <!-- --> style comment - familiar from HTML. (Note in Docbook v4.x <comment> is + Do not hesitate to make comments. Comments can either use the + <comment> element, or the <!-- --> style comment + familiar from HTML. (Note in Docbook v4.x <comment> is replaced by <remark>.) - + - We have an international audience. Refrain from slang, or English - idiosyncrasies (too many to list :). Humor also does not translate + We have an international audience. Refrain from slang, or English + idiosyncrasies (too many to list :). Humor also does not translate well sometimes. - + Try to keep overall line lengths in source files to 80 characters or less for obvious reasons. This is not always possible, with lengthy URLs for instance. - + - Our documents are available in differing formats. Right now, they - are just plain text, HTML, and PDF, but others are always a - future possibility. Be careful with URLs (<ulink>), and avoid + Our documents are available in differing formats. Right now, they + are just plain text and/or HTML, but others are always a + future possibility. Be careful with URLs (<ulink>), and avoid this mistake: My favorite site is <ulink url="http://example.com">here</ulink>. - This will render as My favorite site is here, which is + This will render as My favorite site is here, which is not real helpful in a text doc. Better like this: @@ -607,42 +606,40 @@ Hal. -H option. (ispell I think too.) - + - - + - + Privoxy Custom Entities - Privoxy documentation is using - a number of customized entities to facilitate - documentation maintenance. + Privoxy documentation is using + a number of customized entities to facilitate + documentation maintenance. We are using a set of boilerplate files with generic text, that is used by multiple docs. This way we can write something once, and use it repeatedly without having to re-write the same content over and over again. If editing such a file, keep in mind that it should be - generic. That is the purpose; so it can be used in varying + generic. That is the purpose; so it can be used in varying contexts without additional modifications. - We are also using what Docbook calls - internal entities. These are like variables in + We are also using what Docbook calls + internal entities. These are like variables in programming. Well, sort of. For instance, we have the - p-version entity that contains the current - Privoxy version string. You are strongly - encouraged to use these where possible. Some of these obviously + p-version entity that contains the current + Privoxy version string. You are strongly + encouraged to use these where possible. Some of these obviously require re-setting with each release (done by the Makefile). A sampling of custom entities are listed below. See any of the main docs for examples. - @@ -653,28 +650,29 @@ Hal. In this example, the contents of the file, - supported.sgml is available for inclusion anywhere - in the doc. To make this happen, just reference the now defined - entity: &supported; (starts with an ampersand - and ends with a semi-colon), and the contents will be dumped into + supported.sgml is available for inclusion anywhere + in the doc. To make this happen, just reference the now defined + entity: &supported; (starts with an ampersand + and ends with a semi-colon), and the contents will be dumped into the finished doc at that point. - + + Commonly used internal entities: - p-version: the Privoxy + p-version: the Privoxy version string, e.g. &p-version;. - p-status: the project status, either + p-status: the project status, either alpha, beta, or stable. - p-not-stable: use to conditionally include + p-not-stable: use to conditionally include text in not stable releases (e.g. beta). @@ -684,16 +682,15 @@ Hal. p-text: this doc is only generated as text. - + - - There are others in various places that are defined for a specific + There are others in various places that are defined for a specific purpose. Read the source! - + - + @@ -718,7 +715,7 @@ Hal. Using Comments - + Comment, Comment, Comment @@ -731,7 +728,7 @@ Hal. understand why or what is being done. A reader may spend a lot more time figuring out what is going on when a simple comment or explanation would have prevented the extra research. Please - help your brother IJB'ers out! + help your fellow Privoxy developers out! The comments will also help justify the intent of the code. If the comment describes something different than what the code @@ -740,13 +737,13 @@ Hal. Example: /* if page size greater than 1k ... */ -if ( page_length() > 1024 ) +if (page_length() > 1024) { ... "block" the page up ... } /* if page size is small, send it in blocks */ -if ( page_length() > 1024 ) +if (page_length() > 1024) { ... "block" the page up ... } @@ -757,7 +754,7 @@ is actually being done. - + Use blocks for comments @@ -774,20 +771,20 @@ is actually being done. /********************************************************************* * This will stand out clearly in your code! *********************************************************************/ -if ( this_variable == that_variable ) +if (this_variable == that_variable) { do_something_very_important(); } /* unfortunately, this may not */ -if ( this_variable == that_variable ) +if (this_variable == that_variable) { do_something_very_important(); } -if ( this_variable == that_variable ) /* this may not either */ +if (this_variable == that_variable) /* this may not either */ { do_something_very_important(); } @@ -798,9 +795,9 @@ if ( this_variable == that_variable ) /* this may not either */ wish to "disrupt" the flow of the code, feel free to use a 1 line comment which is NOT on the same line as the code. - + - + Keep Comments on their own line @@ -821,12 +818,12 @@ if ( this_variable == that_variable ) /* this may not either */ * This will stand out clearly in your code, * But the second example won't. *********************************************************************/ -if ( this_variable == this_variable ) +if (this_variable == this_variable) { do_something_very_important(); } -if ( this_variable == this_variable ) /*can you see me?*/ +if (this_variable == this_variable) /*can you see me?*/ { do_something_very_important(); /*not easily*/ } @@ -838,7 +835,7 @@ if ( this_variable == this_variable ) /*can you see me?*/ int urls_read = 0; /* # of urls read + rejected */ int urls_rejected = 0; /* # of urls rejected */ -if ( 1 == X ) +if (1 == X) { do_something_very_important(); } @@ -853,7 +850,7 @@ short do_something_very_important( } /* -END- do_something_very_important */ - + Comment each logical step @@ -871,9 +868,9 @@ short do_something_very_important( comment. After all, these are usually major logic containers. - + - + Comment All Functions Thoroughly @@ -892,9 +889,9 @@ short do_something_very_important( functions should contain the information presented in the addendum section of this document. - + - + Comment at the end of braces if the content is more than one screen length @@ -915,7 +912,7 @@ short do_something_very_important( Example: -if ( 1 == X ) +if (1 == X) { do_something_very_important(); ...some long list of commands... @@ -923,19 +920,19 @@ if ( 1 == X ) or: -if ( 1 == X ) +if (1 == X) { do_something_very_important(); ...some long list of commands... -} /* -END- if ( 1 == X ) */ +} /* -END- if (1 == X) */ - + Naming Conventions - + Variable Names @@ -954,15 +951,13 @@ int ms_iis5_hack = 0; Instead of: - int msiis5hack = 0; int msIis5Hack = 0; - - - + + Function Names @@ -977,20 +972,18 @@ int msiis5hack = 0; int msIis5Hack = 0; Example: -int load_some_file( struct client_state *csp ) +int load_some_file(struct client_state *csp) Instead of: - -int loadsomefile( struct client_state *csp ) -int loadSomeFile( struct client_state *csp ) +int loadsomefile(struct client_state *csp) +int loadSomeFile(struct client_state *csp) - - + - + Header file prototypes @@ -1002,20 +995,19 @@ int loadSomeFile( struct client_state *csp ) Example: -(.h) extern int load_aclfile( struct client_state *csp ); -(.c) int load_aclfile( struct client_state *csp ) +(.h) extern int load_aclfile(struct client_state *csp); +(.c) int load_aclfile(struct client_state *csp) - Instead of: + Instead of: -(.h) extern int load_aclfile( struct client_state * ); or -(.h) extern int load_aclfile(); -(.c) int load_aclfile( struct client_state *csp ) +(.h) extern int load_aclfile(struct client_state *); or +(.h) extern int load_aclfile(); +(.c) int load_aclfile(struct client_state *csp) - - + - + Enumerations, and #defines @@ -1027,7 +1019,7 @@ int loadSomeFile( struct client_state *csp ) Example: -(enumeration) : enum Boolean { FALSE, TRUE }; +(enumeration) : enum Boolean {FALSE, TRUE}; (#define) : #define DEFAULT_SIZE 100; Note: We have a standard naming scheme for #defines @@ -1043,7 +1035,7 @@ int loadSomeFile( struct client_state *csp ) #endif /* def FEATURE_FORCE */ - + Constants @@ -1063,25 +1055,23 @@ int loadSomeFile( struct client_state *csp ) Instead of: - -#define USE_IMG_LST 1 or +#define USE_IMG_LST 1 or #define _USE_IMAGE_LIST 1 or -#define USE_IMAGE_LIST_ 1 or +#define USE_IMAGE_LIST_ 1 or #define use_image_list 1 or #define UseImageList 1 - - + - + Using Space - + Put braces on a line by themselves. @@ -1095,18 +1085,18 @@ int loadSomeFile( struct client_state *csp ) Example: -if ( this == that ) +if (this == that) { ... } Instead of: - if ( this == that ) { ... } + if (this == that) { ... } or - if ( this == that ) { ... } + if (this == that) { ... } Note: In the special case that the if-statement is inside a loop, and it is trivial, i.e. it tests for a @@ -1118,16 +1108,16 @@ if ( this == that ) Example exception: -while ( more lines are read ) +while (more lines are read) { /* Please document what is/is not a comment line here */ - if ( it's a comment ) continue; + if (it's a comment) continue; - do_something( line ); + do_something(line); } - + ALL control statements should have a block @@ -1140,7 +1130,7 @@ while ( more lines are read ) Example: -if ( this == that ) +if (this == that) { do_something(); do_something_else(); @@ -1148,11 +1138,11 @@ if ( this == that ) Instead of: - if ( this == that ) do_something(); do_something_else(); + if (this == that) do_something(); do_something_else(); or - if ( this == that ) do_something(); + if (this == that) do_something(); Note: The first example in "Instead of" will execute in a manner other than that which the developer desired (per @@ -1160,20 +1150,20 @@ if ( this == that ) "feature". The "explanation" and "exception" from the point above also applies. - + - + Do not belabor/blow-up boolean expressions Example: -structure->flag = ( condition ); +structure->flag = (condition); Instead of: - if ( condition ) { structure->flag = 1; } else { + if (condition) { structure->flag = 1; } else { structure->flag = 0; } Note: The former is readable and concise. The later @@ -1181,9 +1171,9 @@ structure->flag = ( condition ); to the project has at least a "good" knowledge of C/C++. (Hope I do not offend by that last comment ... 8-) - + - + Use white space freely because it is free @@ -1199,13 +1189,9 @@ int first_value = 0; int some_value = 0; int another_value = 0; int this_variable = 0; - -if ( this_variable == this_variable ) - -first_value = old_value + ( ( some_value - another_value ) - whatever ) - + Don't use white space around structure operators @@ -1229,9 +1215,9 @@ function_name(); Instead of: a_struct -> a_member; a_struct . a_member; function_name (); - + - + Make the last brace of a function stand out @@ -1241,19 +1227,19 @@ function_name(); int function1( ... ) { ...code... - return( ret_code ); + return(ret_code); -} /* -END- function1 */ +} /* -END- function1 */ int function2( ... ) { -} /* -END- function2 */ +} /* -END- function2 */ Instead of: - int function1( ... ) { ...code... return( ret_code ); } int + int function1( ... ) { ...code... return(ret_code); } int function2( ... ) { } Note: Use 1 blank line before the closing brace and 2 @@ -1267,9 +1253,9 @@ int function2( ... ) Status: developer-discretion on the number of blank lines. Enforced is the end of function comments. - + - + Use 3 character indentions @@ -1290,27 +1276,27 @@ static const char * const url_code_map[256] = int function1( ... ) { - if ( 1 ) + if (1) { - return( ALWAYS_TRUE ); + return ALWAYS_TRUE; } else { - return( HOW_DID_YOU_GET_HERE ); + return HOW_DID_YOU_GET_HERE; } - return( NEVER_GETS_HERE ); + return NEVER_GETS_HERE; } - + Initializing - + Initialize all variables @@ -1337,11 +1323,11 @@ struct *ptr = NULL; - + Functions - + Name functions that return a boolean as a question. @@ -1358,7 +1344,7 @@ contains_an_image(); is_web_page_blank(); - + Always specify a return type for a function. @@ -1370,9 +1356,9 @@ is_web_page_blank(); purpose, and create a void return type if the function does not need to return anything. - + - + Minimize function calls when iterating by using variables @@ -1384,7 +1370,7 @@ is_web_page_blank(); Example: -for ( size_t cnt = 0; cnt < block_list_length(); cnt++ ) +for (size_t cnt = 0; cnt < block_list_length(); cnt++) { .... } @@ -1407,7 +1393,7 @@ for ( size_t cnt = 0; cnt < block_list_length(); cnt++ ) size_t len = block_list_length(); -for ( size_t cnt = 0; cnt < len; cnt++ ) +for (size_t cnt = 0; cnt < len; cnt++) { .... } @@ -1416,9 +1402,9 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) *may* change or could *potentially* change, then you must code the function call in the for/while loop. - + - + Pass and Return by Const Reference @@ -1427,19 +1413,19 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) This allows a developer to define a const pointer and call your function. If your function does not have the const keyword, we may not be able to use your function. Consider - strcmp, if it were defined as: extern int strcmp( char *s1, - char *s2 ); + strcmp, if it were defined as: extern int strcmp(char *s1, + char *s2); - I could then not use it to compare argv's in main: int main( - int argc, const char *argv[] ) { strcmp( argv[0], "privoxy" - ); } + I could then not use it to compare argv's in main: int + main(int argc, const char *argv[]) { strcmp(argv[0], "privoxy"); + } Both these pointers are *const*! If the c runtime library maintainers do it, we should too. - + - + Pass and Return by Value @@ -1447,15 +1433,15 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) Most structures cannot fit onto a normal stack entry (i.e. they are not 4 bytes or less). Aka, a function declaration - like: int load_aclfile( struct client_state csp ) + like: int load_aclfile(struct client_state csp) would not work. So, to be consistent, we should declare all - prototypes with "pass by value": int load_aclfile( struct - client_state *csp ) + prototypes with "pass by value": int load_aclfile(struct + client_state *csp) + - - + Names of include files @@ -1476,20 +1462,18 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) Exception: - -/* This is not a local include, but requires a path element. */ +/* This is not a local include, but requires a path element. */ #include <sys/fileName.h> - Note: Please! do not add "-I." to the Makefile without a _very_ good reason. This duplicates the #include "file.h" behavior. - + - + Provide multiple inclusion protection @@ -1512,7 +1496,7 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) #endif /* ndef PROJECT_H_INCLUDED */ - + Use `extern "C"` when appropriate @@ -1536,7 +1520,7 @@ extern "C" #endif /* def __cplusplus */ - + Where Possible, Use Forward Struct Declaration Instead of Includes @@ -1562,13 +1546,13 @@ extern file_list *xyz; Status: Use with discretion. - + General Coding Practices - + Turn on warnings @@ -1578,9 +1562,9 @@ extern file_list *xyz; should turn on as many as possible. With GCC, the switch is "-Wall". Try and fix as many warnings as possible. - + - + Provide a default case for all switch statements @@ -1594,22 +1578,22 @@ extern file_list *xyz; Example: -switch( hash_string( cmd ) ) +switch (hash_string(cmd)) { - case hash_actions_file : + case hash_actions_file: ... code ... break; - case hash_confdir : + case hash_confdir: ... code ... break; - default : + default: log_error( ... ); ... anomaly code goes here ... continue; / break; / exit( 1 ); / etc ... -} /* end switch( hash_string( cmd ) ) */ +} /* end switch (hash_string(cmd)) */ Note: If you already have a default condition, you are obviously exempt from this point. Of note, most of the @@ -1623,9 +1607,9 @@ switch( hash_string( cmd ) ) Status: Programmer discretion is advised. - + - + Try to avoid falling through cases in a switch statement. @@ -1648,27 +1632,9 @@ switch( hash_string( cmd ) ) the fact of the fall through and reason why you felt it was necessary. - - - - - Use 'long' or 'short' Instead of - 'int' - - Explanation: - On 32-bit platforms, int usually has the range of long. On - 16-bit platforms, int has the range of short. - - Status: open-to-debate. In the case of most FSF - projects (including X/GNU-Emacs), there are typedefs to int4, - int8, int16, (or equivalence ... I forget the exact typedefs - now). Should we add these to IJB now that we have a "configure" - script? - - - + Don't mix size_t and other types @@ -1680,9 +1646,9 @@ switch( hash_string( cmd ) ) variable of a different type (or even against a constant) without casting one of the values. - + - + Declare each variable and struct on its own line. @@ -1715,9 +1681,9 @@ long c = 0; Status: developer-discretion. - + - + Use malloc/zalloc sparingly @@ -1735,7 +1701,7 @@ If a function creates a struct and stores a pointer to it in a list, then it should definitely be allocated via `malloc'. - + The Programmer Who Uses 'malloc' is Responsible for Ensuring 'free' @@ -1752,8 +1718,8 @@ list, then it should definitely be allocated via `malloc'. Example: -int load_re_filterfile( struct client_state *csp ) { ... } -static void unload_re_filterfile( void *f ) { ... } +int load_re_filterfile(struct client_state *csp) { ... } +static void unload_re_filterfile(void *f) { ... } Exceptions: @@ -1765,9 +1731,9 @@ static void unload_re_filterfile( void *f ) { ... } standard is for allocating and freeing data structures (complex or nested). - + - + Add loaders to the `file_list' structure and in order @@ -1783,12 +1749,12 @@ static void unload_re_filterfile( void *f ) { ... } POPUPs can also be referred to as KILLPOPUPs, it is clear that it should come first. - + - + "Uncertain" new code and/or changes to - existing code, use FIXME or XXX + existing code, use XXX Explanation: @@ -1796,18 +1762,18 @@ static void unload_re_filterfile( void *f ) { ... } your changes, but are not *quite* sure of the repercussions, add this: - /* FIXME: this code has a logic error on platform XYZ, * + /* XXX: this code has a logic error on platform XYZ, * attempting to fix */ #ifdef PLATFORM ...changed code here... #endif or: - /* FIXME: I think the original author really meant this... + /* XXX: I think the original author really meant this... */ ...changed code here... or: - /* FIXME: new code that *may* break something else... */ + /* XXX: new code that *may* break something else... */ ...new code here... Note: If you make it clear that this may or may not @@ -1815,7 +1781,7 @@ static void unload_re_filterfile( void *f ) { ... } include in the project (or conversely exclude from the project). - + @@ -1825,15 +1791,14 @@ static void unload_re_filterfile( void *f ) { ... } Example for file comments: -const char FILENAME_rcs[] = "$Id$"; /********************************************************************* * - * File : $Source$ + * File : $Source * * Purpose : (Fill me in with a good description!) * * Copyright : Written by and Copyright (C) 2001-2009 - * the Privoxy team. http://www.privoxy.org/ + * the Privoxy team. https://www.privoxy.org/ * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -1850,7 +1815,7 @@ const char FILENAME_rcs[] = "$Id$"; * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * @@ -1865,7 +1830,7 @@ const char FILENAME_h_rcs[] = FILENAME_H_VERSION; Note: This declares the rcs variables that should be - added to the "show-proxy-args" page. If this is a brand new + added to the "show-version" page. If this is a brand new creation by you, you are free to change the "Copyright" section to represent the rights you wish to maintain. @@ -1879,15 +1844,14 @@ const char FILENAME_h_rcs[] = FILENAME_H_VERSION; #ifndef _FILENAME_H #define _FILENAME_H -#define FILENAME_H_VERSION "$Id$" /********************************************************************* * - * File : $Source$ + * File : $Source * * Purpose : (Fill me in with a good description!) * * Copyright : Written by and Copyright (C) 2001-2009 - * the Privoxy team. http://www.privoxy.org/ + * the Privoxy team. https://www.privoxy.org/ * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -1904,7 +1868,7 @@ const char FILENAME_h_rcs[] = FILENAME_H_VERSION; * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * @@ -1953,10 +1917,10 @@ extern const char FILENAME_h_rcs[]; * Returns : 0 => Ok, everything else is an error. * *********************************************************************/ -int FUNCTION_NAME( void *param1, const char *x ) +int FUNCTION_NAME(void *param1, const char *x) { ... - return( 0 ); + return 0; } @@ -1978,13 +1942,14 @@ int FUNCTION_NAME( void *param1, const char *x ) Testplan for releases Explain release numbers. major, minor. developer releases. etc. - + Remove any existing rpm with rpm -e Remove any file that was left over. This includes (but is not limited to) + /var/log/privoxy /etc/privoxy @@ -1992,7 +1957,7 @@ Remove any file that was left over. This includes (but is not limited to) /etc/init.d/privoxy /usr/doc/privoxy* - + Install the rpm. Any error messages? @@ -2002,26 +1967,72 @@ Install the rpm. Any error messages? Start browsing. Does Privoxy work? Logfile written? Remove the rpm. Any error messages? All files removed? - + - Test reports - -Please submit test reports only with the test form -at sourceforge. Three simple steps: - - - Select category: the distribution you test on. - Select group: the version of Privoxy that we are about to release. - Fill the Summary and Detailed Description with something - intelligent (keep it short and precise). - - - Do not mail to the mailing list (we cannot keep track on issues there). - + Fuzzing Privoxy + + To make fuzzing more convenient, Privoxy can be configured + with --enable-fuzz which will result in the --fuzz option + becoming available. + + + Example (tested on ElectroBSD): + + +# Compile Privoxy with instrumentation for afl +$ export CC=afl-clang +$ export CFLAGS="-fsanitize=address -ggdb" +$ export CPPFLAGS=-I/usr/local/include/ +$ export LDFLAGS="-fsanitize=address -L/usr/local/lib" +$ export AFL_USE_ASAN=1 +$ export AFL_HARDEN=1 +$ ./configure --with-debug --enable-extended-host-patterns --enable-accept-filter --enable-no-gifs --enable-compression --enable-strptime-sanity-checks --enable-external-filters --enable-fuzz + +$ ./privoxy --fuzz +Privoxy version 3.0.24 (http://www.privoxy.org/) +Usage: ./privoxy [--config-test] [--chroot] [--help] [--no-daemon] [--pidfile pidfile] [--pre-chroot-nslookup hostname] [--user user[.group]] [--version] [configfile] + ./privoxy --fuzz fuzz-mode ./path/to/fuzzed/input [--stfu] + +Supported fuzz modes and the expected input: + action: Text to parse as action file. + client-request: Client request to parse. Currently incomplete + client-header: Client header to parse. + chunked-transfer-encoding: Chunk-encoded data to dechunk. + deflate: deflate-compressed data to decompress. + filter: Text to parse as filter file. + gif: gif to deanimate. + gzip: gzip-compressed data to decompress. + pcrs-substitute: A pcrs-substitute to compile. Not a whole pcrs job! Example: Bla $1 bla C $3 blah. + server-header: Server header to parse. + server-response: Server response to parse. + +The following fuzz modes read data from stdin if the 'file' is '-' + client-request + client-header + chunked-transfer-encoding + deflate + gif + gzip + pcrs-substitute + server-header + server-response + +Aborting + +$ export ASAN_OPTIONS='abort_on_error=1' +$ mkdir input output +$ echo '$1 bla fasel $2' > input/pcrs +$ afl-fuzz -i input -o output -m none ~/git/privoxy/privoxy --fuzz pcrs-substitute - --stfu + +$ cat >input/pcrs.txt +FILTER: bla fasel +s@(.{1})[432](\d+)@$1$2$hostname@UgisT + +$ afl-fuzz -i input/ -o output/ -f bla.filter -m none privoxy --fuzz filter bla.filter --stfu + - @@ -2040,8 +2051,8 @@ at sourceforge. Three simple steps: - The following programs are required to follow this process: - ncftpput (ncftp), scp, ssh (ssh), + The following programs are required to follow this process: + ncftpput (ncftp), scp, ssh (ssh), gmake (GNU's version of make), autoconf, cvs. @@ -2049,21 +2060,23 @@ at sourceforge. Three simple steps: Version numbers - First you need to determine which version number the release will have. + First you need to determine which version number the release will have. Privoxy version numbers consist of three numbers, separated by dots, like in X.Y.Z (e.g. 3.0.0), where: + X, the version major, is rarely ever changed. It is increased by one if turning a development branch into stable substantially changes the functionality, - user interface or configuration syntax. Majors 1 and 2 were + user interface or configuration syntax. Majors 1 and 2 were Junkbuster, and 3 will be the first stable Privoxy release. + Y, the version minor, represents the branch within the major version. At any point in time, there are two branches being maintained: The stable branch, with an even minor, say, 2N, in which no functionality is @@ -2081,31 +2094,32 @@ at sourceforge. Three simple steps: Z, the point or sub version, represents a release of the software within a branch. - It is therefore incremented immediately before each code freeze. + It is therefore incremented immediately after each software release. + The point version is reset to zero when the minor changes. Stable branches work a little differently, since there should be little to no development happening in such branches. Remember, only bugfixes, which presumably should have had some testing - before being committed. Stable branches will then have their - version reported as 0.0.0, during that period - between releases when changes are being added. This is to denote - that this code is not for release. Then - as the release nears, the version is bumped according: e.g. + before being committed. Stable branches will then have their + version reported as 0.0.0, during that period + between releases when changes are being added. This is to denote + that this code is not for release. Then + as the release nears, the version is bumped according: e.g. 3.0.1 -> 0.0.0 -> 3.0.2. - - In summary, the main CVS trunk is the development branch where new + In summary, the main Git trunk is the development branch where new features are being worked on for the next stable series. This should almost always be where the most activity takes place. There is always at least one stable branch from the trunk, e.g now it is @@ -2120,88 +2134,128 @@ at sourceforge. Three simple steps: before committing to a stable branch! - Developers should remember too that if they commit a bugfix to the stable - branch, this will more than likely require a separate submission to the - main trunk, since these are separate development trees within CVS. If you + Developers should remember too that if they commit a bugfix to the stable + branch, this will more than likely require a separate submission to the + main trunk, since these are separate development trees within Git. If you are working on both, then this would require at least two separate check outs (i.e main trunk, and the stable release branch, which is v_3_0_branch at the moment). - + - Before the Release: Freeze + Before the Release The following must be done by one of the developers prior to each new release. - - - - + + + Make sure that everybody who has worked on the code in the last couple of days has had a chance to yell no! in case they have pending changes/fixes in their pipelines. Announce the freeze so that nobody will interfere with last minute changes. - - + + - Increment the version number (point from odd to even in development - branches!) in configure.in. (RPM spec files - will need to be incremented as well.) + Update the code status (CODE_STATUS="xxx") in configure.in to one of + "alpha", "beta" or "stable". - + - If default.action has changed since last - release (i.e. software release or standalone actions file release), - bump up its version info to A.B in this line: + Rebuild configure and GNUMakefile to make sure the updated values are being used. - - - {+add-header{X-Actions-File-Version: A.B} -filter -no-popups} + + +$ autoheader && autoconf # rebuild configure +$ ./configure # rebuild GNUmakefile - - - Then change the version info in doc/webserver/actions/index.php, - line: '$required_actions_file_version = "A.B";' + + + + make dok-release to update the sgml documentation source files. - All documentation should be rebuild after the version bump. - Finished docs should be then be committed to CVS (for those - without the ability to build these). Some docs may require - rather obscure processing tools. config, - the man page (and the html version of the man page), and the PDF docs - fall in this category. REAMDE, the man page, AUTHORS, and config - should all also be committed to CVS for other packagers. The - formal docs should be uploaded to the webserver. See the - Section "Updating the webserver" in this manual for details. + If action file processing has changed and is not backward-compatible, + make sure the "for-privoxy-version=x.y.z" minimum version number in + default.action.master has been updated: - + +{{settings}} +############################################################################# +#MASTER# COMMENT: The minimum Privoxy version: +for-privoxy-version=3.0.11 + + - The User Manual is also used for context - sensitive help for the CGI editor. This is version sensitive, so that - the user will get appropriate help for his/her release. So with - each release a fresh version should be uploaded to the webserver - (this is in addition to the main User Manual - link from the main page since we need to keep manuals for various - versions available). The CGI pages will link to something like - http://privoxy.org/$(VERSION)/user-manual/. This - will need to be updated for each new release. There is no Makefile - target for this at this time!!! It needs to be done manually. + Create the change log: - + + $ git tag + # to see the tags + $ git log [last release tag]..HEAD > /tmp/log + # get the commit log since the last release + $ utils/makeChangeLog /tmp/log > /tmp/change.log + # reformat the commit log + + + Edit /tmp/change.log to remove trivial + changes and group the changes under general headings like: + + +- Bug fixes: +- Action file improvements: +- Filter file improvements: +- General improvements: +- Documentation improvements: +- Build system improvements: +- Code cleanups: +- Privoxy-Log-Parser: +- Privoxy-Regression-Test: + + + Add the contents of /tmp/change.log to the + start of ChangeLog and re-create + doc/source/changelog.sgml: + + + $ utils/changelog2doc.pl /tmp/change.log >| doc/source/changelog.sgml + + All developers should look at the ChangeLog and make sure noteworthy changes are referenced. - + + + + All documentation should be rebuilt: + + $ make man + $ make dok + $ make dok-man + $ make dok-tidy + $ make config-file + + Finished docs should be then be committed to Git (for those + without the ability to build these). Some docs may require + rather obscure processing tools. config, + the man page (and the html version of the man page) + fall in this category. README, the man page, AUTHORS, and config + should all also be committed to Git for other packagers. The + formal docs should be uploaded to the webserver. See the section + "Updating the webserver" + in this manual for details. + + Commit all files that were changed in the above steps! @@ -2209,18 +2263,25 @@ at sourceforge. Three simple steps: - Tag all files in CVS with the version number with - cvs tag v_X_Y_Z. - Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc. + The User Manual is also used for context + sensitive help for the CGI editor. This is version sensitive, so that + the user will get appropriate help for his/her release. So with + each release a fresh version should be uploaded to the webserver + (this is in addition to the main User Manual + link from the main page since we need to keep manuals for various + versions available). The CGI pages will link to something like + http://privoxy.org/$(VERSION)/user-manual/. This + will need to be updated for each new release. There is no Makefile + target for this at this time!!! It needs to be done manually. - - + + - If the release was in a development branch, increase the point version - from even to odd (X.Y.(Z+1)) again in configure.in and - commit your change. + Tag all files in Git with the version number with + git tag v_X_Y_Z. + Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc. - + On the webserver, copy the user manual to a new top-level directory @@ -2228,49 +2289,47 @@ at sourceforge. Three simple steps: pages, which have the version as a prefix, will go into the right version of the manual. If this is a development branch release, also symlink X.Y.(Z-1) to X.Y.Z and X.Y.(Z+1) to - . (i.e. dot). + . (i.e. dot). - + - - + Building and Releasing the Packages Now the individual packages can be built and released. Note that for GPL reasons the first package to be released is always the source tarball. - + For all types of packages, including the source tarball, you must make sure that you build from clean sources by exporting - the right version from CVS into an empty directory (just press return when + the right version from Git into an empty directory (just press return when asked for a password): - - + mkdir dist # delete or choose different name if it already exists cd dist - cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login - cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current + git clone https://www.privoxy.org/git/privoxy.git + cd privoxy + git checkout v_X_Y_Z - - + Do NOT change a single bit, including, but not limited to - version information after export from CVS. This is to make sure that + version information after export from Git. This is to make sure that all release packages, and with them, all future bug reports, are based on exactly the same code. - + - Every significant release of Privoxy has included at least one - package that either had incorrect versions of files, missing files, - or incidental leftovers from a previous build process that gave - unknown numbers of users headaches to try to figure out what was + Every significant release of Privoxy has included at least one + package that either had incorrect versions of files, missing files, + or incidental leftovers from a previous build process that gave + unknown numbers of users headaches to try to figure out what was wrong. PLEASE, make sure you are using pristene sources, and are following the prescribed process! @@ -2278,26 +2337,25 @@ at sourceforge. Three simple steps: Please find additional instructions for the source tarball and the - individual platform dependent binary packages below. And details + individual platform dependent binary packages below. And details on the Sourceforge release process below that. Note on Privoxy Packaging - Please keep these general guidelines in mind when putting together + Please keep these general guidelines in mind when putting together your package. These apply to all platforms! - Privoxy requires - write access to: all *.action files, all - logfiles, and the trust file. You will + write access to: all *.action files, all + logfiles, and the trust file. You will need to determine the best way to do this for your platform. - + Please include up to date documentation. At a bare minimum: @@ -2343,13 +2401,13 @@ at sourceforge. Three simple steps: The documentation has been designed such that the manuals are linked - to each other from parallel directories, and should be packaged + to each other from parallel directories, and should be packaged that way. privoxy-index.html can also be included and can serve as a focal point for docs and other links of interest (and possibly renamed to index.html). - This should be one level up from the manuals. There is a link also + This should be one level up from the manuals. There is a link also on this page to an HTMLized version of the man page. To avoid 404 for - this, it is in CVS as + this, it is in Git as doc/webserver/man-page/privoxy-man-page.html, and should be included along with the manuals. There is also a css stylesheets that can be included for better presentation: @@ -2357,16 +2415,16 @@ at sourceforge. Three simple steps: with privoxy-index.html, (i.e. one level up from the manual directories). - + user.action and user.filter are designed for local preferences. Make sure these do not get overwritten! - config should not be overwritten either. This + config should not be overwritten either. This has especially important configuration data in it. trust should be left in tact as well. - + Other configuration files (default.action and @@ -2376,247 +2434,233 @@ at sourceforge. Three simple steps: likely to change between releases and contain important new features and bug fixes. - + - Please check platform specific notes in this doc, if you haven't - done Privoxy packaging before for other platform - specific issues. Conversely, please add any notes that you know - are important for your platform (or contact one of the doc + Please check platform specific notes in this doc, if you haven't + done Privoxy packaging before for other platform + specific issues. Conversely, please add any notes that you know + are important for your platform (or contact one of the doc maintainers to do this if you can't). - + - Packagers should do a clean install of their - package after building it. So any previous installs should be - removed first to ensure the integrity of the newly built package. - Then run the package for a while to make sure there are no + Packagers should do a clean install of their + package after building it. So any previous installs should be + removed first to ensure the integrity of the newly built package. + Then run the package for a while to make sure there are no obvious problems, before uploading. - + - - + Source Tarball - - First, make sure that you have freshly exported the right + + First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing packages" above). Then run: - - - + + cd current autoheader && autoconf && ./configure - - - Then do: - - - + + Then do: + + make tarball-dist - - - To upload the package to Sourceforge, simply issue - - - + + To upload the package to Sourceforge, simply issue + + make tarball-upload - - - Go to the displayed URL and release the file publicly on Sourceforge. + + Go to the displayed URL and release the file publicly on Sourceforge. For the change log field, use the relevant section of the ChangeLog file. SuSE, Conectiva or Red Hat RPM - + In following text, replace dist with either rh for Red Hat or suse for SuSE. - - - First, make sure that you have freshly exported the right + + + First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing - packages" above). - - - As the only exception to not changing anything after export from CVS, + packages" above). + + + As the only exception to not changing anything after export from Git, now examine the file privoxy-dist.spec and make sure that the version information and the RPM release number are correct. The RPM release numbers for each version start at one. Hence it must be reset to one if this is the first RPM for dist which is built from version X.Y.Z. Check the - file + file list if unsure. Else, it must be set to the highest already available RPM release number for that version plus one. - - + + Then run: - - - + + cd current autoheader && autoconf && ./configure - - - Then do - - - + + Then do + + make dist-dist - - - To upload the package to Sourceforge, simply issue - - - + + To upload the package to Sourceforge, simply issue + + make dist-upload rpm_packagerev - - + where rpm_packagerev is the RPM release number as determined above. - Go to the displayed URL and release the file publicly on Sourceforge. + Go to the displayed URL and release the file publicly on Sourceforge. Use the release notes and change log from the source tarball package. OS/2 - First, make sure that you have freshly exported the right + First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing packages" above). Then get the OS/2 Setup module: - - - + + cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co os2setup - - - You will need a mix of development tools. - The main compilation takes place with IBM Visual Age C++. - Some ancillary work takes place with GNU tools, available from - various sources like hobbes.nmsu.edu. - Specificially, you will need autoheader, - autoconf and sh tools. - The packaging takes place with WarpIN, available from various sources, including - its home page: xworkplace. - - - Change directory to the os2setup directory. - Edit the os2build.cmd file to set the final executable filename. - For example, - - - + + You will need a mix of development tools. + The main compilation takes place with IBM Visual Age C++. + Some ancillary work takes place with GNU tools, available from + various sources like hobbes.nmsu.edu. + Specificially, you will need autoheader, + autoconf and sh tools. + The packaging takes place with WarpIN, available from various sources, including + its home page: xworkplace. + + + Change directory to the os2setup directory. + Edit the os2build.cmd file to set the final executable filename. + For example, + + installExeName='privoxyos2_setup_X.Y.Z.exe' - - - Next, edit the IJB.wis file so the release number matches - in the PACKAGEID section: - - - + + Next, edit the IJB.wis file so the release number matches + in the PACKAGEID section: + + PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z" - - - You're now ready to build. Run: - - - + + You're now ready to build. Run: + + os2build - - + You will find the WarpIN-installable executable in the ./files directory. Upload this anonymously to uploads.sourceforge.net/incoming, create a release for it, and you're done. Use the release notes and Change Log from the source tarball package. - + Solaris - Login to Sourceforge's compilefarm via ssh: - - - + Login to Sourceforge's compilefarm via ssh: + + ssh cf.sourceforge.net - - - Choose the right operating system (not the Debian one). + + Choose the right operating system (not the Debian one). When logged in, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing packages" above). Then run: - - - + + cd current autoheader && autoconf && ./configure - - - Then run - - - + + Then run + + gmake solaris-dist - - - which creates a gzip'ed tar archive. Sadly, you cannot use make - solaris-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the + + which creates a gzip'ed tar archive. Sadly, you cannot use make + solaris-upload on the Sourceforge machine (no ncftpput). You now have + to manually upload the archive to Sourceforge's ftp server and release + the file publicly. Use the release notes and Change Log from the source tarball package. - + - Windows + Windows + - You should ensure you have the latest version of Cygwin (from - http://www.cygwin.com/). - Run the following commands from within a Cygwin bash shell. + Note that the docbook generated files might need some hand editing, + so the Windows build makefile does not rebuild the docs. + - First, make sure that you have freshly exported the right + First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing - packages" above). Then get the Windows setup module: - - - - cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co winsetup - + packages" above). + Then you can build the package. This is fully automated, and is - controlled by winsetup/GNUmakefile. + controlled by windows/GNUmakefile. All you need to do is: - - cd winsetup + cd windows make - Now you can manually rename privoxy_setup.exe to - privoxy_setup_X_Y_Z.exe, and upload it to - SourceForge. When releasing the package on SourceForge, use the release notes + privoxy_setup_X.Y.Z.exe, and the build + directory to privoxy_X.Y.Z. + Create a .zip file of the newly renamed privoxy_X.Y.Z directory, + GPG sign the installer and zip file, + + + $ gpg --armor --detach --sign privoxy_setup_X.Y.Z.exe + $ gpg --armor --detach --sign privoxy_X.Y.Z.zip + + + and upload the files to SourceForge. + + + + When releasing the package on SourceForge, use the release notes and Change Log from the source tarball package. @@ -2629,242 +2673,186 @@ at sourceforge. Three simple steps: entry to debian/changelog, if it is not already there, for example by running: - debchange -v &p-version;-&p-status;-1 "New upstream version" - - Then, run: + Then, run: - dpkg-buildpackage -rfakeroot -us -uc -b - This will create ../privoxy_&p-version;-&p-status;-1_i386.deb which can be uploaded. To upload the package to Sourceforge, simply - issue + issue - make debian-upload - Mac OS X - First, make sure that you have freshly exported the right + First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing - packages" above). Then get the Mac OS X setup module: - - - + packages" above). + + + There are three modules available in the Git repository for use on Mac + OS X, though technically only two of them generate a release (the other + can be used to install from source). + + + OSXPackageBuilder module + + The OSXPackageBuilder module generates OS X installer packages + supporting all Macs running OS X 10.4 and above. Obtain it from Git as + follows into a folder parallel to the exported privoxy source: + + + cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co OSXPackageBuilder + + + The module contains complete instructions on its usage in the file + OS X Package Builder HOWTO.txt. + + + Once the package(s) have been generated, you can then upload them + directly to the Files section of the Sourceforge project in the + Macintosh (OS X) folder. Each new version release of Privoxy should + have a new subfolder created in which to store its files. Please + ensure that the folder contains a readme file that makes it clear + which package is for whichversion of OS X. + + + + osxsetup module (DEPRECATED) + + This module is deprecated since the installer it generates + places all Privoxy files in one folder in a non-standard location, and + supports only Intel Macs running OS X 10.6 or higher. + + + Check out the module from Git as follows into a folder parallel to the + exported privoxy source: + + cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co osxsetup - - - Then run: - - - + + Then run: + + cd osxsetup build - - - This will run autoheader, autoconf and - configure as well as make. - Finally, it will copy over the necessary files to the ./osxsetup/files directory - for further processing by PackageMaker. - - - Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, modify the package - name to match the release, and hit the "Create package" button. - If you specify ./Privoxy.pkg as the output package name, you can then create - the distributable zip file with the command: - - - + + This will run autoheader, autoconf + and configure as well as make. + Finally, it will copy over the necessary files to the ./osxsetup/files + directory for further processing by PackageMaker. + + + Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, + modify the package name to match the release, and hit the "Create + package" button. If you specify ./Privoxy.pkg as the output package + name, you can then create the distributable zip file with the command: + + zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg - - - You can then upload privoxyosx_setup_x.y.z.zip anonymously to - uploads.sourceforge.net/incoming, - create a release for it, and you're done. Use the release notes - and Change Log from the source tarball package. - - - - FreeBSD - - Login to Sourceforge's compile-farm via ssh: - - - - ssh cf.sourceforge.net - - - - Choose the right operating system. - When logged in, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: - - - - cd current - autoheader && autoconf && ./configure - - - - Then run: - - - - gmake freebsd-dist - - - - which creates a gzip'ed tar archive. Sadly, you cannot use make - freebsd-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the - source tarball package. - - - - HP-UX 11 - - First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: - - - - cd current - autoheader && autoconf && ./configure - - - - Then do FIXME. - - - - Amiga OS - - First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: - - - - cd current - autoheader && autoconf && ./configure + + You can then upload this file directly to the Files section of the + Sourceforge project in the Macintosh (OS X) folder. Each new version + release of Privoxy should have a new subfolder created in which to + store its files. + Please ensure that the folder contains a readme file that makes it + clear which version(s) of OS X the package supports. + + + + macsetup module + + The macsetup module is ideal if you wish to build and install Privoxy + from source on a single machine. + + + Check out the module from Git as follows into a folder parallel to the + exported privoxy source: + + + cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co macsetup - - - Then do FIXME. - + + The module contains complete instructions on its usage in its + README file. The end result will be the + exported version of Privoxy installed on the build machine. + + - AIX + FreeBSD - Login to Sourceforge's compilefarm via ssh: - - - - ssh cf.sourceforge.net - - - - Choose the right operating system. - When logged in, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: - - - - cd current - autoheader && autoconf && ./configure - - - - Then run: - - - - make aix-dist - - - - which creates a gzip'ed tar archive. Sadly, you cannot use make - aix-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the - source tarball package. - + Update the www/privoxy port and submit a diff upstream. + For details see the FreeBSD Porter's Handbook. + Uploading and Releasing Your Package - After the package is ready, it is time to upload it + After the package is ready, it is time to upload it to SourceForge, and go through the release steps. The upload is done via FTP: - - - - - Upload to: ftp://upload.sourceforge.net/incoming - - - - - user: anonymous - - - - - password: ijbswa-developers@lists.sourceforge.net - - - - + + + + Upload to: ftp://upload.sourceforge.net/incoming + + + + + user: anonymous + + + + + password: ijbswa-developers@lists.sourceforge.net + + + Or use the make targets as described above. - Once this done go to https://sourceforge.net/project/admin/editpackages.php?group_id=11118, - making sure you are logged in. Find your target platform in the - second column, and click Add Release. You will - then need to create a new release for your package, using the format + Once this done go to + + https://sourceforge.net/project/admin/editpackages.php?group_id=11118, + making sure you are logged in. Find your target platform in the + second column, and click Add Release. You will + then need to create a new release for your package, using the format of $VERSION ($CODE_STATUS), e.g. &p-version; (beta). Now just follow the prompts. Be sure to add any appropriate Release - notes. You should see your freshly uploaded packages in - Step 2. Add Files To This Release. Check the - appropriate box(es). Remember at each step to hit the - Refresh/Submit buttons! You should now see your - file(s) listed in Step 3. Fill out the forms with the appropriate + notes. You should see your freshly uploaded packages in + Step 2. Add Files To This Release. Check the + appropriate box(es). Remember at each step to hit the + Refresh/Submit buttons! You should now see your + file(s) listed in Step 3. Fill out the forms with the appropriate information for your platform, being sure to hit Update - for each file. If anyone is monitoring your platform, check the - email box at the very bottom to notify them of + for each file. If anyone is monitoring your platform, check the + email box at the very bottom to notify them of the new package. This should do it! - If you have made errors, or need to make changes, you can go through - essentially the same steps, but select Edit Release, + If you have made errors, or need to make changes, you can go through + essentially the same steps, but select Edit Release, instead of Add Release. @@ -2873,41 +2861,67 @@ at sourceforge. Three simple steps: After the Release When all (or: most of the) packages have been uploaded and made available, - send an email to the announce - mailing list, Subject: "Version X.Y.Z available for download". Be sure to + send an email to the + announce mailing + list, Subject: "Version X.Y.Z available for download". Be sure to include the - download - location, the release notes and the Changelog. Also, post an - updated News item on the project page Sourceforge, and update the Home + + download location, the release notes and the Changelog. Also, post an + updated News item on the project page Sourceforge, and update the Home page and docs linked from the Home page (see below). Other news sites and release oriented sites, such as Freshmeat, should also be notified. + + Then update the source code for the next version to be released: + + + + + Increment the version number and change the code status to "UNRELEASED" + in configure.in + + + + + Rebuild configure (autoheader && autoconf) + and GNUMakefile (./configure) + + + + + make dok-release to update the sgml documentation source files. + + + + + Commit all your changes. + + + + - + Update the Webserver The webserver should be updated at least with each stable release. When updating, please follow these steps to make sure that no broken links, - inconsistent contents or permission problems will occur (as it has many + inconsistent contents or permission problems will occur (as it has many times in the past!): If you have changed anything in the stable-branch documentation source SGML files, do: - - make dok dok-pdf # (or 'make redhat-dok dok-pdf' if 'make dok' doesn't work for you) + make dok - That will generate doc/webserver/user-manual, doc/webserver/developer-manual, - doc/webserver/faq, - doc/pdf/*.pdf and + doc/webserver/faq, doc/webserver/index.html automatically. @@ -2915,7 +2929,7 @@ at sourceforge. Three simple steps: doc/webserver/man-page/privoxy-man-page.html by running make man. (This is a separate target due to dependencies on some obscure perl scripts - [now in CVS, but not well tested]. See comments in GNUmakefile.) + [now in Git, but not well tested]. See comments in GNUmakefile.) If you want to add new files to the webserver, create them locally in @@ -2923,16 +2937,14 @@ at sourceforge. Three simple steps: create new directories under doc/webserver). - Next, commit any changes from the above steps to CVS. All set? + Next, commit any changes from the above steps to Git. All set? If these are docs in the stable branch, then do: - make webserver - - This will do the upload to the + This will do the upload to the webserver (www.privoxy.org) and ensure all files and directories there are group writable. @@ -2944,49 +2956,9 @@ at sourceforge. Three simple steps: - - Contacting the developers, Bug Reporting and Feature Requests - - &contacting; - - - - - -Privoxy Copyright, License and History - - - ©right; - - - -License - - &license; - - - - - -History - - &history; - - - - - - - See also - - &seealso; - - - -