# anope/cfg - "Build" settings for package

#---------------------------------------------------------------------

[technotes]

1. The source tarball used by this package was created  based on "git"
upstream sources. The sources were obtained as follows:

      ocgitfetch --run \
--checkout=48ec53242eb5914098bfdcbdaad3675b823057f2 \
https://github.com/anope/anope.git

#---------------------------------------------------------------------

2. "anope" setup is for advanced CLI users.

#---------------------------------------------------------------------

3. "anope" doesn't depend directly on "ngircd" at build time. However,
"ngircd" must be running before "anope" will run.  So, "ngircd" should
be built and debugged first.

#---------------------------------------------------------------------

4. If the Linux account  "irc" and/or group "irc" don't exist prior to
the build,  the build will create either or both as necessary.

If the "irc" account is created, the account password will be set to a
unique and  non-recoverable string.  This  is O.K. as login to the ac-
ount by password isn't needed.

Note:  The password  in question has  nothing to do  with the password
that you'll see in the "anope" and "ngircd" config files.

#---------------------------------------------------------------------

[configure]

#---------------------------------------------------------------------

[buildtimes]

00.07 hours (or 003.95 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM

#---------------------------------------------------------------------

[settings]
configure = none
license   = See "license*.txt" in installed tree
licfile   = docs/COPYING
purge     = no
tmpsize   = 138M

#---------------------------------------------------------------------

[depends]
tar

#---------------------------------------------------------------------

[build]
BINDIR=$PKGDIR_PROD/bin
PROGDIR=$PKGDIR_PROD/program

pkill services || true
APASS=`od -Anone /dev/random | head -1 | sed -e 's/ //g'`

mkdir -p /home/jail
if test -z "`grep '^irc:' /etc/group`"  ; then groupadd irc; fi
if test -z "`grep '^irc:' /etc/passwd`" ; then
    useradd irc -g irc    -d /home/jail \
                -s /bin/bash -p $APASS
fi

if [ -d $PROGDIR ]; then
    echo Error: Directory $PROGDIR exists
    echo Rename or remove it
    exit 1
fi

if [ -f $PROGDIR ]; then
    echo Error: $PROGDIR is a file
    echo Rename or remove it
    exit 1
fi

cp -p $PKGDIR_SPECIAL/enc_posix.cpp modules/
./Config
cd build
smpmake
smpmake install

cd $PROGDIR
mv conf conf.sample
cp -a $PKGDIR_SPECIAL/conf .
chmod 660 conf/*.conf
chmod 660 conf.sample/*.conf

chmod 770        $PROGDIR/
chown -R irc.irc $PROGDIR/

rm -fr   $BINDIR
mkdir -p $BINDIR
cd       $BINDIR

cp -p $PKGDIR_SPECIAL/run-services .
chmod 755             run-services

#---------------------------------------------------------------------

# Original URLs. These URLs were valid at one point, but may have died
# since then. If you download newer versions of tarballs [etc.], don't
# delete  the  original versions,  as you may not  be able  to replace
# them.

[urls]
url_debian  = tbd
url_home    = https://anope.org/
url_lfs     = tbd
url_tarball = git               # See "technotes" in "cfg" file

#---------------------------------------------------------------------

[history]
210705 Added package. Started with 33590aa59 ("git" hash).
210912 Updated to 48ec53242 (same as 2.0.10)