updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / syslinux-git / PKGBUILD
blob42097ece7d2d0257fae0898cfb434bd087ca4a29
1 # Maintainer : Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
2 # Contributor: Thomas Bächler <thomas@archlinux.org>
3 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
5 _pkgname="syslinux"
6 pkgname="${_pkgname}-git"
8 pkgver=20111216
9 pkgrel=1
10 arch=('i686' 'x86_64')
11 pkgdesc="Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE - GIT Development version"
12 url="http://syslinux.zytor.com/"
13 license=('GPL2')
14 makedepends=('git' 'nasm' 'curl')
15 depends=('perl' 'glibc')
16 optdepends=('perl-passwd-md5: For md5pass'
17                         'perl-digest-sha1: For sha1pass'
18                         'mtools: For mkdiskimage and syslinux'
19                         'dosfstools: For FAT filesystems support')
21 provides=("${_pkgname}")
22 conflicts=("${_pkgname}")
24 backup=('boot/syslinux/syslinux.cfg')
25 install="${_pkgname}.install"
27 source=('Syslinux-Do-not-build-dos-and-windows-executables.patch'
28                 'syslinux-install_update'
29                 'syslinux.cfg')
31 sha256sums=('6d2e510e677ff8063df7400b80413ee4429130927734440a6dcef3843dc93c93'
32                         '49573a3b65362326c8b1e9bfa49e83225e0bf9d3710454de4070abc9481c614c'
33                         'b4ba8f9daa67ec35da6e05adb610469bc8c4facf488468c1ec3e5860ba75313d')
35 _gitroot="git://git.kernel.org/pub/scm/boot/syslinux/syslinux.git"
36 _gitname="${_pkgname}"
38 _update_git() {
39         
40         cd "${srcdir}"
41         
42         msg "Connecting to GIT server...."
43         
44         if [ -d "${srcdir}/${_gitname}/" ]
45         then
46                 cd "${srcdir}/${_gitname}/"
47                 git reset --hard
48                 git fetch
49                 git checkout master
50                 git merge remotes/origin/master
51                 msg "The local GIT repo has been updated."
52         else
53                 git clone "${_gitroot}" "${_gitname}"
54         fi
55         
56         msg "GIT checkout done or server timeout"
57         
58         cd "${srcdir}/"
59         
60         ## Download the installation and update script
61         ## This script is maintained at git://gist.github.com/772138.git
62         # curl "https://gist.github.com/gists/772138/download" > "${srcdir}/syslinux_install_script.tar.gz"
63         # bsdtar xf "${srcdir}/syslinux_install_script.tar.gz"
64         
65         # cd "${srcdir}"/gist*/
66         # mv "${PWD}/syslinux-install_update" "${srcdir}/syslinux-install_update"
67         # rm -rf "${srcdir}"/gist*/
68         
71 build() {
72         
73         _update_git
74         
75         rm -rf "${srcdir}/${_gitname}_build" || true
76         cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}_build"
77         
78         cd "${srcdir}/${_gitname}_build"
79         
80         # Do not try to build syslinux with our default LDFLAGS, it will fail
81         unset LDFLAGS
82         
83         # Do not try to build the Windows or DOS installers
84         patch -Np1 -i "${srcdir}/Syslinux-Do-not-build-dos-and-windows-executables.patch"
85         
86         # Fix FHS manpage path
87         sed 's|/usr/man|$(DATADIR)/man|g' -i "${srcdir}/${_gitname}_build/mk/syslinux.mk" || true
88         
89         # Use python2 instead of python
90         sed 's|/usr/bin/python|/usr/bin/env python2|g' -i "${srcdir}/${_gitname}_build/com32/cmenu"/*.py || true
91         sed 's|/usr/bin/env python|/usr/bin/env python2|g' -i "${srcdir}/${_gitname}_build/com32/cmenu"/*.py || true
92         sed 's|python |python2 |g' -i "${srcdir}/${_gitname}_build/com32/cmenu/Makefile" || true
93         
94         msg "Starting make..."
95         make
96         echo
97         
100 package() {
101         
102         cd "${srcdir}/${_gitname}_build"
103         make INSTALLROOT="${pkgdir}" AUXDIR="/usr/lib/${_pkgname}" install
104         
105         # Install the default configuration
106         install -D -m644 "${srcdir}/syslinux.cfg" "${pkgdir}/boot/syslinux/syslinux.cfg"
107         
108         # Install the installation and update script
109         install -D -m755 "${srcdir}/syslinux-install_update" "${pkgdir}/usr/sbin/syslinux-install_update"
110