summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorncoif2017-12-27 19:23:45 +0000
committerncoif2017-12-27 19:33:23 +0000
commit332b26e0fd8ce95f90871a656536b3d5789247fb (patch)
treeda6a293ae6755fbf85a956a6d4685dfc9a3dc5e1
parent5846fed964bf3f104c7245b082998f79a4d0efb5 (diff)
downloadaur-332b26e0fd8ce95f90871a656536b3d5789247fb.tar.gz
auto-update script
-rw-r--r--PKGBUILD.template107
-rwxr-xr-xauto-update.sh32
2 files changed, 139 insertions, 0 deletions
diff --git a/PKGBUILD.template b/PKGBUILD.template
new file mode 100644
index 000000000000..72b530f276f3
--- /dev/null
+++ b/PKGBUILD.template
@@ -0,0 +1,107 @@
+# -*- sh -*-
+# vim: ft=shell
+
+# Maintainer: ncoif <ncoif@gmx.com>
+# Contributor: Allen Li <darkfeline@felesatra.moe>
+# Contributor: Thomas Dziedzic <gostrc@gmail.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
+# Contributor: tobias [ tobias at archlinux org ]
+# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
+
+_pkgbase=vim
+pkgname=vim-x11
+pkgver=__VERSION__
+_versiondir=74
+pkgrel=1
+_upstream_pkgrel=1
+arch=('i686' 'x86_64')
+license=('custom:vim')
+url='http://www.vim.org'
+makedepends=('gpm' 'python2' 'python' 'ruby' 'libxt' 'lua' 'gawk' 'tcl')
+source=("vim-$pkgver.tar.gz::http://github.com/vim/vim/archive/v$pkgver.tar.gz"
+ 'vimrc'
+ 'archlinux.vim')
+sha1sums=('__SHA1SUM__'
+ 'b8ca9132826e53cd14431ef9767e4fd820faa782'
+ '94f7bb87b5d06bace86bc4b3ef1372813b4eedf2')
+
+pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor (X11 support, no GUI)'
+depends=("vim-runtime=${pkgver}-${_upstream_pkgrel}" 'gpm' 'acl')
+optdepends=('python2: Python 2 language support'
+ 'python: Python 3 language support'
+ 'ruby: Ruby language support'
+ 'lua: Lua language support'
+ 'perl: Perl language support'
+ 'tcl: Tcl language support')
+conflicts=('vim-minimal' 'vim' 'vim-python3' 'gvim' 'gvim-python3')
+provides=("vim=${pkgver}-${_upstream_pkgrel}" 'xxd')
+
+prepare() {
+ cd vim-$pkgver
+
+ # define the place for the global (g)vimrc file (set to /etc/vimrc)
+ sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' \
+ src/feature.h
+ sed -i 's|^.*\(#define VIMRC_FILE.*"\) .*$|\1|' \
+ src/feature.h
+
+ (cd src && autoconf)
+
+ cd "$srcdir"
+ for pkg in ${pkgname[@]}
+ do
+ cp -a vim-$pkgver ${pkg}-build
+ done
+}
+
+build() {
+
+ cd "${srcdir}"/vim-x11-build
+
+ ./configure \
+ --prefix=/usr \
+ --localstatedir=/var/lib/vim \
+ --with-features=huge \
+ --with-compiledby='Arch Linux' \
+ --enable-gpm \
+ --enable-acl \
+ --with-x=yes \
+ --disable-gui \
+ --enable-multibyte \
+ --enable-cscope \
+ --enable-netbeans \
+ --enable-perlinterp=dynamic \
+ --enable-pythoninterp=dynamic \
+ --enable-python3interp=dynamic \
+ --enable-rubyinterp=dynamic \
+ --enable-luainterp=dynamic \
+ --enable-tclinterp=dynamic
+
+ make
+}
+
+package() {
+ cd "${srcdir}"/vim-x11-build
+ make -j1 VIMRCLOC=/etc DESTDIR="${pkgdir}" install
+
+ # provided by (n)vi in core
+ rm "${pkgdir}"/usr/bin/{ex,view}
+
+ # delete some manpages
+ find "${pkgdir}"/usr/share/man -type d -name 'man1' 2>/dev/null | \
+ while read _mandir; do
+ cd ${_mandir}
+ rm -f ex.1 view.1 # provided by (n)vi
+ rm -f evim.1 # this does not make sense if we have no GUI
+ done
+
+ # Runtime provided by runtime package
+ rm -r "${pkgdir}"/usr/share/vim
+
+ # no desktop files and icons
+ rm -r "${pkgdir}"/usr/share/{applications,icons}
+
+ # license
+ install -Dm644 runtime/doc/uganda.txt \
+ "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
+}
diff --git a/auto-update.sh b/auto-update.sh
new file mode 100755
index 000000000000..622f1cc18942
--- /dev/null
+++ b/auto-update.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [[ $# -ne 1 ]]
+then
+ echo "Usage: './auto-update.sh <version>"
+ exit 0
+fi
+
+VERSION=$1
+
+echo "Auto-updating version $VERSION..."
+
+echo "Downloading new package..."
+wget https://github.com/vim/vim/archive/v$VERSION.tar.gz
+
+SHA1SUM=`sha1sum v$VERSION.tar.gz | awk '{ print $1 }'`
+echo "sha1sum is $SHA1SUM"
+
+echo "Generate new PKGBUILD"
+cp PKGBUILD.template PKGBUILD
+sed -i "s/__VERSION__/$VERSION/g" PKGBUILD
+sed -i "s/__SHA1SUM__/$SHA1SUM/g" PKGBUILD
+
+echo "Updating .SRCINFO"
+makepkg --printsrcinfo > .SRCINFO
+
+echo "Commit files"
+git add .SRCINFO PKGBUILD
+git commit -m "vim-runtime version $VERSION"
+
+echo "clean-up"
+rm -v v$VERSION.tar.gz