summaryrefslogtreecommitdiff
path: root/social/diaspora-git/PKGBUILD
blob: b15f66916bf4a5da8ec2456483a96cdd27efe8f0 (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
# 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

pkgname=diaspora-git
pkgver=20110623
pkgrel=1
pkgdesc="A privacy aware, personally controlled, do-it-all, open source social network"
arch=('i686' 'x86_64')
url="http://www.joindiaspora.com/"
license=('AGPL3')
depends=('ruby' 'mysql-ruby' 'redis' 'imagemagick' 'libxslt')
makedepends=('git' 'ruby-headers')
install=diaspora.install
source=('diaspora.bin'
        'diaspora.rc'
        'diaspora.logrotate'
        'diaspora.pam')

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

build() {
  cd "$srcdir"

  msg "Connecting to the Git server..."

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

  msg "Start making..."

  [[ -d $_gitname-build ]] && rm -fr $_gitname-build
  git clone $_gitname $_gitname-build

  # Recover gems cache
  rm -fr $_gitname-gems
  mkdir -p $_gitname-gems
  [[ -d cache ]] && mv cache $_gitname-gems

# Include all gems
  export GEM_HOME="$srcdir/$_gitname-gems"
  export GEM_PATH="$srcdir/$_gitname-gems"
  export PATH="${PATH}:${GEM_PATH}/bin"

  gem install bundler

  # Patch ruby_core_source to not install the headers in the system
  # Remove this if you are behind a proxy and install the ruby-headers package instead
#  gem install ruby_core_source
#  sed -i "s@^  dest_dir.*@  dest_dir = \"$srcdir/rubyhdrs/\" + ruby_dir@" \
#    $_gitname-gems/gems/ruby_core_source*/lib/ruby_core_source.rb

  pushd $_gitname-build
  bundle install --path vendor

  # We make this now because we do not install the git history
  tar czf public/source.tar.gz  `git ls-tree -r master | awk '{print $4}'`

  rm -fr .git
  popd

  # Keep the gems cache
  mv $_gitname-gems/cache "$srcdir"
}

package() {
  cd "$srcdir"
  options=(!strip)

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

  install -d "$usrdir"
  cp -r $_gitname-build "$usrdir/$_gitname"
  #cp -r $_gitname-gems "$usrdir/"
  find "$usrdir/$_gitname-gems" \
    -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/
}
md5sums=('7e7402127f9a05bc58aff0adc5057d1c'
         '7bffaaee41b515247ba19a19c77dc5bf'
         '60f6b3972c73cbc6b1c9ab87c88fb655'
         '96f82c38f3f540b53f3e5144900acf17')