summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Smith2015-06-02 11:26:55 +1000
committerPhillip Smith2015-06-02 11:26:55 +1000
commita1ac6816dd4ea4f38d841b1022eb4f57c123f821 (patch)
treebac3c8cc10184014c0dead2660d55da1d318a81d
downloadaur-a1ac6816dd4ea4f38d841b1022eb4f57c123f821.tar.gz
initial commit
-rw-r--r--.SRCINFO41
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD102
-rw-r--r--logrotate.mb7
-rw-r--r--mirrorbrain.conf15
-rw-r--r--mirrorbrain.install12
6 files changed, 181 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7b25c3bfc172
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,41 @@
+pkgbase = mirrorbrain
+ pkgdesc = an open source framework to run a content delivery network using mirror servers.
+ pkgver = 2.18.1
+ pkgrel = 1
+ url = http://mirrorbrain.org
+ install = mirrorbrain.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = apache>=2.2.6
+ makedepends = apache-mod_form
+ makedepends = python
+ depends = apache>=2.2.6
+ depends = apache-mod_form
+ depends = apache-mod_geoip2
+ depends = geoip
+ depends = perl
+ depends = perl-config-inifiles
+ depends = perl-libwww
+ depends = perl-dbd-pg
+ depends = perl-digest-md4
+ depends = perl-timedate
+ depends = python2
+ depends = python2-psycopg2
+ depends = python2-sqlobject
+ depends = cmdln
+ optdepends = postgresqli-server: recommended database, but can use any database the Apache DBD API supports
+ optdepends = mod_asn: refined mirror selection and full exploitation of network locality
+ provides = mod_mirrorbrain
+ backup = etc/mirrorbrain.conf
+ source = http://mirrorbrain.org/files/releases/mirrorbrain-2.18.1.tar.gz
+ source = http://mirrorbrain.org/files/releases/mirrorbrain-2.18.1.tar.gz.asc
+ source = mirrorbrain.conf
+ source = logrotate.mb
+ md5sums = a3440d971dcc1b56ee2a9df0bf99b2af
+ md5sums = SKIP
+ md5sums = 82cfccc53e67f589091ab4c2c9720e2a
+ md5sums = 9198922d52ebe83610ddc14db52aea05
+
+pkgname = mirrorbrain
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..075d3bebcbd2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/mirrorbrain-*.pkg.tar.xz
+/mirrorbrain-*.tar.gz
+/src/
+/pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..787aa63bbe68
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,102 @@
+# Maintainer: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
+# http://github.com/fukawi2/aur-packages
+
+### I AM ONLY THE PACKAGER, NOT THE DEVELOPER
+### Please ask support questions about this software in one of:
+### 1) The AUR comments; OR
+### 2) Upstream forums/maillist etc; OR
+### 3) The ArchLinux forums
+### I do not always know enough about the software itself, or don't have the
+### time to promptly respond to direct emails.
+### If you have found a problem with the package/PKGBUILD (as opposed to
+### the software) then please do email me or post an AUR comment.
+
+pkgname=mirrorbrain
+pkgver=2.18.1
+pkgrel=1
+pkgdesc="an open source framework to run a content delivery network using mirror servers."
+arch=('i686' 'x86_64')
+url="http://mirrorbrain.org"
+license=('GPL')
+depends=('apache>=2.2.6' 'apache-mod_form' 'apache-mod_geoip2' 'geoip'
+ 'perl' 'perl-config-inifiles' 'perl-libwww' 'perl-dbd-pg' 'perl-digest-md4' 'perl-timedate'
+ 'python2' 'python2-psycopg2' 'python2-sqlobject' 'cmdln')
+makedepends=('apache>=2.2.6' 'apache-mod_form' 'python')
+optdepends=('postgresqli-server: recommended database, but can use any database the Apache DBD API supports'
+ 'mod_asn: refined mirror selection and full exploitation of network locality')
+provides=('mod_mirrorbrain')
+backup=("etc/$pkgname.conf")
+install="$pkgname.install"
+source=("http://mirrorbrain.org/files/releases/$pkgname-$pkgver.tar.gz"
+ "$pkgname.conf"
+ 'logrotate.mb')
+md5sums=('a3440d971dcc1b56ee2a9df0bf99b2af'
+ '82cfccc53e67f589091ab4c2c9720e2a'
+ '9198922d52ebe83610ddc14db52aea05')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver/tools"
+ # Patch for Arch storing GeoIP DB in different location
+ sed -e 's|/var/lib/GeoIP/GeoIP.dat|/usr/share/GeoIP/GeoIP.dat|g' \
+ -i geoiplookup_continent.c \
+ -i geoiplookup_city.c
+ gcc -Wall -o geoiplookup_continent geoiplookup_continent.c -lGeoIP
+ gcc -Wall -o geoiplookup_city geoiplookup_city.c -lGeoIP
+
+ # fixes to use python2 instead of python
+ cd $srcdir/$pkgname-$pkgver
+ sed -e 's|/usr/bin/python|/usr/bin/python2|g' \
+ -i tools/rsyncusers \
+ -i tools/rsyncinfo \
+ -i tools/null-rsync \
+ -i tools/bdecode \
+ -i tools/push2mirrors \
+ -i mb/mb/hashes.py \
+ -i mb/mb/mberr.py \
+ -i mb/mb/crawlers/ftp.py \
+ -i mb/mb.py \
+ -i mirrorprobe/mirrorprobe.py
+}
+
+build() {
+ # Compile the apache modules
+ cd "$srcdir/$pkgname-$pkgver/mod_mirrorbrain/"
+ apxs -c mod_mirrorbrain.c
+ cd "$srcdir/$pkgname-$pkgver/mod_autoindex_mb/"
+ apxs -c mod_autoindex_mb.c
+}
+
+package() {
+ # Install the apache modules
+ cd "$srcdir/$pkgname-$pkgver/mod_mirrorbrain/"
+ install -Dm755 .libs/mod_mirrorbrain.so $pkgdir/usr/lib/httpd/modules/mod_mirrorbrain.so
+ cd "$srcdir/$pkgname-$pkgver/mod_autoindex_mb/"
+ install -Dm755 .libs/mod_autoindex_mb.so $pkgdir/usr/lib/httpd/modules/mod_autoindex_mb.so
+
+ # Install the tools
+ cd "$srcdir/$pkgname-$pkgver/"
+ install -Dm755 tools/geoiplookup_continent $pkgdir/usr/bin/geoiplookup_continent
+ install -Dm755 tools/geoiplookup_city $pkgdir/usr/bin/geoiplookup_city
+ install -Dm755 tools/geoip-lite-update $pkgdir/usr/bin/geoip-lite-update
+ install -Dm755 tools/null-rsync $pkgdir/usr/bin/null-rsync
+ install -Dm755 tools/scanner.pl $pkgdir/usr/bin/scanner
+ install -Dm755 mirrorprobe/mirrorprobe.py $pkgdir/usr/bin/mirrorprobe
+
+ # Install the mb script
+ cd "$srcdir/$pkgname-$pkgver/mb/"
+ python2 setup.py install --root="$pkgdir"
+
+ # Install SQL templates
+ cd "$srcdir/$pkgname-$pkgver/sql/"
+ install -dm755 $pkgdir/usr/share/$pkgname/sql/
+ cp -rv * $pkgdir/usr/share/$pkgname/sql/
+
+ # Install default configuration file
+ cd "$srcdir/"
+ install -Dm640 $srcdir/$pkgname.conf $pkgdir/etc/$pkgname.conf
+
+ # install the logrotate script (to suit the above default conf)
+ install -Dm644 $srcdir/logrotate.mb $pkgdir/etc/logrotate.d/$pkgname
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/logrotate.mb b/logrotate.mb
new file mode 100644
index 000000000000..87f1638f3871
--- /dev/null
+++ b/logrotate.mb
@@ -0,0 +1,7 @@
+/home/mirrorbrain/logs/mirrorprobe.log {
+ noolddir
+ missingok
+ daily
+ rotate 90
+ compress
+}
diff --git a/mirrorbrain.conf b/mirrorbrain.conf
new file mode 100644
index 000000000000..8c0991f567c1
--- /dev/null
+++ b/mirrorbrain.conf
@@ -0,0 +1,15 @@
+[general]
+instances = main
+
+[main]
+dbuser = mirrorbrain
+dbpass = MySuperSecurePassword
+dbdriver = postgresql
+dbhost = localhost
+dbname = mirrorbrain
+#scan_top_include =
+
+[mirrorprobe]
+mailto = me@example.com
+logfile = /home/mirrorbrain/logs/mirrorprobe.log
+loglevel = INFO
diff --git a/mirrorbrain.install b/mirrorbrain.install
new file mode 100644
index 000000000000..bdf5327ff0d8
--- /dev/null
+++ b/mirrorbrain.install
@@ -0,0 +1,12 @@
+post_install() {
+ [[ -e '/usr/bin/mb.py' ]] && rm -f /usr/bin/mb.py
+ [[ -e '/usr/bin/mb.pyc' ]] && rm -f /usr/bin/mb.pyc
+ echo "Creating group 'mirrorbrain'"
+ groupadd -r -g 998 mirrorbrain
+ echo "Creating user 'mirrorbrain'"
+ useradd -r -u 998 -g mirrorbrain -m -c 'Mirrorbrain' -d /home/mirrorbrain mirrorbrain
+ echo "mirrorbrain: Configuration instructions need to be followed:"
+ echo " http://mirrorbrain.org/docs/installation/source/"
+}
+
+# vim:set ts=2 sw=2 et: