summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorNick Østergaard2014-06-08 12:22:03 +0200
committerNick Østergaard2014-06-08 12:22:03 +0200
commit66461fecea6fe24da9d84824c2cbdec780a10e8f (patch)
tree48333e0e6de63998aeefa490a56cf4b9dc851245 /PKGBUILD
downloadaur-66461fecea6fe24da9d84824c2cbdec780a10e8f.tar.gz
Add kicad-pretty-git
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD46
1 files changed, 46 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c7980376b5e8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Nick Østergaard <oe.nick at gmail dot com>
+pkgname=kicad-pretty-git
+pkgver=1
+pkgrel=1
+pkgdesc="KiCad .pretty repos"
+arch=('any')
+url=""
+license=('GPL')
+makedepends=('git')
+options=('!strip')
+install='kicad.install'
+
+
+package() {
+ cd "$srcdir"
+ msg "Fetching list of available pretty repos..."
+ PRETTY_REPOS=`curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> /dev/null \
+ | grep full_name | grep pretty \
+ | sed -r 's:.+ "KiCad/(.+)",:\1:'`
+
+ echo $PRETTY_REPOS
+
+ # Fetching the pretty repos. This should possibly be a bit more
+ # intelligent, such that it will remove orphaned repos.
+ for repo in $PRETTY_REPOS; do
+ if [ ! -e "$srcdir/$repo" ]; then
+ msg "Cloning $repo"
+ git clone "https://github.com/KiCad/$repo" "$srcdir/$repo"
+ else
+ msg "Updating $repo"
+ cd "$srcdir/$repo"
+ git pull
+ fi
+ done
+
+ mkdir -p "$pkgdir/usr/share/kicad/footprints"
+
+ for repo in $PRETTY_REPOS; do
+ cp -r "$srcdir/$repo" "$pkgdir/usr/share/kicad/footprints"
+ done
+
+ wget -q https://raw.githubusercontent.com/KiCad/kicad-library/master/template/fp-lib-table.for-pretty \
+ -O "$pkgdir/usr/share/kicad/footprints/fp-lib-table"
+}
+
+# vim:set ts=2 sw=2 et: