summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Gathoye2016-08-11 20:54:50 +0200
committerWilliam Gathoye2016-08-11 21:10:02 +0200
commit20c9796d9b1e61c62cb62f4479e00a6c607684a6 (patch)
tree849b795c8c3e3b5624c7a9f9fc9d8e8964a2fea3
downloadaur-20c9796d9b1e61c62cb62f4479e00a6c607684a6.tar.gz
Initial commit for PKGBUILD, .SRCINFO and .install file
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD72
-rw-r--r--progit2-git.install9
3 files changed, 97 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..8c18a335cb3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = progit2-git
+ pkgdesc = A package to build the latest version of the progit2 book and read it when offline
+ pkgver = 2.0.0.r611.g024a3a0
+ pkgrel = 1
+ url = https://github.com/progit/progit2
+ install = progit2-git.install
+ arch = any
+ license = CCPL
+ makedepends = git
+ makedepends = ruby-bundler
+ makedepends = ruby
+ source = git+https://github.com/progit/progit2
+ sha512sums = SKIP
+
+pkgname = progit2-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..70a8c0c1953
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer: William Gathoye <william at gathoye dot be>
+# Contributor:
+
+pkgname=progit2-git
+pkgver=2.0.0.r611.g024a3a0
+pkgrel=1
+pkgdesc="A package to build the latest version of the progit2 book and read it when offline"
+arch=('any')
+
+url="https://github.com/progit/progit2"
+license=('CCPL')
+
+makedepends=(
+ 'git'
+ 'ruby-bundler'
+ 'ruby'
+)
+
+install=${pkgname}.install
+
+source=('git+https://github.com/progit/progit2')
+sha512sums=('SKIP')
+
+# Get the most recent un-annotated tag reachable from the last commit
+pkgver() {
+ cd "${pkgname%-git}"
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$srcdir/${pkgname%-git}"
+
+ # Gem dependencies can be installed per user and not systemwide in
+ # /home/<your username>/.gem/ruby/<ruby version>/, but we won't be able to
+ # clean that directory after having build the book, leaving unused
+ # dependencies. -> Dirty
+ # export GEM_HOME=$(ruby -e 'print Gem.user_dir')
+
+
+ # Gem dependencies can be installed as an Arch Linux package which is
+ # created by tools like gem2arch or pacgem. However, what will happen if
+ # package wearing the same name as those installed by these tools appear in
+ # the Arch repos? As conflict checks are not performed by these tools, we
+ # highly risk package names clashes. -> Too dangerous.
+
+ # Gem dependencies can also be installed in the directory we specify, but
+ # the latter will be removed after we have build the book. The PKGBUILD
+ # will have to redownload again all these deps if the user wants to update
+ # hos book.
+ bundle install --path .bundle
+
+ # Override the directory
+ export GEM_HOME=".bundle"
+
+ bundle install
+}
+
+package() {
+ # When entering here, we are in the src directory, go in the cloned progit2
+ # directory.
+ cd "$srcdir/${pkgname%-git}"
+
+ bundle exec rake book:build
+
+ # Install to /usr/share/doc/progit2
+ install -dm755 "$pkgdir/usr/share/doc/${pkgname%-git}/"
+ cp "$srcdir/${pkgname%-git}/progit.epub" "$pkgdir/usr/share/doc/${pkgname%-git}/"
+ cp "$srcdir/${pkgname%-git}/progit-kf8.epub" "$pkgdir/usr/share/doc/${pkgname%-git}/"
+ cp "$srcdir/${pkgname%-git}/progit.mobi" "$pkgdir/usr/share/doc/${pkgname%-git}/"
+ cp "$srcdir/${pkgname%-git}/progit.pdf" "$pkgdir/usr/share/doc/${pkgname%-git}/"
+ cp "$srcdir/${pkgname%-git}/progit.pdfmarks" "$pkgdir/usr/share/doc/${pkgname%-git}/"
+}
diff --git a/progit2-git.install b/progit2-git.install
new file mode 100644
index 00000000000..8202977471d
--- /dev/null
+++ b/progit2-git.install
@@ -0,0 +1,9 @@
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+
+ cat << EOF
+==> The progit2 book has been installed to /usr/share/doc/progit2/
+EOF
+
+}