diff options
author | Niels Horn <niels.horn@gmail.com> | 2010-05-13 01:00:07 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-13 01:00:07 +0200 |
commit | acafd6f8fd72b04dc9277beef3624c689990ac23 (patch) | |
tree | 4bb1ac21e4181f818fbb5148104aee1483f99e20 /network/msn-proxy | |
parent | 247bdc679964e538cf00e1fe87e31d145bcf343f (diff) |
network/msn-proxy: Added to 13.0 repository
Diffstat (limited to 'network/msn-proxy')
-rw-r--r-- | network/msn-proxy/README | 12 | ||||
-rw-r--r-- | network/msn-proxy/README.SLACKWARE | 78 | ||||
-rw-r--r-- | network/msn-proxy/config.patch | 27 | ||||
-rw-r--r-- | network/msn-proxy/doinst.sh | 17 | ||||
-rw-r--r-- | network/msn-proxy/msn-proxy.SlackBuild | 105 | ||||
-rw-r--r-- | network/msn-proxy/msn-proxy.info | 10 | ||||
-rw-r--r-- | network/msn-proxy/mysql.patch | 11 | ||||
-rw-r--r-- | network/msn-proxy/slack-desc | 19 |
8 files changed, 279 insertions, 0 deletions
diff --git a/network/msn-proxy/README b/network/msn-proxy/README new file mode 100644 index 0000000000000..b54929f52e399 --- /dev/null +++ b/network/msn-proxy/README @@ -0,0 +1,12 @@ +msn-proxy is a light-weight transparent proxy for MSN Messenger clients that +allows you to control and monitor the use of Messenger on your network. + +This SlackBuild installs the msn-proxy web pages in /var/www/htdocs/ +To change the location, set the DOCROOT variable: +# DOCROOT=your/docroot/dir ./msn-proxy.SlackBuild +(be sure to omit the leading "/" from the path; for example, use "home/www/" +instead of "/home/www/" if your preferred DOCROOT is /home/www/. + +This requires libevent, and also needs httpd, php, mysql configured & running. + +See the included README.SLACKWARE file for configuration instructions. diff --git a/network/msn-proxy/README.SLACKWARE b/network/msn-proxy/README.SLACKWARE new file mode 100644 index 0000000000000..372a28ea2f84f --- /dev/null +++ b/network/msn-proxy/README.SLACKWARE @@ -0,0 +1,78 @@ +README.SLACKWARE +================ + +After installing the package, follow these steps to setup msn-proxy: + +1) Edit your configuration files +-------------------------------- + +You'll need to check: +- /etc/msn-proxy/msn-proxy.conf +- /etc/msn-proxy/mysql/conf +- /etc/msn-proxy/mysql.inc.php + +2) Create database & user on your MySQL server +---------------------------------------------- + + # mysql -p<your_password> + mysql> create database `msn-proxy`; + mysql> grant all privileges on `msn-proxy`.* to `msn-proxy`@localhost + -> identified by 'secret'; + mysql> flush privileges; + mysql> quit + +Change the password ('secret') and name of the server where msn-proxy will +run (localhost) as needed. + +3) Start msn-proxy first time to create the tables +-------------------------------------------------- + + # msn-proxy -f /etc/msn-proxy/ + +msn-proxy will create the tables and exit with an error: + + fail to read mysql config (check defaults table) + +This is normal and will be solved in the next step. + +4) Insert server IP in defaults table +------------------------------------- + + # mysql -u msn-proxy -psecret + mysql> use database `msn-proxy`; + mysql> insert into defaults (internal_host) values ('<your_ip>'); + mysql> quit + +5) Start msn-proxy +------------------ + +msn-proxy can be started with: + + # msn-proxy -f /etc/msn-proxy & + +Put this line in your /etc/rc.d/rc.local file to always start the service +when booting. + +6) Configuring clients +---------------------- + +The clients on your network need to point their MSN to your new proxy. +You can also do this automatically in your nameserver. If you use dnsmasq +on Slackware, simply insert this line: + + address=/messenger.hotmail.com/<your_ip> + +This way all requests to resolve the IP for "messenger.hotmail.com" will be +answered with the address of your msn-proxy server. + +It is also a good idea to block http access to messenger.hotmail.com (and +some of the alternatives out there) in your proxy or firewall if you want +to be absolutely sure that all messenger traffic goes through msn-proxy. + +7) See the result +----------------- + +Simply point your browser at http://<your_ip>/msn-proxy/index.php + +Now you have the option to either keep this address "secret" or use known +httpd access control methods to prevent all users to see the result :) diff --git a/network/msn-proxy/config.patch b/network/msn-proxy/config.patch new file mode 100644 index 0000000000000..2e92dcc2575c7 --- /dev/null +++ b/network/msn-proxy/config.patch @@ -0,0 +1,27 @@ +--- msn-proxy-0.7_orig/Makefile 2009-01-20 13:34:19.000000000 -0200 ++++ msn-proxy-0.7/Makefile 2009-12-26 23:17:08.000000000 -0200 +@@ -1,18 +1,18 @@ + + RM=/bin/rm + INSTALL=/usr/bin/install +-SYSCONFDIR=$(DESTDIR)/usr/local/etc/msn-proxy +-BINDIR=$(DESTDIR)/usr/local/bin ++SYSCONFDIR=$(DESTDIR)/etc/msn-proxy ++BINDIR=$(DESTDIR)/usr/bin + +-# FreeBSD +-MYSQLINC=/usr/local/include +-MYSQLLIB=/usr/local/lib/mysql ++# Slackware ++MYSQLINC=/usr/include/mysql ++MYSQLLIB=/usr/lib@LIBDIRSUFFIX@/mysql + + # Linux (most) + #MYSQLINC=/usr/lib/mysql + #MYSQLLIB=/usr/local/mysql/lib/mysql + +-CCFLAGS=-g -Wall -O2 -pipe -I/usr/local/include -I$(MYSQLINC) -fno-builtin-log ++CCFLAGS=-g -Wall @SLKCFLAGS@ -pipe -I/usr/local/include -I$(MYSQLINC) -fno-builtin-log + + LDFLAGS=-L/usr/local/lib -levent -L$(MYSQLLIB) -lmysqlclient + diff --git a/network/msn-proxy/doinst.sh b/network/msn-proxy/doinst.sh new file mode 100644 index 0000000000000..4431a61b7cbbf --- /dev/null +++ b/network/msn-proxy/doinst.sh @@ -0,0 +1,17 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/msn-proxy/msn-proxy.conf.new +config etc/msn-proxy/mysql/conf.new +config etc/msn-proxy/mysql.inc.php.new + diff --git a/network/msn-proxy/msn-proxy.SlackBuild b/network/msn-proxy/msn-proxy.SlackBuild new file mode 100644 index 0000000000000..914d5561ec7fe --- /dev/null +++ b/network/msn-proxy/msn-proxy.SlackBuild @@ -0,0 +1,105 @@ +#!/bin/sh + +# Slackware build script for msn-proxy + +# Written by Niels Horn <niels.horn@gmail.com> +# revision date: 2009/12/27 + +PRGNAM=msn-proxy +VERSION=${VERSION:-0.7} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +DOCROOT=${DOCROOT:-var/www/htdocs} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Patch mysql.h because it has the configuration directory hard-coded... +patch -p1 < $CWD/mysql.patch + +# msn-proxy has no "configure", so we'll patch the Makefile to Slackware +# standards +patch -p1 < $CWD/config.patch + +# Now enter SLKCFLAGS LIBDIRSUFFIX in the Makefile: +sed -i -e "s,@SLKCFLAGS@,$SLKCFLAGS,g" -e "s,@LIBDIRSUFFIX@,$LIBDIRSUFFIX,g" \ + Makefile + +make +make install DESTDIR=$PKG + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true +) + +# Rename configuration files +mv $PKG/etc/$PRGNAM/$PRGNAM.conf $PKG/etc/$PRGNAM/$PRGNAM.conf.new +mv $PKG/etc/$PRGNAM/mysql/conf $PKG/etc/$PRGNAM/mysql/conf.new + +# "Install" web pages +mkdir -p $PKG/$DOCROOT/$PRGNAM +cp -a php/* $PKG/$DOCROOT/$PRGNAM/ +chown -R root:apache $PKG/$DOCROOT/$PRGNAM + +# Move PHP configuration +mv $PKG/$DOCROOT/$PRGNAM/mysql.inc.php $PKG/etc/$PRGNAM/mysql.inc.php.new +chmod 640 $PKG/etc/$PRGNAM/mysql.inc.php.new + +# Set correct Slackware location of mysql.sock +sed -i "s,/tmp/mysql.sock,/var/run/mysql/mysql.sock," \ + $PKG/etc/$PRGNAM/mysql.inc.php.new +sed -i "s,/tmp/mysql.sock,/var/run/mysql/mysql.sock," \ + $PKG/etc/$PRGNAM/mysql/conf.new + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + ChangeLog INSTALL \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +# Put instruction to create symbolic link to PHP conf in doinst script +cat >> $PKG/install/doinst.sh << EOF +( cd $DOCROOT/$PRGNAM ; rm -rf mysql.inc.php ) +( cd $DOCROOT/$PRGNAM ; ln -sf /etc/$PRGNAM/mysql.inc.php ) +EOF + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/msn-proxy/msn-proxy.info b/network/msn-proxy/msn-proxy.info new file mode 100644 index 0000000000000..9ba1d84afec07 --- /dev/null +++ b/network/msn-proxy/msn-proxy.info @@ -0,0 +1,10 @@ +PRGNAM="msn-proxy" +VERSION="0.7" +HOMEPAGE="http://msn-proxy.sourceforge.net/" +DOWNLOAD="https://sourceforge.net/projects/msn-proxy/files/msn-proxy/msn-proxy-0.7/msn-proxy-0.7.tar.gz/download" +MD5SUM="11faa72c70c36874685ca1b0ed382dcc" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Niels Horn" +EMAIL="niels.horn@gmail.com" +APPROVED="rworkman" diff --git a/network/msn-proxy/mysql.patch b/network/msn-proxy/mysql.patch new file mode 100644 index 0000000000000..55aac529ef06f --- /dev/null +++ b/network/msn-proxy/mysql.patch @@ -0,0 +1,11 @@ +--- msn-proxy-0.7_orig/mysql.h 2009-03-15 14:30:28.000000000 -0300 ++++ msn-proxy-0.7/mysql.h 2009-12-27 00:02:26.000000000 -0200 +@@ -22,7 +22,7 @@ + #define MYSQL_H + + #ifndef MYSQLCONFDIR +-#define MYSQLCONFDIR "/usr/local/etc/msn-proxy/mysql" ++#define MYSQLCONFDIR "/etc/msn-proxy/mysql" + #endif + #ifndef MYSQLCONF + #define MYSQLCONF "conf" diff --git a/network/msn-proxy/slack-desc b/network/msn-proxy/slack-desc new file mode 100644 index 0000000000000..4d3127b737503 --- /dev/null +++ b/network/msn-proxy/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +msn-proxy: msn-proxy (transparent msn proxy) +msn-proxy: +msn-proxy: msn-proxy is a light-weight transparent proxy for MSN Messenger +msn-proxy: clients that allows you to control and monitor the use of Messenger +msn-proxy: on your network. +msn-proxy: +msn-proxy: http://msn-proxy.sourceforge.net/ +msn-proxy: +msn-proxy: +msn-proxy: +msn-proxy: |