updated on Sat Jan 21 16:18:39 UTC 2012
[aur-mirror.git] / chipmunksystem / PKGBUILD
blob5edb884ed51751eceda1bbf72e27286ff63ae357
1 # Maintainer: thotypous <matiasΘarchlinux-br·org>
2 pkgname="chipmunksystem"
3 pkgver=20050630
4 pkgrel=1
5 pkgdesc="Circuit schematic and simulation environment"
6 arch=('i686' 'x86_64')
7 license=('GPL')
8 url="http://www.cs.berkeley.edu/~lazzaro/chipmunk/"
9 depends=('libx11')
10 makedepends=('sed' 'findutils')
11 source=("http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/psys-1.59.tar.gz"
12         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/log-5.64.tar.gz"
13         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/view-1.14.tar.gz"
14         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/until-1.14.tar.gz"
15         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/wol-1.14.tar.gz"
16         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/wolcomp-1.14.tar.gz"
17         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/netcmp-1.13.tar.gz"
18         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/mosis-1.14.tar.gz"
19         "http://www.cs.berkeley.edu/~lazzaro/chipmunk/pickup/sources/util-1.11.tar.gz")
20 md5sums=('710dd16137962b27ab6e48fe2629dee7'
21          '96466efd12cc09e1d5ba454724f5e545'
22          'dc75cbc39d10b8a515aeaf6ed3962046'
23          '2e4cefe1305c80e15dec0f7989c8eda4'
24          '2ab676624c5771104f3b7ddd8cbabab2'
25          'c3c35fad428ae0059b3aff1ddb642f12'
26          '50558d4a2791cab30a1a5e5d719b62ee'
27          '4cb7791bb6144b878d2dced2febe75b7'
28          '47f48f6fd638aac0251de82be097236d')
30 build() {
31         cd "$srcdir"
33         # Adjust Makefiles
34         for _x in `find . -name Makefile`; do
35                 sed -i "s|^CHIPMUNKFLAGS =.*$|CHIPMUNKFLAGS = -DBSD -Dlinux -DF_OK=0 ${CFLAGS}|" "${_x}"
36         done
38         # Fix paths
39         sed -i "s|-DCHIPLIB=.*$|-DCHIPLIB=\\\\\"/usr/share/${pkgname}/lib\\\\\"|" 'psys/src/Makefile'
40         sed -i "s|^LOGLIBDIR =.*$|LOGLIBDIR = /usr/share/${pkgname}/lib|" 'log/src/Makefile'
41         for _x in 'psys/src/plot.c' 'log/lib/log.doc' 'log/lib/logspc.cnf' 'log/lib/lplot.cnf' 'log/lib/lplot.cnf'; do
42                 sed -i "s|/usr/chipmunk|/usr/share/${pkgname}|" "${_x}"
43         done
44         for _x in 'wol/wol_drc.c' 'wol/wol_init.c'; do
45                 sed -i "s|/usr/%s|/home/%s/.wol|" "${_x}"
46         done
48         # Build everything
49         for _x in 'psys/src' 'log/src' 'view' 'until/V1.2' 'wol' 'wolcomp' 'netcmp' 'mosis' 'util' 'util/spc-tools'; do
50                 cd "${srcdir}/${_x}"
51                 make LIBDIR="/usr/share/${pkgname}/lib" || return 1
52                 make install || return 1
53         done
55         # Copy everything
56         install -m755 -d "${pkgdir}/usr/bin"
57         install -m755 "${srcdir}/bin"/* "${pkgdir}/usr/bin"
58         install -m755 -d "${pkgdir}/usr/share/${pkgname}/lib"
59         install -m644 "${srcdir}/lib"/* "${pkgdir}/usr/share/${pkgname}/lib"
60         install -m644 "${srcdir}/log/lib"/* "${pkgdir}/usr/share/${pkgname}/lib"
61         for _x in view cnf; do
62                 install -m644 "${srcdir}/view/lib"/*.${_x} "${pkgdir}/usr/share/${pkgname}/lib"
63         done
64         install -m755 -d "${pkgdir}/usr/share/${pkgname}/until/designrules"
65         install -m644 "${srcdir}/until/designrules"/* "${pkgdir}/usr/share/${pkgname}/until/designrules"
66         install -m644 "${srcdir}/until/V1.2"/*.ff "${pkgdir}/usr/share/${pkgname}/until"
67         install -m755 -d "${pkgdir}/usr/share/${pkgname}/netcmp"
68         install -m644 "${srcdir}/netcmp"/*.ntk "${pkgdir}/usr/share/${pkgname}/netcmp"