Ticket #42694: Portfile

File Portfile, 3.9 KB (added by jul_bsd@…, 10 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 111353 2013-09-19 07:21:56Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                simplerisk
7version             20141129-001
8categories          security
9platforms           darwin
10maintainers         yahoo.fr:jul_bsd openmaintainer
11license             GPL-2
12
13description         Enterprise Risk Management Simplified
14long_description    ${description}
15
16supported_archs     noarch
17
18homepage            http://www.simplerisk.org/
19## https://code.google.com/p/simplerisk/
20master_sites        https://github.com/simplerisk/bundles/raw/master/:a \
21                    https://github.com/simplerisk/database/raw/master/:d
22#master_sites        googlecode ## No more updated since 201312
23extract.suffix      .tgz
24distfiles           ${distname}${extract.suffix}:a ${name}-en-${version}.sql:d
25
26checksums           simplerisk-${version}.tgz \
27                    rmd160  bb2143e779bb682ba0f98c060a132ee93e097073 \
28                    sha256  6b334aafe1863426016b31058cb618ef6647da6e82e1a8a4987a1acfb8b4cd2d \
29                    simplerisk-en-${version}.sql \
30                    rmd160  b9ecbbbfe998548113689eff6e84618ab6dbb3cc \
31                    sha256  c63f2ba8756a8e2bdf266c8adc9d8f9f120b0e1f435cefb6f41dbe413934b1f5
32
33patchfiles          patch-includes-functions.php.diff patch-includes-config.php.diff
34
35worksrcdir           ${name}
36
37use_configure        no
38build {}
39
40
41set webroot          ${prefix}/www/${name}
42destroot {
43    copy ${worksrcpath} ${destroot}/${webroot}/
44    copy ${distpath}/${name}-en-${version}.sql ${destroot}/${webroot}/
45
46    xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name}/
47    copy ${filespath}/nginx-${name}.conf ${destroot}${prefix}/share/examples/${name}/nginx-${name}.conf.sample
48}
49
50post-activate {
51    if ![file exists ${prefix}/etc/nginx/nginx-${name}.conf] {
52        copy ${prefix}/share/examples/${name}/nginx-${name}.conf.sample ${prefix}/etc/nginx/nginx-${name}.conf
53    }
54}
55
56notes "
57**** To complete simplerisk installation ****
58
591) Install PHP and Mysql5 w extensions php*-mysql, php*-iconv, php*-mbstring
60   Example:
61        $ sudo port install php55-mysql php55-iconv php55-mbstring
622) Setup simplerisk database
63
64   Configure MySQL (new MySQL installs)
65        $ sudo -u mysql ${prefix}/lib/mysql5/bin/mysql_install_db
66
67  Start MySQL:
68        $ sudo ${prefix}/share/mysql5/mysql/mysql.server start
69        (if problems, check mysql user has permissions on ${prefix}/var/db/mysql5)
70
71   Set MySQL to start at system boot
72        $ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
73
74   Set a root MySQL password.
75        Follow the instructions that were given after you executed 'mysql_install_db' above
76    Or execute ${prefix}/lib/mysql5/bin/mysql_secure_installation
77
78   Create a simplerisk MySQL user and simplerisk database.
79        $ mysql5 -u root -p (login with root password set above when prompted)
80        mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON simplerisk.* to simplerisk@localhost;
81        mysql> SET PASSWORD FOR simplerisk@localhost = PASSWORD('<my-simpleriskdb-pwd>');
82        mysql> flush privileges;
83        mysql> create database simplerisk;
84        mysql> exit;
85
86   Import the simplerisk database.
87        $ cat ${webroot}/${name}-en-${version}.sql | mysql5 -u root -p simplerisk (simplerisk is the db name)
88
893) Edit ${webroot}/includes/config.php to match your MySQL information and url path.
90
914) Configure your webserver
92    If Apache, Place a symlink for simplerisk inside your Apache document root.
93        # ln -s ${webroot}  <Apache-docroot>/simplerisk
94
95    If Nginx, include this file in your configuration,
96    ${prefix}/etc/nginx/nginx-simplerisk.conf
97
985) Connect on http://127.0.0.1/simplerisk
99    Default login/pass: admin/admin
100
101"
102
103livecheck.type      regex
104livecheck.url       ${homepage}/downloads
105livecheck.regex     "<td>(\\d+-\\d+)</td>"
106
107