summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43fdc9eb7009cc2520d82368a08a4e7ed0466ddd (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Maintainer: Musikolo <musikolo {at} hotmail [dot] com>
# Contributor: Magician <magician21 ett lycos daht com>
# Contributor: Petrovo https://aur.archlinux.org/account.php?Action=AccountInfo&ID=33361
# Contributor: Pierre-Fran├žois Gomez https://aur.archlinux.org/account/pef/
# Contributor: Shura https://aur.archlinux.org/account/shura/
# Contributor: Michael Hansen <zrax0111 gmail com>
# Contributor: Wesley Chan https://aur.archlinux.org/account/Wesley_Chan

# Original PKGBUILD file from:
# - https://bbs.archlinux.org/viewtopic.php?pid=757428#p757428
# - http://www.scootersoftware.com/vbulletin/showpost.php?s=3c1f289bc76655230b49f440dbe17b53&p=26449&postcount=7

pkgbase=bcompare
pkgname=('bcompare' 'bcompare-kde5' 'bcompare-kde4' 'bcompare-nautilus' 'bcompare-thunar' 'bcompare-cinnamon' 'bcompare-mate')
pkgver=4.2.6.23150
pkgrel=1
arch=('i686' 'x86_64')
url='http://www.scootersoftware.com'
license=('custom')
groups=('utility')
depends=('qt4' 'fontconfig' 'libsm' 'libxcursor' 'libxft' 'libxinerama'  'libxrandr' 'zlib')
makedepends=('sed')
source_x86_64=("http://www.scootersoftware.com/${pkgbase}-${pkgver}.x86_64.tar.gz")
source_i686=("http://www.scootersoftware.com/${pkgbase}-${pkgver}.i386.tar.gz")
sha256sums_i686=('b00516503c90a78f5f08863f295c9a69d8fea214e68fd4f58e225c45b775377f')
sha256sums_x86_64=('06653dffdd3a1ec9fb77e522ea3063630f468941d565bb8df8eb842c46a384b9')
options=('!strip') # Do not strip binaries because it breaks them down

 prepare() {
  # Prepare the directory skeleton needed for install.sh
  _install_dir="${srcdir}/install"
  mkdir -p "${_install_dir}/usr/share/applications"
  mkdir -p "${_install_dir}/usr/share/doc"
  mkdir -p "${_install_dir}/usr/share/mime/packages"
  mkdir -p "${_install_dir}/usr/share/pixmaps"

  # Set up KDE5 service menus
  mkdir -p "${_install_dir}/usr/lib/x86_64-linux-gnu/qt5/plugins/"
  mkdir -p "${_install_dir}/usr/share/kservices5/"

  # Set up KDE4 service menus
  mkdir -p "${_install_dir}/usr/lib/kde4"
  mkdir -p "${_install_dir}/usr/share/kde4/services"

  # Set up Gnome service menus
  mkdir -p "${_install_dir}/usr/lib/nautilus/extensions-3.0"
  mkdir -p "${_install_dir}/usr/lib/nemo/extensions-3.0"
  mkdir -p "${_install_dir}/usr/lib/caja/extensions-3.0"

  # Set up Xfce service menus
  mkdir -p "${_install_dir}/usr/lib/thunarx-2"

  # Apply some fixes on install.sh script
  cd "${pkgbase}-${pkgver}"
  sed -i 's|/usr/|${PREFIX}/usr/|g' install.sh
  sed -i 's|${PREFIX}/usr/bin|/usr/bin|g' install.sh
  sed -i '/-h \/lib64/{N;N;d;}' install.sh
 }

package_bcompare() {
  pkgdesc="Beyond Compare 4: Compare, sync, and merge files and folders"
  optdepends=('bcompare-kde: KDE service menus for Beyond Compare 4'
                         'bcompare-nautilus: Nautilus service menus for Beyond Compare 4'
                         'bcompare-thunar: Thunar service menus for Beyond Compare 4'
                         'bcompare-cinnamon: Cinnamon service menus for Beyond Compare 4'
                         'bcompare-mate: MATE service menus for Beyond Compare 4'  )
  install=${pkgbase}.install

  # Excecute install script - needs to be run here
  cd "${pkgbase}-${pkgver}"
  _install_dir="${srcdir}/install"
  sh install.sh --prefix="${_install_dir}"

  # Prepare the directory skeleton needed for install.sh
  cp -r "${_install_dir}/bin"  "${pkgdir}/"
  cp -r "${_install_dir}/lib"  "${pkgdir}/"
  cp -r "${_install_dir}/usr"  "${pkgdir}/"

  # Move some directories to usr
  cd "${pkgdir}"
  if [ -d usr/lib ]; then
    mv usr/lib/* lib
  fi
  mv bin lib usr/

  # Fix wrong paths
  sed -i "s|"${_install_dir}"|/usr|g" usr/bin/bcompare

  # Remove KDE, Gnome and Xfce files
  rm -rf "${pkgdir}/usr/share/kservices5"
  rm -rf "${pkgdir}/usr/share/kde4"
  rm -rf "${pkgdir}/usr/lib/x86_64-linux-gnu"
  rm -rf "${pkgdir}/usr/lib/kde4"
  rm -rf "${pkgdir}/usr/lib/nautilus"
  rm -rf "${pkgdir}/usr/lib/thunarx-2"
  rm -rf "${pkgdir}/usr/lib/caja"
  rm -rf "${pkgdir}/usr/lib/nemo"


  #Clean unneded files
  pushd usr/lib/beyondcompare/ > /dev/null
  rm -f uninstall.sh RPM-GPG-KEY-scootersoftware scootersoftware.repo kde_context_menu
  mv help "${pkgdir}/usr/share/doc/beyondcompare"
  mv README "${pkgdir}/usr/share/doc/beyondcompare/"
  rm -rf ext
  popd > /dev/null

  # Clean some mime files
  pushd usr/share > /dev/null
  mv  mime/packages .
  rm -rf mime/*
  mv packages mime/
  popd > /dev/null
}

package_bcompare-kde5() {
  pkgdesc="KDE5 service menus for Beyond Compare 4"
  depends=('bcompare')

   msg2 "Packaging KDE5 service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"
  mv "${_install_dir}/usr/lib/x86_64-linux-gnu" "${pkgdir}/usr/lib/"

  find "${_install_dir}/usr/share/kservices5" -type f -exec chmod -x '{}' ';'
  mkdir -p "${pkgdir}/usr/share"
  mv "${_install_dir}/usr/share/kservices5" "${pkgdir}/usr/share"
  msg2 "Done!"
}

package_bcompare-kde4() {
  pkgdesc="KDE4 service menus for Beyond Compare 4"
  depends=('bcompare')
  replaces=('bcompare-kde')
  conflicts=('bcompare-kde')

   msg2 "Packaging KDE4 service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"
  mkdir -p "${pkgdir}/usr/share"

  mv "${_install_dir}/usr/lib/kde4" "${pkgdir}/usr/lib/"
  mv "${_install_dir}/usr/share/kde4" "${pkgdir}/usr/share"
  msg2 "Done!"
}

package_bcompare-nautilus() {
  pkgdesc="Gnome service menus for Beyond Compare 4"
  depends=('bcompare')
  provides=('bcompare-gnome')

  msg2 "Packaging Gnome service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"

  mv "${_install_dir}/usr/lib/nautilus" "${pkgdir}/usr/lib/"
  msg2 "Done!"
}

package_bcompare-thunar() {
  pkgdesc="Xfce service menus for Beyond Compare 4"
  depends=('bcompare')
  provides=('bcompare-xfce')

  msg2 "Packaging Xfce service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"

  mv "${_install_dir}/usr/lib/thunarx-2" "${pkgdir}/usr/lib/"
  msg2 "Done!"
}

package_bcompare-cinnamon() {
  pkgdesc="Cinnamon service menus for Beyond Compare 4"
  depends=('bcompare')

  msg2 "Packaging Cinnamon service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"

  mv "${_install_dir}/usr/lib/nemo" "${pkgdir}/usr/lib/"
  msg2 "Done!"
}

package_bcompare-mate() {
  pkgdesc="MATE service menus for Beyond Compare 4"
  depends=('bcompare')

  msg2 "Packaging MATE service menus..."
  _install_dir="${srcdir}/install"
  # Set up service menus
  mkdir -p "${pkgdir}/usr/lib"

  mv "${_install_dir}/usr/lib/caja" "${pkgdir}/usr/lib/"
  msg2 "Done!"
}