Pkg updates: separate wsd pkg, bad Gemfile.lock mgmt, docs, fixes
For fedora, splits off the wsd daemon in separate package. Overall, tools to handle bad Gemfile.lock: README notes, -f option to invoke 'bundle update' in make-dist.sh. Handling of missing libmozjs in Ubuntu 10.04 (https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/557024) Various fixes & typos.
This commit is contained in:
parent
fcd70ce152
commit
d8fc7d572e
8 changed files with 104 additions and 77 deletions
|
|
@ -1,7 +1,5 @@
|
|||
## Diaspora RPM tools
|
||||
|
||||
NOTE: This does not work ATM, see http://bugs.joindiaspora.com/issues/372
|
||||
|
||||
Creates diaspora source tarballs and RPM packages
|
||||
|
||||
An alternative to the capistrano system, providing classic, binary RPM
|
||||
|
|
@ -11,9 +9,17 @@ aimed for packaging purposes.
|
|||
|
||||
#### Fedora RPM synopsis
|
||||
|
||||
*Prerequisites*: ruby-1.8, rubygem and other packages as described in
|
||||
http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora
|
||||
or http://github.com/diaspora/diaspora/wiki/Installing-on-CentOS-Fedora
|
||||
Prerequisites:
|
||||
|
||||
- ruby-1.8, rubygem, git and rake as described in
|
||||
http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora
|
||||
or http://github.com/diaspora/diaspora/wiki/Installing-on-CentOS-Fedora
|
||||
|
||||
- A personal environment to build RPM:s, also described in
|
||||
http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora
|
||||
|
||||
Install g++ (possibly unnnecessary?):
|
||||
% yum install gcc-c++
|
||||
|
||||
Create source tarballs like dist/diaspora-0.0-1010041233_fade4231.tar.gz
|
||||
and dist/diaspora-bundle-0.0-1010041233_fade4231.tar.gz:
|
||||
|
|
@ -63,12 +69,12 @@ The source tarball could be used as-is, by unpacking add making a
|
|||
%
|
||||
|
||||
This file can be installed anywhere. To use it, add a symlink from vendor/bundle
|
||||
to the bundle's master directory. Reasonable defaults are to install
|
||||
diaspora in /var/diaspora and bundle in /usr/lib/diaspora-bundle. With these,
|
||||
to the bundle's bundle directory. Reasonable defaults are to install
|
||||
diaspora in /usr/share/diaspora and bundle in /usr/lib/diaspora-bundle. With these,
|
||||
the link is
|
||||
% rm -rf /var/diaspora/master/vendor/bundle
|
||||
% ln -sf /usr/lib/diaspora-bundle/master/bundle \
|
||||
> /var/diaspora/master/vendor
|
||||
% rm -rf /usr/share/diaspora/master/vendor/bundle
|
||||
% ln -sf /usr/lib/diaspora-bundle/bundle \
|
||||
> /usr/share/diaspora/master/vendor
|
||||
%
|
||||
|
||||
The directories tmp, log, and public/uploads needs to be writable. If using
|
||||
|
|
@ -83,27 +89,20 @@ The source tarball is as retrieved from diaspora with following differences:
|
|||
|
||||
- The .git directories are removed (freeing more than 50% of the size).
|
||||
- A new file /master/config/gitversion is created.
|
||||
- The file public/source.tar is generated.
|
||||
- The file public/source.tar.gz is generated.
|
||||
- The file .bundle/config is patched. Remove before doing
|
||||
*bundle install*
|
||||
|
||||
./make-dist.sh bundle|source occasionally fails on bad Gemfile.lock. The
|
||||
root cause is a bad Gemfile in the git repo. Possible fixes includes
|
||||
using a older version known to work:
|
||||
|
||||
% ./make-dist.sh -c c818885b6 bundle
|
||||
% ./make-dist.sh -c c818885b6 source
|
||||
|
||||
or forcing a complete update of Gemfile.lock using 'bundle update' (a
|
||||
potential problematic operation):
|
||||
|
||||
potentially problematic operation):
|
||||
% ./make-dist.sh -f bundle
|
||||
|
||||
|
||||
Routines uses last available version from master branch at github. The
|
||||
version contains a time stamp and an abbreviated git commit id.
|
||||
Using -c, a specific commit can be used for source build.
|
||||
|
||||
*make-dist prepare* creates links also for all files listed in SOURCES.
|
||||
Typically, this is secondary sources. *make-dist.sh sources*
|
||||
applies all patches named *.patch in this directory after checking out
|
||||
|
|
@ -150,24 +149,24 @@ diaspora app. This is more or less as mandated by LSB and Fedora packaging rule
|
|||
|
||||
#### Discussion
|
||||
|
||||
For better or worse, this installation differs from the procedure outlined in the
|
||||
original README.md:
|
||||
For better or worse, this installation differs from the procedure outlined
|
||||
in the original README.md:
|
||||
|
||||
- All configuration is done in /usr/share/diaspore. No global ur user installed bundles
|
||||
are involved. Easier to maintain, but a mess if there should be parallel
|
||||
installations.
|
||||
- All configuration is done in /usr/share/diaspore. No global or user
|
||||
installed bundles are involved. Easier to maintain, but a mess if there
|
||||
should be parallel installations.
|
||||
|
||||
- Service is run under it's own uid, not root or an ordinary user account.
|
||||
|
||||
- Using the pre-packaged mongod server means that the DB has reasonable permissions,
|
||||
not 777.
|
||||
- Using the pre-packaged mongod server means that the DB has reasonable
|
||||
permissions, not 777.
|
||||
|
||||
- Splitting in two packages makes sense IMHO. The bundle is not changed that often,
|
||||
but is quite big: ~30M without test packages (the default) or ~55M with test
|
||||
packages. The application is just ~3M, and is fast to deploy even with these
|
||||
tools (yes, I know, capistrano is much faster...)
|
||||
- Splitting in two packages makes sense IMHO. The bundle is not changed
|
||||
that often, but is quite big: ~35M without test packages (the default) or
|
||||
~55M with test packages. The application is just ~3M, and is fast to
|
||||
deploy even with these tools (yes, I know, capistrano is much faster...)
|
||||
|
||||
- Many, roughly 50% of the packages in the bundle are already packaged for Fedora
|
||||
i. e., they could be removed from the bundle and added as dependencies instead.
|
||||
This is likely to make things more stable in the long run.
|
||||
diaspora.spec has a list.
|
||||
- Many, roughly 50% of the packages in the bundle are already packaged
|
||||
for Fedora i. e., they could be removed from the bundle and added as
|
||||
dependencies instead. This is likely to make things more stable in the
|
||||
long run. diaspora.spec has a list.
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ popd
|
|||
getent group diaspora >/dev/null || groupadd -r diaspora
|
||||
getent passwd diaspora >/dev/null || \
|
||||
useradd -r -g diaspora \
|
||||
-md /var/lib/diaspora -s /sbin/nologin \
|
||||
-md /var/lib/diaspora -s /bin/bash \
|
||||
-c "Diaspora daemon" diaspora
|
||||
exit 0
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
#
|
||||
# Do what's needed to initiate diaspora.
|
||||
#
|
||||
# Usage: # ./diaspora-setup [external hostname]
|
||||
#
|
||||
|
||||
arg_hostname="$1"
|
||||
|
||||
test $UID = "0" || {
|
||||
echo "You need to be root to do this, giving up"
|
||||
|
|
@ -37,6 +41,13 @@ fi
|
|||
|
||||
# %attr(0777, diaspora, diaspora) doesn't work in specfile due to umask 022.
|
||||
chmod 777 /var/lib/diaspora/uploads
|
||||
chown -R diaspora /var/log/diaspora
|
||||
|
||||
if [ -n "$arg_hostname" ]; then
|
||||
sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml &&
|
||||
echo "config/app_config.yml updated."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
||||
while : ; do
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ function make_src
|
|||
(
|
||||
cd ${RELEASE_DIR}/master
|
||||
git show --name-only > config/gitversion
|
||||
tar cf public/source.tar \
|
||||
--exclude='source.tar' -X .gitignore *
|
||||
tar czf public/source.tar.gz \
|
||||
--exclude='source.tar.gz' -X .gitignore *
|
||||
find $PWD -name .git\* | xargs rm -rf
|
||||
rm -rf .bundle
|
||||
/usr/bin/patch -p1 -s <../../../add-bundle.diff
|
||||
|
|
@ -192,6 +192,8 @@ set -x
|
|||
mkdir -p $bundle_name/bundle
|
||||
pushd diaspora > /dev/null
|
||||
if [ "$BUNDLE_FIX" = 'yes' ]; then
|
||||
rm -f Gemfile.lock
|
||||
rm -rf .bundle
|
||||
bundle update
|
||||
fi
|
||||
bundle install --deployment \
|
||||
|
|
@ -286,7 +288,7 @@ function usage()
|
|||
|
||||
commit='HEAD'
|
||||
BUNDLE_FIX='no'
|
||||
while getopts ":r:c:fh" opt
|
||||
while getopts ":r:c:u:fh" opt
|
||||
do
|
||||
case $opt in
|
||||
u) GIT_REPO="$OPTARG"
|
||||
|
|
|
|||
|
|
@ -1,32 +1,30 @@
|
|||
## Package-oriented install for ubuntu.
|
||||
|
||||
NOTE: This does not work ATM, see http://bugs.joindiaspora.com/issues/372
|
||||
|
||||
Here are somediaspora-installdiaspora-install scripts to install diaspora on Ubuntu. They are designed to
|
||||
Here are scripts to install diaspora on Ubuntu. They are designed to
|
||||
work as a first step towards packaging, but should be usable as is.
|
||||
|
||||
### Synopsis
|
||||
|
||||
Bootstrap the distribution from git:
|
||||
sudo apt-get install git-core
|
||||
git clone git://github.com/diaspora/diaspora.git
|
||||
cd diaspora/pkg/ubuntu
|
||||
% sudo apt-get install git-core
|
||||
% git clone git://github.com/diaspora/diaspora.git
|
||||
% cd diaspora/pkg/ubuntu
|
||||
|
||||
Install the dependencies (a good time for a coffe break)
|
||||
sudo ./diaspora-install-deps
|
||||
Install the dependencies (a good time for a coffe break):
|
||||
% sudo ./diaspora-install-deps
|
||||
|
||||
Create and install the diaspora bundle and application:
|
||||
./make-dist.sh bundle
|
||||
sudo ./diaspora-bundle-install dist/diaspora-bundle-*.tar.gz
|
||||
% ./make-dist.sh bundle
|
||||
% sudo ./diaspora-bundle-install dist/diaspora-bundle-*.tar.gz
|
||||
|
||||
./make-dist.sh source
|
||||
sudo ./diaspora-install dist/diaspora-0.0*.tar.gz
|
||||
% ./make-dist.sh source
|
||||
% sudo ./diaspora-install dist/diaspora-0.0*.tar.gz
|
||||
|
||||
Initiate and start the server;
|
||||
sudo ./diaspora-setup
|
||||
sudo su - diaspora
|
||||
cd /usr/share/diaspora/master
|
||||
./script/server
|
||||
% sudo ./diaspora-setup
|
||||
% sudo su - diaspora
|
||||
% cd /usr/share/diaspora/master
|
||||
% ./script/server
|
||||
|
||||
### Upgrading
|
||||
|
||||
|
|
@ -36,19 +34,23 @@ The normal procedure to update is to just
|
|||
$ ./make-dist.sh bundle
|
||||
$ ./make-dist.sh source
|
||||
|
||||
And then use diaspore-install and diaspora-install-bundle as above.
|
||||
|
||||
It's necessary to always have the correct bundle. The easy way is to just
|
||||
$ ./make-dist.sh bundle
|
||||
|
||||
Repo: http://github.com/diaspora/diaspora.git
|
||||
Bundle: dist/diaspora-bundle-0.0-1010111342_afad554.tar.gz
|
||||
|
||||
The command will return the last built bundle (which is cached) if it's
|
||||
OK to use. If it's not, it will build a new.
|
||||
And then use diaspora-install and diaspora-install-bundle as above.
|
||||
It's necessary to always have the correct bundle. The *./make-dist.sh bundle*
|
||||
above will use a cached bundle if it's still valid, else build a new.
|
||||
In most cases only source will need to be built, which is fast.
|
||||
|
||||
### Notes
|
||||
|
||||
./make-dist.sh bundle|source occasionally fails on bad Gemfile.lock. The
|
||||
root cause is a bad Gemfile.lock in the git repo. Possible fixes includes
|
||||
using a older version known to work:
|
||||
% ./make-dist.sh -c c818885b6 bundle
|
||||
% ./make-dist.sh -c c818885b6 source
|
||||
|
||||
or forcing a complete update of Gemfile.lock using 'bundle update' (a
|
||||
potentially problematic operation):
|
||||
% ./make-dist.sh -f bundle
|
||||
|
||||
./make-dist.sh bundle|source occasionally fails on bad Gemfile.lock. The
|
||||
root cause is a bad Gemfile.lock in the git repo. Possible fixes includes
|
||||
using a older version known to work:
|
||||
|
|
@ -73,22 +75,20 @@ the stuff using git in this case.
|
|||
The user diaspora is added during install.
|
||||
|
||||
Tools used for building package are installed globally. All of diasporas
|
||||
dependencies lives in the nothing is insalled by user or on system level.
|
||||
|
||||
make-dist.sh accepts arguments to get a specified commit and/or use another
|
||||
repo.
|
||||
dependencies lives in the application - nothing is installed by user or
|
||||
on system level.
|
||||
|
||||
This has been tested on a Ubuntu 32-bit 10.10 , clean server and on 10.04
|
||||
Lucid desktop, also clean installation.
|
||||
|
||||
mongodb is having problems occasionally. Sometimes the dependencies are not
|
||||
installed, and mongod refuses to start. invoke /usr/bin/mongod -f /etc/mongodb.conf
|
||||
fo test. The lockfile /var/lib/mongodb/mongod.conf is also a potential
|
||||
problem. Remove to make it start again.
|
||||
installed, and mongod refuses to start. invoke */usr/bin/mongod -f
|
||||
/etc/mongodb.conf* to test. The lockfile /var/lib/mongodb/mongod.conf is
|
||||
also a potential problem. Remove to make it start again.
|
||||
|
||||
The diaspora-wsd is just placeholder FTM, it does **not** work.
|
||||
|
||||
Please, report any problems!
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ test "$(perl -e 'print $>')" = "0" || {
|
|||
exit 2
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
getent group diaspora >/dev/null || groupadd -r diaspora
|
||||
getent passwd diaspora >/dev/null || \
|
||||
useradd -r -g diaspora \
|
||||
|
|
|
|||
|
|
@ -11,11 +11,18 @@ grep -v '^#' /etc/apt/sources.list | grep -q universe || {
|
|||
EOF
|
||||
sleep 2
|
||||
}
|
||||
release=$( lsb_release -a | awk '/Release:/ {print $2}')
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -qy --ignore-missing build-essential libxslt1-dev \
|
||||
libxml2 ruby-full mongodb rake python-software-properties git-core \
|
||||
imagemagick libmagick9-dev xulrunner-1.9
|
||||
sudo apt-get install -qy build-essential libxslt1-dev libxml2 \
|
||||
ruby-full mongodb rake python-software-properties git-core \
|
||||
imagemagick libmagick9-dev
|
||||
if [ "$release" = "10.04" ]; then
|
||||
# See: https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/557024
|
||||
sudo apt-get install xulrunner-1.9
|
||||
xulversion=$( xulrunner --gre-version)
|
||||
sudo ln -sf "/usr/lib/xulrunner-$xulversion/libmozjs.so" /usr/lib
|
||||
fi
|
||||
sudo add-apt-repository ppa:maco.m/ruby
|
||||
sudo apt-get update
|
||||
sudo apt-get install -qy rubygems
|
||||
|
|
|
|||
|
|
@ -2,12 +2,16 @@
|
|||
#
|
||||
# Do what's needed to initiate diaspora.
|
||||
#
|
||||
# Usage: sudo diaspora-setup [external hostname]
|
||||
#
|
||||
|
||||
test "$( perl -e 'print $<')" = "0" || {
|
||||
echo "You need to be root to do this, giving up"
|
||||
exit 2
|
||||
}
|
||||
|
||||
arg_hostname="$1"
|
||||
|
||||
services=$( netstat -nl | grep '[^:]:3000[ \t]')
|
||||
test -n "$services" && {
|
||||
echo "Warning: something is already using port 3000"
|
||||
|
|
@ -42,6 +46,12 @@ fi
|
|||
chmod 777 /var/lib/diaspora/uploads
|
||||
chown -R diaspora /var/log/diaspora
|
||||
|
||||
if [ -n "$arg_hostname" ]; then
|
||||
sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml &&
|
||||
echo "config/app_config.yml updated."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
||||
while : ; do
|
||||
echo "Current hostname is \"$hostname\""
|
||||
|
|
|
|||
Loading…
Reference in a new issue