aboutsummaryrefslogtreecommitdiffstats
path: root/main/eggdrop/APKBUILD
blob: 7c0735434790f57ce2094c97b335ffd20f41c5fd (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=eggdrop
pkgver=1.6.21
pkgrel=0
pkgdesc="World's most popular Open Source IRC bot"
url="http://www.eggheads.org/"
arch="all"
license='GPL-2'
depends="tcl"
makedepends="tcl-dev !bind-libs"
install=
subpackages="$pkgname-doc $pkgname-logs2html $pkgname-gseen"
source="ftp://ftp.eggheads.org/pub/eggdrop/GNU/1.6/${pkgname}${pkgver}.tar.bz2
	eggdrop-langdir.patch
	gseen.mod.patch
	logs2html.mod.patch"

_builddir="$srcdir/${pkgname}${pkgver}"

prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"	
	./configure --prefix=/usr
	make config || return 1
	make -j1 || return 1
}

package() {
	cd "$_builddir"	
	make -j1 INSTALL="install -p" DEST="$pkgdir"/usr/share/eggdrop install \
		|| return 1
	rm -rf "$pkgdir"/usr/share/eggdrop/README \
		"$pkgdir"/usr/share/eggdrop/doc \
		"$pkgdir"/usr/share/eggdrop/eggdrop* \
		"$pkgdir"/usr/share/eggdrop/filesys \
		"$pkgdir"/usr/share/eggdrop/logs \
		"$pkgdir"/usr/share/eggdrop/modules \
		"$pkgdir"/usr/share/eggdrop/scripts/CONTENTS \
		|| return 1
	install -D -m 755 eggdrop "$pkgdir"/usr/bin/eggdrop || return 1
	install -D -m 644 doc/man1/eggdrop.1 \
		"$pkgdir"/usr/share/man/man1/eggdrop.1 || return 1
	
	#move modules to /usr/lib
	mkdir "$pkgdir"/usr/lib
	mv "$pkgdir"/usr/share/eggdrop/modules-* \
		"$pkgdir"/usr/lib/eggdrop || return 1


	# Fix paths of example eggdrop.conf
	sed -i -e '2d' -e '1s@^.*@#!/usr/bin/eggdrop@' \
		-e 's@scripts/@/usr/share/eggdrop/scripts/@g' \
		-e 's@help/@/usr/share/eggdrop/help/@g' \
		-e 's@modules/@/usr/lib/eggdrop/@g' \
		eggdrop.conf
	
	mkdir -p "$pkgdir"/usr/share/doc/eggdrop
	cp -a \
		COPYING FEATURES NEWS README doc/Changes1.6 eggdrop.conf \
		doc/ABOUT doc/BANS doc/BOTNET doc/BUG-REPORT doc/FIRST-SCRIPT \
		doc/MODULES doc/PARTYLINE doc/TEXT-SUBSTITUTIONS doc/TRICKS \
		doc/USERS doc/WEIRD-MESSAGES doc/tcl-commands.doc doc/settings \
		doc/html \
		"$pkgdir"/usr/share/doc/eggdrop
}

logs2html() {
	pkgdesc="logs2html module for eggdrop"
	install=""
	cd "$_builddir"

	for dir in language help; do
		mkdir -p "$subpkgdir"/usr/share/eggdrop/$dir
		mv "$pkgdir"/usr/share/eggdrop/$dir/logs2html.* "$subpkgdir"/usr/share/eggdrop/$dir/ || return 1
	done

	mkdir -p "$subpkgdir"/usr/lib/eggdrop
	mv "$pkgdir"/usr/lib/eggdrop/logs2html.so \
		"$subpkgdir"/usr/lib/eggdrop/ || return 1

	mkdir -p "$subpkgdir"/usr/share/eggdrop/log2html
	
	for files in logs2html.conf top100.tpl user.css readme.txt chan.list; do
		cp src/mod/logs2html.mod/${files} "$subpkgdir"/usr/share/eggdrop/log2html/ || return 1
	done
}


gseen() {
	pkgdesc="gseen module for eggdrop"
	install=""
	cd "$_builddir"
	mkdir -p "$subpkgdir"/usr/share/eggdrop/language
	mv "$pkgdir"/usr/share/eggdrop/language/gseen.* \
		"$subpkgdir"/usr/share/eggdrop/language/ || return 1
	mkdir -p "$subpkgdir"/usr/lib/eggdrop
	mv "$pkgdir"/usr/lib/eggdrop/gseen.so \
		"$subpkgdir"/usr/lib/eggdrop/ || return 1
	mkdir -p "$subpkgdir"/usr/share/eggdrop/gseen
	cp src/mod/gseen.mod/gseen.conf "$subpkgdir"/usr/share/eggdrop/gseen/ \
		|| return 1
	cp src/mod/gseen.mod/README "$subpkgdir"/usr/share/eggdrop/gseen/ \
		|| return 1
}

md5sums="5663b2daecc790e6e9237e1d5a2caa50  eggdrop1.6.21.tar.bz2
fdc2a01f611f14a8132225c8294f5039  eggdrop-langdir.patch
853a8526472ee964a8c94046cb9ae8b8  gseen.mod.patch
8b12435d0944b47898758d74bb227778  logs2html.mod.patch"