Changeset 5190b2d for Slackware


Ignore:
Timestamp:
Nov 4, 2009 10:27:02 AM (11 years ago)
Author:
sponge <sponge@…>
Branches:
master
Children:
a3b1c790
Parents:
b65865b8
Message:

Fixups to Slackware scripts

Location:
Slackware
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Slackware/i2p-base/doinst.sh

    rb65865b8 r5190b2d  
    11#!/bin/sh
     2#
     3#
     4# Now in the future we only need to look for '#I2P' and '#/I2P'
     5# for modifications to rc.local and rc.local_shutdown.
     6# I was a moron for not doing it this way in the first place :-) -- Sponge
     7#
     8#
     9
    210touch /etc/rc.d/rc.local
    311touch /etc/rc.d/rc.local_shutdown
    412
    5 I2PRCA=`grep -c /etc/rc.d/rc.local -e i2p`
    6 I2PRCB=`grep -c /etc/rc.d/rc.local_shutdown -e i2p`
    7 
    813echo
     14echo -n "Check 1: /etc/rc.d/rc.local "
     15I2PRCA=`grep -c /etc/rc.d/rc.local -e '/etc/rc.d/rc.i2p'`
    916
    1017if [ $I2PRCA -eq 0 ] ; then
     18        echo '#I2P' >> /etc/rc.d/rc.local
     19        echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
    1120        echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
    1221        echo "        sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
    1322        echo "fi" >> /etc/rc.d/rc.local
    14         echo "/etc/rc.d/rc.local modified."
     23        echo '#/I2P' >> /etc/rc.d/rc.local
     24        echo "modified."
    1525else
    16         echo "/etc/rc.d/rc.local looks OK"
     26        echo -n "looks OK so far,"
     27        # Fix old installs, or where people have modified.
     28
     29        echo -n " Check 1A: "
     30        I2PRCC=`grep -c /etc/rc.d/rc.local -e 'i2p-\*\.tmp'`
     31
     32        if [ $I2PRCC -eq 0 ] ; then
     33                DATA=$(cat /etc/rc.d/rc.local | sed -re 's/if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/#I2P\n\( cd \/tmp ; rm -Rf i2p-*.tmp \)\nif \[ -x \/etc\/rc.d\/rc.i2p \] ; then/')
     34                echo "${DATA}" > /etc/rc.d/rc.local
     35                echo -n "additional modifications applied,"
     36        else
     37                echo -n "looks OK so far,"
     38        fi
     39
     40        echo -n " Check 1B: "
     41        I2PRCE=`grep -c /etc/rc.d/rc.local -e 'i2p-\*\.tmp'`
     42        if [ $I2PRCE -eq 0 ] ; then
     43                DATATOP=$(cat /etc/rc.d/rc.local | sed -n '0,/i2p-\*\.tmp/p' | sed '$d' )
     44                DATABOT=$(cat /etc/rc.d/rc.local | sed -n '/i2p-\*\.tmp/,$p' | sed -n '/^fi/,$p' | sed "1d")
     45                echo "${DATATOP}" > /etc/rc.d/rc.local
     46                echo '#I2P' >> /etc/rc.d/rc.local
     47                echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
     48                echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
     49                echo "        sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
     50                echo "fi" >> /etc/rc.d/rc.local
     51                echo '#/I2P' >> /etc/rc.d/rc.local
     52                echo "${DATABOT}" >> /etc/rc.d/rc.local
     53               
     54                echo -n "additional modifications applied,"
     55        else
     56                echo -n "looks ok so far,"
     57        fi
     58        echo -n " Check 1C: "
     59        I2PRCF=`grep -c /etc/rc.d/rc.local -e '#/I2P'`
     60        if [ $I2PRCF -eq 0 ] ; then
     61                DATATOP=$(cat /etc/rc.d/rc.local | sed -n '0,/^#I2P/p' | sed '$d' )
     62                DATABOT=$(cat /etc/rc.d/rc.local | sed -n '/^#I2P/,$p' | sed -n '/^fi/,$p' | sed "1d")
     63                echo "${DATATOP}" > /etc/rc.d/rc.local
     64                echo '#I2P' >> /etc/rc.d/rc.local
     65                echo '( cd /tmp ; rm -Rf i2p-*.tmp )' >> /etc/rc.d/rc.local
     66                echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local
     67                echo "        sh /etc/rc.d/rc.i2p start" >> /etc/rc.d/rc.local
     68                echo "fi" >> /etc/rc.d/rc.local
     69                echo '#/I2P' >> /etc/rc.d/rc.local
     70                echo "${DATABOT}" >> /etc/rc.d/rc.local
     71
     72                echo -n "additional modifications applied,"
     73        else
     74                echo -n "looks ok so far,"
     75        fi
     76        echo " Done."
    1777fi
    1878
     79echo -n "Check 2: /etc/rc.d/rc.local_shutdown "
     80I2PRCB=`grep -c /etc/rc.d/rc.local_shutdown -e '/etc/rc.d/rc.i2p'`
    1981if [ $I2PRCB -eq 0 ] ; then
     82        echo "#I2P" >> /etc/rc.d/rc.local_shutdown
    2083        echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
    2184        echo "        sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
    2285        echo "fi" >> /etc/rc.d/rc.local_shutdown
    23         echo "/etc/rc.d/rc.local_shutdown modified."
     86        echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
     87        echo "modified."
    2488else
    25         echo "/etc/rc.d/rc.local_shutdown looks OK"
     89        echo -n "looks OK so far,"
     90        # Fix old installs
     91
     92        echo -n " Check 1A: "
     93        I2PRCG=`grep -c /etc/rc.d/rc.local_shutdown -e '#I2P'`
     94        if [ $I2PRCG -eq 0 ] ; then
     95                DATATOP=$(cat /etc/rc.d/rc.local_shutdown | sed -n '0,/^if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/p' | sed '$d' )
     96                DATABOT=$(cat /etc/rc.d/rc.local_shutdown | sed -n '/^if \[ -x \/etc\/rc\.d\/rc\.i2p \] ; then/,$p' | sed -n '/^fi/,$p' | sed "1d")
     97                echo "${DATATOP}" > /etc/rc.d/rc.local_shutdown
     98                echo '#I2P' >> /etc/rc.d/rc.local_shutdown
     99                echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
     100                echo "        sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
     101                echo "fi" >> /etc/rc.d/rc.local_shutdown
     102                echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
     103                echo "${DATABOT}" >> /etc/rc.d/rc.local_shutdown
     104                echo -n "additional modifications applied,"
     105        else
     106                echo -n "looks OK so far,"
     107        fi
     108        echo -n " Check 1B: "
     109        I2PRCH=`grep -c /etc/rc.d/rc.local_shutdown -e '#/I2P'`
     110        if [ $I2PRCH -eq 0 ] ; then
     111                DATATOP=$(cat /etc/rc.d/rc.local_shutdown | sed -n '0,/^#I2P/p' | sed '$d' )
     112                DATABOT=$(cat /etc/rc.d/rc.local_shutdown | sed -n '/^#I2P/,$p' | sed -n '/^fi/,$p' | sed "1d")
     113                echo "${DATATOP}" > /etc/rc.d/rc.local_shutdown
     114                echo '#I2P' >> /etc/rc.d/rc.local_shutdown
     115                echo "if [ -x /etc/rc.d/rc.i2p ] ; then" >> /etc/rc.d/rc.local_shutdown
     116                echo "        sh /etc/rc.d/rc.i2p stop" >> /etc/rc.d/rc.local_shutdown
     117                echo "fi" >> /etc/rc.d/rc.local_shutdown
     118                echo "#/I2P" >> /etc/rc.d/rc.local_shutdown
     119                echo "${DATABOT}" >> /etc/rc.d/rc.local_shutdown
     120                echo -n "additional modifications applied,"
     121        else
     122                echo -n "looks OK so far,"
     123        fi
     124        echo " Done."
    26125fi
    27126
     
    30129                chmod +x /etc/rc.d/rc.i2p.new
    31130        fi
    32         echo
     131        # Hopefully get admin's attention.
     132        echo -ne "\007" ; sleep 0.3
     133        echo -ne "\007" ; sleep 0.3
     134        echo -ne "\007" ; sleep 0.3
     135        echo -ne "\007" ; sleep 0.3
     136        echo -ne "\007" ; sleep 0.3
     137        echo -ne "\007" ; sleep 0.3
     138        echo -e "\007" ; sleep 0.3
    33139        echo "It apears that you already have /etc/rc.d/rc.i2p"
    34         echo "You may wish to replace it with /etc/rc.d/rc.i2p.new"
    35         echo
     140        echo "You should replace it with /etc/rc.d/rc.i2p.new as soon as possible"
     141        echo -ne "\007" ; sleep 0.3
     142        echo -ne "\007" ; sleep 0.3
     143        echo -ne "\007" ; sleep 0.3
     144        echo -ne "\007" ; sleep 0.3
     145        echo -ne "\007" ; sleep 0.3
     146        echo -ne "\007" ; sleep 0.3
     147        echo -e "\007" ; sleep 0.3
    36148else
    37149        mv /etc/rc.d/rc.i2p.new /etc/rc.d/rc.i2p
    38150        echo
    39151        echo "Installation finished. The i2p start/stop script has been"
    40         echo "installed on /etc/rc.d directory. You should chmod +x"
     152        echo "installed in /etc/rc.d . You should chmod +x"
    41153        echo '/etc/rc.d/rc.i2p to start it on boot.'
    42154        echo
  • Slackware/i2p-base/i2p-base.SlackBuild

    rb65865b8 r5190b2d  
    11#!/bin/sh
    2 # Heavily based on the Slackware 12.1 SlackBuild
    3 # Slackware build script for i2p
    4 
     2#
     3# Heavily based on the Slackware 12.2 SlackBuild
     4# Slackware build script for I2P
     5#
    56# 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.
     7# How to start I2P:
     8# After installpkg command, doinst.sh will execute a post-installation script
     9# needed by I2P. After that you have to chmod +x /etc/rc.d/rc.i2p and start
     10# I2P service with /etc/rc.d/rc.i2p start.
     11#
    1212# Now tell your browser to user this proxy: localhost on port 4444 and open
    1313# this page: http://localhost:7657/index.jsp
    14 # Here you can configure i2p, watch network status and navigate anonimously.
     14#
     15# Here you can configure I2P, watch network status and navigate anonimously.
    1516# It's suggested to subscribe to various dns host, like i2host.i2p
    1617# For any additional information, visit i2host.i2p and forum.i2p
     18#
    1719
    1820CWD=$(pwd)
    1921TMP=/tmp
    2022PKG=/$TMP/package-base-i2p
    21 rm -rf $PKG
    22 mkdir -p $PKG
    23 # put here installation dir, without first and last /
    24 # es: usr/local
    2523NAME=i2p-base
    26 VERSION=0.0.1
     24VERSION=0.0.2
    2725BUILD=1sponge
    2826ARCH=noarch
    2927INSTALL_DIR=opt
     28
     29# Less than slackware 13?
     30SLKPLT=$(cat /etc/slackware-version | sed -re "s/(Slackware )([0-9]*)(.*)/\2/")
     31if [ $SLKPLT -lt 13 ] ; then
     32        EXT=tgz
     33else
     34        EXT=txz
     35fi
     36
     37rm -rf $PKG
     38mkdir -p $PKG
    3039cd $PKG
    3140chown -R root:root .
     
    3342mkdir -p $PKG/etc/rc.d
    3443mkdir -p $PKG/install
    35 sed "s|directory|/$INSTALL_DIR/i2p/i2prouter|g" $CWD/rc.i2p_def > $PKG/etc/rc.d/rc.i2p.new
     44sed "s|directory|/$INSTALL_DIR/i2p/i2prouter|g" "$CWD/rc.i2p_def" > $PKG/etc/rc.d/rc.i2p.new
    3645chmod 644 $PKG/etc/rc.d/rc.i2p.new
    37 sed "s|directory|/$INSTALL_DIR/i2p/|g" $CWD/doinst.sh > $PKG/install/doinst.sh
    38 cat $CWD/slack-desc > $PKG/install/slack-desc
     46cat "$CWD/doinst.sh" > $PKG/install/doinst.sh
     47cat "$CWD/slack-desc" > $PKG/install/slack-desc
    3948
    4049cd $PKG
    4150#
    42 # Not really that important to exec this.
    43 #requiredbuilder -v -y -s $CWD $PKG
     51# Not really that important to exec this 
     52# as there aren't any deps we don't know.
    4453#
    45 cat $CWD/slack-required > $PKG/install/slack-required
    46 makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
     54# requiredbuilder -v -y -s $CWD $PKG
     55#
     56cat "$CWD/slack-required" > $PKG/install/slack-required
     57makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.$EXT
  • Slackware/i2p-base/rc.i2p_def

    rb65865b8 r5190b2d  
    1010}
    1111
     12i2p_restart() {
     13 /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory restart)"
     14}
     15
     16i2p_status() {
     17 /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )"
     18}
     19
     20i2p_console() {
     21 /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory console )"
     22}
     23
     24i2p_dump() {
     25 /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory dump )"
     26}
     27
    1228case "$1" in
    1329'start')
     
    1834  ;;
    1935'restart')
    20   i2p_stop
    21   i2p_start
     36  i2p_restart
     37  ;;
     38'status')
     39  i2p_status
     40  ;;
     41'console')
     42  i2p_console
     43  ;;
     44'dump')
     45  i2p_dump
    2246  ;;
    2347*)
    24   echo "usage $0 start|stop|restart"
     48  echo "usage $0 start|stop|restart|status|console|dump"
    2549  ;;
    2650esac
  • Slackware/i2p/i2p.SlackBuild

    rb65865b8 r5190b2d  
    11#!/bin/sh
    2 # Heavily based on the Slackware 12.1 SlackBuild
    3 # Slackware build script for i2p
    4 
     2#
     3# Heavily based on the Slackware 12.2 SlackBuild
     4# Slackware build script for I2P
     5#
    56# 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
     7# Probably you will never have to update I2P packages with upgradepkg,
     8# just because I2P has an auto-update function.
     9# Really you should not ever use any "upgrade" method.
     10#
     11# The correct way to upgrade is to:
     12# 1: install the upgrade
     13# 2: remove the old package
     14#
     15# It is a terrible shame that upgradepkg doesn't do this, infact,
     16# it would actually be the correct way for *any* package!
     17#
     18#
    1719
    1820BUILD=1sponge
    19 
    20 # put here installation dir, without first and last /
    21 # eg: usr/local
    2221INSTALL_DIR=opt
    2322NAME=i2p
    2423ARCH=noarch
     24
     25# Less than slackware 13?
     26SLKPLT=$(cat /etc/slackware-version | sed -re "s/(Slackware )([0-9]*)(.*)/\2/")
     27if [ $SLKPLT -lt 13 ] ; then
     28        EXT=tgz
     29else
     30        EXT=txz
     31fi
    2532
    2633
     
    118125# It also did not catch the shell requirements! BOOOOOOOOOOO! HISSSSSSSS!
    119126#
    120 #requiredbuilder -v -y -s $CWD $PKG
     127# requiredbuilder -v -y -s $CWD $PKG
    121128#
    122129cat $CWD/slack-required > $PKG/install/slack-required
    123 makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.tgz
     130makepkg -l y -c n $CWD/${NAME}-$VERSION-$ARCH-$BUILD.$EXT
Note: See TracChangeset for help on using the changeset viewer.