changes for newest release of sonar.
[archlinuxdevstack.git] / redmine / redmine.install
blob9b26e731be5169d35090ceeb97a09a80ffd997ba
1 #!/bin/sh
2 # $Id$
3 # vim:set ts=2 sw=2 et:
5 # arg 1: the new package version
6 pre_install() {
7 /bin/true
10 # arg 1: the new package version
11 post_install() {
12 # link to the system rails installation
13 ln -s /usr/share/rails /opt/redmine/vendor/
15 echo ">>> Creating redmine user and group and setting permissions..."
16 getent group redmine >/dev/null || usr/sbin/groupadd redmine
17 getent passwd redmine >/dev/null || usr/sbin/useradd -c 'Redmine PMS'\
18 -g redmine -d '/' -s /bin/false redmine
20 cd opt/redmine
22 mkdir tmp
23 mkdir public/plugin_assets
24 chown -R redmine:redmine files log tmp public/plugin_assets
25 chmod -R 755 files log tmp public/plugin_assets
27 echo ">>> Generating session store secret..."
28 rake config/initializers/session_store.rb
30 cat << EOF
31 >>>
32 >>> You can run Redmine in a couple of different ways:
33 >>> * Apache (via passenger)
34 >>> * WEBrick (standalone included webserver) - script/ruby -e production
35 >>>
36 >>> When running via WEBrick, you can start the daemon via:
37 >>> /etc/rc.d/redmine start
38 >>> Alternatively add "redmine" to the DAEMONS array in /etc/rc.conf.
39 >>>
40 >>> To run it i Apache, add the following into the section
41 >>> "Supplemental configuration" of /etc/httpd/conf/httpd.conf.
42 # Redmine PMS
43 Include conf/extra/httpd-redmine.conf
44 >>>
45 >>> After the installation you should create the database (in MySQL)
46 >>> with the following commands:
47 >>> mysql -u root -p
48 >>> mysql> create database redmine character set utf8;
49 >>> mysql> create user 'redmine'@'localhost' identified by 'redmine'
50 >>> mysql> grant all privileges on redmine.* to 'redmine'@'localhost'
51 >>> rake db:migrate RAILS_ENV="production"
52 >>>
53 >>> Furthermore you could add some default data with:
54 >>> rake redmine:load_default_data
55 >>>
56 >>> Default login and password are admin/admin. Remember to change these.
57 >>>
58 >>> Further installation help can be found at:
59 >>> http://www.redmine.org/wiki/redmine/RedmineInstall
60 EOF
63 # arg 1: the new package version
64 # arg 2: the old package version
65 pre_upgrade() {
66 /bin/true
69 # arg 1: the new package version
70 # arg 2: the old package version
71 post_upgrade() {
72 cd opt/redmine
73 echo ">>> Clearing cache and existing sessions..."
74 rake tmp:cache:clear
75 rake tmp:sessions:clear
76 echo ">>> Remember to update you database with"
77 echo ">>> rake db:migrate RAILS_ENV=\"production\" >/dev/null"
80 # arg 1: the old package version
81 pre_remove() {
82 usr/sbin/userdel redmine &>/dev/null
83 usr/sbin/groupdel redmine &>/dev/null
86 # arg 1: the old package version
87 post_remove() {
88 /bin/true