source: trunk/dports/_resources/port1.0/group/octave-1.0.tcl @ 101770

Last change on this file since 101770 was 101770, checked in by and.damore@…, 7 years ago

octave-1.0 portgroup: relying on octave's builtin pkg manager for building each package's tarball and making it available to the user as package

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1# $Id: octave-1.0.tcl 101770 2013-01-18 21:59:57Z and.damore@macports.org $
2#
3# Copyright (c) 2010 The MacPorts Project
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15# 3. Neither the name of The MacPorts Project nor the names of its
16#    contributors may be used to endorse or promote products derived from
17#    this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30#
31#
32# This PortGroup automatically sets up the standard environment for building
33# an octave module.
34#
35# Usage:
36#
37#   PortGroup               octave 1.0
38#   octave.setup            module version
39#
40# where module is the name of the module (e.g. communications) and version is
41# its version.
42
43
44options octave.module
45
46proc octave.setup {module version} {
47    global octave.module
48
49    octave.module               ${module}
50    name                        octave-${module}
51    version                     ${version}
52    categories                  math science
53    homepage                    http://octave.sourceforge.net/${octave.module}/
54    master_sites                sourceforge:octave
55    distname                    ${octave.module}-${version}
56
57    depends_lib                 path:bin/octave:octave
58
59    # octave is not universal
60    universal_variant           no
61    use_configure               no
62
63    livecheck.type              regex
64    livecheck.url               http://octave.sourceforge.net/packages.php
65    livecheck.regex             http://downloads\\.sourceforge\\.net/octave/${octave.module}-(\\d+(\\.\\d+)*)\\.tar
66}
67
68extract {
69    xinstall -d -m 755 ${worksrcpath}
70}
71
72build {
73    system "${prefix}/bin/octave -q -f --eval 'pkg build -verbose -nodeps ${worksrcpath} ${distpath}/${distfiles}'"
74}
75
76destroot.keepdirs   ${destroot}${prefix}/lib/octave/packages \
77                    ${destroot}${prefix}/share/octave/packages
78
79pre-destroot {
80    xinstall -d -m 755 ${destroot}${prefix}/lib/octave/packages
81    xinstall -d -m 755 ${destroot}${prefix}/share/octave/packages
82}
83
84destroot {
85    xinstall    -m 644 ${worksrcpath}/${distname}.tar.gz ${destroot}${prefix}/share/octave/${octave.module}.tar.gz
86}
87
88post-deactivate {
89    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg uninstall ${octave.module}'"
90    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
91}
92
93post-activate {
94    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg install -verbose -global ${prefix}/share/octave/${octave.module}.tar.gz'"
95    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
96}
Note: See TracBrowser for help on using the repository browser.