updated on Mon Jan 23 16:10:15 UTC 2012
[aur-mirror.git] / atelierb / PKGBUILD
blob84868f4efea0ffe4a472c3031133039697c87ae6
1 #mathieu clabaut <mathieu.clabaut@gmail.com>
2 pkgname=atelierb
3 pkgver=4.0
4 pkgrel=1
5 pkgdesc="the industrial tool to efficiently deploy the B Method"
6 arch=('i686')
7 url="http://www.atelierb.eu"
8 license=('atelierb')
9 depends=()
10 optdepends=('texlive-bin' 'firefox')
11 install=atelierb.install
12 source=(http://www.atelierb.eu/atelier-b/${pkgver}/free/${pkgname}-${pkgver}-linux-free.tgz)
13 md5sums=('fde235e988b4d1d1a192b8affe0508c6')
14          
17 build() {
18   install -m755 -d $pkgdir/opt/atelierb/
19   DEST=$pkgdir/opt/atelierb
20   cd $DEST
21   tar xfz $srcdir/tarExeAB.lin.tgz
22   while read NAM MOD
23   do
24     case $NAM
25     in
26     \#* | "" | " "* | " "* ) continue ;;
27     esac
28     if [ ! -r $NAM ] 
29     then
30       error=$NAM
31       break
32     else
33       if [ -d $NAM ]
34       then
35         echo "Checking directory $NAM ..."
36       fi
37       chmod $MOD $NAM
38       if [ ! $? = 0 ]
39       then
40         errormod=$NAM
41         break
42       fi
43     fi
44                 done < $DEST/AB/INSTALL/listeAB_linux
45                 if [ ! "x$error" = "x" ]
46                 then
47                         echo "Cannot access file or directory $NAM" 
48                         exit 1
49                 fi
50                 if [ ! "x$errormod" = "x" ]
51                 then
52                         echo "ERROR : Cannot change UNIX permissions for file or directory $NAM"
53                         exit 1
54                 fi
56         exec 3> $DEST/AB/AtelierB.new
57         if test -f $DEST/AB/AtelierB
58         then
59                 cat $DEST/AB/AtelierB >&3
60         else
61                 cat $DEST/AB/INSTALL/etc/AtelierB.model >&3
62                 cat >&3 <<-EOF
63                         !
64                         !  AtelierB Directory
65                         !
66                         ATB*ATB*AtelierB_Directory: $DEST/AB
67                         !
68                         !  Project Database
69                         !
70                         ATB*ATB*Atelier_Database_Directory: $DEST/AB/press/bdb
71                         !
72                         !  Print Command
73                         !
74                         ATB*ATB*Print_Command: $DEST/AB/bbin/bprint
75                         !
76                         ! BART refiner file
77                         !
78                         ATB*BART*RefinerFile: $DEST/AB/press/include/PatchRaffiner.rmf
79                         !
80                         !  Obvious Proof Obligations Generation
81                         !
82                 EOF
83     echo "ATB*POG*Generate_Obvious_PO: FALSE" >&3
84                         
85         fi
86         
87                 cat >&3 <<-EOF
88                         !
89                         !  Optional tools path
90                         !
91                 EOF
92         
93                 SYSTEM="LINUX"
94         echo "ATB*OPT_TOOLS_$SYSTEM*Editor_Path: /usr/bin/gvim" >&3
96         # If latex exists
97         if test "${Latex}" = "1"
98         then
99                 echo "ATB*OPT_TOOLS_$SYSTEM*Latex_Binary_Directory: /usr/bin/" >&3
100                 echo "ATB*OPT_TOOLS_$SYSTEM*Latex_Viewer: xdvi" >&3
101                 echo "ATB*OPT_TOOLS_$SYSTEM*Latex_Postcript_Translator: dvips" >&3
102         fi
103         if test "${html}" = "1"
104         then
105     echo "ATB*OPT_TOOLS_$SYSTEM*HTML_Viewer_Path: /usr/bin/firefox" >&3
106         fi
108         exec 3>&-
109         mv $DEST/AB/AtelierB.new $DEST/AB/AtelierB
111         # Create new start scripts
112         echo "#!/bin/sh" > $DEST/AB/bbin/startAB
113         echo "atelierb_dir=$DEST" >> $DEST/AB/bbin/startAB
114         cat $DEST/AB/bbin/startAB > $DEST/AB/bbin/startBB
115         cat $DEST/AB/INSTALL/etc/startAB.model >> $DEST/AB/bbin/startAB
116         cat $DEST/AB/INSTALL/etc/startBB.model >> $DEST/AB/bbin/startBB
117         chmod 755 $DEST/AB/bbin/startAB
118         chmod 755 $DEST/AB/bbin/startBB
120         # Create links for old names
121   cd $DEST/AB/bbin
122         if [ ! -f $DEST/AB/bbin/lanceAB ]
123         then
124                 ln -s startAB lanceAB
125         fi
126         if [ ! -f $DEST/AB/bbin/lanceBB ]
127         then
128                 ln -s startBB lanceBB
129         fi      
130   install -m755 -d $pkgdir/usr/share/licenses/atelierb
131   install -m644 $srcdir/licence.txt $pkgdir/usr/share/licenses/atelierb
135 # vim:set ts=2 sw=2 et: