updated on Mon Jan 23 20:11:11 UTC 2012
[aur-mirror.git] / gptfdisk-git / PKGBUILD
blob7e3630d5c3fcd49a4cf69a2de293f8cbc33aa842
1 # Maintainer : Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
2 # Contributor: Evangelos Foutras <evangelos@foutrelis.com>
3 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
4 # Contributor: Hokum <hokum_at_mail_dot_ru>
6 _ENABLE_UTF16LE='1'
8 _pkgname="gptfdisk"
9 pkgname="${_pkgname}-git"    ## For AUR interface
10 pkgbase="${_pkgname}-git"    ## For split packages
12 true && pkgname=('gptfdisk-git' 'fixparts-git')
14 if [[ "${_ENABLE_UTF16LE}" == '0' ]]; then
15         true && pkgname=('gptfdisk-no_icu-git' 'fixparts-git')
18 pkgver=20120121
19 pkgrel=1
20 arch=('i686' 'x86_64')
21 url="http://www.rodsbooks.com/gdisk"
22 makedepends=('util-linux' 'popt' 'ncurses')
24 if [[ "${_ENABLE_UTF16LE}" == '1' ]]; then
25         makedepends+=('icu')
28 depends=('sh')
29 license=('GPL2')
30 options=(strip emptydirs zipman !libtool docs)
32 source=('gptfdisk_remove_icu_UTF16LE.patch')
33 sha256sums=('ef8c30689d1d5da8506c2b02e9044033325e100d959116b43503e0211c89724f')
35 _gitroot="git://gptfdisk.git.sourceforge.net/gitroot/gptfdisk/gptfdisk"
36 _gitname="${_pkgname}"
37 _gitbranch="master"
39 _update_git() {
40         
41         cd "${srcdir}/"
42         
43         msg "Connecting to GIT server...."
44         
45         if [[ -d "${srcdir}/${_gitname}/" ]]; then
46                 cd "${srcdir}/${_gitname}/"
47                 git reset --hard
48                 git fetch
49                 git checkout "${_gitbranch}"
50                 git merge "remotes/origin/${_gitbranch}"
51                 msg "The local GIT repo has been updated."
52         else
53                 git clone "${_gitroot}" "${_gitname}"
54                 cd "${srcdir}/${_gitname}/"
55                 git checkout "${_gitbranch}"
56                 msg "GIT checkout done or server timeout"
57         fi
58         
59         echo
60         
63 build() {
64         
65         _update_git
66         
67         rm -rf "${srcdir}/${_gitname}_build/" || true
68         cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}_build"
69         
70         cd "${srcdir}/${_gitname}_build/"
71         
72         # unset CFLAGS
73         # unset CXXFLAGS
74         # unset LDFLAGS
75         # unset MAKEFLAGS
76         
77         make clean || true
78         echo
79         
80         CFLAGS="" CXXFLAGS="" LDFLAGS="" make
81         echo
82         
85 package_gptfdisk() {
86         
87         depends+=('util-linux' 'popt' 'ncurses')
88         
89         if [[ "${_ENABLE_UTF16LE}" == '1' ]]; then
90                 pkgdesc="Text-mode partitioning utilities that work on GUID Partition Table (GPT) disks - GIT version"
91                 depends+=('icu')
92         fi
93         
94         cd "${srcdir}/${_gitname}_build/"
95         
96         if [[ "${_ENABLE_UTF16LE}" == '0' ]]; then
97                 pkgdesc="Text-mode partitioning utilities that work on GUID Partition Table (GPT) disks - without UTF16LE support - GIT version"
98                 patch -Np1 -i "${srcdir}/gptfdisk_remove_icu_UTF16LE.patch"
99         fi
100         
101         install -Dp -m0755 "${srcdir}/${_gitname}_build/gdisk" "${pkgdir}/usr/sbin/gdisk"
102         install -Dp -m0755 "${srcdir}/${_gitname}_build/sgdisk" "${pkgdir}/usr/sbin/sgdisk"
103         install -Dp -m0755 "${srcdir}/${_gitname}_build/cgdisk" "${pkgdir}/usr/sbin/cgdisk"
104         
105         install -Dp -m0644 "${srcdir}/${_gitname}_build/gdisk.8" "${pkgdir}/usr/share/man/man8/gdisk.8"
106         install -Dp -m0644 "${srcdir}/${_gitname}_build/sgdisk.8" "${pkgdir}/usr/share/man/man8/sgdisk.8"
107         install -Dp -m0644 "${srcdir}/${_gitname}_build/cgdisk.8" "${pkgdir}/usr/share/man/man8/cgdisk.8"
108         
109         install -Dp -m0644 "${srcdir}/${_gitname}_build/README" "${pkgdir}/usr/share/${_pkgname}/README"
110         install -Dp -m0644 "${srcdir}/${_gitname}_build/NEWS" "${pkgdir}/usr/share/${_pkgname}/NEWS"
111         
114 package_gptfdisk-no_icu() {
115         
116         conflicts+=('gptfdisk')
117         provides+=('gptfdisk')
118         
119         package_gptfdisk
120         
123 package_fixparts() {
124         
125         pkgdesc="Text-mode utility that repairs MBR (msdos) partition table disks - GIT version"
126         
127         cd "${srcdir}/${_gitname}_build/"
128         
129         install -Dp -m0755 "${srcdir}/${_gitname}_build/fixparts" "${pkgdir}/usr/sbin/fixparts"
130         install -Dp -m0644 "${srcdir}/${_gitname}_build/fixparts.8" "${pkgdir}/usr/share/man/man8/fixparts.8"
131         
134 package_gptfdisk-git() {
135         
136         conflicts+=('gptfdisk')
137         provides+=('gptfdisk')
138         
139         package_gptfdisk
140         
143 package_gptfdisk-no_icu-git() {
144         
145         conflicts+=('gptfdisk-no_icu')
146         provides+=('gptfdisk-no_icu')
147         
148         package_gptfdisk-no_icu
149         
152 package_fixparts-git() {
153         
154         conflicts+=('fixparts')
155         provides+=('fixparts')
156         
157         package_fixparts
158