Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 87 lines (68 sloc) 2.821 kb
#!/bin/bash
#
# Install a fedora source package
#
#
Usage='diaspora-install <tar package>'
test "$(perl -e 'print $>')" = "0" || {
echo "You need to be root to do this, giving up"
exit 2
}
test $# -eq 1 || { echo "$Usage"; exit 2; }
test -r "$1" || { echo "Cannot open $1"; exit 2; }
getent group diaspora >/dev/null || groupadd -r diaspora
getent passwd diaspora >/dev/null || \
useradd -r -g diaspora \
-md /var/lib/diaspora \
-s /bin/bash \
-c "Diaspora daemon" diaspora
sudo tar -C /usr/share -xzf $1
cd /usr/share;
rm -rf /usr/share/diaspora
mv $( basename $1 .tar.gz) diaspora
cd /usr/share/diaspora
find . -perm /u+x -type f -exec \
sed -i 's|^#!/usr/local/bin/ruby|#!/usr/bin/ruby|' {} \; > /dev/null
rm -rf master/vendor/bundle master/public/uploads master/tmp master/log
sed -i '/BUNDLE_PATH/s|:.*|: /usr/lib/diaspora-bundle/vendor/bundle|' \
master/.bundle/config
cp master/GNU-AGPL-3.0 master/COPYRIGHT master/README.md master/AUTHORS .
cp master/config/app_config.yml.example ./app_config.yml
cp master/pkg/ubuntu/diaspora-websocket.conf /etc/init
cp master/pkg/ubuntu/diaspora-resque.conf /etc/init
cp master/pkg/ubuntu/diaspora-redis.conf /etc/init
cp master/pkg/ubuntu/diaspora-thin.conf /etc/init
cp master/pkg/ubuntu/diaspora /etc/init.d
cp master/pkg/ubuntu/diaspora.logrotate /etc/logrotate.d/diaspora
ln -s master/pkg/ubuntu/diaspora-setup .
mkdir -p /var/log/diaspora
mkdir -p /var/lib/diaspora/uploads
mkdir -p /var/lib/diaspora/tmp
mkdir -p /var/run/diaspora
mkdir -p /etc/diaspora
bundle='/usr/lib/diaspora-bundle'
[ "$(arch | tr -d '\n')" = 'x86_64' ] && \
bundle='/usr/lib64/diaspora-bundle'
ln -sf /var/log/diaspora ./master/log
cp master/config/app_config.yml.example /etc/diaspora/app_config.yml
ln -sf /etc/diaspora/app_config.yml master/config/app_config.yml
ln -sf /var/lib/diaspora/uploads master/public/
ln -sf /var/lib/diaspora/tmp master
rm -rf master/vendor
ln -sf $bundle/vendor master/vendor
ln -sf $bundle/Gemfile master/Gemfile
ln -sf $bundle/Gemfile.lock master/Gemfile.lock
rm -rf /usr/share/doc/diaspora
mkdir -p /usr/share/doc/diaspora
mv AUTHORS README.md GNU-AGPL-3.0 COPYRIGHT /usr/share/doc/diaspora
find ./ -print | xargs chown root:root
rm -rf /usr/share/doc/diaspora
mkdir /usr/share/doc/diaspora
chown diaspora:diaspora /usr/share/diaspora/master/config.ru
chown diaspora:diaspora /usr/share/diaspora/master/config/environment.rb
chown diaspora:diaspora /var/log/diaspora
chown diaspora:diaspora /var/lib/diaspora/uploads
chown diaspora:diaspora /var/lib/diaspora/tmp
chown diaspora:diaspora /var/lib/diaspora
chown diaspora:diaspora /var/run/diaspora
chown diaspora:diaspora /usr/share/diaspora/master/pkg/ubuntu/dist
Jump to Line
Something went wrong with that request. Please try again.