Note that this file is so very out of date that it is more or less useless.

--Skandranon

From: Carlo Kid - Runaway <carlo@sg.tn.tudelft.nl>
Subject: GUIDE for compiling your server
To: wastelanders@rush.cc.edu (New Wastelanders MailingList)
Date: Thu, 26 May 94 13:44:10 METDST
Cc: carlo@sg.tn.tudelft.nl
Mailer: Elm [revision: 66.33]
Status: RO

GUIDE for compiling your server,     by Runaway
===============================================

First of all you must get all the files you need, as an example
I will explain how to compile irc2.8.19.U3.2.
The files you'll need in general are:

- irc2.8.19.U3.2.tar.gz

Or, when you already have an older version -say irc2.8.19.U3.1- a patch:

- irc2.8.19.U3.1-2.patch

It is possible you need more then one patch, especially when you already
upgraded more often. But in that case you already have those old patches.
Of course, in that case, you also already have the old directory tree:

/home..../yourname/....ircd/irc2.8.19.U3.1/

Scripts, patches and directory trees
====================================

It is good practise to:
1) Call the directory tree after the version
2) Let this directory ONLY contain what comes with the .tar.gz file!
   Thus: Do NOT put ircd.conf, or any patches etc in it!!!
   In general, you must be able to delete this whole directory tree
   when you still have the original .tar.gz file and patches applied to it.
3) Put it in a directory ending on /ircd, THIS directory will contain
   your ircd.motd, ircd.pid, ircd.conf and patches...

So, you end up with:

...ircd/irc2.8.19.U3.1-2.patch
...ircd/irc2.8.19.U3.1.tar.gz

or just:

...ircd/irc2.8.19.U3.2.tar.gz

at once.

Before you can delete the old directory tree, you must be SURE to save
everything thats in it. This is thus the .tar.gz file, all patches but
ALSO the following files:

Makefile
include/config.h
include/setup.h

You should always keep a copy of those files OUTSIDE the irc2.8.19.U3.2/
directory tree. For instance:

...ircd/irc.personal/Makefile
...ircd/irc.personal/include/config.h
...ircd/irc.personal/include/setup.h

To make these backups easy, you should make a script, called backup.personal
containing:

cp Makefile ../irc.personal/Makefile
cp include/config.h ../irc.personal/include/config.h
cp include/setup.h ../irc.personal/include/setup.h

If you also change anything in the other Makefiles (ircd/Makefile and
common/Makefile) you can add those too. Be sure to make the directories
by hand first.

Make the script 'backup.personal' executable with:
chmod 700 backup.personal
You must be able to run it from any directory, so put it in your ..bin/

Ok... so now you have a backup of everything. If you wanted to start
ALL over you could delete the directory tree, unzip and untar the archive
again, apply all patches to it, change the Makefile and config.h again,
put setup.h back, recompile and reinstall.
In some cases it is easy to do this with an other script, I call it 'repatch',
it provides you with an easy-to-change overview of the patched you have used.
Here is how my 'repatch' looks now (it is located in .../ircd/repatch).

cd ~/irc/ircd
rm -rf irc2.8.19 irc2.8.19.U3.2
zcat irc2.8.19.tar.gz | tar xf -
mv irc2.8.19 irc2.8.19.U3.2
cd irc2.8.19.U3.2
#patch -p1 < ../Makefile.config.h.patch 2> ../patch.out
#cp ../setup.h include/setup.h
patch -p1 < ../irc2.8.19-TSpre8.2.patch 2>> ../patch.out
patch -p1 < ../irc2.8.19.TSpre8-note.patch 2>> ../patch.out
patch -p1 < ../irc2.8.19.TSpre8-wallops.patch 2>> ../patch.out
patch -p1 < ../irc2.8.19.TSpre8-bquiet.patch 2>> ../patch.out
patch -p1 < ../irc2.8.19.TSpre8-silence.2.patch 2>> ../patch.out
#patch -p1 < ../irc2.8.19.U3-ban.patch 2>> ../patch.out
make clean
vi include/patchlevel.h
grep -e '\.rej' -e '[Ff]ail' -e fuzz ../patch.out

As you can see I commented out the patches Makefile.config.h.patch and
irc2.8.19.U3-ban.patch, and don't copy setup.h here. This is because
I wanted to make a virgin .U3.2.tar.gz for distribution via ftp-sites.
If I change the name of the directory, I have to change it in three
places :/
This script forces me to edit the patchlevel.h :) :)
The last grep warns me if anything went wrong with the patches.

Moreover, as you can see, I have a 'Makefile.config.h.patch'.
You should make your own as soon as you completely installed
and tested your server. It is very handy for re-installing a new
version.

To make this patch, edit the Makefile's and and config.h and type:

backup.personal
cd ..
rm -rf irc2.8.19
zcat irc2.8.19.tar.gz | tar xf -
diff -rc irc2.8.19 irc.personal > Makefile.config.h.patch

