| 1 |
Using CVS |
|---|
| 2 |
========= |
|---|
| 3 |
|
|---|
| 4 |
Swish-e is available via cvs from SourceForge. See http://swish-e.org for |
|---|
| 5 |
links to SourceForge and instructions downloading via cvs. |
|---|
| 6 |
|
|---|
| 7 |
The buildswishe.pl script can be used to fetch the latest cvs source, along |
|---|
| 8 |
with latest libxml2 and zlib sources, and build them all. |
|---|
| 9 |
|
|---|
| 10 |
Otherwise, swish-e uses the familiar: |
|---|
| 11 |
|
|---|
| 12 |
./configure --prefix=/path/to/install |
|---|
| 13 |
make |
|---|
| 14 |
make check |
|---|
| 15 |
make install |
|---|
| 16 |
|
|---|
| 17 |
Only 'make install' might require root priviledges, depending on the permissions |
|---|
| 18 |
of /path/to/install. |
|---|
| 19 |
|
|---|
| 20 |
Modifications to any of the build files (Makefile.am, configure.in) requires |
|---|
| 21 |
running the bootstrap script. You will need a full set of developer tools |
|---|
| 22 |
for these to work (autoconf, automake, libtool). |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
Building with HTML docs |
|---|
| 26 |
======================= |
|---|
| 27 |
|
|---|
| 28 |
The cvs version does not included the HTML documentation. The HTML docs are |
|---|
| 29 |
built from the swish_website module (also in cvs) using the same templates that |
|---|
| 30 |
http://swish-e.org uses. Links not pointing to the local documentation are |
|---|
| 31 |
adjusted in the distribuiton documentation to point to http://swish-e.org. |
|---|
| 32 |
|
|---|
| 33 |
The tools to build the HTML docs can also be fetched via cvs from SourceForge |
|---|
| 34 |
(see the swish_website cvs module). |
|---|
| 35 |
|
|---|
| 36 |
The swish_website module requires several Perl modules, including |
|---|
| 37 |
Template-Toolkit, Pod::POM and a few others. Once you have swish_website |
|---|
| 38 |
downloaded and can build the site using the swish_website/bin/build script, |
|---|
| 39 |
you can then proceed to building Swish-e with: |
|---|
| 40 |
|
|---|
| 41 |
./configure --with-website=/path/to/swish_website |
|---|
| 42 |
make |
|---|
| 43 |
make check |
|---|
| 44 |
make install |
|---|
| 45 |
|
|---|
| 46 |
If the program "build-swish-docs" is in your $PATH then you do not need |
|---|
| 47 |
to specify --with-website above. "build-swish-docs" can be a symlink |
|---|
| 48 |
to the actual swish_website/bin/build script. |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
See the swish_website/README for more about the HTML documentation. |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
Daily Builds |
|---|
| 55 |
============ |
|---|
| 56 |
|
|---|
| 57 |
The swish-daily.pl script can be used to build swish-e from cvs (or |
|---|
| 58 |
from tarball) via cron. In a top-level build directory a dated sub-directory is |
|---|
| 59 |
created and the source is fetched, compiled and installed. For example: |
|---|
| 60 |
|
|---|
| 61 |
swish-daily.pl \ |
|---|
| 62 |
--topdir=$HOME/swish/swish_daily_build |
|---|
| 63 |
--tardir=$HOME/swish/swish-daily |
|---|
| 64 |
|
|---|
| 65 |
Which creates a directory structure like: |
|---|
| 66 |
|
|---|
| 67 |
$ ls -l swish_daily_build/ |
|---|
| 68 |
latest_swish_build -> swish-e-2005-05-29 |
|---|
| 69 |
swish-e-2005-05-26 |
|---|
| 70 |
swish-e-2005-05-27 |
|---|
| 71 |
swish-e-2005-05-28 |
|---|
| 72 |
swish-e-2005-05-29 |
|---|
| 73 |
|
|---|
| 74 |
See the documentation in the swish-daily.pl script for more details. |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
Developer Notes: |
|---|
| 79 |
|
|---|
| 80 |
Release and Tag |
|---|
| 81 |
=============== |
|---|
| 82 |
|
|---|
| 83 |
There's two parts to making a release. One is building the tarball |
|---|
| 84 |
and the other is updating the website. (Plus, announce the relase, |
|---|
| 85 |
of course). |
|---|
| 86 |
|
|---|
| 87 |
Building the tarball is done on your own machine, and then testing that tarball. |
|---|
| 88 |
|
|---|
| 89 |
Updating the site requires using the swish-daily.pl script to fetch the tarball, |
|---|
| 90 |
build it and then update the website. There's a script called Make_Release.sh that |
|---|
| 91 |
automates this process. |
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
Building the tarball |
|---|
| 95 |
-------------------- |
|---|
| 96 |
|
|---|
| 97 |
1) Run "cvs -nq update" to make sure your copy is up-to-date. |
|---|
| 98 |
Watch carefully for merge errors. |
|---|
| 99 |
|
|---|
| 100 |
2) Edit the pod/CHANGES.pod file to update the date of the release |
|---|
| 101 |
|
|---|
| 102 |
3) Edit the version in configure.in |
|---|
| 103 |
|
|---|
| 104 |
4) run ./bootstrap to create new Makefile.in with new version string |
|---|
| 105 |
|
|---|
| 106 |
5) Make sure you have the swish_website module available and can build |
|---|
| 107 |
the docs. See above about building the docs. |
|---|
| 108 |
|
|---|
| 109 |
6) Run make distcheck to make sure it all builds correctly. |
|---|
| 110 |
|
|---|
| 111 |
$ mkdir temp && cd temp |
|---|
| 112 |
$ ../swish-e/configure >/dev/null (/dev/null is up to you) |
|---|
| 113 |
$ make distcheck > /dev/null |
|---|
| 114 |
|
|---|
| 115 |
That will create a tarball in the current directory. |
|---|
| 116 |
|
|---|
| 117 |
7) Good idea to upload the tarball created by make distcheck someplace and |
|---|
| 118 |
then test on a few platforms |
|---|
| 119 |
|
|---|
| 120 |
8) Check in the updated version Makefiles: |
|---|
| 121 |
|
|---|
| 122 |
$ cvs ci |
|---|
| 123 |
|
|---|
| 124 |
9) Tag the release. For example: |
|---|
| 125 |
|
|---|
| 126 |
$ cvs tag rel-2-4-0 |
|---|
| 127 |
|
|---|
| 128 |
10) Upload to swish-e site -- see "Update Site" below for details before doing this. |
|---|
| 129 |
|
|---|
| 130 |
Now move on to development. Change version in configure.in (2.5.0 for example), |
|---|
| 131 |
run ./bootstrap and check in. |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
Update Site |
|---|
| 135 |
----------- |
|---|
| 136 |
|
|---|
| 137 |
Updating the site for a new release means updating the web site, such as the |
|---|
| 138 |
main page to announce the new release, and to build the web site using the new |
|---|
| 139 |
release so the on-line documentation is up to date. |
|---|
| 140 |
|
|---|
| 141 |
This is always a bit more hands-on due to changes in the build system between |
|---|
| 142 |
releases. |
|---|
| 143 |
|
|---|
| 144 |
See swish_website/README for more details on building the web site, but |
|---|
| 145 |
basically the swish_website script (bin/build) needs to know where to find the |
|---|
| 146 |
source for both the release and the current development builds. This is currently done by |
|---|
| 147 |
two symlinks "swishsrc" and "develsrc". develsrc points to the daily build directory. |
|---|
| 148 |
The symlinks go in the swish_website directory: |
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
For example: |
|---|
| 152 |
|
|---|
| 153 |
develsrc -> /home/bmoseley/swish/swish_daily_build/latest_swish_build/source |
|---|
| 154 |
|
|---|
| 155 |
The daily builds are created with the swish-daily.pl script. swish-daily.pl fetches the |
|---|
| 156 |
source via cvs (with daily builds) or via a URL (for releases), unpacks into the "source" |
|---|
| 157 |
directory and builds swish-e. If all goes well a symlink is created to the |
|---|
| 158 |
"latest_swish_build". |
|---|
| 159 |
|
|---|
| 160 |
This same process can be used to build a release. But, instead of fetching from cvs[1] |
|---|
| 161 |
you fetch a tarball built above and placed in some location to fetch by URL. |
|---|
| 162 |
|
|---|
| 163 |
The swish_website/Build_Release.sh script does this by running: |
|---|
| 164 |
|
|---|
| 165 |
#!/bin/sh |
|---|
| 166 |
|
|---|
| 167 |
DIR="${BASE_DIR:=$HOME/swish}" |
|---|
| 168 |
|
|---|
| 169 |
if test ! -n "$1"; then |
|---|
| 170 |
echo "Must specify URL to fetch" |
|---|
| 171 |
exit 1 |
|---|
| 172 |
fi |
|---|
| 173 |
|
|---|
| 174 |
TAR_URL="$1" |
|---|
| 175 |
|
|---|
| 176 |
swish-daily.pl \ |
|---|
| 177 |
--fetchtarurl="$TAR_URL" \ |
|---|
| 178 |
--topdir=$DIR/swish_release_build \ |
|---|
| 179 |
--noremove \ |
|---|
| 180 |
--notimestamp \ |
|---|
| 181 |
--verbose \ |
|---|
| 182 |
--tardir=$DIR/swish-releases || exit 1; |
|---|
| 183 |
|
|---|
| 184 |
So, run that script and pass a URL, swish-daily.pl will fetch the script, attempt to |
|---|
| 185 |
build and install swish-e, and then build a tarball and place it in the swish-releases |
|---|
| 186 |
directory and upate the latest.tar.gz link. That basically makes the tarball available in |
|---|
| 187 |
the download directory, but it cannot be seen yet until the website is updated. |
|---|
| 188 |
|
|---|
| 189 |
For that you can run the swish_website/build.sh script, passing -a to tell it to build the |
|---|
| 190 |
entire site. |
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
Patching a previous version |
|---|
| 196 |
--------------------------- |
|---|
| 197 |
|
|---|
| 198 |
Say development has started on the next release but a bug is found in the last. |
|---|
| 199 |
Development has gone on too far to use the development version. |
|---|
| 200 |
|
|---|
| 201 |
-- Creating a Branch in CVS - |
|---|
| 202 |
|
|---|
| 203 |
The first thing that is needed is to create a branch of the cvs tree. This |
|---|
| 204 |
only needs to be done *once*, and there's more than one way to do it: you can |
|---|
| 205 |
either branch based on a checked out version (e.g. first check out the tagged |
|---|
| 206 |
version), or the branch can be done on the repository. |
|---|
| 207 |
|
|---|
| 208 |
So, to just branch the repository: |
|---|
| 209 |
|
|---|
| 210 |
$ cvs -d :ext:<developer>@cvs.sourceforge.net:/cvsroot/swishe rtag -b -r rel-2-4-0 rel-2-4-0-patches swish-e |
|---|
| 211 |
|
|---|
| 212 |
which says to create a branch called rel-2-4-0.patches branched off of the |
|---|
| 213 |
tagged source rel-2-4-0. |
|---|
| 214 |
|
|---|
| 215 |
[See NOTE below about before following this example] |
|---|
| 216 |
|
|---|
| 217 |
-- Checkout branch -- |
|---|
| 218 |
|
|---|
| 219 |
Again, two ways to go here. You can convert your existing local source tree |
|---|
| 220 |
to the branch or simply do a new checkout. I prefer to do a new checkout. |
|---|
| 221 |
|
|---|
| 222 |
$ cvs -d :ext:<moseley>@cvs.sourceforge.net:/cvsroot/swishe -z3 checkout -r rel-2-4-0-patches -d swish-e-2.4.0.patches swish-e |
|---|
| 223 |
|
|---|
| 224 |
This specifies the Root again with -d, -z3 is compression, we checkout |
|---|
| 225 |
rel-2-4-0-patches from the swish-e module, but instead of writing to |
|---|
| 226 |
the "swish-e" directory use -d to create a directory called |
|---|
| 227 |
swish-e-2.4.0.patches swish-e. |
|---|
| 228 |
|
|---|
| 229 |
-- Make chages -- |
|---|
| 230 |
|
|---|
| 231 |
Make changes as normal. Check in as normal: |
|---|
| 232 |
|
|---|
| 233 |
$ cvs ci |
|---|
| 234 |
|
|---|
| 235 |
and that will ONLY update this current branch. |
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
-- Merging changes back to main branch -- |
|---|
| 239 |
|
|---|
| 240 |
Changes and fixes that are done on the branch will proably need to be moved |
|---|
| 241 |
to the main branch. |
|---|
| 242 |
|
|---|
| 243 |
To merge in changs from another branch into your working copy (the main HEAD |
|---|
| 244 |
branch - 2.5.x in this example) |
|---|
| 245 |
|
|---|
| 246 |
(in your 2.5.x working copy) |
|---|
| 247 |
$ cvs update -j rel-2-4-0-patches |
|---|
| 248 |
|
|---|
| 249 |
That should update your sources. Watch out for conflicts! |
|---|
| 250 |
|
|---|
| 251 |
Note that this is a bit tricky, because this will likely change the version |
|---|
| 252 |
number in configure.in. |
|---|
| 253 |
|
|---|
| 254 |
Verify version in configure.in (might have been changed) then don't forget to |
|---|
| 255 |
check the new patches into the HEAD branch. |
|---|
| 256 |
|
|---|
| 257 |
$ cvs ci -m "Merged patches from 2-4-0-patches" |
|---|
| 258 |
|
|---|
| 259 |
Now, once merged go to your patches directory (swish-e-2.4.0.patches in this |
|---|
| 260 |
example) and *tag* it. That will allow merging later updates into the HEAD |
|---|
| 261 |
branch without re-merging what was just merged. |
|---|
| 262 |
|
|---|
| 263 |
(in the .patches directory) |
|---|
| 264 |
$ cvs tag rel-2-4-1 |
|---|
| 265 |
|
|---|
| 266 |
that just tags the rel-2-4-0-patches branch. |
|---|
| 267 |
|
|---|
| 268 |
Then when 2.4.2 is later created, just the changes from 2.4.1 to 2.4.2 can be |
|---|
| 269 |
merged: |
|---|
| 270 |
|
|---|
| 271 |
(in the main branch) |
|---|
| 272 |
$ cvs update -j rel-2-4-1 -j rel-2-4-0-patches |
|---|
| 273 |
|
|---|
| 274 |
which says merge from the tag rel-2-4-1 to the end of the branch |
|---|
| 275 |
rel-2-4-0-patches into the current directory. |
|---|
| 276 |
|
|---|
| 277 |
At least I think that's how it works. |
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
NOTE: The example for naming the branch may not be best. In this example we |
|---|
| 281 |
are fixing a bug in 2.4.0 so will likely release a 2.4.1. Development is now |
|---|
| 282 |
in 2.5.x. So it may be better to create the branch as rel-2-4-patches (instead |
|---|
| 283 |
of rel-2-4-0-patches) and then all 2.4.x updates will get added there. |
|---|
| 284 |
|
|---|
| 285 |
|
|---|
| 286 |
Developer Hints |
|---|
| 287 |
=============== |
|---|
| 288 |
|
|---|
| 289 |
There's a bunch of debugging techniques, but I do this: |
|---|
| 290 |
|
|---|
| 291 |
$ ./configure --prefix=$HOME/swt --enable-memtrace CFLAGS='-O0 -g' |
|---|
| 292 |
$ make install |
|---|
| 293 |
|
|---|
| 294 |
Then I cd to src and create a test config |
|---|
| 295 |
|
|---|
| 296 |
$ gdb ~/swt/bin/swish-e |
|---|
| 297 |
run -c c -i test.doc |
|---|
| 298 |
|
|---|
| 299 |
Changes to source in another window and in gdb "make install" will |
|---|
| 300 |
build without having to exit. |
|---|