source: Slackware/i2p/i2p.SlackBuild @ f70be29

Last change on this file since f70be29 was f70be29, checked in by sponge <sponge@…>, 12 years ago

small change so that the version number makes more sense

  • Property mode set to 100755
File size: 2.3 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# es: 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
67ant dist
68
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
79mv $PKG/$INSTALL_DIR/i2p/blocklist.txt $PKG/$INSTALL_DIR/i2p/blocklist.txt.new
80mv $PKG/$INSTALL_DIR/i2p/*.config $PKG/install
81sed "s|directory|/$INSTALL_DIR/i2p/|g" $CWD/doinst.sh > $PKG/install/doinst.sh
82cat $CWD/slack-desc > $PKG/install/slack-desc
83cd $PKG
84requiredbuilder -v -y -s $CWD $PKG
85makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
Note: See TracBrowser for help on using the repository browser.