# Contributor: Fabian Affolter # Maintainer: Fabian Affolter global pkgname := 'py-serial' global _pkgname := 'pyserial' global pkgver := '3.4' global pkgrel := '0' global pkgdesc := '"Python Serial Port Extension'" global url := '"http://pyserial.sourceforge.net/'" global arch := '"noarch'" global license := '"Python'" global depends := '"python2'" global makedepends := '"python2-dev python3-dev py-setuptools'" global install := ''"" global subpackages := ""py2-$(pkgname#py-):_py2 py3-$(pkgname#py-):_py3 $pkgname-doc $pkgname-examples"" global source := ""https://files.pythonhosted.org/packages/source/$(_pkgname:0:1)/$_pkgname/$_pkgname-$pkgver.tar.gz"" global builddir := ""$srcdir"/$_pkgname-$pkgver" proc build { cd $builddir python2 setup.py build || return 1 python3 setup.py build || return 1 } proc package { global depends := ""py2-$(pkgname#py-) py3-$(pkgname#py-)"" mkdir -p $pkgdir } proc _py2 { _py_common python2 rm "$subpkgdir/usr/bin/miniterm.py" } proc _py3 { _py_common python3 } proc _py_common { var python = $1 global depends := $python cd $builddir $python setup.py install --prefix=/usr --root="$subpkgdir" } proc doc { cd $builddir mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/ || return 1 # Documentation files global _docs := '"appendix.rst examples.rst index.rst pyserial.rst \ pyserial_api.rst shortintro.rst tools.rst url_handlers.rst'" for _doc in [$_docs] { mv "$srcdir"/$_pkgname-$pkgver/documentation/$_doc \ "$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1 } } proc examples { cd $builddir mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/examples || return 1 # Example files global _examples := '"port_publisher.sh rfc2217_server.py tcp_serial_redirect.py\ wxSerialConfigDialog.py wxTerminal.py port_publisher.py\ at_protocol.py setup-miniterm-py2exe.py\ setup-rfc2217_server-py2exe.py setup-wxTerminal-py2exe.py\ wxSerialConfigDialog.wxg wxTerminal.wxg'" for _example in [$_examples] { mv "$srcdir"/$_pkgname-$pkgver/examples/$_example \ "$subpkgdir"/usr/share/doc/$pkgname/examples/$_example || return 1 } } global sha512sums := '"d71dffc330704e41caac6054adf192bee2f1c119691faf2ea93fe22e8e3ba000dc4a1434293f6f80d05a5577d85b96791f656e28d5c63fb0ce6a6605467a117f pyserial-3.4.tar.gz'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(py-serial)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:_pkgname) op:Equal rhs:{(pyserial)} spids:[9])] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(3.4)} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[15])] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("Python Serial Port Extension"))} spids: [18] ) ] spids: [18] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://pyserial.sourceforge.net/"))} spids: [23] ) ] spids: [23] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (noarch))} spids:[28])] spids: [28] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (Python))} spids:[33])] spids: [33] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ (python2))} spids:[38])] spids: [38] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ("python2-dev python3-dev py-setuptools"))} spids: [43] ) ] spids: [43] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:install) op:Equal rhs:{(DQ )} spids:[48])] spids: [48] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ (py2-) (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(py-)}) spids: [55 59] ) (":_py2 py3-") (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(py-)}) spids: [61 65] ) (":_py3 ") ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") (-examples) ) } spids: [52] ) ] spids: [52] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("https://files.pythonhosted.org/packages/source/") (BracedVarSub token: suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 1)}) ) spids: [76 82] ) (/) ($ VSub_Name "$_pkgname") (/) ($ VSub_Name "$_pkgname") (-) ($ VSub_Name "$pkgver") (.tar.gz) ) } spids: [73] ) ] spids: [73] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$_pkgname") (-) ($ VSub_Name "$pkgver")} spids: [93] ) ] spids: [93] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(python2)} {(setup.py)} {(build)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(python3)} {(setup.py)} {(build)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [107] ) spids: [103 106] ) (FuncDef name: package body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: { (DQ (py2-) (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(py-)}) spids: [155 159] ) (" py3-") (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{(py-)}) spids: [161 165] ) ) } spids: [152] ) ] spids: [152] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$pkgdir"))}) ] spids: [149] ) spids: [145 148] ) (FuncDef name: _py2 body: (BraceGroup children: [ (C {(_py_common)} {(python2)}) (C {(rm)} {(DQ ($ VSub_Name "$subpkgdir") (/usr/bin/miniterm.py))}) ] spids: [184] ) spids: [180 183] ) (FuncDef name: _py3 body: (BraceGroup children:[(C {(_py_common)} {(python3)})] spids:[206]) spids: [202 205] ) (FuncDef name: _py_common body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:python) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [225] ) ] spids: [223] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ($ VSub_Name "$python"))} spids: [231] ) ] spids: [231] ) (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {($ VSub_Name "$python")} {(setup.py)} {(install)} {(--prefix) (Lit_Other "=") (/usr)} {(--root) (Lit_Other "=") (DQ ($ VSub_Name "$subpkgdir"))} ) ] spids: [220] ) spids: [216 219] ) (FuncDef name: doc body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_docs) op: Equal rhs: { (DQ ("appendix.rst examples.rst index.rst pyserial.rst ") ("\t\tpyserial_api.rst shortintro.rst tools.rst url_handlers.rst") ) } spids: [300] ) ] spids: [300] ) (ForEach iter_name: _doc iter_words: [{($ VSub_Name "$_docs")}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$_pkgname") (-) ($ VSub_Name "$pkgver") (/documentation/) ($ VSub_Name "$_doc") } {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/) ($ VSub_Name "$_doc")} ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [317 349] ) spids: [313 315] ) ] spids: [268] ) spids: [264 267] ) (FuncDef name: examples body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/examples) } ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_examples) op: Equal rhs: { (DQ ("port_publisher.sh rfc2217_server.py tcp_serial_redirect.py") ("\t wxSerialConfigDialog.py wxTerminal.py port_publisher.py") ("\t at_protocol.py setup-miniterm-py2exe.py") ("\t setup-rfc2217_server-py2exe.py setup-wxTerminal-py2exe.py") ("\t wxSerialConfigDialog.wxg wxTerminal.wxg") ) } spids: [390] ) ] spids: [390] ) (ForEach iter_name: _example iter_words: [{($ VSub_Name "$_examples")}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$srcdir")) (/) ($ VSub_Name "$_pkgname") (-) ($ VSub_Name "$pkgver") (/examples/) ($ VSub_Name "$_example") } {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/examples/) ($ VSub_Name "$_example") } ) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] spids: [413 445] ) spids: [409 411] ) ] spids: [358] ) spids: [354 357] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "d71dffc330704e41caac6054adf192bee2f1c119691faf2ea93fe22e8e3ba000dc4a1434293f6f80d05a5577d85b96791f656e28d5c63fb0ce6a6605467a117f pyserial-3.4.tar.gz" ) ) } spids: [450] ) ] spids: [450] ) ] )