summaryrefslogtreecommitdiff
path: root/network/wicd/wicd.SlackBuild
blob: e1aa892b285aaf41ea6c61f7ead98235f3056ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh

# Copyright 2008  Robby Workman  Northport, AL, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=wicd
VERSION=${VERSION:-1.4.2}
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $PKG	# Yes, we'll do this all inside $PKG :)
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/${PRGNAM}_${VERSION}-src.tar.bz2
chown -R root:root .
find . -type f -exec chmod 0644 {} \;
find . -type f -name "*.py" -exec chmod 0755 {} \;

# Unapplied patches - use them at your own risk.
# Thanks to nawcom for the ideas on this
#patch -p1 < $CWD/dhcpcd_daemon.py.diff
#patch -p1 < $CWD/dhcpcd_networking.py.diff

# Move the init script to Slackware's place and name it accordingly
# Also, let's not clobber it on upgrades
mkdir -p etc/rc.d
mv etc/init.d/wicd etc/rc.d/rc.wicd.new
chmod 0755 etc/rc.d/rc.wicd.new
rmdir etc/init.d

# Don't clobber the config file either
mv etc/dbus-1/system.d/wicd.conf etc/dbus-1/system.d/wicd.conf.new

# Give the menu entry desktop file a sane name (really doesn't matter though)
mv usr/share/applications/hammer-00186ddbac.desktop \
  usr/share/applications/wicd.desktop

# We don't have pm-utils on Slackware, so this can go
rm -rf etc/acpi

mkdir -p usr/doc/$PRGNAM-$VERSION
cat $CWD/README > usr/doc/$PRGNAM-$VERSION/README
# The source code does not include a copy of the the gpl-2.0
# license so lets add it for them.
zcat $CWD/gpl-2.0.txt.gz > usr/doc/$PRGNAM-$VERSION/LICENSE

mkdir -p install
cat $CWD/slack-desc > install/slack-desc
cat $CWD/doinst.sh > install/doinst.sh

/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz