9 pkgdesc="Outliner and personal wiki with keeping the tree of notes in the form of directories on disk"
10 #url="http://jenyay.net/Soft/Outwiker"
12 depends=('wxpython' 'pywebkitgtk')
13 optdepends=('mimetex: rendering of formulas'
14 'python-gnomeprint: printing non-latin symbols')
16 conflicts=($_realname)
18 url="http://launchpad.net/outwiker"
19 _bzrtrunk='lp:outwiker/trunk'
21 #bzr branch lp:outwiker/trunk
26 msg2 "Connecting to the server...."
27 if [ ! -d "${srcdir}/${_bzrmod}" ]; then
28 bzr co ${_bzrtrunk} ${_bzrmod} -r ${pkgver}
30 bzr up ${_bzrmod} -r ${pkgver}
32 msg2 "BZR checkout done or server timeout"
39 install -dm755 "$srcdir"/patched
40 cp -a "$srcdir"/$_bzrmod "$srcdir"/patched
42 cd "$srcdir"/patched/$_realname
44 msg2 "Applying patch for python2..."
47 for file in $(find . -name '*.py' -print); do
48 sed -i 's_#!.*/usr/bin/python_#!/usr/bin/python2_' $file
49 sed -i 's_#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
52 # install -d -m755 "${pkgdir}/usr/share/${_realname}"
54 install -D -m644 "$srcdir"/patched/$_realname/src/runoutwiker.py "$pkgdir"/usr/share/$_realname/runoutwiker.py
55 install -m644 "$srcdir"/patched/$_realname/src/version.txt "$pkgdir"/usr/share/$_realname
56 install -m644 "$srcdir"/patched/$_realname/{copyright,README} "$pkgdir"/usr/share/$_realname
58 cp -r "$srcdir"/patched/$_realname/src/outwiker "$pkgdir"/usr/share/$_realname
59 cp -r "$srcdir"/patched/$_realname/src/{help,images,locale,plugins,templates} "$pkgdir"/usr/share/$_realname
60 #cp -r "../src/help" $outwiker_dir
61 #cp -r "../src/images" $outwiker_dir
62 #cp -r "../src/locale" $outwiker_dir
63 #cp -r "../src/plugins" $outwiker_dir
64 #cp -r "../src/templates" $outwiker_dir
66 cd "$pkgdir"/usr/share/${_realname}
67 # remove *.pyc, *.wxg, *.py~, *.wxg~
68 find . -name *.pyc -type f -print | xargs rm -f
69 find . -name *.py~ -type f -print | xargs rm -f
70 find . -name *.wxg -type f -print | xargs rm -f
71 find . -name *.wxg~ -type f -print | xargs rm -f
72 find . -name *.~1~ -type f -print | xargs rm -f
75 # install desktop file and icon
77 install -Dm644 "${srcdir}"/patched/$_realname/distrib/$_realname-$_pkgver/usr/share/applications/outwiker.desktop $pkgdir/usr/share/applications/$_realname.desktop
78 install -Dm755 "${srcdir}"/patched/$_realname/distrib/$_realname-$_pkgver/usr/bin/$_realname $pkgdir/usr/bin/$_realname
80 sed -i -e 's/python /python2 /' ${pkgdir}/usr/bin/$_realname
82 install -Dm644 "${srcdir}"/patched/$_realname/distrib/$_realname-$_pkgver/usr/share/pixmaps/$_realname.png $pkgdir/usr/share/pixmaps/$_realname.png
84 rm -fR "${srcdir}"/patched
85 find "$pkgdir"/usr/share/$_realname -type f -exec chmod a-x,u+w {} \;