Check it with an editor if it looks ok. In the above, 'irc2.8.19.tar.gz'
is the virgin 'Avalon' version, I change the Makefiles in the .U3
however also, so you might wanna use the virgin .U3.2.tar.gz.

Starting ALL over (or begining for the first time)
==================================================

This is about EDITTING the Makefile(s) and config.h, and creating the
setup.h for the first time.

2.8.19 is different from 2.8.16 and before. You will have to EDIT the
Makefile and config.h that comes with the distribution. You can NOT
use the old Makefile and config.h you had !

First write down the path you want to use where you are going to put
the ircd.conf etc...

Edit the Makefile. Comments are in it. You should simply define that
what is needed for your Operating System.

Then edit the config.h

Then run ./Config to create setup.h ... at first simply hit return all the
time. If you insist on using gcc instead of cc, you must edit that in your
Makefile BEFORE running setup.h. You can't change that running Config,
although it asks for it. If you have more then one cc, you can add the
right path to in the Makefile (if it uses the wrong one).

Since U3.2, I changed the Makefile and config.h a little. The changes are:
- I added note.o to the dependency
- I added *.orig files to the 'make clean' (otherwise the *.orig generated
  by some 'patch' programs will be left).
If you want this too, and you have .U3.1, you can get the patch from
sg.tn.tudelft.nl (file: Makefile.conf.U3.patch).

As soon as you are done, run backup.personal. To stay up to date with your
backup.

Then make the Makefile.conf.patch as described above. (or wait with that
till you are sure it works... otherwise it might be done more then once
which is a waste of time).

Special remarks
---------------

Makefile:
First occurance of
        CC=cc
Change this NOT if you want another compiler, add another CC= later, close
to your OS specific #defines...

# IRCDDIR must be the same as DPATH in include/config.h
#
IRCDDIR=/sb/users/carlo/irc/ircd
Make sure you use the same path in the config.h :)

SUBDIRS=common ircd
By removing the 'irc' from this line, you stop 'make' from making the client
as well.

config.h:

#undef  DEBUGMODE               /* define DEBUGMODE to enable debugging mode.*/
Debug mode uses a lot more memory and is a lot slower. ONLY define
when your server gives problems like crashing/coredumping, or other
things like not wanting to startup etc. In other words: when you are really
*USING* this feature to do DEBUGing !

#define DPATH   "/sb/users/carlo/irc/ircd"
Must be the same as in the Makefile!
#define SPATH   "/sb/users/carlo/bin/ircd" /* path to server executeable */
This is used when you do a /RESTART. For fast restarting a NEW version (upgrade)you can let this point to a symbolic link, and then change this link to the
new executable. Do a 'restart' and voila...
For instance:
.../bin/ircd.U3.2*
.../bin/ircd -> ircd.U3.2
The last made with:
ln -s ircd.U3.2 ircd
Then when you upgrade:
rm ircd
ln -s ircd.U3.3 ircd
and a /RESTART

#undef  CRYPT_LINK_PASSWORD
Make sure your ircd.conf isn't world readable like on pasadena :/
(and on ircserver.et.tudelft.nl once - we DID have to change all passwords
 then)

Compiling the server
====================

*** FIRST edit your include/patchlevel.h ***

If you don't want to compile the client, you can change the Makefile
as mentioned above, or type:
make server

After a succesfull compilation (ignore warning ;), you can type
make install
or just
cp ircd/ircd ~/bin/ircd.U3.2
cd ~/bin
chmod 700 ircd.U3.2
rm ircd
ln -s ircd.U3.2 ircd

I changed my Makefile to do the latter thing when I type 'make install'

Then run the server by typing 'ircd'. Don't do this on the
...ircd/irc2.8.19.U3.2/ircd/ directory, because when in your PATH the
'.' comes before your '~/bin' you start up THAT exucutable, disallowing
you to recompile later (text file busy).

Compile errors
==============

If you get problems while linking saying it has undefined _something
and something is something with 'res', you must add -lresolv to your
IRCDLIBS in the Makefile.

If you get problems with any function beging defines twice are giving
errors like not compatible with previous definition (likely atol() in
note.c), just remove that whole function from the .c file (put #ifdef notdef
around it). You have it already in your system libraries.

Last remarks
============

Add those U: lines!!!
And change your ircd.motd to reflect the new commands/features :)
( /MOTD uxb*   -- Nice motd RedRum! :)

-------------------------------------------------------------------

Run

--
-------------------------------------------------------------------------------
|  carlo@sg.tn.tudelft.nl           |  Run @ IRC                              |
|                                   |  Admin of Delft.NL.EU.undernet.org      |
| * Don't expect anything of live,  |  and      Ircserver.et.tudelft.nl       |
| or you'll miss all the rest of it.|                                         |
-------------------------------------------------------------------------------

