updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / chromium-browser-bin / PKGBUILD
blobb6ecc80089058ac9fed058d79b4f3223c5ada3e1
1 # $Id:$
2 # Contributor: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
3 # Credits: alexwizard, thotypous, jdhore, xduugu and randypenguin
4 # Maintainer: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
6 pkgname=chromium-browser-bin
7 _realname=chromium-browser
8 pkgver=LATEST
9 pkgrel=31
10 pkgdesc="The open-source project behind Google Chrome (Web/HTTP/FTP Browser)"
11 arch=('i686' 'x86_64')
12 url=http://code.google.com/chromium/
13 license=('custom:BSD')
14 depends=('alsa-lib' 'desktop-file-utils' 'gconf' 'gtk2' 'nss' 'libpng12' 'libxss' 'libxtst')
15 optdepends=('chromium-codecs-ffmpeg-nonfree-bin: for viewing HTML5/H.264 videos [AUR]'
16     'ttf-hannom: Unicode Han and Nom (Chinese and Vietnamese) fonts [extra]'
17     'otf-ipafont: Unicode Gothic/sans and Mincho/serif (Japanese) fonts [AUR]'
18     'ttf-indic-otf: Unicode collection various (Indian) language fonts [extra]'
19     'xdg-utils: for setting a default browser on desktop environments [extra]')
20 provides=("${_realname}")
21 conflicts=("${_realname}" "${_realname}-svn")
22 backup=("etc/${_realname}/default")
23 # let the 'makepkg' decide what and how to strip archives, binaries and, or libs
24 STRIP_DIRS=("opt/${_realname}")
25 options=('emptydirs' '!strip')
26 install=${_realname}.install
28 case "$CARCH" in
29     i686|i[3-5]86) _bldarch='Linux';;
30     x86_64|amd64) _bldarch='Linux_x64';;
31     # The following should not happen; provided you're using 'makepkg' ;)
32     *) error "Unknown or invalid CARCH=$CARCH"; exit 1
33 esac
35 _bldname=chrome-linux.zip
36 _bldroot=http://commondatastorage.googleapis.com/chromium-browser-continuous/${_bldarch}
38 source=('LICENSE.txt' 'chrome-wrapper.patch' "${_realname}.1.gz" "${_realname}.default"
39         "${_realname}.desktop" "${_realname}.sh")
40 noextract=(${_realname}.1.gz)
42 # trick re-determining the build revision and, or entertain the hidden
43 # makepkg option --forcever, huh
44 if [ -z "$FORCE_VER" ]; then
45     msg "Determining latest build revision..."
46     newpkgver="$(wget -qO - ${_bldroot}/LAST_CHANGE)"
47     if [ -n "$newpkgver" -a "$newpkgver" != "$pkgver" ]; then
48         msg2 "Version found: %s" "$newpkgver"
49         FORCE_VER="$newpkgver"
50     else
51         FORCE_VER="$pkgver"
52     fi
54 if [ "$FORCE_VER" = "LATEST" -a "$SOURCEONLY" -eq 0 ]; then
55     error "Plz omit '--forcever LATEST'; I'll auto-detect the LATEST ;)"
56     exit 1
57 elif [ "$FORCE_VER" != "$pkgver" ]; then
58     rm -f "$SRCDEST/${_bldname}"
59     devel_update
62 try_symlink() {
63     if [ -L /usr/lib/$1 ]; then
64         ln -s $(readlink /usr/lib/$1) $pkgdir/usr/lib/$2 || return $?
65     elif [ -r /usr/lib/$1 ]; then
66         ln -s $1 $pkgdir/usr/lib/$2 || return $?
67     else
68         printf "ln: file or symlink not found -- /usr/lib/%s\n" "$1" && return 1
69     fi
72 build() {
73     if [ ! -r "$srcdir/${_bldname}" ]; then
74         msg2 "Downloading the latest '$CARCH/$pkgver/${_bldname}'..."
75         wget $QUIET --no-cache -c "${_bldroot}/$pkgver/${_bldname}" \
76             -O "$SRCDEST/${_bldname}" || return $?
77         ln -fs "$SRCDEST/${_bldname}" "$srcdir/${_bldname}" || return $?
78     fi
80     msg2 "Extracting Binaries..."
81     cd $srcdir
82     bsdtar xf $srcdir/${_bldname} || return $?
83     mkdir -p $pkgdir/opt/${_realname}
84     cp -r ./chrome-linux/* $pkgdir/opt/${_realname}
86     msg2 "Creating missing symlinks..."
87     mkdir -p $pkgdir/usr/lib
88     try_symlink libnss3.so libnss3.so.1d || return $?
89     try_symlink libnssutil3.so libnssutil3.so.1d || return $?
90     try_symlink libsmime3.so libsmime3.so.1d || return $?
91     try_symlink libssl3.so libssl3.so.1d || return $?
92     try_symlink libplds4.so libplds4.so.0d || return $?
93     try_symlink libplc4.so libplc4.so.0d || return $?
94     try_symlink libnspr4.so libnspr4.so.0d || return $?
96     msg2 "Patching script 'chrome-wrapper'..."
97     cd $pkgdir/opt/${_realname}
98     patch -sp1 < $srcdir/chrome-wrapper.patch
100     msg2 "Making it nice..."
101     mv $pkgdir/opt/${_realname}/libffmpegsumo.so $pkgdir/opt/${_realname}/libffmpegsumo.so.FREE
102     # adjust the permissions on directories and, or files, eh
103     chown -R 0:0 $pkgdir/opt/${_realname}
104     find $pkgdir/opt/${_realname} -type d -exec chmod 0755 {} ';'
105     find $pkgdir/opt/${_realname} -type f -exec chmod 0644 {} ';'
106     chmod 755 $pkgdir/opt/${_realname}/chrome
107     chmod 755 $pkgdir/opt/${_realname}/chrome[_-]*
108     chmod 755 $pkgdir/opt/${_realname}/xdg-settings
109     # install default, wrapper-script, desktop, license and manpages
110     install -Dm644 $srcdir/${_realname}.default $pkgdir/etc/${_realname}/default
111     install -Dm755 $srcdir/${_realname}.sh $pkgdir/usr/bin/${_realname}
112     install -Dm644 $srcdir/${_realname}.desktop $pkgdir/usr/share/applications/${_realname}.desktop
113     install -Dm644 $srcdir/LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
114     install -Dm644 $srcdir/${_realname}.1.gz $pkgdir/usr/share/man/man1/${_realname}.1.gz
115     mv $pkgdir/opt/${_realname}/chrome.1 $pkgdir/usr/share/man/man1/chromium.1 || return $?
116     # symlink the icon file
117     mkdir -p $pkgdir/usr/share/pixmaps
118     ln -s /opt/${_realname}/product_logo_48.png $pkgdir/usr/share/pixmaps/product_logo_48.png
119     #ln -s /opt/${_realname}/product_logo_48.png $pkgdir/usr/share/pixmaps/${_realname}.png
120     # any localization, eh
121     if [ -f $startdir/PKGBUILD.local ]; then
122         msg2 "Executing PKGBUILD.local..."
123         source $startdir/PKGBUILD.local
124     fi
127 # vim:set ts=4 sw=4 et:
128 md5sums=('b689219f39e74e0c0b19f10a1db1839d'
129          'b231add683c7b08b0291718496e974da'
130          '1774b5d79cfc67403fb336147a17e9a6'
131          'dfc9db0cb84aa38def9f685e26bf60b6'
132          'a9ecb6e9963d17ed3f37641500d95dd1'
133          '7a72a9def90fee0e398b3e686e6c6741')