Skip to content
Extraits de code Groupes Projets
Valider d8fc7d57 rédigé par Alec Leamas's avatar Alec Leamas
Parcourir les fichiers

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