Skip to content

Instantly share code, notes, and snippets.

@AubreyHewes
Created January 21, 2015 23:24
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save AubreyHewes/261748ad940a0be64f28 to your computer and use it in GitHub Desktop.
Save AubreyHewes/261748ad940a0be64f28 to your computer and use it in GitHub Desktop.
Compile and Install BitchX on Ubuntu
#!/bin/sh
####################################################################################
#
# Download Compile and Install BitchX on Ubuntu
#
####################################################################################
# download bitchx source
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
DOWNLOAD_URL=$(curl -s http://bitchx.sourceforge.net |\
grep "http://sourceforge.net" |\
sed -e "s|.*href=\"||g" |\
sed -e "s|\".*||g" |\
grep "/download" | uniq) # should only be one
if [ "${DOWNLOAD_URL}" = "" ]; then
echo "ERROR: Could not find DOWNLOAD_URL from http://bitchx.sourceforge.net"
exit 255;
fi
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
VERSION=$(echo ${DOWNLOAD_URL} | sed -e "s|.*ircii-pana/bitchx-||g" | sed -e "s|\/.*||g")
if [ "${VERSION}" = "" ]; then
echo "ERROR: Could not find VERSION from ${DOWNLOAD_URL}"
exit 255;
fi
echo "Will try to download and install version ${VERSION}";
DOWNLOAD_URL=http://downloads.sourceforge.net/project/bitchx/ircii-pana/bitchx-${VERSION}/bitchx-${VERSION}.tar.gz
echo "Downloading: ${DOWNLOAD_URL}"
curl -L -s "${DOWNLOAD_URL}" -o bitchx-${VERSION}.tar.gz
# install required dev libraries
sudo apt-get install libssl-dev ncurses-dev
# unpack source
tar -xzf bitchx-${VERSION}.tar.gz
# go to source dir
cd bitchx-${VERSION}
# configure
./configure --prefix=/usr --with-ssl --with-plugins --enable-ipv6
# build
make
# install (change to "make install_local" for local installation; in your own $HOME)
sudo make install
# remove src + build
cd $OLDPWD && rm -rf bitchx-${VERSION}*
# done use "BitchX" to run...
@red-axolotl
Copy link

Hey, so i got an error and i am just checking if i am the only one with it:

/usr/bin/ld: numbers.o:/tmp/bitchx-1.2.1/source/numbers.c:69: multiple definition of no_hook_notify'; commands.o:/tmp/bitchx-1.2.1/source/commands.c:121: first defined here /usr/bin/ld: server.o:/tmp/bitchx-1.2.1/source/server.c:90: multiple definition of serv_open_func'; modules.o:/tmp/bitchx-1.2.1/source/./modules.c:86: first defined here
collect2: error: ld returned 1 exit status
gmake[1]: *** [Makefile:183: BitchX] Error 1
gmake[1]: Leaving directory '/tmp/bitchx-1.2.1/source'
make: *** [Makefile:196: BitchX] Error 2

i know what it means but i get it every time i try to compile it

@red-axolotl
Copy link

never mind, i found the problem and the script worked! thanks a lot

@lamoboos223
Copy link

@red-axolotl what was the problem and how did you tackle it?

@lamoboos223
Copy link

hey @red-axolotl

I just tried to install it and i got the same error. How did you solve it? pls help

@red-axolotl
Copy link

red-axolotl commented Jul 19, 2022 via email

@AubreyHewes
Copy link
Author

Ha, well this is a very old docker example. Could be done much easier these days. Nice to know people found it ;-)

NOTE: is outdated (8 years)

@sebolio
Copy link

sebolio commented Dec 5, 2022

how the heck did you fix it?

@vt887
Copy link

vt887 commented Oct 31, 2023

The fix is pretty easy:

--- commands.c	2014-11-04 05:54:23.000000000 -0500
+++ commands.c	2023-10-31 08:34:17.876041504 -0400
@@ -118,7 +118,7 @@

 static	void	oper_password_received (char *, char *);

-int	no_hook_notify = 0;
+// int	no_hook_notify = 0;
 int	load_depth = -1;

 extern char	cx_function[];
 
 --- modules.c	2010-06-26 04:18:34.000000000 -0400
+++ modules.c	2023-10-31 08:23:31.312250180 -0400
@@ -83,7 +83,7 @@
 extern int (*dcc_input_func)  (int, int, char *, int, int);
 extern int (*dcc_close_func) (int, unsigned long, int);

-int (*serv_open_func) (int, unsigned long, int);
+int (*serv_open2_func) (int, unsigned long, int);
 extern int (*serv_output_func) (int, int, char *, int);
 extern int (*serv_input_func)  (int, char *, int, int, int);
 extern int (*serv_close_func) (int, unsigned long, int);
@@ -631,7 +631,7 @@
 	global_table[USERHOSTBASE]		= (Function_ptr) BX_userhostbase;


-	global_table[SERV_OPEN_FUNC]		= (Function_ptr) &serv_open_func;
+	global_table[SERV_OPEN_FUNC]		= (Function_ptr) &serv_open2_func;
 	global_table[SERV_OUTPUT_FUNC]		= (Function_ptr) &serv_output_func;
 	global_table[SERV_INPUT_FUNC]		= (Function_ptr) &serv_input_func;
 	global_table[SERV_CLOSE_FUNC]		= (Function_ptr) &serv_close_func;
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment