source: Slackware/i2p/i2p.SlackBuild @ e3de3dc

Last change on this file since e3de3dc was e3de3dc, checked in by sponge <sponge@…>, 11 years ago
  • Property mode set to 100755
File size: 3.7 KB
Line 
1#!/bin/sh
2# Heavily based on the Slackware 12.1 SlackBuild
3# Slackware build script for i2p
4
5# PLEASE READ THIS:
6# Probably you will never have to update i2p packages with upgradepkg,
7# just because i2p have an auto-update function.
8# How to start i2p:
9# After installpkg command, doinst.sh will execute a postinstallation script
10# needed by i2p. After that you have to chmod +x /etc/rc.d/rc.i2p and start
11# i2p service with /etc/rc.d/rc.i2p start.
12# Now tell your browser to user this proxy: localhost on port 4444 and open
13# this page: http://localhost:7657/index.jsp
14# Here you can configure i2p, watch network status and navigate anonimously.
15# It's suggested to subscribe to various dns host, like i2host.i2p
16# For any additional information, visit i2host.i2p and forum.i2p
17
18BUILD=1sim
19
20# put here installation dir, without first and last /
21# eg: usr/local
22INSTALL_DIR=opt
23NAME=i2p
24ARCH=noarch
25
26
27#
28# This mess is here due to the totally moronic way i2p does versioning.
29# We correct it here.
30#
31ROUTER=$(echo -ne "_")$(cat ../../router/java/src/net/i2p/router/RouterVersion.java | grep -e "public final static long BUILD" | cut -f2 -d"=" | cut -f1 -d";" | sed -re "s/ //g")
32if [ "$ROUTER" == "_" ] ;  then
33        ROUTER="_0"
34fi
35
36#
37# That was the easy one, now for the tough one.
38#
39
40CORE=$(cat ../../core/java/src/net/i2p/CoreVersion.java | grep -e "public final static String VERSION" | cut -f2 -d'"' | sed -re "s/ //g")
41CORE1=$(echo -n $CORE.x.x | sed -re "s/(.*)\.(.*)\.(.*)\.(.*)/\1/")
42CORE2=$(echo -n $CORE.x | sed -re "s/(.*)\.(.*)\.(.*)\.(.*)/\1/")
43
44if [ "$CORE.x.x" == "$CORE1" ] ; then
45        CORE=$(echo -ne $CORE".0.0")
46fi
47if [ "$CORE.x" == "$CORE2" ] ; then
48        CORE=$(echo -ne $CORE".0")
49fi
50
51VERSION=$(echo $CORE$ROUTER)
52#
53# Whew!
54# OK, let's build i2p
55#
56
57CWD=$(pwd)
58TMP=/tmp
59
60PKG=$TMP/package-i2p
61rm -rf $PKG
62mkdir -p $PKG
63
64cd $CWD/../../
65
66ant distclean
67#ant dist
68ant tarball
69
70tar xjvf i2p.tar.bz2 -C $TMP
71
72cd $TMP/i2p
73chown -R root:root .
74
75mkdir -p $PKG/$INSTALL_DIR/
76cp -a ../i2p $PKG/$INSTALL_DIR/
77
78mkdir -p $PKG/install
79
80#############################################################################
81# Preconfigureation to make package smaller
82#############################################################################
83cd $PKG/$INSTALL_DIR/i2p
84
85# wrapper.config $INSTALL_PATH and $SYSTEM_java_io_tmpdir
86sed "s|\$INSTALL_PATH|$INSTALL_DIR/i2p|g" wrapper.config > a
87sed "s|\$SYSTEM_java_io_tmpdir|/var/tmp|g" a > wrapper.config
88# eepget %INSTALL_PATH
89sed "s|\$INSTALL_PATH|$INSTALL_DIR/i2p|g" eepget > a
90rm eepget
91mv a eepget
92# runplain.sh %INSTALL_PATH and %SYSTEM_java_io_tmpdir
93sed "s|%INSTALL_PATH|$INSTALL_DIR/i2p|g" runplain.sh > a
94sed "s|%SYSTEM_java_io_tmpdir|/var/tmp|g" a > runplain.sh
95# i2prouter %INSTALL_PATH and %SYSTEM_java_io_tmpdir
96sed "s|%INSTALL_PATH|$INSTALL_DIR/i2p|g" i2prouter > a
97sed "s|%SYSTEM_java_io_tmpdir|/var/tmp|g" a > i2prouter
98
99chmod 744 ./i2prouter
100chmod 744 ./osid
101chmod 744 ./runplain.sh
102chmod 744 ./eepget
103chmod 744 ./scripts/i2pbench.sh
104chmod 744 ./scripts/i2ptest.sh
105rm -Rf ./lib/*.dll ./*.bat ./*.exe ./installer ./icons ./a postinstall.sh
106
107mv $PKG/$INSTALL_DIR/i2p/*.config $PKG/install
108mv $PKG/$INSTALL_DIR/i2p/blocklist.txt $PKG/$INSTALL_DIR/i2p/blocklist.txt.new
109mv $PKG/$INSTALL_DIR/i2p/eepsite/jetty.xml $PKG/$INSTALL_DIR/i2p/eepsite/jetty.xml.new
110mv $PKG/$INSTALL_DIR/i2p/eepsite/docroot/index.html $PKG/$INSTALL_DIR/i2p/eepsite/docroot/index.html.new
111mv $PKG/$INSTALL_DIR/i2p/eepsite/docroot/favicon.ico $PKG/$INSTALL_DIR/i2p/eepsite/docroot/favicon.ico.new
112sed "s|directory|/$INSTALL_DIR/i2p/|g" $CWD/doinst.sh > $PKG/install/doinst.sh
113cat $CWD/slack-desc > $PKG/install/slack-desc
114
115cd $PKG
116requiredbuilder -v -y -s $CWD $PKG
117makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
Note: See TracBrowser for help on using the repository browser.