From 9b83b07f8029ca3aba2f8e2050cbcac846d028ca Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 04:04:34 +0200 Subject: [PATCH 01/40] Install from local git gems without download from remote repo. --- pkg/fedora/make-dist.sh | 49 ++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 3da2ab6e3..5857114c7 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -175,41 +175,23 @@ function make_src echo "Required bundle: $(git_id dist/diaspora/Gemfile)" } -function get_git_repos() +function read_git_urls() +# Simple now, possibly needs to handle also http: git repos. { - grep -A 2 GIT $1 | - awk ' /remote:/ { repo = $2 } - /revision:/ { printf "%s=%s\n",repo, $2}' + grep -o 'git://[^ ]*' $1 | tr -d '\047",' } - -function package_git_gems() +function fix_gemfile() { - gemfile="$1" - dest="$2" - - rm -rf git-tmp - mkdir git-tmp - cd git-tmp - for repo in $( get_git_repos $1); do - url=${repo%%=*} - rev=${repo##*=} - - name=${url##*/} - name="${name%.git}" - - rm -rf "$name" - git clone "$url" "$name" - cd $name - git reset --hard $rev - sed -i '/s.date/s/Date.today/"2010-09-25"/' *.gemspec - gem build *.gemspec - cp *.gem $dest - echo "Built GIT gem $name (*.gem)" - echo "Where: $dest" - cd .. - done - cd .. + gemfile=$1 + for url in $(read_git_urls $gemfile); do + name=${url##*/} + name=${name%.*} + rm -rf vendor/git/$name + git clone --bare --quiet $url vendor/git/$name && + sed -i "s#$url#vendor/git/$name#" $gemfile || + echo "Cannot fix git repo \"$url\"" + done } @@ -231,9 +213,10 @@ function make_bundle() rm -rf .bundle bundle update fi - bundle install --deployment + [ -d 'vendor/git' ] || mkdir vendor/git + fix_gemfile ./Gemfile + bundle install --path vendor/gems bundle package - package_git_gems "$PWD/Gemfile.lock" "$PWD/vendor/cache" cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \ vendor/cache cd vendor From a279bae720218cd340df123cb214b70da5b123b6 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 10:31:13 +0200 Subject: [PATCH 02/40] Separate doc dir collecting copyrights and readmes. --- pkg/fedora/.gitignore | 1 + pkg/fedora/diaspora-bundle.spec | 4 +-- pkg/fedora/diaspora.spec | 3 +-- pkg/fedora/make-dist.sh | 42 ++++++++++++++++++++++-------- pkg/ubuntu/diaspora-bundle-install | 6 ++--- 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/pkg/fedora/.gitignore b/pkg/fedora/.gitignore index bedbdc760..2a21dd54d 100644 --- a/pkg/fedora/.gitignore +++ b/pkg/fedora/.gitignore @@ -1,3 +1,4 @@ TODO dist .stgit* +vendor diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index dee189a26..b3496262b 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -38,8 +38,6 @@ Source file usede to compile native libraries in diaspora-bundle. %setup -q -n %{name}-%{version}-%{git_release} %build -mkdir -p vendor/cache -mv *.gem vendor/cache bundle install --local --deployment --without ri rdoc pushd vendor/bundle/ruby/1.8/gems @@ -218,7 +216,7 @@ cat files >> dirs && cp dirs files %files -f files %defattr(-, diaspora, diaspora, 0755) -%doc COPYRIGHT Gemfile Gemfile.lock AUTHORS GNU-AGPL-3.0 +%doc COPYRIGHT Gemfile Gemfile.lock AUTHORS GNU-AGPL-3.0 docs %files -f dev-files devel %defattr(-, root, root, 0644) diff --git a/pkg/fedora/diaspora.spec b/pkg/fedora/diaspora.spec index 1d61026e5..8a30492c8 100644 --- a/pkg/fedora/diaspora.spec +++ b/pkg/fedora/diaspora.spec @@ -49,13 +49,12 @@ find . -perm /u+x -type f -exec \ %build rm -rf master/vendor/bundle -mkdir master/tmp || : %install rm -fr $RPM_BUILD_ROOT sed -i \ - '/BUNDLE_PATH/s|:.*|: %{_libdir}/diaspora-bundle/bundle|' \ + '/BUNDLE_PATH/s|:.*|: %{_libdir}/diaspora-bundle/vendor/bundle|' \ master/.bundle/config cp master/GNU-AGPL-3.0 master/COPYRIGHT master/README.md master/AUTHORS . diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 5857114c7..a0f91b515 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -138,7 +138,7 @@ function checkout() cd diaspora; git fetch --quiet upstream git merge --quiet upstream/master - git checkout --quiet ${1:-'HEAD'} + [ -n "$1" ] && git reset --hard --quiet $1 git_id -n ) } @@ -183,9 +183,9 @@ function read_git_urls() function fix_gemfile() { - gemfile=$1 + local gemfile=$1 for url in $(read_git_urls $gemfile); do - name=${url##*/} + local name=${url##*/} name=${name%.*} rm -rf vendor/git/$name git clone --bare --quiet $url vendor/git/$name && @@ -194,6 +194,22 @@ function fix_gemfile() done } +function make_docs() +{ + local gems=$1 + local dest=$2 + + for gem in $(ls $gems); do + local name=$(basename $gem) + [ -r $gem/README* ] && { + local readme=$(basename $gem/README*) + cp -a $gem/$readme $dest/$readme.$name + } + [ -r $gem/COPYRIGHT ] && \ + cp -a $gem/COPYRIGHT $dest/COPYRIGHT.$name + done +} + function make_bundle() # Create the bundle tarball @@ -201,8 +217,8 @@ function make_bundle() # { checkout ${1:-'HEAD'} >/dev/null - bundle_id=$( git_id dist/diaspora/Gemfile) - bundle_name="diaspora-bundle-$VERSION-$bundle_id" + local bundle_id=$( git_id dist/diaspora/Gemfile) + local bundle_name="diaspora-bundle-$VERSION-$bundle_id" test -e "dist/$bundle_name.tar.gz" || { echo "Creating bundle $bundle_name" cd dist @@ -213,17 +229,21 @@ function make_bundle() rm -rf .bundle bundle update fi + [ -d 'vendor/git' ] || mkdir vendor/git fix_gemfile ./Gemfile bundle install --path vendor/gems bundle package + + mkdir -p "../$bundle_name/docs" + mkdir -p "../$bundle_name/vendor" cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \ - vendor/cache - cd vendor - mv cache $bundle_name - tar czf ../../$bundle_name.tar.gz $bundle_name - mv $bundle_name cache - cd .. + ../$bundle_name + make_docs "vendor/gems" "../$bundle_name/docs" + mv vendor/cache ../$bundle_name/cache + + tar czf ../$bundle_name.tar.gz $bundle_name + mv ../$bundle_name/cache cache cd .. cd .. } diff --git a/pkg/ubuntu/diaspora-bundle-install b/pkg/ubuntu/diaspora-bundle-install index 88924b930..9a4c9a10a 100755 --- a/pkg/ubuntu/diaspora-bundle-install +++ b/pkg/ubuntu/diaspora-bundle-install @@ -23,11 +23,9 @@ mv $(basename $1 .tar.gz) diaspora-bundle mkdir -p /usr/share/doc/diaspora-bundle || : cd /usr/lib/diaspora-bundle -cp AUTHORS GNU-AGPL-3.0 COPYRIGHT Gemfile Gemfile.lock \ +cp -a AUTHORS GNU-AGPL-3.0 COPYRIGHT Gemfile Gemfile.lock \ /usr/share/doc/diaspora-bundle - -mkdir -p vendor/cache -mv *.gem vendor/cache +cp -ar docs /usr/share/doc/diaspora-bundle bundle install --local --deployment --without ri rdoc From 1c170694911100ded9ea1435409752b1b021e029 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 10:59:57 +0200 Subject: [PATCH 03/40] bugfix --- pkg/fedora/make-dist.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index a0f91b515..250caa0d8 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -241,10 +241,9 @@ function make_bundle() ../$bundle_name make_docs "vendor/gems" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/cache - - tar czf ../$bundle_name.tar.gz $bundle_name - mv ../$bundle_name/cache cache cd .. + tar czf $bundle_name.tar.gz $bundle_name + mv $bundle_name/cache diaspora/vendor/cache cd .. } echo From 66d468c2b2c4c2210112de866689b5e3c290055b Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 11:10:00 +0200 Subject: [PATCH 04/40] bugfix --- pkg/fedora/make-dist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 250caa0d8..50ddbdc47 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -240,10 +240,10 @@ function make_bundle() cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \ ../$bundle_name make_docs "vendor/gems" "../$bundle_name/docs" - mv vendor/cache ../$bundle_name/cache + mv vendor/cache ../$bundle_name/vendor cd .. tar czf $bundle_name.tar.gz $bundle_name - mv $bundle_name/cache diaspora/vendor/cache + mv $bundle_name/vendor/cache diaspora/vendor/cache cd .. } echo From 76a8ea0e73346158959f28ce6e4e6df6fb744321 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 23:15:26 +0200 Subject: [PATCH 05/40] new git gem flow using. --- pkg/Licenses | 99 ++++++++++++++++++++++++++++++ pkg/fedora/diaspora-bundle.spec | 13 +++- pkg/fedora/make-dist.sh | 91 +++++++++++++++++++++------ pkg/ubuntu/diaspora-bundle-install | 9 +++ 4 files changed, 192 insertions(+), 20 deletions(-) create mode 100644 pkg/Licenses diff --git a/pkg/Licenses b/pkg/Licenses new file mode 100644 index 000000000..cc8f33741 --- /dev/null +++ b/pkg/Licenses @@ -0,0 +1,99 @@ + +abstract: Ruby +actionmailer: MIT +actionpack: MIT +activemodel: MIT +activerecord: MIT +activeresource: ? (Other distros uses MIT, "Ruby-alike", no pointers) +activesupport: MIT +addressable: MIT +arel: MIT +aws MIT +bcrypt-ruby: MIT +builder: MIT +bunny: MIT +capistrano: MIT +capybara: MIT +chef: ASL 2.0 +childprocess: MIT +columnize: GPLv2 +crack: MIT +cucumber: MIT +cucumber-rails: MIT +culerity: MIT +daemons: Ruby+MIT +database_cleaner: MIT +devise: MIT +devise_invitable MIT +diff Ruby+GPLv2+ Artistic 2.0 +em-websocket: MIT +eribus: MIT +event-machine: Ruby+GPLv2 +extlib: MIT +factory_girls MIT +factory_girls_rails: MIT +ffi MIT +haml MIT +http_connection: MIT +gherkin: MIT +hashie: MIT +highline GPLv2+Ruby +json: Ruby +json-pure: Ruby +launchy: MIT +linecache: GPLv2 +mail: MIT +mime-types: GPLv2+Ruby+Artistic 2.0 +mini_magick: MIT +mini_fb: ? +mixlib-authentication: ASL 2.0 +mixlib-cli ASL 2.0 +mixlib-config ASL 2.0 +mixlib-log ASL 2.0 +mocha Ruby+MIT +moneta: MIT +mongo: ASL 2.0 +net-scp: MIT +net-sftp: MIT +net-ssh: MIT +net-ssh-gatawey: MIT +ohai: ASL 2.0 +plucky: MIT +polyglot. MIT +pubsubhubbub: ASL 2.0 http://code.google.com/p/pubsubhubbub/ +rake: MIT +rack-mount: MIT +rack-test: MIT +railties: MIT +rest-client: MIT +rspec-core: MIT +rspec-expectations: MIT +rspec-mocks: MIT +rspec-rails: MIT +rack: MIT +rack-mount: MIT +ruby-debug: MIT +ruby-debug-base: MIT +rubyzip: Ruby +selenium-webdriver: ASL 2.0 +subexec: MIT +term-ansicolor: GPLv2 +textile. MIT +textile-warden: MIT +thin: MIT +thor: MIT +treetop: MIT +tx-info: MIT +uutdtools: MIT +iwarden: MIT +webmock: MIT +will-paginate MIT + + + + + + + + + diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index b3496262b..a13a85368 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -38,7 +38,16 @@ Source file usede to compile native libraries in diaspora-bundle. %setup -q -n %{name}-%{version}-%{git_release} %build -bundle install --local --deployment --without ri rdoc +bundle install --local --deployment --without ri rdoc test +for gem in vendor/git/*; do + gem install --local \ + --force \ + --no-rdoc \ + --no-ri \ + --install-dir vendor/bundle/ruby/1.8/bundler \ + $gem + +done pushd vendor/bundle/ruby/1.8/gems # In repo (2.2.4) @@ -198,7 +207,7 @@ popd } mkdir -p $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle -cp -ar vendor/bundle $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle +cp -ar vendor $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle find %{buildroot}/%{_libdir}/diaspora-bundle \ -type d -fprintf dirs '%%%dir "%%p"\n' diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 50ddbdc47..273ad6eae 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -183,15 +183,61 @@ function read_git_urls() function fix_gemfile() { - local gemfile=$1 - for url in $(read_git_urls $gemfile); do - local name=${url##*/} - name=${name%.*} - rm -rf vendor/git/$name - git clone --bare --quiet $url vendor/git/$name && - sed -i "s#$url#vendor/git/$name#" $gemfile || - echo "Cannot fix git repo \"$url\"" + + sed -i '/git:/s/,.*//' $1 + sed -i -e 's/GIT/GEM/' \ + -e '/[ ]*revision:/d' \ + -e '/[ ]*remote: git/s|git:.*|http://github.com|' \ + $1.lock + +} + +function build_git_gems() +# Usage: build_git_gems +{ + mkdir gem-tmp || : + cd gem-tmp + rm -rf * + + grep 'git:' ../$1 | sed 's/,/ /' | awk ' + /^.*git:\/\/.*$/ { + gsub( "=>", "") + gsub( ",", "") + if ( $1 != "gem") { + print "Strange git: line (ignored) :" $0 + next + } + name = $2 + suffix = "" + url="" + for (i = 3; i <= NF; i += 1) { + key = $i + i += 1 + if (key == ":git") + url = $i + else if ( key == ":ref") { + suffix = "; cd " name + suffix = suffix "; git reset --hard " $i + suffix = suffix "; cd .." + } + else if ( key == ":branch") + suffix = "; git checkout " $i + } + print "Running: ", cmd + cmd = sprintf( "git clone --quiet %s %s %s\n", + url, name, suffix) + system( cmd) + }' + sed -i 's/Date.today/"2010-10-24"/' carrierwave/carrierwave.gemspec + for dir in *; do + cd $dir + gem build *.gemspec + cp *.gem ../../$2 + cd .. done + + cd .. + # rm -rf gem-tmp } function make_docs() @@ -201,12 +247,18 @@ function make_docs() for gem in $(ls $gems); do local name=$(basename $gem) - [ -r $gem/README* ] && { - local readme=$(basename $gem/README*) - cp -a $gem/$readme $dest/$readme.$name + [ -r $gems/$gem/README* ] && { + local readme=$(basename $gems/$gem/README*) + cp -a $gems/$gem/$readme $dest/$readme.$name } - [ -r $gem/COPYRIGHT ] && \ - cp -a $gem/COPYRIGHT $dest/COPYRIGHT.$name + [ -r $gems/$gem/COPYRIGHT ] && \ + cp -a $gems/$gem/COPYRIGHT $dest/COPYRIGHT.$name + [ -r $gems/$gem/LICENSE ] && \ + cp -a $gems/$gem/LICENSE $dest/LICENSE.$name + [ -r $gems/$gem/MIT-LICENSE ] && \ + cp -a $gems/$gem/MIT-LICENSE $dest/MIT-LICENSE.$name + [ -r $gems/$gem/COPYING ] && \ + cp -a $gems/$gem/COPYING $dest/COPYING.$name done } @@ -229,11 +281,14 @@ function make_bundle() rm -rf .bundle bundle update fi - +set -x [ -d 'vendor/git' ] || mkdir vendor/git - fix_gemfile ./Gemfile - bundle install --path vendor/gems + bundle install bundle package + mkdir vendor/git + build_git_gems Gemfile vendor/git +# fix_gemfile Gemfile +set +x mkdir -p "../$bundle_name/docs" mkdir -p "../$bundle_name/vendor" @@ -241,14 +296,14 @@ function make_bundle() ../$bundle_name make_docs "vendor/gems" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/vendor + mv vendor/git ../$bundle_name/vendor + rm -rf vendor/gems/* cd .. tar czf $bundle_name.tar.gz $bundle_name - mv $bundle_name/vendor/cache diaspora/vendor/cache cd .. } echo echo "Bundle: dist/$bundle_name.tar.gz" - echo "Current dir:$PWD" } diff --git a/pkg/ubuntu/diaspora-bundle-install b/pkg/ubuntu/diaspora-bundle-install index 9a4c9a10a..65ae9520e 100755 --- a/pkg/ubuntu/diaspora-bundle-install +++ b/pkg/ubuntu/diaspora-bundle-install @@ -28,4 +28,13 @@ cp -a AUTHORS GNU-AGPL-3.0 COPYRIGHT Gemfile Gemfile.lock \ cp -ar docs /usr/share/doc/diaspora-bundle bundle install --local --deployment --without ri rdoc +for gem in vendor/git/*; do + gem install --local \ + --force \ + --no-rdoc \ + --no-ri \ + --install-dir vendor/bundle/ruby/1.8/bundler \ + $gem +done + From fcb88bdba77d4c5007dc3adecbbe55995b2aa228 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 25 Oct 2010 04:04:34 +0200 Subject: [PATCH 06/40] Bundle: add licenses, handle git gems Adding a docs dir collexting README and licenses from contained gems. git gems, which bundler does not handle well today, are handled by a hacked parsing of Gemfile.log, gem built into the source bundle and installed on target system --- pkg/fedora/make-dist.sh | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 273ad6eae..093f6a4c3 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -175,25 +175,9 @@ function make_src echo "Required bundle: $(git_id dist/diaspora/Gemfile)" } -function read_git_urls() -# Simple now, possibly needs to handle also http: git repos. -{ - grep -o 'git://[^ ]*' $1 | tr -d '\047",' -} - -function fix_gemfile() -{ - - sed -i '/git:/s/,.*//' $1 - sed -i -e 's/GIT/GEM/' \ - -e '/[ ]*revision:/d' \ - -e '/[ ]*remote: git/s|git:.*|http://github.com|' \ - $1.lock - -} - function build_git_gems() # Usage: build_git_gems +# Horrible hack, in wait for bundler handling git gems OK. { mkdir gem-tmp || : cd gem-tmp @@ -202,7 +186,6 @@ function build_git_gems() grep 'git:' ../$1 | sed 's/,/ /' | awk ' /^.*git:\/\/.*$/ { gsub( "=>", "") - gsub( ",", "") if ( $1 != "gem") { print "Strange git: line (ignored) :" $0 next @@ -223,9 +206,9 @@ function build_git_gems() else if ( key == ":branch") suffix = "; git checkout " $i } - print "Running: ", cmd cmd = sprintf( "git clone --quiet %s %s %s\n", url, name, suffix) + print "Running: ", cmd system( cmd) }' sed -i 's/Date.today/"2010-10-24"/' carrierwave/carrierwave.gemspec @@ -255,6 +238,8 @@ function make_docs() cp -a $gems/$gem/COPYRIGHT $dest/COPYRIGHT.$name [ -r $gems/$gem/LICENSE ] && \ cp -a $gems/$gem/LICENSE $dest/LICENSE.$name + [ -r $gems/$gem/License ] && \ + cp -a $gems/$gem/License $dest/License.$name [ -r $gems/$gem/MIT-LICENSE ] && \ cp -a $gems/$gem/MIT-LICENSE $dest/MIT-LICENSE.$name [ -r $gems/$gem/COPYING ] && \ @@ -281,25 +266,24 @@ function make_bundle() rm -rf .bundle bundle update fi -set -x - [ -d 'vendor/git' ] || mkdir vendor/git + bundle install bundle package - mkdir vendor/git + [ -d 'vendor/git' ] || mkdir vendor/git build_git_gems Gemfile vendor/git -# fix_gemfile Gemfile -set +x mkdir -p "../$bundle_name/docs" mkdir -p "../$bundle_name/vendor" cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \ ../$bundle_name + make_docs "vendor/gems" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/vendor mv vendor/git ../$bundle_name/vendor rm -rf vendor/gems/* cd .. tar czf $bundle_name.tar.gz $bundle_name + mv $bundle_name/vendor/cache diaspora/vendor/cache cd .. } echo From 97940073d7e3d0abea98d74f6a9984228d8c92e5 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 26 Oct 2010 22:09:12 +0200 Subject: [PATCH 07/40] Works, w ith bit gem file and git repos... --- pkg/fedora/README.md | 12 ++++-- pkg/fedora/diaspora-bundle.spec | 6 ++- pkg/fedora/make-dist.sh | 67 +++++++++++++++++++------------- pkg/ubuntu/diaspora-install-deps | 3 +- 4 files changed, 55 insertions(+), 33 deletions(-) diff --git a/pkg/fedora/README.md b/pkg/fedora/README.md index 7c5c9e3a2..38801dc42 100644 --- a/pkg/fedora/README.md +++ b/pkg/fedora/README.md @@ -18,7 +18,7 @@ Prerequisites: - A personal environment to build RPM:s, also described in [RPM installation Fedora](http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora) -Install g++ (possibly unnnecessary?): +Install g++ (unnecessary?): % yum install gcc-c++ Create source tarballs like dist/diaspora-0.0-1010041233_fade4231.tar.gz @@ -73,7 +73,7 @@ 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 /usr/share/diaspora/master/vendor/bundle - % ln -sf /usr/lib/diaspora-bundle/bundle \ + % ln -sf /usr/lib/diaspora-bundle/vendor/bundle \ > /usr/share/diaspora/master/vendor % @@ -93,6 +93,9 @@ The source tarball is as retrieved from diaspora with following differences: - The file .bundle/config is patched. Remove before doing *bundle install* +The bundle is basically the output from 'bundle package'. The git-based +gems are also added into vendor/git. + ./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: @@ -128,9 +131,10 @@ at [ftp://mumin.dnsalias.net/pub/leamas/diaspora/builds](ftp://mumin.dnsalias.ne 'make-dist.sh source' script checks out latest version of diaspora into the dist/diaspora directory. This content is, after some patches, the diaspora package. -'make-dir.sh bundle' makes a 'bundle install --deployment' in the diaspora dir. +'make-dir.sh bundle' makes a *bundle package* in the diaspora dir. The resulting bundle is stored in vendor/bundle. This is, after some more -patches, the content of diaspora-bundle. +patches, the content of diaspora-bundle tarball. Target systems makes a +*bundle install --local* to use it. Here is also support for running the diaspora websocket service as a system service through /sbin/service and some install scripts. diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index a13a85368..a5f1e7071 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -39,12 +39,12 @@ Source file usede to compile native libraries in diaspora-bundle. %build bundle install --local --deployment --without ri rdoc test -for gem in vendor/git/*; do +for gem in vendor/git/*.gem; do gem install --local \ --force \ --no-rdoc \ --no-ri \ - --install-dir vendor/bundle/ruby/1.8/bundler \ + --install-dir vendor/bundle/ruby/1.8 \ $gem done @@ -190,6 +190,8 @@ exit 0 find . -name .git | xargs rm -rf find . -name .gitignore -delete find . -name \*.o -delete || : +rm -rf vendor/git +rm -rf vendor/cache test -d vendor/bundle/ruby/1.8//gems/selenium-webdriver-0.0.* && { pushd vendor/bundle//ruby/1.8/gems/selenium-webdriver-0.0.*/lib/selenium/webdriver/ diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 093f6a4c3..3e250f31b 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -175,6 +175,12 @@ function make_src echo "Required bundle: $(git_id dist/diaspora/Gemfile)" } +function fix_gemfile +{ + sed -i 's|git://.*/|vendor/git/|g' $1 + +} + function build_git_gems() # Usage: build_git_gems # Horrible hack, in wait for bundler handling git gems OK. @@ -183,42 +189,46 @@ function build_git_gems() cd gem-tmp rm -rf * - grep 'git:' ../$1 | sed 's/,/ /' | awk ' + grep 'git:' ../$1 | sed 's/,/ /g' | awk ' /^.*git:\/\/.*$/ { - gsub( "=>", "") + gsub( "=>", " ") if ( $1 != "gem") { print "Strange git: line (ignored) :" $0 next } name = $2 - suffix = "" url="" + suffix = "; cd " name for (i = 3; i <= NF; i += 1) { key = $i i += 1 if (key == ":git") url = $i - else if ( key == ":ref") { - suffix = "; cd " name + else if ( key == ":ref") suffix = suffix "; git reset --hard " $i - suffix = suffix "; cd .." - } else if ( key == ":branch") - suffix = "; git checkout " $i + suffix = suffix "; git checkout " $i } + suffix = suffix "; cd .." cmd = sprintf( "git clone --quiet %s %s %s\n", url, name, suffix) print "Running: ", cmd system( cmd) + cmd = sprintf( "git clone --bare --quiet %s\n", url) + print "Running: ", cmd + system( cmd) }' sed -i 's/Date.today/"2010-10-24"/' carrierwave/carrierwave.gemspec for dir in *; do - cd $dir - gem build *.gemspec - cp *.gem ../../$2 - cd .. + if [ -e $dir/*.gemspec ] ; then + cd $dir + gem build *.gemspec + cp *.gem ../../$2 + cd .. + else + cp -ar $dir ../$2 + fi done - cd .. # rm -rf gem-tmp } @@ -230,19 +240,19 @@ function make_docs() for gem in $(ls $gems); do local name=$(basename $gem) - [ -r $gems/$gem/README* ] && { + [ -r "$gems/$gem/README*" ] && { local readme=$(basename $gems/$gem/README*) cp -a $gems/$gem/$readme $dest/$readme.$name } - [ -r $gems/$gem/COPYRIGHT ] && \ + [ -r "$gems/$gem/COPYRIGHT" ] && \ cp -a $gems/$gem/COPYRIGHT $dest/COPYRIGHT.$name - [ -r $gems/$gem/LICENSE ] && \ + [ -r "$gems/$gem/LICENSE" ] && \ cp -a $gems/$gem/LICENSE $dest/LICENSE.$name - [ -r $gems/$gem/License ] && \ + [ -r "$gems/$gem/License" ] && \ cp -a $gems/$gem/License $dest/License.$name - [ -r $gems/$gem/MIT-LICENSE ] && \ + [ -r "$gems/$gem/MIT-LICENSE" ] && \ cp -a $gems/$gem/MIT-LICENSE $dest/MIT-LICENSE.$name - [ -r $gems/$gem/COPYING ] && \ + [ -r "$gems/$gem/COPYING" ] && \ cp -a $gems/$gem/COPYING $dest/COPYING.$name done } @@ -267,17 +277,22 @@ function make_bundle() bundle update fi - bundle install - bundle package [ -d 'vendor/git' ] || mkdir vendor/git build_git_gems Gemfile vendor/git + sed -i 's|git://.*/|vendor/git/|g' Gemfile + rm Gemfile.lock + rm -rf .bundle + # see: http://bugs.joindiaspora.com/issues/440 + bundle install --path=vendor/bundle || + bundle install --path=vendor/bundle + bundle package mkdir -p "../$bundle_name/docs" mkdir -p "../$bundle_name/vendor" cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \ ../$bundle_name - make_docs "vendor/gems" "../$bundle_name/docs" + make_docs "vendor/bundle/ruby/1.8/gems/" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/vendor mv vendor/git ../$bundle_name/vendor rm -rf vendor/gems/* @@ -348,16 +363,16 @@ function usage() -h Print this message. -c commit Use a given commit, defaults to last checked in. - -r release Mark with specified release, defaults to 1. + -r release For prepare, mark with release nr, defaults to 1. -u uri Git repository URI, defaults to $GIT_REPO. - -f For bundle, fix dependencies by running 'bundle update' - before 'bundle install' + -f For bundle, fix dependencies by running 'bundle update' + before 'bundle install' source Build a diaspora application tarball. bundle Build a bundler(1) bundle for diaspora. prepare Symlink bundle and source tarballs to rpm source dir, - create patched rpm spec files. + create patched rpm spec files. All results are stored in dist/ diff --git a/pkg/ubuntu/diaspora-install-deps b/pkg/ubuntu/diaspora-install-deps index 388dc39e0..cf30822ea 100755 --- a/pkg/ubuntu/diaspora-install-deps +++ b/pkg/ubuntu/diaspora-install-deps @@ -14,7 +14,8 @@ grep -v '^#' /etc/apt/sources.list | grep -q universe || { release=$( lsb_release -a | awk '/Release:/ {print $2}') sudo apt-get update -sudo apt-get install -qy build-essential libxslt1-dev libxml2 \ +sudo apt-get install --no-install-recommends -qy\ + build-essential libxslt1-dev libxml2 \ ruby-full mongodb rake python-software-properties git-core \ imagemagick libmagick9-dev if [ "$release" = "10.04" ]; then From 88a12ca8893bffc47832053e72e3a9d141882801 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 27 Oct 2010 11:47:11 +0200 Subject: [PATCH 08/40] Big cleanup, linking to bundle, removing garbage, git mgmt --- pkg/fedora/diaspora-bundle.spec | 19 ++++------------- pkg/fedora/diaspora-setup | 5 +++++ pkg/fedora/diaspora.spec | 1 + pkg/fedora/make-dist.sh | 33 +++++++----------------------- pkg/ubuntu/diaspora-bundle-install | 8 -------- pkg/ubuntu/diaspora-setup | 6 ++++++ 6 files changed, 23 insertions(+), 49 deletions(-) diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index a5f1e7071..2b3b4238a 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -38,16 +38,7 @@ Source file usede to compile native libraries in diaspora-bundle. %setup -q -n %{name}-%{version}-%{git_release} %build -bundle install --local --deployment --without ri rdoc test -for gem in vendor/git/*.gem; do - gem install --local \ - --force \ - --no-rdoc \ - --no-ri \ - --install-dir vendor/bundle/ruby/1.8 \ - $gem - -done +bundle install --local --deployment --without ri rdoc pushd vendor/bundle/ruby/1.8/gems # In repo (2.2.4) @@ -154,7 +145,7 @@ pushd vendor/bundle/ruby/1.8/gems chmod 644 cucumber-rails-0.3.2/templates/install/step_definitions/capybara_steps.rb.erb || : chmod 644 ffi-0.6.3/ext/ffi_c/libffi/ltmain.sh || : chmod 644 gherkin-2.2.4/tasks/compile.rake || : - chmod 644 i18n-0.4.1/MIT-LICENSE + chmod 644 i18n-0.4.1/MIT-LICENSE || : chmod 755 linecache-0.43/Rakefile || : chmod 755 mime-types-1.16/Rakefile || : chmod 755 mini_magick-2.1/test/not_an_image.php || : @@ -168,7 +159,7 @@ pushd vendor/bundle/ruby/1.8/gems for file in CHANGES VERSION README Rakefile; do chmod 644 term-ansicolor-1.0.5/$file || : done - chmod 755 thin-1.2.7/lib/thin/controllers/service.sh.erb + chmod 755 thin-1.2.7/lib/thin/controllers/service.sh.erb ||: chmod 755 thin-1.2.7/example/async_chat.ru || : chmod 755 thin-1.2.7/example/async_tailer.ru || : chmod 644 treetop-1.4.8/spec/compiler/test_grammar.tt || : @@ -190,8 +181,6 @@ exit 0 find . -name .git | xargs rm -rf find . -name .gitignore -delete find . -name \*.o -delete || : -rm -rf vendor/git -rm -rf vendor/cache test -d vendor/bundle/ruby/1.8//gems/selenium-webdriver-0.0.* && { pushd vendor/bundle//ruby/1.8/gems/selenium-webdriver-0.0.*/lib/selenium/webdriver/ @@ -227,7 +216,7 @@ cat files >> dirs && cp dirs files %files -f files %defattr(-, diaspora, diaspora, 0755) -%doc COPYRIGHT Gemfile Gemfile.lock AUTHORS GNU-AGPL-3.0 docs +%doc COPYRIGHT AUTHORS GNU-AGPL-3.0 docs %files -f dev-files devel %defattr(-, root, root, 0644) diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index b3e2eac69..56fb030a8 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -22,6 +22,11 @@ test -n "$services" && { cd /usr/share/diaspora/master +rm -rf vendor +ln -s /usr/lib/diaspora-bundle/vendor . +ln -sf /usr/lib/diaspora-bundle/Gemfile . +ln -sf /usr/lib/diaspora-bundle/Gemfile.lock . + test -e config/app_config.yml || cp config/app_config.yml.example config/app_config.yml diff --git a/pkg/fedora/diaspora.spec b/pkg/fedora/diaspora.spec index 8a30492c8..dc02467f4 100644 --- a/pkg/fedora/diaspora.spec +++ b/pkg/fedora/diaspora.spec @@ -71,6 +71,7 @@ cp %SOURCE3 $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/diaspora mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora cp -ar master $RPM_BUILD_ROOT/%{_datadir}/diaspora cp -ar master/.bundle $RPM_BUILD_ROOT/%{_datadir}/diaspora/master +rm -rf $RPM_BUILD_ROOT/%{_datadir}/diaspora/master/vendor/* mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/uploads mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/tmp cp %SOURCE2 $RPM_BUILD_ROOT/%{_datadir}/diaspora diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 3e250f31b..ecfffb781 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -161,6 +161,7 @@ function make_src cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master ( cd ${RELEASE_DIR}/master + rm -rf vendor/bundle/* vendor/git/* vendor/cache/* gem-tmp git show --name-only > config/gitversion tar czf public/source.tar.gz \ --exclude='source.tar.gz' -X .gitignore * @@ -175,17 +176,11 @@ function make_src echo "Required bundle: $(git_id dist/diaspora/Gemfile)" } -function fix_gemfile -{ - sed -i 's|git://.*/|vendor/git/|g' $1 - -} - function build_git_gems() # Usage: build_git_gems # Horrible hack, in wait for bundler handling git gems OK. { - mkdir gem-tmp || : + [ -d 'gem-tmp' ] || mkdir gem-tmp cd gem-tmp rm -rf * @@ -198,34 +193,19 @@ function build_git_gems() } name = $2 url="" - suffix = "; cd " name for (i = 3; i <= NF; i += 1) { key = $i i += 1 if (key == ":git") url = $i - else if ( key == ":ref") - suffix = suffix "; git reset --hard " $i - else if ( key == ":branch") - suffix = suffix "; git checkout " $i } - suffix = suffix "; cd .." - cmd = sprintf( "git clone --quiet %s %s %s\n", - url, name, suffix) - print "Running: ", cmd - system( cmd) cmd = sprintf( "git clone --bare --quiet %s\n", url) print "Running: ", cmd system( cmd) }' - sed -i 's/Date.today/"2010-10-24"/' carrierwave/carrierwave.gemspec + mv devise-mongo_mapper.git devise-mongo_mapper for dir in *; do - if [ -e $dir/*.gemspec ] ; then - cd $dir - gem build *.gemspec - cp *.gem ../../$2 - cd .. - else + if [ ! -e $dir/*.gemspec ]; then cp -ar $dir ../$2 fi done @@ -271,16 +251,17 @@ function make_bundle() cd dist rm -rf $bundle_name cd diaspora + rm Gemfile.lock if [ "$BUNDLE_FIX" = 'yes' ]; then - rm -f Gemfile.lock rm -rf .bundle bundle update fi [ -d 'vendor/git' ] || mkdir vendor/git + rm -rf vendor/git/* + git checkout Gemfile build_git_gems Gemfile vendor/git sed -i 's|git://.*/|vendor/git/|g' Gemfile - rm Gemfile.lock rm -rf .bundle # see: http://bugs.joindiaspora.com/issues/440 bundle install --path=vendor/bundle || diff --git a/pkg/ubuntu/diaspora-bundle-install b/pkg/ubuntu/diaspora-bundle-install index 65ae9520e..506dec038 100755 --- a/pkg/ubuntu/diaspora-bundle-install +++ b/pkg/ubuntu/diaspora-bundle-install @@ -28,13 +28,5 @@ cp -a AUTHORS GNU-AGPL-3.0 COPYRIGHT Gemfile Gemfile.lock \ cp -ar docs /usr/share/doc/diaspora-bundle bundle install --local --deployment --without ri rdoc -for gem in vendor/git/*; do - gem install --local \ - --force \ - --no-rdoc \ - --no-ri \ - --install-dir vendor/bundle/ruby/1.8/bundler \ - $gem -done diff --git a/pkg/ubuntu/diaspora-setup b/pkg/ubuntu/diaspora-setup index 579664597..71466cf9a 100755 --- a/pkg/ubuntu/diaspora-setup +++ b/pkg/ubuntu/diaspora-setup @@ -24,6 +24,12 @@ service mongodb start || : cd /usr/share/diaspora/master +rm -rf vendor +ln -s /usr/lib/diaspora-bundle/vendor . +ln -sf /usr/lib/diaspora-bundle/Gemfile . +ln -sf /usr/lib/diaspora-bundle/Gemfile.lock . + + test -e config/app_config.yml || cp config/app_config.yml.example config/app_config.yml From 322faf3cc00aa3f366ea9b8fa114404351b55deb Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 27 Oct 2010 13:27:40 +0200 Subject: [PATCH 09/40] Error recovery --- pkg/fedora/make-dist.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index ecfffb781..c96a7f756 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -252,8 +252,8 @@ function make_bundle() rm -rf $bundle_name cd diaspora rm Gemfile.lock + rm -rf .bundle if [ "$BUNDLE_FIX" = 'yes' ]; then - rm -rf .bundle bundle update fi @@ -262,10 +262,12 @@ function make_bundle() git checkout Gemfile build_git_gems Gemfile vendor/git sed -i 's|git://.*/|vendor/git/|g' Gemfile - rm -rf .bundle # see: http://bugs.joindiaspora.com/issues/440 - bundle install --path=vendor/bundle || - bundle install --path=vendor/bundle + bundle install --path=vendor/bundle || { + rm -rf vendor/git/* .bundle + build_git_gems Gemfile vendor/git + bundle install --path=vendor/bundle + } bundle package mkdir -p "../$bundle_name/docs" From 916d488298470f0420ef35221b976dc40bc9545d Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 27 Oct 2010 20:21:06 +0200 Subject: [PATCH 10/40] New try, outside vendor --- pkg/fedora/make-dist.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index c96a7f756..8da155d59 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -257,16 +257,17 @@ function make_bundle() bundle update fi - [ -d 'vendor/git' ] || mkdir vendor/git - rm -rf vendor/git/* + [ -d 'git-repos' ] || mkdir git-repos + rm -rf git-repos/* git checkout Gemfile - build_git_gems Gemfile vendor/git - sed -i 's|git://.*/|vendor/git/|g' Gemfile + build_git_gems Gemfile git-repos + sed -i 's|git://.*/|git-repos/|g' Gemfile # see: http://bugs.joindiaspora.com/issues/440 bundle install --path=vendor/bundle || { - rm -rf vendor/git/* .bundle - build_git_gems Gemfile vendor/git - bundle install --path=vendor/bundle + bundle install --path=vendor/bundle || { + echo "bundle install failed, giving up" >&2 + exit 3 + } } bundle package @@ -277,7 +278,7 @@ function make_bundle() make_docs "vendor/bundle/ruby/1.8/gems/" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/vendor - mv vendor/git ../$bundle_name/vendor + mv git-repos ../$bundle_name rm -rf vendor/gems/* cd .. tar czf $bundle_name.tar.gz $bundle_name From de06f43d2637a765aebf3d44ae6a62ff498f643a Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 06:11:27 +0300 Subject: [PATCH 11/40] bugfix --- pkg/fedora/diaspora-bundle.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index 2b3b4238a..7a03479a4 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -205,7 +205,7 @@ find %{buildroot}/%{_libdir}/diaspora-bundle \ find -L %{buildroot}/%{_libdir}/diaspora-bundle -regextype posix-awk \ -type f -not -regex '.*[.]c$|.*[.]h$|.*[.]cpp$|.*Makefile$' \ -fprintf files '"%%p"\n' -find %{buildroot}/%{_libdir}/diaspora-bundle -regextype posix-awk \ +find -L %{buildroot}/%{_libdir}/diaspora-bundle -regextype posix-awk \ -type f -regex '.*[.]c$|.*[.]h$|.*[.]cpp$|.*Makefile$' \ -fprintf dev-files '"%%p"\n' sed -i -e 's|%{buildroot}||' -e 's|//|/|' files dev-files dirs From 625bd428a175ddec509f6c2bfed46a2404579b50 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 13:18:56 +0200 Subject: [PATCH 12/40] bugfixes. Rewrite http: github path to git: --- Gemfile | 2 +- pkg/fedora/diaspora-setup | 2 +- pkg/fedora/make-dist.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 457bfd75b..2b2b8eb92 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem 'roxml', :git => 'git://github.com/Empact/roxml.git' gem 'addressable', :require => 'addressable/uri' gem 'json' gem 'mini_fb' -gem 'http_accept_language', :git => 'http://github.com/iain/http_accept_language.git' +gem 'http_accept_language', :git => git://github.com/iain/http_accept_language.git' #Standards gem 'pubsubhubbub' diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index 56fb030a8..726cfe148 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -30,7 +30,7 @@ ln -sf /usr/lib/diaspora-bundle/Gemfile.lock . test -e config/app_config.yml || cp config/app_config.yml.example config/app_config.yml -if rake db:seed:dev; then +if bundle exec rake db:seed:dev; then echo "Database config OK, new user tom/evankorth in place" else cat <<- EOF diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 8da155d59..5d6d1cdba 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -278,8 +278,8 @@ function make_bundle() make_docs "vendor/bundle/ruby/1.8/gems/" "../$bundle_name/docs" mv vendor/cache ../$bundle_name/vendor + mv vendor/gems ../$bundle_name/vendor mv git-repos ../$bundle_name - rm -rf vendor/gems/* cd .. tar czf $bundle_name.tar.gz $bundle_name mv $bundle_name/vendor/cache diaspora/vendor/cache From 668da620f19d0e43b0a8bcaf4501c460c238a8be Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 13:34:45 +0200 Subject: [PATCH 13/40] bugfix --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2b2b8eb92..29a77fb0b 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem 'roxml', :git => 'git://github.com/Empact/roxml.git' gem 'addressable', :require => 'addressable/uri' gem 'json' gem 'mini_fb' -gem 'http_accept_language', :git => git://github.com/iain/http_accept_language.git' +gem 'http_accept_language', :git => 'git://github.com/iain/http_accept_language.git' #Standards gem 'pubsubhubbub' From 04984d576a5152764b45807415d5701a9f678902 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 15:48:33 +0200 Subject: [PATCH 14/40] bugfix --- pkg/fedora/diaspora-bundle.spec | 1 + pkg/fedora/diaspora-setup | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index 7a03479a4..5b56f4d56 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -199,6 +199,7 @@ popd mkdir -p $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle cp -ar vendor $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle +cp -a Gemfile Gemfile.lock $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle find %{buildroot}/%{_libdir}/diaspora-bundle \ -type d -fprintf dirs '%%%dir "%%p"\n' diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index 726cfe148..4c5138571 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -4,6 +4,7 @@ # # Usage: # ./diaspora-setup [external hostname] # +export PATH=$PATH:/usr/local/bin arg_hostname="$1" @@ -22,10 +23,12 @@ test -n "$services" && { cd /usr/share/diaspora/master +libdir=$(rpm --eval %_libdir) + rm -rf vendor -ln -s /usr/lib/diaspora-bundle/vendor . -ln -sf /usr/lib/diaspora-bundle/Gemfile . -ln -sf /usr/lib/diaspora-bundle/Gemfile.lock . +ln -s $libdir/diaspora-bundle/vendor . +ln -sf $libdir/diaspora-bundle/Gemfile . +ln -sf $libdir/diaspora-bundle/Gemfile.lock . test -e config/app_config.yml || cp config/app_config.yml.example config/app_config.yml From 42e8c8f11b9f033bb895a7aed2709bcb7564c138 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 21:16:37 +0200 Subject: [PATCH 15/40] Raw code --- pkg/.gitignore | 1 + pkg/README.md | 13 ++ pkg/fedora/README.md | 75 ++----- pkg/fedora/dist | 1 + pkg/fedora/dist/.gitkeep | 0 pkg/fedora/prepare-rpm.sh | 165 +++++++++++++++ pkg/source/README.md | 74 +++++++ pkg/{fedora => source}/add-bundle.diff | 0 pkg/source/funcs.sh | 78 ++++++++ pkg/{fedora => source}/make-dist.sh | 266 ++++--------------------- pkg/ubuntu/README.md | 15 +- pkg/ubuntu/make-dist.sh | 1 - 12 files changed, 390 insertions(+), 299 deletions(-) create mode 100644 pkg/.gitignore create mode 100644 pkg/README.md create mode 120000 pkg/fedora/dist delete mode 100644 pkg/fedora/dist/.gitkeep create mode 100755 pkg/fedora/prepare-rpm.sh create mode 100644 pkg/source/README.md rename pkg/{fedora => source}/add-bundle.diff (100%) create mode 100644 pkg/source/funcs.sh rename pkg/{fedora => source}/make-dist.sh (50%) delete mode 120000 pkg/ubuntu/make-dist.sh diff --git a/pkg/.gitignore b/pkg/.gitignore new file mode 100644 index 000000000..1521c8b76 --- /dev/null +++ b/pkg/.gitignore @@ -0,0 +1 @@ +dist diff --git a/pkg/README.md b/pkg/README.md new file mode 100644 index 000000000..8b65d479c --- /dev/null +++ b/pkg/README.md @@ -0,0 +1,13 @@ +## Diaspora install and packaging tools + +This directory contains stuff to install and run diaspora. + +- ubuntu-setup.bash: script which installs all of Diasporas + dependencies and starts the server. + +- source: stuff to package Diaspora into traditional tarballs + which can be installed. + +- ubuntu: Scripts and tools to install generic tarballs on Ubuntu + +- fedora: Scripts and tools to create fedora RPMS:s from tarballs diff --git a/pkg/fedora/README.md b/pkg/fedora/README.md index 38801dc42..40ccf7ae3 100644 --- a/pkg/fedora/README.md +++ b/pkg/fedora/README.md @@ -18,16 +18,20 @@ Prerequisites: - A personal environment to build RPM:s, also described in [RPM installation Fedora](http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora) -Install g++ (unnecessary?): +Install g++ and gcc: % 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: - % ./make-dist.sh source - % ./make-dist.sh bundle +Bootstrap the distribution from git: + % sudo apt-get install git-core + % git clone git://github.com/diaspora/diaspora.git + % cd diaspora/pkg/ubuntu -Setup links to tarballs from RPM source directory and create spec files: - % ./make-dist.sh prepare +Create and install the diaspora bundle and application in +diaspora/pkg/source according to +[source README](http://github.com/diaspora/diaspora/blob/master/source/fedora/README.md) + +Setup links from tarballs to RPM source directory and create spec files: + % ./prepare-rpm.sh Build rpms: rpmbuild -ba dist/diaspora.spec @@ -51,63 +55,10 @@ apache/passenger setup. After configuration, start with: /sbin/service diaspora-wsd start /sbin/service httpd restart -#### Generic source synopsis - -Generate source tarball: - % ./make-dist.sh source - Using repo: http://github.com/diaspora/diaspora.git - Commit id: 1010092232_b313272 - Source: dist/diaspora-0.0-1010092232_b313272.tar.gz - Required bundle: 1010081636_d1a4ee0 - % - -The source tarball could be used as-is, by unpacking add making a -*bundle install*. An alternative is to generate a canned bundle like: - % ./make-dist.sh bundle - [ lot's of output...] - Bundle: dist/diaspora-bundle-0.0-1010081636_d1a4ee0.tar.gz - % - -This file can be installed anywhere. To use it, add a symlink from vendor/bundle -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 /usr/share/diaspora/master/vendor/bundle - % ln -sf /usr/lib/diaspora-bundle/vendor/bundle \ - > /usr/share/diaspora/master/vendor - % - -The directories tmp, log, and public/uploads needs to be writable. If using -apache passenger, read the docs on uid used and file ownership. - -Note that the bundle version required is printed each time a new source -is generated. - #### Notes -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.gz is generated. - - The file .bundle/config is patched. Remove before doing - *bundle install* - -The bundle is basically the output from 'bundle package'. The git-based -gems are also added into vendor/git. - -./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 -potentially problematic operation): - % ./make-dist.sh -f bundle - -*make-dist prepare* creates links also for all files listed in SOURCES. -Typically, this is secondary sources. *make-dist.sh sources* +prepare-rpm.sh prepare creates links also for all files listed in SOURCES. +Typically, this is secondary sources. *make-dist.sh source* applies all patches named *.patch in this directory after checking out source from git. diff --git a/pkg/fedora/dist b/pkg/fedora/dist new file mode 120000 index 000000000..378798d00 --- /dev/null +++ b/pkg/fedora/dist @@ -0,0 +1 @@ +../source/dist \ No newline at end of file diff --git a/pkg/fedora/dist/.gitkeep b/pkg/fedora/dist/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/fedora/prepare-rpm.sh b/pkg/fedora/prepare-rpm.sh new file mode 100755 index 000000000..5d03f8328 --- /dev/null +++ b/pkg/fedora/prepare-rpm.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +# Create RPM spec files matching diaspora tarballs +# +# Usage: See function usage() at bottom. +# +GIT_REPO='http://github.com/diaspora/diaspora.git' +VERSION='0.0' +RELEASE='1' + +. ../source/funcs.sh + + +function fix_alphatag() +# Patch version on top comment first id line: +# Usage: fix_alphatag +# Patches:\ +# * Fri Sep 24 2010 name surname 1.20100925_faf23207 +{ + local dist=$(rpm --eval %dist) + awk -v dist="$dist" -v version="$2" -v commit="$3" -v release="$4" \ + ' BEGIN { done = 0 } + /^[*]/ { if (done) + print + else + { + s = sprintf( "-%s.%s%s\n", release, commit, dist) + gsub( "-[0-9][.][^ ]*$", s) + done = 1 + # add new gsub for version... + print + } + next + } + { print }' < $1 > $1.tmp && mv -f $1.tmp $1 +} + + +function fix_bundle_deps +# usage: fix_bundle_deps +# Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148 +{ + awk -v vers="$2-$3" \ + ' /Requires:/ { if ($2 == "diaspora-bundle") + printf( "%s %s = %s\n", $1,$2,vers) + else + print + next + } + { print}' \ + < $1 > $1.tmp && mv -f $1.tmp $1 +} + + +function patch() +# Patch spec-files with current version-release +# Usage: patch +{ + sed -e "/^%define/s|HEAD|$2|" \ + -e '/^Version:/s|.*|Version: '$1'|' \ + dist/diaspora.spec + fix_alphatag dist/diaspora.spec $1 $2 $3 + local bundle_id=$(git_id dist/diaspora/Gemfile) + local dist_tag=$(rpm --eval %dist) + fix_bundle_deps dist/diaspora.spec $1 "$RELEASE.${bundle_id}$dist_tag" + sed -e "/^%define/s|HEAD|$bundle_id|" \ + -e '/^Version:/s|.*|Version: '$1'|' \ + < diaspora-bundle.spec > dist/diaspora-bundle.spec + + cp dist/diaspora.spec dist/diaspora/diaspora.spec +} + + +function prepare_rpm() +# Usage: prepare_rpm < commit> +{ + local dest=$(rpm --eval %_sourcedir) + test -z "$dest" && { + echo "Can't find RPM source directory, giving up." + exit 2 + } + + local commit=$( checkout $1) + echo "Release: $RELEASE.$commit" + echo "Rpm source dir: $dest" + + patch $VERSION $commit $RELEASE + + local src="dist/diaspora-$VERSION-$commit.tar.gz" + test -e $src || + cat <<- EOF + Warning: $src does not exist + (last version not built?) + EOF + ln -sf $PWD/$src $dest + + local bundle_commit=$( git_id dist/diaspora/Gemfile) + local bundle="dist/diaspora-bundle-$VERSION-$bundle_commit.tar.gz" + test -e $bundle || + cat <<- EOF + Warning: $bundle does not exist + (last version not built?) + EOF + ln -sf $PWD/$bundle $dest + + local file + for file in $( grep -v '^#' SOURCES); do + if [ -e "$file" ]; then + ln -sf $PWD/$file $dest/$file + else + echo "Warning: $file (listed in SOURCES) does not exist" + fi + done + + ( cd $dest; find . -type l -not -readable -exec rm {} \;) + echo "Source specfile: dist/diaspora.spec" + echo "Bundle specfile: dist/diaspora-bundle.spec" +} + + +function usage() +{ + cat <<- EOF + + Usage: prepare-rpm [options] + + Options: + + -h Print this message. + -r release For prepare, mark with release nr, defaults to 1. + + Symlink bundle and source tarballs to rpm source dir, create + patched rpm spec files. + + All results are stored in dist/ + + EOF +} + + +commit='HEAD' +BUNDLE_FIX='no' +while getopts ":r:h" opt +do + case $opt in + r) RELEASE="$OPTARG:" + ;; + h) usage + exit 0 + ;; + *) usage + exit 2 + ;; + esac +done +shift $(($OPTIND - 1)) + +typeset -r GIT_REPO RELEASE BUNDLE_FIX +export LANG=C + +test $# -gt 0 && { + usage; + exit 2; +} +prepare_rpm diff --git a/pkg/source/README.md b/pkg/source/README.md new file mode 100644 index 000000000..789da6ec8 --- /dev/null +++ b/pkg/source/README.md @@ -0,0 +1,74 @@ +## Diaspora source tarball generation + +Creates diaspora source tarballs. + +#### Generic source synopsis + +Generate source tarball: + % ./make-dist.sh source + Using repo: http://github.com/diaspora/diaspora.git + Commit id: 1010092232_b313272 + Source: dist/diaspora-0.0-1010092232_b313272.tar.gz + Required bundle: 1010081636_d1a4ee0 + % + +The source tarball could be used as-is, by unpacking add making a +*bundle install*. An alternative is to generate a canned bundle like: + % ./make-dist.sh bundle + [ lot's of output...] + Bundle: dist/diaspora-bundle-0.0-1010081636_d1a4ee0.tar.gz + % + +This file can be installed anywhere. To use it, add a symlinks from app +to the bundle'. Reasonable defaults are to install diaspora in +/usr/share/diaspora and bundle in /usr/lib/diaspora-bundle. With these, +the link setups is + % cd /usr/share/diaspora/master + % rm -rf vendor + % ln -sf /usr/lib/diaspora-bundle/vendor vendor + % ln -sf /usr/lib/diaspora-bundle/Gemfile . + % ln -sf /usr/lib/diaspora-bundle/Gemfile.lock . + + +The directories tmp, log, and public/uploads needs to be writable. If using +apache passenger, read the docs on uid used and file ownership. + +Note that the bundle version required is printed each time a new source +is generated. + +#### Notes + +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.gz is generated. + - The file .bundle/config is patched. Remove before doing + *bundle install* + +The bundle is basically the output from 'bundle package'. The git-based +gems are also added into git-gems. Bundle also houses the two files +Gemfile and Gemfile.lock + +*make-dist.sh source* applies all patches named *.patch in this directory +after checking out source from git. + +./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 +potentially problematic operation): + % ./make-dist.sh -f bundle + +#### Implementation + +'make-dist.sh source' script checks out latest version of diaspora into the + dist/diaspora directory. This content is, after some patches, the diaspora package. + +'make-dir.sh bundle' makes a *bundle package* in the diaspora dir. +The resulting bundle is stored in vendor/bundle. This is, after some more +patches, the content of diaspora-bundle tarball. Target systems makes a +*bundle install --local* to use it. diff --git a/pkg/fedora/add-bundle.diff b/pkg/source/add-bundle.diff similarity index 100% rename from pkg/fedora/add-bundle.diff rename to pkg/source/add-bundle.diff diff --git a/pkg/source/funcs.sh b/pkg/source/funcs.sh new file mode 100644 index 000000000..127801ea6 --- /dev/null +++ b/pkg/source/funcs.sh @@ -0,0 +1,78 @@ +# +# Common stuff for pkg scripts +# + +function git_id +# +# Echo package-friendly source id. +# +# Usage: git_id [-n] [file or directory] +# +{ + local nl="\n" + local file_or_dir="$PWD" + test "$1" = '-n' && { nl=""; shift; } + test -n "$1" && file_or_dir="$1" + if [ -d $file_or_dir ]; then + local file="" + local dir=$file_or_dir + else + local file=$(basename $file_or_dir) + local dir=$(dirname $file_or_dir) + fi + + ( + cd $dir + git log -1 --abbrev-commit --date=iso $file | + awk -v nl="$nl" \ + ' BEGIN { commit = ""; d[1] = "" } + /^commit/ { if ( commit == "") commit = $2 } + /^Date:/ { if (d[1] == "") { + split( $2, d, "-") + split( $3, t, ":") + } + } + END { printf( "%s%s%s%s%s_%s%s", + substr( d[1],3), d[2], d[3], + t[1], t[2], + commit, nl) + }' + ) +} + +function checkout() +# Checkout last version of diaspora unless it's already there. +# Uses global GIT_REPO to determine repo url +# Usage: checkout [commit id, defaults to HEAD] +# Returns: commit for current branch's HEAD. +{ + mkdir dist &>/dev/null || : + ( + local last_repo='' + cd dist + + test -e '.last-repo' && + last_repo=$( cat '.last-repo') + test "$last_repo" != $GIT_REPO && + rm -rf diaspora + test -d diaspora || { + git clone --quiet $GIT_REPO; + ( + cd diaspora; + git remote add upstream \ + git://github.com/diaspora/diaspora.git + for p in ../../*.patch; do + git apply --whitespace=fix $p > /dev/null + done &> /dev/null || : + ) + } + echo -n "$GIT_REPO" > '.last-repo' + + cd diaspora; + git fetch --quiet upstream + git merge --quiet upstream/master + [ -n "$1" ] && git reset --hard --quiet $1 + git_id -n + ) +} + diff --git a/pkg/fedora/make-dist.sh b/pkg/source/make-dist.sh similarity index 50% rename from pkg/fedora/make-dist.sh rename to pkg/source/make-dist.sh index 5d6d1cdba..125f9dcdd 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/source/make-dist.sh @@ -1,180 +1,13 @@ #!/bin/bash -# Create a diaspora distribution +# Create diaspora distribution tarballs. # # Usage: See function usage() at bottom. # GIT_REPO='http://github.com/diaspora/diaspora.git' VERSION='0.0' -RELEASE='1' - -function git_id -# -# Echo package-friendly source id. -# -# Usage: git_id [-n] [file or directory] -# -{ - local nl="\n" - local file_or_dir="$PWD" - test "$1" = '-n' && { nl=""; shift; } - test -n "$1" && file_or_dir="$1" - if [ -d $file_or_dir ]; then - local file="" - local dir=$file_or_dir - else - local file=$(basename $file_or_dir) - local dir=$(dirname $file_or_dir) - fi - - ( - cd $dir - git log -1 --abbrev-commit --date=iso $file | - awk -v nl="$nl" \ - ' BEGIN { commit = ""; d[1] = "" } - /^commit/ { if ( commit == "") commit = $2 } - /^Date:/ { if (d[1] == "") { - split( $2, d, "-") - split( $3, t, ":") - } - } - END { printf( "%s%s%s%s%s_%s%s", - substr( d[1],3), d[2], d[3], - t[1], t[2], - commit, nl) - }' - ) -} - - -function fix_alphatag() -# Patch version on top comment first id line: -# Usage: fix_alphatag -# Patches:\ -# * Fri Sep 24 2010 name surname 1.20100925_faf23207 -{ - local dist=$(rpm --eval %dist) - awk -v dist="$dist" -v version="$2" -v commit="$3" -v release="$4" \ - ' BEGIN { done = 0 } - /^[*]/ { if (done) - print - else - { - s = sprintf( "-%s.%s%s\n", release, commit, dist) - gsub( "-[0-9][.][^ ]*$", s) - done = 1 - # add new gsub for version... - print - } - next - } - { print }' < $1 > $1.tmp && mv -f $1.tmp $1 -} - - -function fix_bundle_deps -# usage: fix_bundle_deps -# Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148 -{ - awk -v vers="$2-$3" \ - ' /Requires:/ { if ($2 == "diaspora-bundle") - printf( "%s %s = %s\n", $1,$2,vers) - else - print - next - } - { print}' \ - < $1 > $1.tmp && mv -f $1.tmp $1 -} - - -function patch() -# Patch spec-files with current version-release -# Usage: patch -{ - sed -e "/^%define/s|HEAD|$2|" \ - -e '/^Version:/s|.*|Version: '$1'|' \ - dist/diaspora.spec - fix_alphatag dist/diaspora.spec $1 $2 $3 - local bundle_id=$(git_id dist/diaspora/Gemfile) - local dist_tag=$(rpm --eval %dist) - fix_bundle_deps dist/diaspora.spec $1 "$RELEASE.${bundle_id}$dist_tag" - sed -e "/^%define/s|HEAD|$bundle_id|" \ - -e '/^Version:/s|.*|Version: '$1'|' \ - < diaspora-bundle.spec > dist/diaspora-bundle.spec - - cp dist/diaspora.spec dist/diaspora/diaspora.spec -} - - -function checkout() -# Checkout last version of diaspora unless it's already there. -# Usage: checkout [commit id, defaults to HEAD] -# Returns: commit for current branch's HEAD. -{ - mkdir dist &>/dev/null || : - ( - local last_repo='' - cd dist - - test -e '.last-repo' && - last_repo=$( cat '.last-repo') - test "$last_repo" != $GIT_REPO && - rm -rf diaspora - test -d diaspora || { - git clone --quiet $GIT_REPO; - ( - cd diaspora; - git remote add upstream \ - git://github.com/diaspora/diaspora.git - for p in ../../*.patch; do - git apply --whitespace=fix $p > /dev/null - done &> /dev/null || : - ) - } - echo -n "$GIT_REPO" > '.last-repo' - - cd diaspora; - git fetch --quiet upstream - git merge --quiet upstream/master - [ -n "$1" ] && git reset --hard --quiet $1 - git_id -n - ) -} - - -function make_src -# Create a distribution tarball -# Usage: make src -{ - echo "Using repo: $GIT_REPO" - - commit=$(checkout ${1:-'HEAD'}) - echo "Commit id: $commit" - - RELEASE_DIR="diaspora-$VERSION-$commit" - rm -rf dist/${RELEASE_DIR} - mkdir dist/${RELEASE_DIR} - cd dist - mkdir ${RELEASE_DIR}/master - cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master - ( - cd ${RELEASE_DIR}/master - rm -rf vendor/bundle/* vendor/git/* vendor/cache/* gem-tmp - git show --name-only > config/gitversion - 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 - ) - tar czf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR} && \ - rm -rf ${RELEASE_DIR} - cd .. - echo "Source: dist/${RELEASE_DIR}.tar.gz" - echo "Required bundle: $(git_id dist/diaspora/Gemfile)" -} +. ./funcs.sh function build_git_gems() # Usage: build_git_gems @@ -213,6 +46,38 @@ function build_git_gems() # rm -rf gem-tmp } +function make_src +# Create a distribution tarball +# Usage: make src +{ + echo "Using repo: $GIT_REPO" + + commit=$(checkout ${1:-'HEAD'}) + echo "Commit id: $commit" + + RELEASE_DIR="diaspora-$VERSION-$commit" + rm -rf dist/${RELEASE_DIR} + mkdir dist/${RELEASE_DIR} + cd dist + mkdir ${RELEASE_DIR}/master + cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master + ( + cd ${RELEASE_DIR}/master + rm -rf vendor/bundle/* vendor/git/* vendor/cache/* gem-tmp + git show --name-only > config/gitversion + 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 + ) + tar czf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR} && \ + rm -rf ${RELEASE_DIR} + cd .. + echo "Source: dist/${RELEASE_DIR}.tar.gz" + echo "Required bundle: $(git_id dist/diaspora/Gemfile)" +} + function make_docs() { local gems=$1 @@ -238,6 +103,7 @@ function make_docs() } + function make_bundle() # Create the bundle tarball # Usage: make_bundle [ commit, defaults to HEAD] @@ -285,69 +151,21 @@ function make_bundle() mv $bundle_name/vendor/cache diaspora/vendor/cache cd .. } + git checkout Gemfile echo echo "Bundle: dist/$bundle_name.tar.gz" } - -function prepare_rpm() -# Usage: prepare_rpm < commit> -{ - local dest=$(rpm --eval %_sourcedir) - test -z "$dest" && { - echo "Can't find RPM source directory, giving up." - exit 2 - } - - local commit=$( checkout $1) - echo "Release: $RELEASE.$commit" - echo "Rpm source dir: $dest" - - patch $VERSION $commit $RELEASE - - local src="dist/diaspora-$VERSION-$commit.tar.gz" - test -e $src || - cat <<- EOF - Warning: $src does not exist - (last version not built?) - EOF - ln -sf $PWD/$src $dest - - local bundle_commit=$( git_id dist/diaspora/Gemfile) - local bundle="dist/diaspora-bundle-$VERSION-$bundle_commit.tar.gz" - test -e $bundle || - cat <<- EOF - Warning: $bundle does not exist - (last version not built?) - EOF - ln -sf $PWD/$bundle $dest - - local file - for file in $( grep -v '^#' SOURCES); do - if [ -e "$file" ]; then - ln -sf $PWD/$file $dest/$file - else - echo "Warning: $file (listed in SOURCES) does not exist" - fi - done - - ( cd $dest; find . -type l -not -readable -exec rm {} \;) - echo "Source specfile: dist/diaspora.spec" - echo "Bundle specfile: dist/diaspora-bundle.spec" -} - - function usage() { cat <<- EOF - Usage: make-dist [options] + Usage: make-dist [options] Options: -h Print this message. -c commit Use a given commit, defaults to last checked in. - -r release For prepare, mark with release nr, defaults to 1. -u uri Git repository URI, defaults to $GIT_REPO. -f For bundle, fix dependencies by running 'bundle update' @@ -355,8 +173,6 @@ function usage() source Build a diaspora application tarball. bundle Build a bundler(1) bundle for diaspora. - prepare Symlink bundle and source tarballs to rpm source dir, - create patched rpm spec files. All results are stored in dist/ @@ -366,15 +182,13 @@ function usage() commit='HEAD' BUNDLE_FIX='no' -while getopts ":r:c:u:fh" opt +while getopts ":c:u:fh" opt do case $opt in u) GIT_REPO="$OPTARG" ;; c) commit="${OPTARG:0:7}" ;; - r) RELEASE="$OPTARG:" - ;; f) BUNDLE_FIX='yes' ;; h) usage @@ -387,7 +201,7 @@ do done shift $(($OPTIND - 1)) -typeset -r GIT_REPO RELEASE BUNDLE_FIX +typeset -r GIT_REPO BUNDLE_FIX export LANG=C test $# -gt 1 -o $# -eq 0 && { @@ -401,8 +215,6 @@ case $1 in ;; 'source') make_src $commit ;; - 'prepare') prepare_rpm $commit $release - ;; *) usage exit 1 ;; diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index 44e83c79b..53960af05 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -5,23 +5,20 @@ 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 +Create and install the diaspora bundle and application in +diaspora/pkg/source according to +[source README](http://github.com/diaspora/diaspora/blob/master/source/fedora/README.md) + 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 source - % sudo ./diaspora-install dist/diaspora-0.0*.tar.gz - -Initiate and start the server; +Install, initiate and start the server; + % sudo ./diaspora-install % sudo ./diaspora-setup % sudo su - diaspora % cd /usr/share/diaspora/master diff --git a/pkg/ubuntu/make-dist.sh b/pkg/ubuntu/make-dist.sh deleted file mode 120000 index f6ba9c6a2..000000000 --- a/pkg/ubuntu/make-dist.sh +++ /dev/null @@ -1 +0,0 @@ -../fedora/make-dist.sh \ No newline at end of file From 6c25b02216d19de4e8e861637717f49aa7a7853c Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 21:21:10 +0200 Subject: [PATCH 16/40] bugfix --- pkg/ubuntu/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index 53960af05..f0cdfb767 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -12,7 +12,7 @@ Bootstrap the distribution from git: Create and install the diaspora bundle and application in diaspora/pkg/source according to -[source README](http://github.com/diaspora/diaspora/blob/master/source/fedora/README.md) +[source README](//diaspora/diaspora/blob/master/source/fedora/README.md) Install the dependencies (a good time for a coffe break): % sudo ./diaspora-install-deps From 2a3ea8b8e6ab32357300194d633a2b94e98680e0 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 21:25:05 +0200 Subject: [PATCH 17/40] bugfix --- pkg/ubuntu/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index f0cdfb767..ad55213de 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -12,7 +12,7 @@ Bootstrap the distribution from git: Create and install the diaspora bundle and application in diaspora/pkg/source according to -[source README](//diaspora/diaspora/blob/master/source/fedora/README.md) +[source README](/diaspora/diaspora/blob/master/source/fedora/README.md) Install the dependencies (a good time for a coffe break): % sudo ./diaspora-install-deps From 814041d771c595feece1e10fe5d0a336bcbb2792 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 21:27:07 +0200 Subject: [PATCH 18/40] bugfix --- pkg/ubuntu/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ubuntu/README.md b/pkg/ubuntu/README.md index ad55213de..53960af05 100644 --- a/pkg/ubuntu/README.md +++ b/pkg/ubuntu/README.md @@ -12,7 +12,7 @@ Bootstrap the distribution from git: Create and install the diaspora bundle and application in diaspora/pkg/source according to -[source README](/diaspora/diaspora/blob/master/source/fedora/README.md) +[source README](http://github.com/diaspora/diaspora/blob/master/source/fedora/README.md) Install the dependencies (a good time for a coffe break): % sudo ./diaspora-install-deps From 50b52af11abbd227bb7564584ff6d0558f4bc0db Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 21:37:45 +0200 Subject: [PATCH 19/40] bugfix,docs --- pkg/fedora/README.md | 26 +++++++------------------- pkg/source/make-dist.sh | 2 +- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pkg/fedora/README.md b/pkg/fedora/README.md index 40ccf7ae3..7d645374f 100644 --- a/pkg/fedora/README.md +++ b/pkg/fedora/README.md @@ -1,13 +1,12 @@ ## Diaspora RPM tools -Creates diaspora source tarballs and RPM packages +Create RPM packages An alternative to the capistrano system, providing classic, binary RPM -packages for deployment on Fedora 13 and OS-independent source tarballs -aimed for packaging purposes. +packages for deployment on Fedora. -#### Fedora RPM synopsis +#### Synopsis Prerequisites: @@ -62,15 +61,15 @@ Typically, this is secondary sources. *make-dist.sh source* applies all patches named *.patch in this directory after checking out source from git. -The spec-files in dist/ are patched by *./make-dist.sh prepare* to reference +The spec-files in dist/ are patched by *./prepare-rpm.sh to reference correct versions of diaspora and diaspora-bundle. The diaspora-bundle is only updated if Gemfile is updated, upgrading diaspora doesn't always require a new diaspora-bundle. Editing spec files should be done -in this directory, changes in dist/ are lost when doing *./make-dist prepare*. +in this directory, changes in dist/ are lost when doing *./prepare-rpm.sh *. The topmost comment's version is patched to reflect the complete version -of current specfile by *make-dist source*. Write the comment in this -directory, copy-paste previous version nr. It will be updated. +of current specfile . Write the comment in this directory, copy-paste +previous version nr. It will be updated. This has been confirmed to start up and provide basic functionality both using the thin webserver and apache passenger, on 32/64 bit systems and in the @@ -79,17 +78,6 @@ at [ftp://mumin.dnsalias.net/pub/leamas/diaspora/builds](ftp://mumin.dnsalias.ne #### Implementation -'make-dist.sh source' script checks out latest version of diaspora into the - dist/diaspora directory. This content is, after some patches, the diaspora package. - -'make-dir.sh bundle' makes a *bundle package* in the diaspora dir. -The resulting bundle is stored in vendor/bundle. This is, after some more -patches, the content of diaspora-bundle tarball. Target systems makes a -*bundle install --local* to use it. - -Here is also support for running the diaspora websocket service as a system -service through /sbin/service and some install scripts. - Diaspora files are stored in /usr/share/diaspora, and owned by root. The bundle, containing some C extensions, is architecture-dependent and lives in /usr/lib[64]/diaspora. Log files are in /var/log/diaspora. Symlinks in diff --git a/pkg/source/make-dist.sh b/pkg/source/make-dist.sh index 125f9dcdd..e96e62ef6 100755 --- a/pkg/source/make-dist.sh +++ b/pkg/source/make-dist.sh @@ -146,12 +146,12 @@ function make_bundle() mv vendor/cache ../$bundle_name/vendor mv vendor/gems ../$bundle_name/vendor mv git-repos ../$bundle_name + git checkout Gemfile cd .. tar czf $bundle_name.tar.gz $bundle_name mv $bundle_name/vendor/cache diaspora/vendor/cache cd .. } - git checkout Gemfile echo echo "Bundle: dist/$bundle_name.tar.gz" } From 205a0a69f21b873ab65630b2093cbe0ce0046ff4 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sun, 31 Oct 2010 00:02:06 +0200 Subject: [PATCH 20/40] Hlding dist dirs in rep --- pkg/ubuntu/dist | 1 + pkg/ubuntu/dist/.gitkeep | 0 2 files changed, 1 insertion(+) create mode 120000 pkg/ubuntu/dist delete mode 100644 pkg/ubuntu/dist/.gitkeep diff --git a/pkg/ubuntu/dist b/pkg/ubuntu/dist new file mode 120000 index 000000000..378798d00 --- /dev/null +++ b/pkg/ubuntu/dist @@ -0,0 +1 @@ +../source/dist \ No newline at end of file diff --git a/pkg/ubuntu/dist/.gitkeep b/pkg/ubuntu/dist/.gitkeep deleted file mode 100644 index e69de29bb..000000000 From 68d2f4162ea0da5160d1664784e9168e85240d57 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sun, 31 Oct 2010 01:38:48 +0200 Subject: [PATCH 21/40] bugfix --- pkg/source/funcs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/source/funcs.sh b/pkg/source/funcs.sh index 127801ea6..bc9edd862 100644 --- a/pkg/source/funcs.sh +++ b/pkg/source/funcs.sh @@ -59,6 +59,7 @@ function checkout() git clone --quiet $GIT_REPO; ( cd diaspora; + git checkout Gemfile git remote add upstream \ git://github.com/diaspora/diaspora.git for p in ../../*.patch; do From 21772842be0e256ff70afbe96558bf09f98cf90f Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sun, 31 Oct 2010 13:20:00 +0100 Subject: [PATCH 22/40] bugfixes --- pkg/source/dist/.gitkeep | 0 pkg/ubuntu/diaspora-install | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 pkg/source/dist/.gitkeep diff --git a/pkg/source/dist/.gitkeep b/pkg/source/dist/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/ubuntu/diaspora-install b/pkg/ubuntu/diaspora-install index 4679c9f2b..fc4aebbf6 100755 --- a/pkg/ubuntu/diaspora-install +++ b/pkg/ubuntu/diaspora-install @@ -43,12 +43,19 @@ mkdir -p /var/lib/diaspora/tmp mkdir -p /var/run/diaspora mkdir -p /etc/diaspora +bundle='/usr/lib/diaspora-bundle' +[[ $(arch) == '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 -ln -sf /usr/lib/diaspora-bundle/vendor/bundle master/vendor +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 From c07771b390ccbd3f3faba574a81bc23bae92450c Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sun, 31 Oct 2010 13:55:33 +0100 Subject: [PATCH 23/40] bugfix --- pkg/ubuntu/diaspora-install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/ubuntu/diaspora-install b/pkg/ubuntu/diaspora-install index fc4aebbf6..7090e775b 100755 --- a/pkg/ubuntu/diaspora-install +++ b/pkg/ubuntu/diaspora-install @@ -44,7 +44,8 @@ mkdir -p /var/run/diaspora mkdir -p /etc/diaspora bundle='/usr/lib/diaspora-bundle' -[[ $(arch) == 'x86_64']] && bundle='/usr/lib64/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 From cf6c2deba327805837eb40f627574420fb031c00 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 31 Oct 2010 22:54:26 +0100 Subject: [PATCH 24/40] Added missing strings to swedish translation --- config/locales/devise/devise.sv.yml | 24 +++++++-- config/locales/diaspora/sv.yml | 82 +++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 20 deletions(-) diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index 0366d0c49..419d90deb 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -8,6 +8,7 @@ sv: errors: messages: not_found: "kan ej hitta" + already_confirmed: "är redan bekräftad" not_locked: "var ej låst" devise: @@ -15,11 +16,16 @@ sv: unauthenticated: 'Du måste logga in innan du kan fortsätta.' unconfirmed: 'Du måste verifiera ditt konto innan du kan fortsätta.' locked: 'Ditt konto är låst.' - invalid: 'Felaktig användare eller lösenord.' + invalid: 'Felaktigt användarnamn eller lösenord.' invalid_token: 'Ogiltig identifiering.' timeout: 'Din session är avslutad, var vänlig logga in igen.' inactive: 'Ditt konto är inte aktiverat.' sessions: + new: + login: 'Logga in' + username: 'Användarnamn' + password: 'Lösenord' + sign_in: 'Logga in' signed_in: 'Inloggning ok.' signed_out: 'Utloggning ok.' passwords: @@ -40,6 +46,16 @@ sv: invitation_token_invalid: 'Denna inbjudan är ej giltig!' updated: 'Ditt lösenord är nu inställt och du är inloggad.' mailer: - confirmation_instructions: 'Instruktioner för att verifiera ditt konto.' - reset_password_instructions: 'Instruktioner för att återställa ditt lösenord.' - unlock_instructions: 'Instruktioner för att låsa upp ditt konto.' + confirmation_instructions: + subject: 'Instruktioner för att verifiera ditt konto.' + reset_password_instructions: + subject: 'Instruktioner för att återställa ditt lösenord.' + unlock_instructions: + subject: 'Instruktioner för att låsa upp ditt konto.' + invitation: + subject: 'En vän vill att du ska gå med i Diaspora!' + shared: + links: + sign_in: 'Logga in' + sign_up: 'Registrera dig' + forgot_your_password: 'Glömt ditt lösenord?' diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 968a3cafa..d5b18e6fa 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -27,6 +27,8 @@ sv: models: user: attributes: + person: + invalid: "är ogiltigt" username: taken: "är redan taget" email: @@ -35,7 +37,6 @@ sv: attributes: diaspora_handle: taken: "är redan taget" - hello: "Hej världen!" application: helper: @@ -54,7 +55,10 @@ sv: people_on_pod_are_aware_of: " personer på denna plats är medvetna om att" layouts: application: + view_profile: "visa profil" edit_profile: "ändra profil" + account_settings: "kontoinstallningar" + search: "Search" logout: "logga ut" shared: aspect_nav: @@ -81,8 +85,10 @@ sv: updated: "uppdaterad" by: "av" edit: + album_name: "Namn på fotoalbum" editing: "Ändrar" updated: "uppdaterad" + update_album: "Uppdatera fotoalbum" are_you_sure: "Är du säker?" delete_album: "Ta bort fotoalbum" cancel: "Avbryt" @@ -117,6 +123,7 @@ sv: ignore_remove: "Ignorera/Ta bort" new_aspect: add_a_new_aspect: "Lägg till ny sida" + name: "Namn" create: "Skapa" create: success: "Klicka på plustecknet till höger för att välja vilka som kan se din nya sida." @@ -137,19 +144,26 @@ sv: users: edit: editing_profile: "Ändrar profil" - profile: + invite_friends: "Bjud in en vän" + are_you_sure: "Är du säker?" + export_data: "Exportera data" + close_account: "Stäng kontot" + change_language: "Ändra språk" + change_password: "Ändra lösenord" + new_password: "Nytt lösenord" + password_confirmation: "Bekräfta lösenord" + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" cancel: "Avbryt" - update_profile: "Uppdatera Profil" - home: "Hem" - diaspora_username: "Diaspora-användarnamn:" - info: "Info" - picture: "Profilbild" - editing_profile: "Ändrar profil" - albums: "Album" - you_dont_have_any_photos: "Du har inga foton! Gå till" - page_to_upload_some: "sidan för att ladda upp några." - or: "eller" destroy: "Ditt konto är nu stängt." + getting_started: + 'step_1': + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" comments: comment: ago: "sedan" @@ -189,6 +203,13 @@ sv: registrations: new: sign_up: "Registrera dig" + sign_up_for_diaspora: "Gå med i Diaspora" + upload_existing_account: "Ladda upp ett befintligt Diaspora-konto" + upload: "Ladda upp" + username: "Användarnamn" + email: "E-post address" + password: "Lösenord" + password_confirmation: "Bekräfta lösenord" create: success: "Du har nu gått med i Diaspora!" invitations: @@ -232,10 +253,6 @@ sv: new: new_person: "Ny person" back_to_list: "Tillbaka till listan" - edit: - cancel: "Avbryt" - or: "eller" - update_profile: "Uppdatera profil" show: last_seen: "senast sedd: %{how_long_ago}" friends_since: "vänner sedan: %{how_long_ago}" @@ -243,12 +260,39 @@ sv: are_you_sure: "Är du säker?" remove_friend: "ta bort vän" no_posts: "ingenting att visa!" + add_friend: "lägg till en vän" + edit: + settings: "Inställningar" + your_profile: "Din profil" + your_name: "Ditt namn" + first_name: "Förnamn" + last_name: "Efternamn" + your_gender: "Ditt kön" + your_birthday: "Din födelsedag" + your_bio: "Din biografi" + fill_me_out: "Fyll i mig" + your_photo: "Ditt foto" + profile: "Profil" + account: "Konto" + services: "Tjänster" + cancel: "Avbryt" + update_profile: "Uppdatera profil" + home: "Hem" + diaspora_username: "Användarnamn:" + info: "Info" + picture: "Foto" + editing_profile: "Ändrar profil" + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" requests: new_request: add_a_new_friend_to: "Lägg till en vän till" enter_a_diaspora_username: "Ange ett användarnamn:" your_diaspora_username_is: "Din Diaspora-adress är: %{diaspora_handle}" friends_username: "Vännens Diaspora-adress" + create_request: "Skapa förfrågan" destroy: success: "Ni är nu vänner." error: "Var god välj en aspekt!" @@ -261,6 +305,12 @@ sv: already_friends: "Du är redan vän med %{destination_url}!" success: "En vänförfrågan har skickats till %{destination_url}." horribly_wrong: "Nu gick något rejält fel här." + services: + index: + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" # The following is from the rails-i18n project at http://github.com/svenfuchs/rails-i18n From d8376b5a8401f510129fe05a55af6c2a3018c5a0 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 1 Nov 2010 05:20:33 +0100 Subject: [PATCH 25/40] bugfix, refactor funcs --- pkg/bootstrap-fedora-diaspora.sh | 122 ++++++++++++++++++++++--------- pkg/source/funcs.sh | 31 +++++++- 2 files changed, 118 insertions(+), 35 deletions(-) diff --git a/pkg/bootstrap-fedora-diaspora.sh b/pkg/bootstrap-fedora-diaspora.sh index 84352f12d..67ba40fc2 100755 --- a/pkg/bootstrap-fedora-diaspora.sh +++ b/pkg/bootstrap-fedora-diaspora.sh @@ -1,48 +1,102 @@ #!/bin/bash +# +# Install diaspora, its dependencies and start. +# +# Usage: bootstrap-fedora-diaspora.sh [external hostname] +# +# Must run as root -export DIASPORADIR=`pwd` +arg_hostname="$1" -echo "####" -echo "Installing build deps ..." -echo "####" -sleep 3 -su -c "yum install git bison svn autoconf sqlite-devel gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel ImageMagick git rubygems libxslt libxslt-devel libxml2 libxml2-devel openssl-devel" +. source/funcs.sh -echo "####" -echo "Installing RVM ..." -echo "####" -sleep 3 +test $UID = "0" || { + echo "You need to be root to do this, giving up" + exit 2 +} -mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install +yum install -y git bison svn autoconf sqlite-devel gcc-c++ patch \ + readline-devel zlib-devel libyaml-devel libffi-devel \ + ImageMagick git rubygems libxslt-devel libxml2-devel \ + openssl-devel mongodb-server wget openssh-clients -echo "####" -echo "Installing RVM into bashrc and sourcing bash ..." -echo "####" -sleep 3 +getent group diaspora >/dev/null || groupadd diaspora +getent passwd diaspora >/dev/null || { + useradd -g diaspora -s /bin/bash -m diaspora + echo "Created user diaspora" +} -if [[ `grep -l "rvm/scripts/rvm" $HOME/.bashrc | wc -l` -eq 0 ]]; then - echo 'if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi' >> $HOME/.bashrc +su - diaspora <> \$HOME/.bashrc + } +} + +source \$HOME/.bashrc + +[ -d .ssh ] || { + ssh-keygen -q + echo "StrictHostKeyChecking no" > .ssh/config + chmod 600 .ssh/config +} + +ruby=\$(which ruby) || ruby="" + +if [[ -z "\$ruby" || ("\${ruby:0:4}" == "/usr") ]]; then + echo '#### Installing ruby (will take forever) ... ####' + rvm install ruby-1.8.7-p302 + rvm --default ruby-1.8.7 + + echo "#### Installing bundler ... ####" + gem install bundler fi -source $HOME/.bashrc -echo "####" -echo "Installing ruby (will take forever) ..." -echo "####" -sleep 3 +echo '### Clone diapora, install bundle. ###' +git clone git@github.com:diaspora/diaspora.git +cd diaspora +bundle install -rvm install ruby-1.8.7-p302 -rvm --default ruby-1.8.7 +#Configure diaspora -echo "####" -echo "Installing bundler ..." -echo "####" -sleep 3 +source pkg/source/funcs.sh +init_appconfig config/app_config.yml "\$arg_hostname" -gem install bundler +# Install DB setup +echo "Setting up DB..." +if bundle exec rake db:seed:dev ; then + cat <<- EOM + DB ready. Login -> tom and password -> evankorth. + More details ./diaspora/db/seeds/tom.rb. and ./diaspora/db/seeds/dev.rb. + EOM +else + cat <<- EOM + Database config failed. You might want to remove all db files with + 'rm -rf /var/lib/mongodb/*' and/or reset the config file by + 'cp config/app_config.yml.example config/app_config.yml' before + making a new try. Also, make sure the mongodb server is running + e. g., by running 'service mongodb status'. + EOM +fi + +# Run appserver +echo "Starting server" +script/server + +EOF -echo "####" -echo "Installing deps with bundle ..." -echo "####" -sleep 3 -pushd $DIASPORADIR && bundle install && popd diff --git a/pkg/source/funcs.sh b/pkg/source/funcs.sh index bc9edd862..8fb0ee937 100644 --- a/pkg/source/funcs.sh +++ b/pkg/source/funcs.sh @@ -59,7 +59,7 @@ function checkout() git clone --quiet $GIT_REPO; ( cd diaspora; - git checkout Gemfile + git checkout Gemfile Gemfile.lock git remote add upstream \ git://github.com/diaspora/diaspora.git for p in ../../*.patch; do @@ -77,3 +77,32 @@ function checkout() ) } +function init_appconfig +# Edit pod_url in hostname +# Silently uses argumetn if present, else run dialog. +# Usage: init_appconfig [hostname] +{ + config=$1 + arg_hostanme="$2" + hostname=$( awk '/pod_url:/ { print $2; exit }' <$config ) + + if [ -n "$arg_hostname" ]; then + sed -i "/pod_url:/s|$hostname|$arg_hostname|g" $config && \ + echo "config/app_config.yml updated." + return 0 + else + while : ; do + echo "Current hostname is \"$hostname\"" + echo -n "Enter new hostname [$hostname] :" + read new_hostname garbage + echo -n "Use \"$new_hostname\" as pod_url (Yes/No) [Yes]? :" + read yesno garbage + [ "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" ] && { + sed -i "/pod_url:/s|$hostname|$new_hostname|g" $config && + echo "config/app_config.yml updated." + break + } + done + fi +} + From 23e566ce2e663469f45f89300825f4e3a4fd9297 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 1 Nov 2010 06:13:31 +0100 Subject: [PATCH 26/40] bugfix --- pkg/.gitignore | 1 + pkg/bootstrap-fedora-diaspora.sh | 17 ++++++++++------- pkg/source/funcs.sh | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/.gitignore b/pkg/.gitignore index 1521c8b76..470b7660b 100644 --- a/pkg/.gitignore +++ b/pkg/.gitignore @@ -1 +1,2 @@ dist +*.log diff --git a/pkg/bootstrap-fedora-diaspora.sh b/pkg/bootstrap-fedora-diaspora.sh index 67ba40fc2..34b32eb1b 100755 --- a/pkg/bootstrap-fedora-diaspora.sh +++ b/pkg/bootstrap-fedora-diaspora.sh @@ -5,10 +5,8 @@ # Usage: bootstrap-fedora-diaspora.sh [external hostname] # # Must run as root - -arg_hostname="$1" - -. source/funcs.sh +GIT_REPO='git@github.com:leamas/diaspora.git' +DIASPORA_HOSTNAME='mumin.dnsalias.net' test $UID = "0" || { echo "You need to be root to do this, giving up" @@ -67,14 +65,19 @@ if [[ -z "\$ruby" || ("\${ruby:0:4}" == "/usr") ]]; then fi echo '### Clone diapora, install bundle. ###' -git clone git@github.com:diaspora/diaspora.git +rm -rf diaspora +git clone $GIT_REPO cd diaspora +echo "PWD: \$PWD" +echo "pkg: \$(ls pkg)" +echo "source: \$(ls pkg/source)" +source pkg/source/funcs.sh bundle install #Configure diaspora -source pkg/source/funcs.sh -init_appconfig config/app_config.yml "\$arg_hostname" +cp config/app_config.yml.example config/app_config.yml +init_appconfig config/app_config.yml "$DIASPORA_HOSTNAME" # Install DB setup echo "Setting up DB..." diff --git a/pkg/source/funcs.sh b/pkg/source/funcs.sh index 8fb0ee937..e47af236d 100644 --- a/pkg/source/funcs.sh +++ b/pkg/source/funcs.sh @@ -83,7 +83,7 @@ function init_appconfig # Usage: init_appconfig [hostname] { config=$1 - arg_hostanme="$2" + arg_hostname="$2" hostname=$( awk '/pod_url:/ { print $2; exit }' <$config ) if [ -n "$arg_hostname" ]; then From 85f94a2b002f2b2ed8a98b33b5fc9c7674dc08f1 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Sat, 30 Oct 2010 13:18:56 +0200 Subject: [PATCH 27/40] Refactored into separate generic, source dir + distro addons. --- pkg/bootstrap-fedora-diaspora.sh | 2 +- pkg/fedora/README.md | 6 ++++++ pkg/fedora/dist | 1 - pkg/source/dist/.gitkeep | 0 pkg/ubuntu/add-bundle.diff | 11 ----------- vendor/plugins/.gitkeep | 0 6 files changed, 7 insertions(+), 13 deletions(-) delete mode 120000 pkg/fedora/dist delete mode 100644 pkg/source/dist/.gitkeep delete mode 100644 pkg/ubuntu/add-bundle.diff delete mode 100644 vendor/plugins/.gitkeep diff --git a/pkg/bootstrap-fedora-diaspora.sh b/pkg/bootstrap-fedora-diaspora.sh index 34b32eb1b..41d317a34 100755 --- a/pkg/bootstrap-fedora-diaspora.sh +++ b/pkg/bootstrap-fedora-diaspora.sh @@ -26,7 +26,7 @@ getent passwd diaspora >/dev/null || { su - diaspora < Date: Mon, 1 Nov 2010 06:59:41 +0100 Subject: [PATCH 28/40] pkg bugfixes --- pkg/bootstrap-fedora-diaspora.sh | 73 ++++++++++++++++++++------------ pkg/fedora/prepare-rpm.sh | 6 ++- pkg/source/dist/.gitkeep | 0 3 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 pkg/source/dist/.gitkeep diff --git a/pkg/bootstrap-fedora-diaspora.sh b/pkg/bootstrap-fedora-diaspora.sh index 41d317a34..a8a7c2f41 100755 --- a/pkg/bootstrap-fedora-diaspora.sh +++ b/pkg/bootstrap-fedora-diaspora.sh @@ -2,21 +2,42 @@ # # Install diaspora, its dependencies and start. # -# Usage: bootstrap-fedora-diaspora.sh [external hostname] +# Usage: pkg/bootstrap-fedora-diaspora.sh [external hostname] +# +# Synopsis: +# +# $ git clone git@github.com:diaspora/diaspora.git +# $ cd diaspora +# $ sudo pkg/bootstrap-rffedora-diaspora.sh +# +# Unless already existing, the diaspora user is created. +# The directory the scripts is invoked from is copied to +# diasporas's home dir, populated and configured and finally +# acts as a base for running diaspora servers. +# +# Script is designed not to make any changes in invoking +# caller's environment. +# user. # # Must run as root + GIT_REPO='git@github.com:leamas/diaspora.git' -DIASPORA_HOSTNAME='mumin.dnsalias.net' +DIASPORA_HOSTNAME=${1:-'mumin.dnsalias.net'} test $UID = "0" || { echo "You need to be root to do this, giving up" exit 2 } -yum install -y git bison svn autoconf sqlite-devel gcc-c++ patch \ +[[ -d config && -d script ]] || { + echo Error: "this is not a diaspora base directory" + exit 3 +} +yum install -y git bison svn sqlite-devel gcc-c++ patch \ readline-devel zlib-devel libyaml-devel libffi-devel \ - ImageMagick git rubygems libxslt-devel libxml2-devel \ - openssl-devel mongodb-server wget openssh-clients + ImageMagick rubygems libxslt-devel libxml2-devel \ + openssl-devel mongodb-server wget openssh-clients \ + make autoconf automake getent group diaspora >/dev/null || groupadd diaspora getent passwd diaspora >/dev/null || { @@ -24,10 +45,27 @@ getent passwd diaspora >/dev/null || { echo "Created user diaspora" } -su - diaspora < .ssh/config - chmod 600 .ssh/config -} - ruby=\$(which ruby) || ruby="" if [[ -z "\$ruby" || ("\${ruby:0:4}" == "/usr") ]]; then @@ -64,22 +96,8 @@ if [[ -z "\$ruby" || ("\${ruby:0:4}" == "/usr") ]]; then gem install bundler fi -echo '### Clone diapora, install bundle. ###' -rm -rf diaspora -git clone $GIT_REPO -cd diaspora -echo "PWD: \$PWD" -echo "pkg: \$(ls pkg)" -echo "source: \$(ls pkg/source)" -source pkg/source/funcs.sh bundle install -#Configure diaspora - -cp config/app_config.yml.example config/app_config.yml -init_appconfig config/app_config.yml "$DIASPORA_HOSTNAME" - -# Install DB setup echo "Setting up DB..." if bundle exec rake db:seed:dev ; then cat <<- EOM @@ -96,7 +114,6 @@ else EOM fi -# Run appserver echo "Starting server" script/server diff --git a/pkg/fedora/prepare-rpm.sh b/pkg/fedora/prepare-rpm.sh index 5d03f8328..908c1844a 100755 --- a/pkg/fedora/prepare-rpm.sh +++ b/pkg/fedora/prepare-rpm.sh @@ -128,6 +128,8 @@ function usage() -h Print this message. -r release For prepare, mark with release nr, defaults to 1. + -u uri Git repository URI, defaults to + $GIT_REPO. Symlink bundle and source tarballs to rpm source dir, create patched rpm spec files. @@ -140,7 +142,7 @@ function usage() commit='HEAD' BUNDLE_FIX='no' -while getopts ":r:h" opt +while getopts ":r:u:h" opt do case $opt in r) RELEASE="$OPTARG:" @@ -148,6 +150,8 @@ do h) usage exit 0 ;; + u) GIT_REPO="$OPTARG" + ;; *) usage exit 2 ;; diff --git a/pkg/source/dist/.gitkeep b/pkg/source/dist/.gitkeep new file mode 100644 index 000000000..e69de29bb From 168843bcd502f2b5a0688cf4af370e6297da27bd Mon Sep 17 00:00:00 2001 From: Gabriel Gilder Date: Thu, 28 Oct 2010 20:57:18 -0700 Subject: [PATCH 29/40] redirecting to :back instead of manage page on failed aspect creation +spec --- app/controllers/aspects_controller.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index aadbf1ecf..9f2942f6c 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -24,7 +24,7 @@ class AspectsController < ApplicationController respond_with @aspect else flash[:error] = I18n.t('aspects.create.failure') - redirect_to aspects_manage_path + redirect_to :back end end diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index d62d91f5b..7c3c0dda9 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -16,6 +16,7 @@ describe AspectsController do friend_users(@user,@aspect, @user2, @aspect2) @contact = @user.contact_for(@user2.person) sign_in :user, @user + request.env["HTTP_REFERER"] = 'http://' + request.host end describe "#index" do @@ -44,9 +45,9 @@ describe AspectsController do post :create, "aspect" => {"name" => ""} @user.reload.aspects.count.should == 2 end - it "goes back to manage aspects" do + it "goes back to the page you came from" do post :create, "aspect" => {"name" => ""} - response.should redirect_to(aspects_manage_path) + response.should redirect_to(:back) end end end From b0b1fa51c22eaa7af7b5d7ff181c86ded2610bf9 Mon Sep 17 00:00:00 2001 From: Himanshu Chhetri Date: Fri, 29 Oct 2010 20:31:45 -0700 Subject: [PATCH 30/40] Use FileUtils for all file operations. Also uses Kernel.system to execute shell commands in a secure fashion. --- lib/collect_user_photos.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/collect_user_photos.rb b/lib/collect_user_photos.rb index 4b0fedea2..d95aa386a 100644 --- a/lib/collect_user_photos.rb +++ b/lib/collect_user_photos.rb @@ -17,12 +17,12 @@ module PhotoMover current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}" new_photo_location = "#{album_dir}/#{photo.image_filename}" - `cp #{current_photo_location} #{new_photo_location}` + FileUtils::cp current_photo_location new_photo_location end end - `tar cf #{user.id}.tar #{user.id}` - `rm -r #{user.id}` + system("tar", "cf #{user.id}.tar #{user.id}") + FileUtils::rm_r user.id, :secure => true, :force => true "#{Rails.root}/#{temp_dir}.tar" end From f33fded40053d96ec3f982d523908bb7a029fba2 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 31 Oct 2010 22:49:40 -0700 Subject: [PATCH 31/40] Refactor aspect cucumber feature - now happy path only. --- features/manages_aspects.feature | 14 ++++++++++++++ features/user_creates_an_aspect.feature | 21 --------------------- 2 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 features/manages_aspects.feature delete mode 100644 features/user_creates_an_aspect.feature diff --git a/features/manages_aspects.feature b/features/manages_aspects.feature new file mode 100644 index 000000000..74f6744f4 --- /dev/null +++ b/features/manages_aspects.feature @@ -0,0 +1,14 @@ +@aspects @javascript +Feature: User manages aspects + In order to share with a limited group + As a User + I want to create new aspects + + Scenario: creating an aspect + Given I am signed in + When I follow "Manage" in the header + And I follow "Add a new aspect" + And I fill in "Name" with "Dorm Mates" in the modal window + And I press "Create" in the modal window + Then I should see "Dorm Mates" in the header + And I should see "Your aspect 'Dorm Mates' is empty." diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature deleted file mode 100644 index d611d412f..000000000 --- a/features/user_creates_an_aspect.feature +++ /dev/null @@ -1,21 +0,0 @@ -@aspects @javascript -Feature: User creates an aspect - In order to share with a limited group - As a User - I want to create a new aspect - - Background: - Given I am signed in - And I follow "Manage" in the header - And I follow "Add a new aspect" - - Scenario: success - Given I fill in "Name" with "Dorm Mates" in the modal window - When I press "Create" in the modal window - Then I should see "Dorm Mates" in the header - And I should see "Your aspect 'Dorm Mates' is empty." - - Scenario: I omit the name - Given I fill in "Name" with "" in the modal window - When I press "Create" in the modal window - Then I should see "Aspect creation failed." From 7f7f160ca1e3343444b450135cff9d162f2c03ae Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 31 Oct 2010 22:50:20 -0700 Subject: [PATCH 32/40] Add feature for skipping the setup wizard. --- features/signs_up.feature | 16 ++++------------ features/step_definitions/custom_web_steps.rb | 4 ++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/features/signs_up.feature b/features/signs_up.feature index e64b066e7..d449034cf 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -1,7 +1,7 @@ @javascript Feature: new user registration - Scenario: new user sees profile wizard + Background: When I go to the new user registration page And I fill in "Username" with "ohai" And I fill in "Email" with "ohai@example.com" @@ -11,6 +11,7 @@ Feature: new user registration Then I should be on the getting started page And I should see "Welcome to Diaspora!" + Scenario: new user goes through the setup wizard When I fill in "person_profile_first_name" with "O" And I fill in "person_profile_last_name" with "Hai" And I press "Save and continue" @@ -32,17 +33,8 @@ Feature: new user registration Then I should be on the home page And I should see "We know you have friends, bring them to Diaspora!" - @wip - Scenario: new user can skip the profile wizard - When I go to the new user registration page - And I fill in "Username" with "ohai" - And I fill in "Email" with "ohai@example.com" - And I fill in "Password" with "secret" - And I fill in "Password confirmation" with "secret" - And I press "Sign up" - Then I should be on the getting started page - And I should see "Welcome to Diaspora!" - + Scenario: new user skips the setup wizard When I follow "skip getting started" + And I wait for the home page to load Then I should be on the home page And I should see "We know you have friends, bring them to Diaspora!" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index d213cbf4d..c98150d3d 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -20,4 +20,8 @@ Then /^I should see "([^\"]*)" in the main content area$/ do |stuff| within("#stream") do Then "I should see #{stuff}" end +end + +When /^I wait for the home page to load$/ do + wait_until { current_path == root_path } end \ No newline at end of file From fb145beb9a25e9182981389e251c7399214d6aa8 Mon Sep 17 00:00:00 2001 From: Sarah Allen Date: Thu, 28 Oct 2010 21:28:20 -0700 Subject: [PATCH 33/40] Rails.env is a string, not a symbol --- config/initializers/_load_app_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 723e38525..b66b0c8f9 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -23,4 +23,4 @@ end APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' -puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test +puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != "test" From f693a97bf3d7db77835b6a534fee7c106193be85 Mon Sep 17 00:00:00 2001 From: Curtis J Schofield Date: Thu, 28 Oct 2010 21:02:58 -0700 Subject: [PATCH 34/40] i put in a dash --- config/locales/diaspora/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index d61abb8a2..837ecf8b8 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -91,7 +91,7 @@ en: your_albums: "Your Albums" aspects: no_friends_message: - nobody: "We know you have friends, bring them to Diaspora!" + nobody: "We know you have friends — bring them to Diaspora!" nobody_in_aspect: "Your aspect '%{aspect_name}' is empty." add_friend: "Add a friend" add_friend_to: "Add someone to %{aspect_name}" From 1a32766fb06af55fc49004ba4cae049017a343ef Mon Sep 17 00:00:00 2001 From: J David Eisenberg Date: Sat, 30 Oct 2010 22:01:02 -0700 Subject: [PATCH 35/40] Issue #492: Informal, vague description when signing up as a new user --- app/views/users/getting_started.html.haml | 2 +- config/locales/diaspora/en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 5edb3e67a..c90a3fadd 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -30,7 +30,7 @@ %h1{:style => "text-align:right;"} = "Welcome to Diaspora!" .description - Do the stuff below to further complete some things. + =t('.signup_steps') %h3{:style => "text-align:right;"} = link_to "Edit your profile", getting_started_path(:step => 1) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 837ecf8b8..ca1d8f471 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -143,6 +143,7 @@ en: cancel: "Cancel" destroy: "Account successfully closed." getting_started: + signup_steps: "Complete your sign-up by doing these things:" 'step_1': albums: "Albums" you_dont_have_any_photos: "You don't have any photos! Go to the" From 9a56296214c6ceee87f76ccf253364299302b22a Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 1 Nov 2010 00:55:16 -0700 Subject: [PATCH 36/40] Forgot to change spelling in feature --- features/signs_up.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/signs_up.feature b/features/signs_up.feature index d449034cf..80e32934f 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -31,10 +31,10 @@ Feature: new user registration When I follow "Continue on to your everyone page, an overview of all of your aspects." Then I should be on the home page - And I should see "We know you have friends, bring them to Diaspora!" + And I should see "bring them to Diaspora!" Scenario: new user skips the setup wizard When I follow "skip getting started" And I wait for the home page to load Then I should be on the home page - And I should see "We know you have friends, bring them to Diaspora!" + And I should see "bring them to Diaspora!" From 65419e423a5106b3de4dc34588d5fb883d6fa1f1 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 31 Oct 2010 22:54:26 +0100 Subject: [PATCH 37/40] Added missing strings to swedish translation --- config/locales/devise/devise.sv.yml | 24 +++++++-- config/locales/diaspora/sv.yml | 82 +++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 20 deletions(-) diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index 0366d0c49..419d90deb 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -8,6 +8,7 @@ sv: errors: messages: not_found: "kan ej hitta" + already_confirmed: "är redan bekräftad" not_locked: "var ej låst" devise: @@ -15,11 +16,16 @@ sv: unauthenticated: 'Du måste logga in innan du kan fortsätta.' unconfirmed: 'Du måste verifiera ditt konto innan du kan fortsätta.' locked: 'Ditt konto är låst.' - invalid: 'Felaktig användare eller lösenord.' + invalid: 'Felaktigt användarnamn eller lösenord.' invalid_token: 'Ogiltig identifiering.' timeout: 'Din session är avslutad, var vänlig logga in igen.' inactive: 'Ditt konto är inte aktiverat.' sessions: + new: + login: 'Logga in' + username: 'Användarnamn' + password: 'Lösenord' + sign_in: 'Logga in' signed_in: 'Inloggning ok.' signed_out: 'Utloggning ok.' passwords: @@ -40,6 +46,16 @@ sv: invitation_token_invalid: 'Denna inbjudan är ej giltig!' updated: 'Ditt lösenord är nu inställt och du är inloggad.' mailer: - confirmation_instructions: 'Instruktioner för att verifiera ditt konto.' - reset_password_instructions: 'Instruktioner för att återställa ditt lösenord.' - unlock_instructions: 'Instruktioner för att låsa upp ditt konto.' + confirmation_instructions: + subject: 'Instruktioner för att verifiera ditt konto.' + reset_password_instructions: + subject: 'Instruktioner för att återställa ditt lösenord.' + unlock_instructions: + subject: 'Instruktioner för att låsa upp ditt konto.' + invitation: + subject: 'En vän vill att du ska gå med i Diaspora!' + shared: + links: + sign_in: 'Logga in' + sign_up: 'Registrera dig' + forgot_your_password: 'Glömt ditt lösenord?' diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 968a3cafa..d5b18e6fa 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -27,6 +27,8 @@ sv: models: user: attributes: + person: + invalid: "är ogiltigt" username: taken: "är redan taget" email: @@ -35,7 +37,6 @@ sv: attributes: diaspora_handle: taken: "är redan taget" - hello: "Hej världen!" application: helper: @@ -54,7 +55,10 @@ sv: people_on_pod_are_aware_of: " personer på denna plats är medvetna om att" layouts: application: + view_profile: "visa profil" edit_profile: "ändra profil" + account_settings: "kontoinstallningar" + search: "Search" logout: "logga ut" shared: aspect_nav: @@ -81,8 +85,10 @@ sv: updated: "uppdaterad" by: "av" edit: + album_name: "Namn på fotoalbum" editing: "Ändrar" updated: "uppdaterad" + update_album: "Uppdatera fotoalbum" are_you_sure: "Är du säker?" delete_album: "Ta bort fotoalbum" cancel: "Avbryt" @@ -117,6 +123,7 @@ sv: ignore_remove: "Ignorera/Ta bort" new_aspect: add_a_new_aspect: "Lägg till ny sida" + name: "Namn" create: "Skapa" create: success: "Klicka på plustecknet till höger för att välja vilka som kan se din nya sida." @@ -137,19 +144,26 @@ sv: users: edit: editing_profile: "Ändrar profil" - profile: + invite_friends: "Bjud in en vän" + are_you_sure: "Är du säker?" + export_data: "Exportera data" + close_account: "Stäng kontot" + change_language: "Ändra språk" + change_password: "Ändra lösenord" + new_password: "Nytt lösenord" + password_confirmation: "Bekräfta lösenord" + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" cancel: "Avbryt" - update_profile: "Uppdatera Profil" - home: "Hem" - diaspora_username: "Diaspora-användarnamn:" - info: "Info" - picture: "Profilbild" - editing_profile: "Ändrar profil" - albums: "Album" - you_dont_have_any_photos: "Du har inga foton! Gå till" - page_to_upload_some: "sidan för att ladda upp några." - or: "eller" destroy: "Ditt konto är nu stängt." + getting_started: + 'step_1': + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" comments: comment: ago: "sedan" @@ -189,6 +203,13 @@ sv: registrations: new: sign_up: "Registrera dig" + sign_up_for_diaspora: "Gå med i Diaspora" + upload_existing_account: "Ladda upp ett befintligt Diaspora-konto" + upload: "Ladda upp" + username: "Användarnamn" + email: "E-post address" + password: "Lösenord" + password_confirmation: "Bekräfta lösenord" create: success: "Du har nu gått med i Diaspora!" invitations: @@ -232,10 +253,6 @@ sv: new: new_person: "Ny person" back_to_list: "Tillbaka till listan" - edit: - cancel: "Avbryt" - or: "eller" - update_profile: "Uppdatera profil" show: last_seen: "senast sedd: %{how_long_ago}" friends_since: "vänner sedan: %{how_long_ago}" @@ -243,12 +260,39 @@ sv: are_you_sure: "Är du säker?" remove_friend: "ta bort vän" no_posts: "ingenting att visa!" + add_friend: "lägg till en vän" + edit: + settings: "Inställningar" + your_profile: "Din profil" + your_name: "Ditt namn" + first_name: "Förnamn" + last_name: "Efternamn" + your_gender: "Ditt kön" + your_birthday: "Din födelsedag" + your_bio: "Din biografi" + fill_me_out: "Fyll i mig" + your_photo: "Ditt foto" + profile: "Profil" + account: "Konto" + services: "Tjänster" + cancel: "Avbryt" + update_profile: "Uppdatera profil" + home: "Hem" + diaspora_username: "Användarnamn:" + info: "Info" + picture: "Foto" + editing_profile: "Ändrar profil" + albums: "Fotoalbum" + you_dont_have_any_photos: "Du har inga foton! Gå till" + page_to_upload_some: "sidan för att ladda upp några." + or: "eller" requests: new_request: add_a_new_friend_to: "Lägg till en vän till" enter_a_diaspora_username: "Ange ett användarnamn:" your_diaspora_username_is: "Din Diaspora-adress är: %{diaspora_handle}" friends_username: "Vännens Diaspora-adress" + create_request: "Skapa förfrågan" destroy: success: "Ni är nu vänner." error: "Var god välj en aspekt!" @@ -261,6 +305,12 @@ sv: already_friends: "Du är redan vän med %{destination_url}!" success: "En vänförfrågan har skickats till %{destination_url}." horribly_wrong: "Nu gick något rejält fel här." + services: + index: + settings: "Inställningar" + profile: "Profil" + account: "Konto" + services: "Tjänster" # The following is from the rails-i18n project at http://github.com/svenfuchs/rails-i18n From be4f33bf67849d9a3ae09387182d5e5303727cbe Mon Sep 17 00:00:00 2001 From: Gabriel Gilder Date: Thu, 28 Oct 2010 20:57:18 -0700 Subject: [PATCH 38/40] redirecting to :back instead of manage page on failed aspect creation +spec --- pkg/ubuntu/dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ubuntu/dist b/pkg/ubuntu/dist index 2fb4d8549..378798d00 120000 --- a/pkg/ubuntu/dist +++ b/pkg/ubuntu/dist @@ -1 +1 @@ -../source/dist/ \ No newline at end of file +../source/dist \ No newline at end of file From 2c8f6c27ba86819fa7b12880ec9401ddeb8edef6 Mon Sep 17 00:00:00 2001 From: Himanshu Chhetri Date: Fri, 29 Oct 2010 20:31:45 -0700 Subject: [PATCH 39/40] Use FileUtils for all file operations. Also uses Kernel.system to execute shell commands in a secure fashion. --- pkg/ubuntu/dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ubuntu/dist b/pkg/ubuntu/dist index 378798d00..2fb4d8549 120000 --- a/pkg/ubuntu/dist +++ b/pkg/ubuntu/dist @@ -1 +1 @@ -../source/dist \ No newline at end of file +../source/dist/ \ No newline at end of file From bf4f402c309737deede37ba749ca0f64206c4101 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 1 Nov 2010 15:43:53 +0100 Subject: [PATCH 40/40] pkg bugfixes --- pkg/bootstrap-fedora-diaspora.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/bootstrap-fedora-diaspora.sh b/pkg/bootstrap-fedora-diaspora.sh index a8a7c2f41..8230b01fa 100755 --- a/pkg/bootstrap-fedora-diaspora.sh +++ b/pkg/bootstrap-fedora-diaspora.sh @@ -33,10 +33,10 @@ test $UID = "0" || { echo Error: "this is not a diaspora base directory" exit 3 } -yum install -y git bison svn sqlite-devel gcc-c++ patch \ +yum install -y git bison sqlite-devel gcc-c++ patch \ readline-devel zlib-devel libyaml-devel libffi-devel \ - ImageMagick rubygems libxslt-devel libxml2-devel \ - openssl-devel mongodb-server wget openssh-clients \ + ImageMagick libxslt-devel libxml2-devel \ + openssl-devel mongodb-server wget \ make autoconf automake getent group diaspora >/dev/null || groupadd diaspora @@ -54,17 +54,13 @@ mkdir $home/diaspora cp -ar * $home/diaspora chown -R diaspora $home/diaspora +service mongod start + su - diaspora << EOF #set -x cd diaspora -#Configure diaspora -cp config/app_config.yml.example config/app_config.yml -source source/funcs.sh -init_appconfig config/app_config.yml "$DIASPORA_HOSTNAME" - - [ -e "\$HOME/.rvm/scripts/rvm" ] || { echo '#### Installing rvm ####' wget http://rvm.beginrescueend.com/releases/rvm-install-head @@ -98,6 +94,12 @@ fi bundle install +#Configure diaspora +cp config/app_config.yml.example config/app_config.yml +source pkg/source/funcs.sh +init_appconfig config/app_config.yml "$DIASPORA_HOSTNAME" + + echo "Setting up DB..." if bundle exec rake db:seed:dev ; then cat <<- EOM