added install to the PKGBUILD
[archlinuxdevstack.git] / redmine / redmine.install
blobb0b61f59b3b577f0b0c8195495856fcfa7135b65
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 echo ">>> Creating redmine user and group and setting permissions..."
13 getent group redmine >/dev/null || usr/sbin/groupadd redmine
14 getent passwd redmine >/dev/null || usr/sbin/useradd -c 'Redmine PMS' -g redmine -d '/' -s /bin/false redmine
15 usr/bin/passwd -l redmine &>/dev/null
17 cd usr/lib/redmine
19 mkdir tmp
20 mkdir public/plugin_assets
21 chown -R redmine:redmine files log tmp public/plugin_assets
22 chmod -R 755 files log tmp public/plugin_assets
24 echo ">>> Generating session store secret..."
25 rake config/initializers/session_store.rb
27 cat << EOF
28 >>>
29 >>> You can run Redmine in a couple of different ways:
30 >>> * Apache (via passenger)
31 >>> * WEBrick (standalone included webserver) - script/ruby -e production
32 >>>
33 >>> When running via WEBrick, you can start the daemon via:
34 >>> /etc/rc.d/redmine start
35 >>> Alternatively add "redmine" to the DAEMONS array in /etc/rc.conf.
36 >>>
37 >>> To run it i Apache, add the following into the section
38 >>> "Supplemental configuration" of /etc/httpd/conf/httpd.conf.
39 # Redmine PMS
40 Include conf/extra/httpd-redmine.conf
41 >>>
42 >>> After the installation you should create the database (in MySQL)
43 >>> with the following commands:
44 >>> mysql -u root -p
45 >>> mysql> create database redmine character set utf8;
46 >>> mysql> create user 'redmine'@'localhost' identified by 'redmine'
47 >>> mysql> grant all privileges on redmine.* to 'redmine'@'localhost'
48 >>> rake db:migrate RAILS_ENV="production"
49 >>>
50 >>> Furthermore you could add some default data with:
51 >>> rake redmine:load_default_data
52 >>>
53 >>> Default login and password are admin/admin. Remember to change these.
54 >>>
55 >>> Further installation help can be found at:
56 >>> http://www.redmine.org/wiki/redmine/RedmineInstall
57 EOF
60 # arg 1: the new package version
61 # arg 2: the old package version
62 pre_upgrade() {
63 /bin/true
66 # arg 1: the new package version
67 # arg 2: the old package version
68 post_upgrade() {
69 cd usr/lib/redmine
70 echo ">>> Clearing cache and existing sessions..."
71 rake tmp:cache:clear
72 rake tmp:sessions:clear
73 echo ">>> Remember to update you database with"
74 echo ">>> rake db:migrate RAILS_ENV=\"production\" >/dev/null"
77 # arg 1: the old package version
78 pre_remove() {
79 usr/sbin/userdel redmine &>/dev/null
80 usr/sbin/groupdel redmine &>/dev/null
83 # arg 1: the old package version
84 post_remove() {
85 /bin/true