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 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name simplerisk |
---|
7 | version 20141129-001 |
---|
8 | categories security |
---|
9 | platforms darwin |
---|
10 | maintainers yahoo.fr:jul_bsd openmaintainer |
---|
11 | license GPL-2 |
---|
12 | |
---|
13 | description Enterprise Risk Management Simplified |
---|
14 | long_description ${description} |
---|
15 | |
---|
16 | supported_archs noarch |
---|
17 | |
---|
18 | homepage http://www.simplerisk.org/ |
---|
19 | ## https://code.google.com/p/simplerisk/ |
---|
20 | master_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 |
---|
23 | extract.suffix .tgz |
---|
24 | distfiles ${distname}${extract.suffix}:a ${name}-en-${version}.sql:d |
---|
25 | |
---|
26 | checksums simplerisk-${version}.tgz \ |
---|
27 | rmd160 bb2143e779bb682ba0f98c060a132ee93e097073 \ |
---|
28 | sha256 6b334aafe1863426016b31058cb618ef6647da6e82e1a8a4987a1acfb8b4cd2d \ |
---|
29 | simplerisk-en-${version}.sql \ |
---|
30 | rmd160 b9ecbbbfe998548113689eff6e84618ab6dbb3cc \ |
---|
31 | sha256 c63f2ba8756a8e2bdf266c8adc9d8f9f120b0e1f435cefb6f41dbe413934b1f5 |
---|
32 | |
---|
33 | patchfiles patch-includes-functions.php.diff patch-includes-config.php.diff |
---|
34 | |
---|
35 | worksrcdir ${name} |
---|
36 | |
---|
37 | use_configure no |
---|
38 | build {} |
---|
39 | |
---|
40 | |
---|
41 | set webroot ${prefix}/www/${name} |
---|
42 | destroot { |
---|
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 | |
---|
50 | post-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 | |
---|
56 | notes " |
---|
57 | **** To complete simplerisk installation **** |
---|
58 | |
---|
59 | 1) Install PHP and Mysql5 w extensions php*-mysql, php*-iconv, php*-mbstring |
---|
60 | Example: |
---|
61 | $ sudo port install php55-mysql php55-iconv php55-mbstring |
---|
62 | 2) 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 | |
---|
89 | 3) Edit ${webroot}/includes/config.php to match your MySQL information and url path. |
---|
90 | |
---|
91 | 4) 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 | |
---|
98 | 5) Connect on http://127.0.0.1/simplerisk |
---|
99 | Default login/pass: admin/admin |
---|
100 | |
---|
101 | " |
---|
102 | |
---|
103 | livecheck.type regex |
---|
104 | livecheck.url ${homepage}/downloads |
---|
105 | livecheck.regex "<td>(\\d+-\\d+)</td>" |
---|
106 | |
---|
107 | |
---|