summaryrefslogtreecommitdiff
path: root/extra/xfig/PKGBUILD
blob: c6a91bc2d3c6e9054eb4485907a42facbe7b9f87 (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
# $Id: PKGBUILD 204604 2014-01-24 03:48:01Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=xfig
pkgver=3.2.5c
pkgrel=2
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 xfig-fix_dash_list_for_different_styles.patch
        LICENSE)
sha1sums=('47d31dd9ad46819732ab74db340e11489db2c646'
          '926ad99c7221baa4aa9e9737722958860b2700fc'
          '45e7fb80193825b088d798089aeade2e1729c9ac'
          'e595ccdbe293ea0fdecbf59a2192ae57ced2c8eb'
          '6aa98ab4497c30d18b4d0599f9d943bf78991246'
          '31edf4cfab708820ea3f114d095dfef5aa88e5aa')

prepare() {
  cd ${pkgname}.${pkgver}
  patch -p1 -i "${srcdir}/xfig-3.2.4-redhat.patch"
  patch -p1 -i "${srcdir}/xfig-3.2.5-color-resources.patch"
  patch -p1 -i "${srcdir}/xfig-3.2.5-urwfonts.patch"
  patch -p1 -i "${srcdir}/xfig-fix_dash_list_for_different_styles.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"	
}