summaryrefslogtreecommitdiff
path: root/social/diaspora-git/PKGBUILD
blob: 77a11d70139409c5b69210789ce7bb9197827396 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Maintainer: fauno <fauno@kiwwwi.com.ar>
# Maintainer: Hilton Medeiros <medeiros.hilton at gmail dot com>
# Contributor: Splashy <splash at open-web dot fr>

# After installing, see the Diaspora wiki page for more information:
# https://wiki.archlinux.org/index.php/Diaspora

pkgbase=diaspora-git
pkgname=('diaspora-mysql-git' 'diaspora-postgresql-git' 'diaspora-sqlite-git')
<<<<<<< HEAD
pkgver=20110623
=======
pkgver=20111229
>>>>>>> ddf6b4309b9f9816e75828359a2d60a23a0ca68c
pkgrel=1
pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network"
arch=('i686' 'x86_64')
url="https://diasporafoundation.org/"
license=('AGPL3')
depends=('ruby' 'redis' 'imagemagick' 'libxslt')
makedepends=('git' 'ruby-headers')
provides=('diaspora')
install=diaspora.install
source=('diaspora.bin'
        'diaspora.rc'
        'diaspora.logrotate'
        'diaspora.pam')
md5sums=('440ce2511485855030e74e28843a037d'
         '7bffaaee41b515247ba19a19c77dc5bf'
         '60f6b3972c73cbc6b1c9ab87c88fb655'
         '96f82c38f3f540b53f3e5144900acf17')

_gitroot="https://github.com/diaspora/diaspora.git"
_gitname="diaspora"

# I use this because I'm behind an asshole proxy
tsocks=tsocks

build() {
  cd "$srcdir"

  msg "Connecting to the Git server..."

  if [[ -d $_gitname ]] ; then
    pushd $_gitname
    $tsocks git pull origin
    msg "The local files are updated."
    popd
  else
    $tsocks git clone $_gitroot
    msg "Git clone done."
  fi

  msg "Start making..."

  [[ -d $_gitname-build ]] && rm -fr $_gitname-build
<<<<<<< HEAD
  git clone $_gitname $_gitname-build
=======
  $tsocks git clone $_gitname $_gitname-build
>>>>>>> ddf6b4309b9f9816e75828359a2d60a23a0ca68c

# Include all gems
  export GEM_HOME="${PWD}/vendor"
  export GEM_PATH="${PWD}/vendor"
  export PATH="${PATH}:${GEM_PATH}/bin"

  cd ${srcdir}/${_gitname}-build

<<<<<<< HEAD
  gem install bundler
=======
  $tsocks gem install bundler
>>>>>>> ddf6b4309b9f9816e75828359a2d60a23a0ca68c
}

# Helper
_package() {
  cd "${srcdir}"

  usrdir="${pkgdir}/usr/share/webapps"

  install -d "${usrdir}"
  cp -a ${_gitname}-build "${usrdir}/${_gitname}"

  cd "${usrdir}/${_gitname}"

# Set the example config
  sed -e 's/rails_env:.*/rails_env: "production"/' \
      -e "s/db:.*/db: \"${DB}\"/" \
      -i config/script_server.yml.example

  ${tsocks} bundle install --local --path vendor --without development test

  find -type d -name ".git" -exec rm -fr '{}' \; &>/dev/null || true

  install -Dm755 ${_gitname}.bin "${pkgdir}/usr/bin/${_gitname}"
  install -Dm755 ${_gitname}.rc "${pkgdir}/etc/rc.d/${_gitname}"
  install -Dm644 ${_gitname}.logrotate "${pkgdir}/etc/logrotate.d/${_gitname}"
  install -Dm644 ${_gitname}.pam "${pkgdir}/etc/pam.d/${_gitname}"

  install -d ${pkgdir}/usr/share/licenses/${_gitname}/
  install -Dm644 ${srcdir}/${_gitname}-build/{AUTHORS,COPYRIGHT,GNU-AGPL-3.0} \
                 ${pkgdir}/usr/share/licenses/${_gitname}/
}

package_diaspora-mysql-git() {
    pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (MySQL version)"
    provides=('diaspora-mysql' 'diaspora')
    depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'mysql')
    options=(!strip)

    export DB="mysql"

    _package
}

package_diaspora-postgresql-git() {
    pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (PostgreSQL version)"
    provides=('diaspora-postgresql' 'diaspora')
    depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'postgresql')
    options=(!strip)

    export DB="postgresql"

    _package
}

package_diaspora-sqlite-git() {
    pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network (SQLite3 version)"
    provides=('diaspora-sqlite' 'diaspora')
    depends=('ruby' 'redis' 'imagemagick' 'libxslt' 'sqlite3')
    options=(!strip)

    export DB="sqlite"

    _package
}