summaryrefslogtreecommitdiff
path: root/pcr/mediagoblin/mediagoblin.install
blob: fd485db16af2afca4da691a053e7c293ad092501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
pkgname=mediagoblin

post_install() {
  if [ ! `grep mediagoblin /etc/group` ]; then
    groupadd mediagoblin &>/dev/null;
  fi

  id mediagoblin &>/dev/null || \
    useradd -g mediagoblin -d /var/lib/mediagoblin -s /bin/false mediagoblin

  /usr/bin/systemd-tmpfiles --create mediagoblin.conf

  chown -R mediagoblin:mediagoblin /var/run/mediagoblin /var/lib/mediagoblin

  cd /usr/share/webapps/mediagoblin/
  /bin/su -s /bin/sh -c "/usr/share/webapps/mediagoblin/bin/gmg dbupdate" mediagoblin
}

post_upgrade() {
  cd /usr/share/webapps/mediagoblin/
  /bin/su -s /bin/sh -c "/usr/share/webapps/mediagoblin/bin/gmg dbupdate" mediagoblin
}

pre_remove() {
  /usr/bin/systemd-tmpfiles --remove mediagoblin.conf
  userdel mediagoblin
}