summaryrefslogtreecommitdiff
path: root/extra/xfig/PKGBUILD
blob: 548e94fab7e5489951c41faeffa152eaa9ff1f04 (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
# $Id: PKGBUILD 194017 2013-09-10 00:31:09Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=xfig
pkgver=3.2.5c
pkgrel=1
pkgdesc="An interactive drawing tool"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.xfig.org/userman/"
license=('custom')
depends=('libpng' 'libjpeg' 'libxaw' 'libxi' 'desktop-file-utils' 'gsfonts')
makedepends=('imake')
optdepends=('transfig: to use the frontend to convert fig files')
options=('!makeflags' '!emptydirs')
install=xfig.install
source=(http://downloads.sourceforge.net/mcj/${pkgname}.${pkgver}.full.tar.gz \
	xfig-3.2.4-redhat.patch xfig-3.2.5-color-resources.patch \
        xfig-3.2.5-urwfonts.patch \
        LICENSE)
sha1sums=('47d31dd9ad46819732ab74db340e11489db2c646'
          '926ad99c7221baa4aa9e9737722958860b2700fc'
          '45e7fb80193825b088d798089aeade2e1729c9ac'
          'e595ccdbe293ea0fdecbf59a2192ae57ced2c8eb'
          '31edf4cfab708820ea3f114d095dfef5aa88e5aa')

prepare() {
  cd ${pkgname}.${pkgver}
  patch -p1 < ../xfig-3.2.4-redhat.patch
  patch -p1 < ../xfig-3.2.5-color-resources.patch
  patch -p1 < ../xfig-3.2.5-urwfonts.patch
  sed -i -e 's|X11R6/||' -e 's|image/x-xfig|image/fig;image/x-xfig|' xfig.desktop
  echo -e "Categories=Application;Graphics;\nIcon=xfig" >> xfig.desktop
  sed -i 's/#define XAW3D/XCOMM #define XAW3D/' Imakefile
  sed -i 's/XCOMM USEINLINE/USEINLINE/' Imakefile
  sed -i -e 's/XCOMM #define I18N/#define I18N/' \
    -e 's/XCOMM XAW_INTERN/XAW_INTERN/' Imakefile
  chmod 755 Libraries
  groff -mandoc -Thtml Doc/xfig.man > Doc/xfig_man.html
}

build() {
  cd ${pkgname}.${pkgver}
  xmkmf
  make XFIGDOCDIR=/usr/share/doc/xfig LIBDIR=/usr/share \
    XAPPLOADDIR=/usr/share/X11/app-defaults
}

package() {
  cd ${pkgname}.${pkgver}

  make DESTDIR="${pkgdir}" XFIGDOCDIR=/usr/share/doc/xfig LIBDIR=/usr/share \
    MANDIR=/usr/share/man/man1 XAPPLOADDIR=/usr/share/X11/app-defaults install.all
  rm "${pkgdir}/usr/share/app-defaults"

  find "${pkgdir}/usr/share/xfig/Libraries" -type f -exec chmod 0644 {} \;
  find "${pkgdir}/usr/share/xfig/Libraries" -type d -exec chmod 0755 {} \;
  find "${pkgdir}/usr/share/doc/xfig" -type f -exec chmod 0644 {} \;
  find "${pkgdir}/usr/share/doc/xfig" -type d -exec chmod 0755 {} \;

  install -D -m644 xfig.desktop "${pkgdir}/usr/share/applications/xfig.desktop"
  install -D -m644 xfig.png  "${pkgdir}/usr/share/pixmaps/xfig.png"
  install -D -m644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"	
}