summaryrefslogtreecommitdiff
path: root/~emulatorman/iceape-libre/PKGBUILD
blob: 2595a36f9f295ce79d370acc4a480ff111dcd92a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Maintainer : Márcio Silva <coadde@lavabit.com>
# Maintainer : André Silva <emulatorman@lavabit.com>

# We're getting this from Debian Sid
_debname=iceape
_debver=2.7.11
_debrel=1
_debrepo=http://ftp.debian.org/debian/pool/main/
debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; }

_pkgname=${_debname}
pkgname=${_debname}-libre
pkgver=${_debver}.${_debrel}
pkgrel=2
pkgdesc="A libre version of Debian Iceape, the Internet Suite based on Mozilla Seamonkey."
arch=('i586' 'i686' 'x86_64' 'mips64el')
license=('GPL2' 'MPL' 'LGPL')
depends=('alsa-lib' 'dbus-glib' 'desktop-file-utils' 'gtk2' 'hunspell' 'libevent' 'libnotify' 'libvpx' 'libxt' 'mime-types' 'mozilla-common' 'mozilla-searchplugins' 'nss' 'sqlite' 'startup-notification')
makedepends=('unzip-libre' 'zip' 'pkg-config' 'python2' 'python2-ply' 'librsvg' 'wireless_tools' 'yasm' 'mesa' 'autoconf2.13' 'quilt')
replaces=('mozilla' 'seamonkey')
conflicts=('seamonkey')
provides=('seamonkey')
install=$_pkgname.install
url="http://packages.debian.org/source/sid/${_pkgname}"
source=("${_debrepo}/`debfile ${_debname}`_${_debver}.orig.tar.bz2"
        "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.debian.tar.gz"
        mozconfig
        ${_pkgname}.desktop
        ${_pkgname}-2.0-lang.patch
        clrf.patch
        libre.patch)
md5sums=('40473b4c662975eda865e1fc35c4953b'
         'f704b69cc0328c83edd6223420fbd412'
         '60ba9e8f2fafd20e41268af534a55ea7'
         '7266333e31731af8bb50c2eca8d0bd26'
         '25b6fe16ac24cd5c852213e5c1adb272'
         'c395d443a8c4c16880c7322bcf174743'
         'ebe66195898c89644138ffc88ba26a24')

build() {
  export QUILT_PATCHES=debian/patches
  export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  export QUILT_DIFF_ARGS='--no-timestamps'
  export LDFLAGS="${LDFLAGS} -Wl,--as-needed,-rpath,/usr/lib/${_pkgname}"
  export PYTHON="/usr/bin/python2"
  export DEBIAN_BUILD="comm-release"
  export DEBIAN_BRANDING_DIR="debian/branding" 
  export ICEAPE_ICONS_BRANDING="suite/branding/nightly"
  mv comm-esr10 "${DEBIAN_BUILD}"
  mv debian "${srcdir}/${DEBIAN_BUILD}"
  cd "${srcdir}/${DEBIAN_BUILD}"
  quilt push -av

  patch -Np1 -i "$srcdir/$_pkgname-2.0-lang.patch"
  patch -Np1 -i "$srcdir/clrf.patch"
  patch -Np1 -i "$srcdir/libre.patch"

  # set up a simple non-animated throbber from the icon
  install -m644 debian/extras/Throbber-small.gif suite/themes/classic/communicator/brand/throbber-anim.png
  install -m644 debian/extras/Throbber-small.png suite/themes/classic/communicator/brand/throbber-single.png
  install -m644 debian/extras/Throbber-small.gif suite/themes/classic/communicator/brand/throbber16-anim.png
  install -m644 debian/extras/Throbber-small.png suite/themes/classic/communicator/brand/throbber16-single.png
  install -m644 debian/extras/Throbber-small.gif suite/themes/modern/communicator/brand/throbber-anim.png
  install -m644 debian/extras/Throbber-small.png suite/themes/modern/communicator/brand/throbber-single.png
  install -m644 debian/extras/Throbber-small.gif suite/themes/modern/communicator/brand/throbber16-anim.png
  install -m644 debian/extras/Throbber-small.png suite/themes/modern/communicator/brand/throbber16-single.png

  install -m644 debian/extras/preview.png suite/themes/classic/preview.png

  # Converting svg file to png and replacing seamonkey by iceape icons
  rsvg-convert -w 300 -h 280 -o ${ICEAPE_ICONS_BRANDING}/content/about.png ${DEBIAN_BRANDING_DIR}/iceape_logo_plain.svg
  rsvg-convert -w 64 -h 64 -o ${ICEAPE_ICONS_BRANDING}/content/icon64.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 128 -h 128 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/iceape.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 32 -h 32 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/default.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 32 -h 32 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/main-window.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 16 -h 16 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/default16.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 16 -h 16 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/main-window16.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 48 -h 48 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/default48.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 48 -h 48 -o ${ICEAPE_ICONS_BRANDING}/icons/gtk/main-window48.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  
  # Creating app-icons Folder for iceape*.png icons

  install -m755 -d "${DEBIAN_BRANDING_DIR}/app-icons"

  # Icons for /usr/share/icons/hicolor
  rsvg-convert -w 16 -h 16 -o ${DEBIAN_BRANDING_DIR}/app-icons/iceape16.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 32 -h 32 -o ${DEBIAN_BRANDING_DIR}/app-icons/iceape32.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 48 -h 48 -o ${DEBIAN_BRANDING_DIR}/app-icons/iceape48.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 64 -h 64 -o ${DEBIAN_BRANDING_DIR}/app-icons/iceape64.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg
  rsvg-convert -w 128 -h 128 -o ${DEBIAN_BRANDING_DIR}/app-icons/iceape128.png ${DEBIAN_BRANDING_DIR}/iceape_icon_plain.svg

  cp "${srcdir}/mozconfig" .mozconfig
  make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
}

package() {
  cd "${srcdir}/${DEBIAN_BUILD}"

  make -j1 -f client.mk DESTDIR="${pkgdir}" install

  rm -rf "$pkgdir"/usr/lib/$_pkgname/{dictionaries,hyphenation,searchplugins}
  ln -sf /usr/share/hunspell "$pkgdir/usr/lib/$_pkgname/dictionaries"
  ln -sf /usr/share/hyphen "$pkgdir/usr/lib/$_pkgname/hyphenation"
  ln -sf /usr/lib/mozilla/searchplugins "$pkgdir/usr/lib/$_pkgname/searchplugins"

  install -m755 -d "$pkgdir/usr/share/applications"
  install -m755 -d "$pkgdir/usr/share/pixmaps"
  install -m644 ${ICEAPE_ICONS_BRANDING}/icons/gtk/iceape.png \
                "$pkgdir/usr/share/pixmaps/"

  for i in 16x16 32x32 48x48 64x64 128x128; do
      install -Dm644 "${DEBIAN_BRANDING_DIR}/app-icons/${_pkgname}${i/x*/}.png" "${pkgdir}/usr/share/icons/hicolor/$i/apps/${_pkgname}.png"
  done
  install -Dm644 "${DEBIAN_BRANDING_DIR}/${_pkgname}_icon_plain.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_pkgname}.svg"

  install -m644 "$srcdir/$_pkgname.desktop" "$pkgdir/usr/share/applications/"
}