From dd1a488be17b89768fd9c940dfafe882409a2fb7 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Fri, 8 Oct 2010 03:00:36 +0200 Subject: [PATCH 1/3] Bringing in some very old stuff lost in patch mgmmt. --- pkg/fedora/.gitignore | 2 + pkg/fedora/Gemfile.lock.patch | 13 ---- pkg/fedora/README.md | 60 +++++++++++++--- pkg/fedora/SOURCES | 4 -- pkg/fedora/add-bundle.patch | 11 +++ pkg/fedora/diaspora-bundle.spec | 32 ++++++--- pkg/fedora/diaspora-reset | 11 +++ pkg/fedora/diaspora-setup | 28 ++++---- pkg/fedora/diaspora.spec | 62 +++++++++++------ pkg/fedora/make-dist.sh | 39 ++++------- pkg/fedora/perm-fix.patch | 120 -------------------------------- pkg/fedora/source-fix.patch | 21 ------ 12 files changed, 166 insertions(+), 237 deletions(-) create mode 100644 pkg/fedora/.gitignore delete mode 100644 pkg/fedora/Gemfile.lock.patch create mode 100644 pkg/fedora/add-bundle.patch create mode 100755 pkg/fedora/diaspora-reset delete mode 100644 pkg/fedora/perm-fix.patch delete mode 100644 pkg/fedora/source-fix.patch diff --git a/pkg/fedora/.gitignore b/pkg/fedora/.gitignore new file mode 100644 index 000000000..3fab5f9c0 --- /dev/null +++ b/pkg/fedora/.gitignore @@ -0,0 +1,2 @@ +TODO +dist diff --git a/pkg/fedora/Gemfile.lock.patch b/pkg/fedora/Gemfile.lock.patch deleted file mode 100644 index 7b96c043e..000000000 --- a/pkg/fedora/Gemfile.lock.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Gemfile.lock b/Gemfile.lock -index 8534f58..44d386e 100644 ---- a/Gemfile.lock -+++ b/Gemfile.lock -@@ -258,7 +258,7 @@ DEPENDENCIES - autotest - bson (= 1.0.7) - bson_ext (= 1.0.7) -- bundler (= 1.0.0) -+ bundler (>= 1.0.0) - capybara (~> 0.3.9) - carrierwave! - cucumber-rails (= 0.3.2) diff --git a/pkg/fedora/README.md b/pkg/fedora/README.md index d5bd23fe9..96c9c47d9 100644 --- a/pkg/fedora/README.md +++ b/pkg/fedora/README.md @@ -5,13 +5,15 @@ Creates RPM packages from diaspora git repository. An alternative to the capistrano system, providing classic, binary RPM packages for deployment on Fedora 13. + #### Synopsis: *Prerequisites*: ruby-1.8, rubygem and other packages as described in http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora +or http://github.com/diaspora/diaspora/wiki/Installing-on-CentOS-Fedora Create source tarballs like dist/diaspora-0.0-1010041233_fade4231.tar.gz -and dist/diaspora-bundle-0.0-1010041233_fade4231.tar.gz +and dist/diaspora-bundle-0.0-1010041233_fade4231.tar.gz: % ./make-dist.sh source % ./make-dist.sh bundle @@ -22,7 +24,7 @@ Build rpms: rpmbuild -ba dist/diaspora.spec rpmbuild -ba dist/diaspora-bundle.spec -Install +Install (as root): rpm -U ~/rmpbuild/rpms/i686/diaspora-bundle-0.0-1.1010042345_4343fade43.fc13.i686 rpm -U ~/rmpbuild/rpms/noarch/diaspora-0.0-1.1010042345_4343fade43.fc13.noarch @@ -32,7 +34,7 @@ Initiate (as root). Start development server: sudo su - diaspora - cd master + cd /usr/share/diaspora/master ./script/server See http://github.com/diaspora/diaspora/wiki/Using-apache for @@ -46,26 +48,41 @@ apache/passenger setup. After configuration, start with: Routines uses last available version from master branch at github. The version contains a time stamp and an abbreviated git commit id. If listed in filename order, like ls does, latest version will be the last one. +Using -c, a specific commit can be used for source build. *make-dist links* creates links also for all files listed in SOURCES. -Typically, this is patches and secondary sources. +Typically, this is secondary sources. *make-dist.sh sources* +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 source to reference +The spec-files in dist/ are patched by ./make-dist.sh source 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 source. +in this directory, changes in dist/ are lost when doing ./make-dist source. + +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. rpmlint shows many errors, most of which related to that the server won't start if the .git directories are not included. Needs investigation. This has been confirmed to start up and provide basic functionality both using -the thin webserver and apache passenger. +the thin webserver and apache passenger, and on 32/64 bit systems. + +#### Bugs + +As of now, diaspora fails if it not owns all file under /usr/share/diaspora. +I guess this means diaspora writes some stuff somewhere. In the long run, +this should be located and symlinked to /var,leaving the rest of the files +owned by root. FTM, all files in /usr/share/diaspore are owned by +diaspora + #### Implementation - -'make_dist.sh source' script checks out latest version of diaspora into the +'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. @@ -85,3 +102,28 @@ This is more or less as mandated by LSB and Fedora packaging rules. /usr/share/diaspora/master/public/uploads -> /var/lib/diaspora/uploads /usr/share/diaspora/master/log -> /var/log/diaspora /usr/share/diaspora/master/vendor/bundle -> /usr/lib/diaspora-bundle/master/vendor/bundle + + +#### Discussion + +For better or worse, this installation differs from the procedure outlined in the +original README.md: + +- All configuration is done in /usr/share/diaspore. No global ur user installed bundles + are involved. Easier to maintain, but a mess if there should be parallel + installations. + +- Service is run under it's own uid, not root or an ordinary user account. + +- Using the pre-packaged mongod server means that the DB has reasonable permissions, + not 777. + +- Splitting in two packages makes sense IMHO. The bundle is not changed that often, + but is quite bug: ~18M without test packages (the default) or ~55M with test + packages. The application is just ~7.5M, and is fast to deploy even with these + tools (yes, I know, capistrano is much faster...) + +- Many, roughly 50% of the packages in the bundle are already packaged for Fedora + i. e., they could be removed from the bundle and added as dependencies instead. + This is likely to make things more stable in the long run. + diaspora.spec has a list. diff --git a/pkg/fedora/SOURCES b/pkg/fedora/SOURCES index 4b487fdf5..4f85fc9c7 100644 --- a/pkg/fedora/SOURCES +++ b/pkg/fedora/SOURCES @@ -1,7 +1,3 @@ # These files will be linked to %_sourcedir by 'make-dist links' -.bundle diaspora-setup diaspora-ws -Gemfile.patch -perm-fix.patch -source-fix.patch diff --git a/pkg/fedora/add-bundle.patch b/pkg/fedora/add-bundle.patch new file mode 100644 index 000000000..24c0f6035 --- /dev/null +++ b/pkg/fedora/add-bundle.patch @@ -0,0 +1,11 @@ +diff --git a/.bundle/config b/.bundle/config +new file mode 100644 +index 0000000..1c3e2ce +--- /dev/null ++++ b/.bundle/config +@@ -0,0 +1,5 @@ ++--- ++BUNDLE_FROZEN: "1" ++BUNDLE_DISABLE_SHARED_GEMS: "1" ++BUNDLE_WITHOUT: test:rdoc ++BUNDLE_PATH: vendor/bundle diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index 87656f110..27abb2b45 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -13,6 +13,8 @@ URL: http://www.joindiaspora.com/ Vendor: joindiaspora.com Source: %{name}-%{version}-%{git_release}.tar.gz Prefix: %{_prefix} + +Requires(pre): shadow-utils BuildRequires: git Requires: ruby(abi) = 1.8 @@ -28,8 +30,6 @@ Requires: %{name} = %{version} %description devel Source file usede to compile native libraries in diaspora-bundle. - - %prep %setup -q -n %{name}-%{version}-%{git_release} @@ -60,7 +60,7 @@ pushd bundle/ruby/1.8/ sed -i -e '/^#!/d' $f chmod 0644 $f done > /dev/null 2>&1 - find . -type f -print0 | + find . -perm /u+x -type f -print0 | xargs --null sed -i 's|^#!/usr/local/bin/ruby|#!/usr/bin/ruby|' chmod 755 gems/thin-1.2.7/example/async_chat.ru @@ -70,13 +70,12 @@ pushd bundle/ruby/1.8/ chmod 644 gems/mini_magick-2.1/MIT-LICENSE chmod 755 gems/thin-1.2.7/lib/thin/controllers/service.sh.erb chmod 644 gems/treetop-1.4.8/spec/compiler/test_grammar.tt - popd - %build pushd bundle/ruby/1.8/ + # In repo (2.2.4) test -d gems/gherkin-*/ext && { pushd gems/gherkin-*/ext # Recompile all shared libraries using -O2 optimalization flagcd @@ -104,6 +103,7 @@ pushd bundle/ruby/1.8/ popd } + # In repo as 1.2.5, rawhide 1.2.7 pushd gems/thin-1.2.7/lib rm thin_parser.so ln -s ../ext/thin_parser/thin_parser.so . @@ -114,6 +114,7 @@ pushd bundle/ruby/1.8/ ln -s ../cbson/cbson.so . popd + # In repo (0.10.4) pushd gems/ruby-debug-base-0.10.3/lib rm ruby_debug.so ln -s ../ext/ruby_debug.so . @@ -127,6 +128,7 @@ pushd bundle/ruby/1.8/ ln -s ../ext/fastfilereader/fastfilereaderext.so . popd + # In repo pushd gems/bcrypt-ruby-2.1.2/lib rm bcrypt_ext.so ln -s ../ext/mri/bcrypt_ext.so . @@ -152,13 +154,21 @@ pushd bundle/ruby/1.8/ popd pushd bundler/gems/em-http-request-6f66010cda90/lib - rm em_buffer.so + rm em_buffer.so ln -s ../ext/buffer/em_buffer.so . rm http11_client.so ln -s ../ext/http11_client/http11_client.so . popd popd +%pre +getent group diaspora >/dev/null || groupadd -r diaspora +getent passwd diaspora >/dev/null || \ + useradd -r -g apache \ + -md /var/lib/diaspora -s /sbin/nologin \ + -c "Diaspora daemon" diaspora +exit 0 + %install find . -name .git | xargs rm -rf @@ -186,10 +196,12 @@ mkdir -p $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle/master/vendor cp -ar bundle $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle/master/vendor find %{buildroot}/%{_libdir}/diaspora-bundle \ -type d -fprintf dirs '%%%dir "%%p"\n' -find -L %{buildroot}/%{_libdir}/diaspora-bundle \ - -regextype posix-awk -type f -not -regex '.*[.]c$|.*[.]h$|.*[.]cpp$' -fprintf files '"%%p"\n' +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 \ - -type f -regex '.*[.]c$|.*[.]h$|.*[.]cpp$' -fprintf dev-files '"%%p"\n' + -type f -regex '.*[.]c$|.*[.]h$|.*[.]cpp$|.*Makefile$' \ + -fprintf dev-files '"%%p"\n' sed -i -e 's|%{buildroot}||' -e 's|//|/|' files dev-files dirs cat files >> dirs && cp dirs files @@ -197,7 +209,7 @@ cat files >> dirs && cp dirs files [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT %files -f files -%defattr(-, root, root, 0755) +%defattr(-, diaspora, diaspora, 0755) %doc COPYRIGHT Gemfile AUTHORS GNU-AGPL-3.0 %files -f dev-files devel diff --git a/pkg/fedora/diaspora-reset b/pkg/fedora/diaspora-reset new file mode 100755 index 000000000..f9315b37d --- /dev/null +++ b/pkg/fedora/diaspora-reset @@ -0,0 +1,11 @@ +#!/bin/sh + + +set -x +service mongod stop +service diaspora-ws stop +rm -rf /var/lib/mongod/* +cp /usr/share/diaspora/master/config/app_config.yml.example \ + /usr/share/diaspora/master/config/app_config.yml +service mongod start + diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index 0df7ceb2f..e92a2610e 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -12,19 +12,26 @@ test $UID = "0" || { exit 2 } +# Note: this line is patched by installation scripts. cd /usr/share/diaspora/master +/sbin/service mongod start || : + +test -e config/app_config.yml || + cp config/app_config.yml.example config/app_config.yml + if rake db:seed:dev; then echo "Database config OK, new user tom/evankort in place" else cat <<- EOF - Database config failed. You might want to remove all db files with - rm -rf /var/lib/mongodb/* and/or resetting the config file by - cp config/app_config.yml.example config/app_config.yml before - making a new try. - EOF - exit 1 + Database config failed. You might want to remove all db files with + 'rm -rf /var/lib/mongodb/*' and/or resetting 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., using '/sbin/service mongod status'. + EOF + exit 1 fi # %attr(0777, diaspora, diaspora) doesn't work in specfile due to umask 022. @@ -35,17 +42,12 @@ while : ; do echo "Current hostname is \"$hostname\"" echo -n "Enter new hostname [$hostname] :" read new_hostname garbage - echo -n "Use hostname \"$new_hostname\" (Yes/No) [Yes]? :" + echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :" read yesno garbage - test ${yesno:0:1} = 'y' -o ${yesno:0:1} = 'Y' -o -z "$yesno" && { + test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && { sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml && echo "config/app_config.yml updated." break } done - - - - - diff --git a/pkg/fedora/diaspora.spec b/pkg/fedora/diaspora.spec index 318ab9523..6796f4e11 100644 --- a/pkg/fedora/diaspora.spec +++ b/pkg/fedora/diaspora.spec @@ -14,28 +14,42 @@ Source1: diaspora-ws Source2: diaspora-setup BuildArch: noarch -# See http://github.com/diaspora/diaspora/issues/issue/393 -Patch0: source-fix.patch - BuildRequires: git -Requires(pre): shadow-utils Requires: mongodb-server Requires: ruby(abi) = 1.8 Requires: diaspora-bundle = %{version} +# rubygem-term-ansicolor in repo (1.0.5) +# rubygem-abstract: in repo (1.0) +# rubygem-actionpack in repo (2.3.5), rawhide (2.3.8) +# rubygem-builder in repo (2.1.2) +# rubygem-columnize in repo (0.3.1) +# rubygem-crack in repo (0.1.8) +# rubygem-cucumber in repo (0.9.0) +# diff-lcs in rep (1.1.2) +# eventmachine in repo (0.12.10) +# gherkin in repo (2.2.4) +# rubygem-json in repo (1.1.9), rawhide(1.4.6) +# rubygem-linecache in repo (0.43) +# rubygem-mime-types in repo (1.16) +# rubygem-mocha in repo (0.9.8) +# rubygem-net-ssh in repo (2.0.23) +# rubygem-nokogiri in repo (1.4.3.1) +# rubygem-rake in repo (0.8.7) +# rubygem-ruby-debug in repo (0.10.4) +# rubygem-ruby-debug-base in repo (0.10.4) +# rubygem-term-ansicolor in repo (1.0.5) +# rubygem-thin in repo(1.2.5), rawhide(1.2.7) +# rubygem-uuidtools in repo(2.1.1) + %description A privacy aware, personally controlled, do-it-all and open source social network server. %prep %setup -q -n %{name}-%{version}-%{git_release} -pushd master -%patch0 -p1 -# See: http://github.com/diaspora/diaspora/issues/issue/392 -git apply %{_sourcedir}/perm-fix.patch -popd find . -perm /u+x -type f -exec \ sed -i 's|^#!/usr/local/bin/ruby|#!/usr/bin/ruby|' {} \; > /dev/null @@ -46,14 +60,6 @@ pushd master tar cf public/source.tar --exclude='source.tar' -X .gitignore * popd -%pre -getent group diaspora >/dev/null || groupadd -r diaspora -getent passwd diaspora >/dev/null || \ - useradd -r -g apache \ - -md /usr/share/diaspora -s /sbin/nologin \ - -c "Diaspora daemon" diaspora -exit 0 - %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora @@ -68,10 +74,19 @@ mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d cp diaspora.logconf $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/diaspora mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora cp -ar master $RPM_BUILD_ROOT/%{_datadir}/diaspora -cp master/.gitignore $RPM_BUILD_ROOT/%{_datadir}/diaspora/master +cp -ar master/.gitignore master/.bundle $RPM_BUILD_ROOT/%{_datadir}/diaspora/master cp diaspora-setup $RPM_BUILD_ROOT/%{_datadir}/diaspora mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/uploads +find $RPM_BUILD_ROOT/%{_datadir}/diaspora -type d -fprintf dirs '%%%dir "%%p"\n' +find -L $RPM_BUILD_ROOT/%{_datadir}/diaspora -type f -fprintf files '"%%p"\n' +cat files >> dirs && mv -f dirs files +sed -i -e '\|.*/master/config.ru"$|d' \ + -e '\|.*/master/config/environment.rb"$|d' \ + -e 's|%{buildroot}||' -e 's|//|/|' -e '/""/d' \ + files + + %post rm -f %{_datadir}/diaspora/master/vendor/bundle rm -f %{_datadir}/diaspora/master/log @@ -83,7 +98,7 @@ ln -s %{_libdir}/diaspora-bundle/master/vendor/bundle \ %{_datadir}/diaspora/master/vendor || : ln -s %{_localstatedir}/lib/diaspora/uploads \ %{_datadir}/diaspora/master/public/uploads || : -/sbin/chkconfig --add diaspora-ws +/sbin/chkconfig --add diaspora-ws || : %preun if [ $1 -eq 0 ] ; then @@ -94,10 +109,11 @@ fi %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT -%files -%defattr(-, root, root, 0755) +%files -f files +%defattr(-, diaspora, diaspora, 0755) %doc README.md GNU-AGPL-3.0 -%attr(0555, diaspora, diaspora) %{_datadir}/diaspora +%attr(-, diaspora, diaspora) %{_datadir}/diaspora/master/config.ru +%attr(-, diaspora, diaspora) %{_datadir}/diaspora/master/config/environment.rb %attr(-, diaspora, diaspora) %{_localstatedir}/log/diaspora %attr(-, diaspora, diaspora) %{_localstatedir}/lib/diaspora/uploads %config(noreplace) %{_sysconfdir}/logrotate.d/diaspora @@ -105,4 +121,4 @@ fi %changelog * Fri Sep 24 2010 Alec Leamas 1.1009280542_859ec2d - - Initial attempt to create a spec file + - Initial attempt to create a spec fi+le diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index 6d0795618..5e9b9d869 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -52,13 +52,12 @@ function git_id function fix_alphatag() # Patch version on top comment first id line: -# Uses %define git_release to get release. +# Usage: fix_alphatag #* Fri Sep 24 2010 name surname 1.20100925_faf234320 { dist=$(rpm --eval %dist) - awk -v dist="$dist" -v version="$2" \ + awk -v dist="$dist" -v version="$2" -v release="$3" \ ' BEGIN { done = 0 } - /%define/ { if ($2 = "git_release") release = $3 } /^[*]/ { if (done) print else @@ -96,7 +95,7 @@ function patch() sed -e "/^%define/s|HEAD|$2|" \ -e '/^Version:/s|.*|Version: '$1'|' \ dist/diaspora.spec - fix_alphatag dist/diaspora.spec $1 + fix_alphatag dist/diaspora.spec $1 $2 #mkdir dist/diaspora/tmp || : bundle_id=$(git_id dist/diaspora/Gemfile) fix_bundle_deps dist/diaspora.spec $1 "1.$bundle_id.fc13" @@ -121,7 +120,11 @@ function checkout() 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 ) + } cd diaspora; git fetch --quiet upstream @@ -145,14 +148,13 @@ function make_dist cp diaspora-ws diaspora-setup diaspora.logconf dist/${RELEASE_DIR} cd dist mkdir ${RELEASE_DIR}/master - cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master - cp -r ../.bundle ${RELEASE_DIR}/master + cp -ar diaspora/* diaspora/.git* diaspora/.bundle ${RELEASE_DIR}/master mv ${RELEASE_DIR}/master/diaspora.spec ${RELEASE_DIR} + ( cd ${RELEASE_DIR}; find . -name .gitkeep -delete) tar czf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR} && rm -rf ${RELEASE_DIR} cd .. - bundle_id=$(git_id dist/diaspora/Gemfile) echo "Source: dist/${RELEASE_DIR}.tar.gz" - echo "Required bundle: $bundle_id" + echo "Required bundle: $(git_id dist/diaspora/Gemfile)" echo "Source specfile: dist/diaspora.spec" echo "Bundle specfile: dist/diaspora-bundle.spec" } @@ -170,20 +172,11 @@ function make_bundle() pushd diaspora > /dev/null test -e ../../Gemfile.lock.patch && git apply ../../Gemfile.lock.patch > /dev/null 2>&1 - rm -rf devise.tmp - git clone http://github.com/BadMinus/devise.git devise.tmp - ( cd devise.tmp; gem build devise.gemspec) - gem install --install-dir "../$bundle_name/bundle/ruby/1.8" \ - --no-rdoc --no-ri \ - --ignore-dependencies \ - devise.tmp/devise-1.1.rc1.gem && - rm -rf devise.tmp - bundle install --deployment \ --path="../$bundle_name/bundle" \ --without=test rdoc - cp AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT "../$bundle_name" + cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT "../$bundle_name" popd tar czf $bundle_name.tar.gz $bundle_name } @@ -201,10 +194,8 @@ function make_links() } echo "Linking sources to $dest" - src_commit="$1" - test -z "$src_commit" && { - src_commit=$(checkout) - } + src_commit="${1:-$( checkout)}" + src="dist/diaspora-$VERSION-$src_commit.tar.gz" ln -sf $PWD/$src $dest @@ -212,7 +203,7 @@ function make_links() bundle="dist/diaspora-bundle-$VERSION-$bundle_commit.tar.gz" ln -sf $PWD/$bundle $dest - for file in $( egrep -v '^#' SOURCES); do + for file in $( grep -v '^#' SOURCES); do ln -sf $PWD/$file $dest/$file done @@ -224,7 +215,7 @@ function usage() { cat <<- EOF - Usage: make_dist [-c commit] + Usage: make-dist [-c commit] -c Use a given commit, defaults to last checked in. dist Build a diaspora application tarball. diff --git a/pkg/fedora/perm-fix.patch b/pkg/fedora/perm-fix.patch deleted file mode 100644 index b6fabed52..000000000 --- a/pkg/fedora/perm-fix.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff --git a/public/javascripts/fancybox/blank.gif b/public/javascripts/fancybox/blank.gif -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_close.png b/public/javascripts/fancybox/fancy_close.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_loading.png b/public/javascripts/fancybox/fancy_loading.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_nav_left.png b/public/javascripts/fancybox/fancy_nav_left.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_nav_right.png b/public/javascripts/fancybox/fancy_nav_right.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_e.png b/public/javascripts/fancybox/fancy_shadow_e.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_n.png b/public/javascripts/fancybox/fancy_shadow_n.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_ne.png b/public/javascripts/fancybox/fancy_shadow_ne.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_nw.png b/public/javascripts/fancybox/fancy_shadow_nw.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_s.png b/public/javascripts/fancybox/fancy_shadow_s.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_se.png b/public/javascripts/fancybox/fancy_shadow_se.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_sw.png b/public/javascripts/fancybox/fancy_shadow_sw.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_shadow_w.png b/public/javascripts/fancybox/fancy_shadow_w.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_title_left.png b/public/javascripts/fancybox/fancy_title_left.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_title_main.png b/public/javascripts/fancybox/fancy_title_main.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_title_over.png b/public/javascripts/fancybox/fancy_title_over.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancy_title_right.png b/public/javascripts/fancybox/fancy_title_right.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancybox-x.png b/public/javascripts/fancybox/fancybox-x.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancybox-y.png b/public/javascripts/fancybox/fancybox-y.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/fancybox.png b/public/javascripts/fancybox/fancybox.png -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/jquery.easing-1.3.pack.js b/public/javascripts/fancybox/jquery.easing-1.3.pack.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.css b/public/javascripts/fancybox/jquery.fancybox-1.3.1.css -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.js b/public/javascripts/fancybox/jquery.fancybox-1.3.1.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js b/public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js b/public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/fileuploader.js b/public/javascripts/fileuploader.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/jquery.cycle/jquery.cycle.lite.min.js b/public/javascripts/jquery.cycle/jquery.cycle.lite.min.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/jquery.infieldlabel.js b/public/javascripts/jquery.infieldlabel.js -old mode 100755 -new mode 100644 -diff --git a/public/javascripts/web_socket.js b/public/javascripts/web_socket.js -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/blueprint/src/grid.css b/public/stylesheets/blueprint/src/grid.css -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/blueprint/src/print.css b/public/stylesheets/blueprint/src/print.css -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/blueprint/src/reset.css b/public/stylesheets/blueprint/src/reset.css -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.svg b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.svg -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/demo.html b/public/stylesheets/brandongrotesque_light/demo.html -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/brandongrotesque_light/stylesheet.css b/public/stylesheets/brandongrotesque_light/stylesheet.css -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/fileuploader.css b/public/stylesheets/fileuploader.css -old mode 100755 -new mode 100644 -diff --git a/public/stylesheets/loading.gif b/public/stylesheets/loading.gif -old mode 100755 -new mode 100644 diff --git a/pkg/fedora/source-fix.patch b/pkg/fedora/source-fix.patch deleted file mode 100644 index 55dffae43..000000000 --- a/pkg/fedora/source-fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/script/server b/script/server -index da43895..c5357a3 100755 ---- a/script/server -+++ b/script/server -@@ -7,9 +7,13 @@ then - echo "Mongod not started" - else - mkdir -p -v log/thin/ -- #force AGPL -- tar cf ../_source.tar -X .gitignore * -- mv ../_source.tar public/source.tar -+ #force AGPL -+ test -w public -a ! -e public/source.tar && -+ tar cf public/source.tar --exclude='source.tar' -X .gitignore * -+ test -e public/source.tar || { -+ echo "Can't find, or even create, public/source.tar. Giving up" -+ exit 2 -+ } - bundle exec ruby ./script/websocket_server.rb& - bundle exec thin start $@ - fi From 75aadc5c57da23dfebe16bc3266cfcf1c1ec5031 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 18:25:59 -0700 Subject: [PATCH 2/3] DG MS; cleaned up routes, killed all deprication warnings in everything. totally legit. --- config/initializers/_mongo.rb | 4 ++-- config/initializers/devise.rb | 1 - config/routes.rb | 22 +++++++--------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/config/initializers/_mongo.rb b/config/initializers/_mongo.rb index 41a2098c0..3f51d8765 100644 --- a/config/initializers/_mongo.rb +++ b/config/initializers/_mongo.rb @@ -4,8 +4,8 @@ ENV['MONGODB_URL'] = ENV['MONGOHQ_URL'] || URI::Generic.build(:scheme => 'mongodb', :host => APP_CONFIG['mongo_host'], :port => APP_CONFIG['mongo_port'], :path => "/diaspora-#{Rails.env}").to_s -MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGODB_URL']}} -MongoMapper.connect RAILS_ENV +MongoMapper.config = {::Rails.env => {'uri' => ENV['MONGODB_URL']}} +MongoMapper.connect ::Rails.env if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 620547cd5..b012b3f74 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -105,7 +105,6 @@ Devise.setup do |config| # scope, setting true below. # Note that devise does not generate default routes. You also have to # specify them in config/routes.rb - config.use_default_scope = true # Configure the default scope used by Devise. By default it's the first devise # role declared in your routes. diff --git a/config/routes.rb b/config/routes.rb index 2d043682d..5959f21bb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -34,24 +34,16 @@ Diaspora::Application.routes.draw do match 'set_backer_number', :to => "dev_utilities#set_backer_number" match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" - #routes for devise, not really sure you will need to mess with this in the future, lets put default, - #non mutable stuff in anohter file - #match 'login', :to => 'devise/sessions#new', :as => "new_user_session" - #match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" - #match 'signup', :to => 'registrations#new', :as => "new_user_registration" + #signup + match 'get_to_the_choppa', :to => redirect("/users/sign_up") - #match 'get_to_the_choppa', :to => redirect("/signup") #public routes - # - - match 'webfinger', :to => 'publics#webfinger' - match 'hcard/users/:id', :to => 'publics#hcard' - - match 'hub', :to => 'publics#hub' - + match 'webfinger', :to => 'publics#webfinger' + match 'hcard/users/:id', :to => 'publics#hcard' match '.well-known/host-meta',:to => 'publics#host_meta' - match 'receive/users/:id', :to => 'publics#receive' - match 'log', :to => "dev_utilities#log" + match 'receive/users/:id', :to => 'publics#receive' + match 'hub', :to => 'publics#hub' + match 'log', :to => "dev_utilities#log" #root root :to => 'aspects#index' From ed1cb5a0e7f44863227409d7580e2f100632c6cd Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 18:52:46 -0700 Subject: [PATCH 3/3] DG MS; moved change password to account page; fixed the styling on password inputs --- app/controllers/users_controller.rb | 14 +++++++----- app/views/albums/edit.html.haml | 2 +- app/views/users/_account.haml | 29 ++++++++++++++++++++++++ app/views/users/_profile.haml | 11 ++------- app/views/users/_services.haml | 1 + app/views/users/edit.html.haml | 4 +--- public/stylesheets/application.css | 6 +++-- public/stylesheets/sass/application.sass | 6 +++-- 8 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 app/views/users/_account.haml diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index df4519f65..e5239129b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -23,10 +23,6 @@ class UsersController < ApplicationController def update @user = current_user - data = clean_hash params[:user] - prep_image_url(data) - - params[:user].delete(:password) if params[:user][:password].blank? params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? @@ -36,10 +32,16 @@ class UsersController < ApplicationController else flash[:error] = "Password Change Failed" end + else + data = clean_hash params[:user] + prep_image_url(data) + if @user.update_profile data + flash[:notice] = "Profile updated" + else + flash[:error] = "Failed to update profile" + end end - - @user.update_profile data redirect_to edit_user_path(@user) end diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index 0f96bc1cd..4969227e4 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -19,7 +19,7 @@ - for photo in @album.photos .photo_edit_block= image_tag photo.url(:thumb_medium) - #submit_block + .submit_block = link_to t('.cancel'), root_path or = a.submit diff --git a/app/views/users/_account.haml b/app/views/users/_account.haml new file mode 100644 index 000000000..8bd19d72d --- /dev/null +++ b/app/views/users/_account.haml @@ -0,0 +1,29 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + +%h2 Account + +%h3 Change Password + += form_for @user do |f| + = f.error_messages + + %p + = f.label :password, "New Password" + = f.password_field :password + %p + = f.label :password_confirmation + = f.password_field :password_confirmation + + .submit_block + = link_to "Cancel", edit_user_path(current_user) + or + = f.submit 'Change password' + +%h3 Export Data + += link_to "download my xml", users_export_path, :class => "button" += link_to "download my photos", users_export_photos_path, :class => "button" + diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index 7f935972b..9b415a720 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -47,16 +47,9 @@ %p = p.label :last_name = p.text_field :last_name, :value => @profile.last_name - %p - = f.label :password - = f.password_field :password - %p - = f.label :password_confirmation - = f.password_field :password_confirmation - - #submit_block - = link_to t('.cancel'), root_path + .submit_block + = link_to t('.cancel'), edit_user_path(current_user) = t('.or') = f.submit t('.update_profile') diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index 07173ecd8..80cf33663 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -23,3 +23,4 @@ #content_bottom .back = link_to "⇧ home", root_path + diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 78076e789..80d426202 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -26,10 +26,8 @@ = render 'users/profile' #account.settings_pane - = link_to "download my xml", users_export_path, :class => "button" - = link_to "download my photos", users_export_photos_path, :class => "button" + = render 'users/account' #services.settings_pane = render 'users/services' - diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 39427a4f4..80d0dfe39 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -347,7 +347,9 @@ ul.comment_set { #debug_info h5 { color: #cccccc; } -input[type='text'], textarea { +input[type='text'], +input[type='password'], +textarea { font-family: "lucida grande", "lucida sans", "sans-serif"; font-size: 14px; padding: 0.3em; @@ -362,7 +364,7 @@ input[type='text'], textarea { -moz-box-shadow: 0 1px 2px white; -webkit-box-shadow: 0 1px 2px white; } -#submit_block { +.submit_block { text-align: right; font-size: 12px; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 83465d57e..e50888c9d 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -467,7 +467,9 @@ ul.comment_set :color #ccc -input[type='text'], textarea +input[type='text'], +input[type='password'], +textarea :font :family 'lucida grande', 'lucida sans', 'sans-serif' :size 14px @@ -485,7 +487,7 @@ input[type='text'], textarea :-moz-box-shadow 0 1px 2px #fff :-webkit-box-shadow 0 1px 2px #fff -#submit_block +.submit_block :text :align right :font