adopted md5sum
[archlinuxdevstack.git] / redmine / redmine.install
blobe696ebf4b79a10b6f19216ae180c638455e3b606
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 '/opt/redmine' --system -s /bin/bash redmine
20 cd opt/redmine
22 mkdir tmp
23 mkdir public/plugin_assets
24 echo ">> Change Ownership for corresponding directories"
25 chown -R redmine:redmine config files log tmp public/plugin_assets
26 chmod -R 755 config files log tmp public/plugin_assets
28 echo ">>> Creating log-storage"
29 mkdir /var/log/redmine
30 chown -R redmine:root /var/log/redmine
31 chmod -R 775 /var/log/redmine
33 echo ">>> Generating session store secret..."
34 rake config/initializers/session_store.rb
36 cat << EOF
37 >>>
38 >>> You can run Redmine in a couple of different ways:
39 >>> * Apache (via passenger)
40 >>> * WEBrick (standalone included webserver) - script/ruby -e production
41 >>>
42 >>> When running via WEBrick, you can start the daemon via:
43 >>> /etc/rc.d/redmine start
44 >>> Alternatively add "redmine" to the DAEMONS array in /etc/rc.conf.
45 >>>
46 >>> To run it i Apache, add the following into the section
47 >>> "Supplemental configuration" of /etc/httpd/conf/httpd.conf.
48 # Redmine PMS
49 Include conf/extra/httpd-redmine.conf
50 >>>
51 >>> After the installation you should create the database (in MySQL)
52 >>> with the following commands:
53 >>> mysql -u root -p
54 >>> mysql> create database redmine character set utf8;
55 >>> mysql> create user 'redmine'@'localhost' identified by 'redmine'
56 >>> mysql> grant all privileges on redmine.* to 'redmine'@'localhost'
57 >>> rake db:migrate RAILS_ENV="production"
58 >>>
59 >>> Furthermore you could add some default data with:
60 >>> rake redmine:load_default_data RAILS_ENV="production"
61 >>>
62 >>> Default login and password are admin/admin. Remember to change these.
63 >>>
64 >>> Further installation help can be found at:
65 >>> http://www.redmine.org/wiki/redmine/RedmineInstall
66 EOF
69 # arg 1: the new package version
70 # arg 2: the old package version
71 pre_upgrade() {
72 /bin/true
75 # arg 1: the new package version
76 # arg 2: the old package version
77 post_upgrade() {
78 cd opt/redmine
79 echo ">> Change Ownership for corresponding directories"
80 chmod -R 755 config files log tmp public/plugin_assets
82 echo ">>> Clearing cache and existing sessions..."
83 rake tmp:cache:clear
84 rake tmp:sessions:clear
85 echo ">>> Remember to update you database with"
86 echo ">>> rake db:migrate RAILS_ENV=\"production\" >/dev/null"
89 # arg 1: the old package version
90 pre_remove() {
91 usr/sbin/userdel redmine &>/dev/null
92 usr/sbin/groupdel redmine &>/dev/null
95 # arg 1: the old package version
96 post_remove() {
97 /bin/true