Merge branch 'master' of github.com:diaspora/diaspora into invites

This commit is contained in:
ilya 2010-10-07 19:25:42 -07:00
commit 9a34ca07c4
23 changed files with 225 additions and 278 deletions

View file

@ -23,10 +23,6 @@ class UsersController < ApplicationController
def update def update
@user = current_user @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) if params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].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 else
flash[:error] = "Password Change Failed" flash[:error] = "Password Change Failed"
end 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 end
@user.update_profile data
redirect_to edit_user_path(@user) redirect_to edit_user_path(@user)
end end

View file

@ -19,7 +19,7 @@
- for photo in @album.photos - for photo in @album.photos
.photo_edit_block= image_tag photo.url(:thumb_medium) .photo_edit_block= image_tag photo.url(:thumb_medium)
#submit_block .submit_block
= link_to t('.cancel'), root_path = link_to t('.cancel'), root_path
or or
= a.submit = a.submit

View file

@ -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"

View file

@ -47,16 +47,9 @@
%p %p
= p.label :last_name = p.label :last_name
= p.text_field :last_name, :value => @profile.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
#submit_block = link_to t('.cancel'), edit_user_path(current_user)
= link_to t('.cancel'), root_path
= t('.or') = t('.or')
= f.submit t('.update_profile') = f.submit t('.update_profile')

View file

@ -23,3 +23,4 @@
#content_bottom #content_bottom
.back .back
= link_to "⇧ home", root_path = link_to "⇧ home", root_path

View file

@ -26,10 +26,8 @@
= render 'users/profile' = render 'users/profile'
#account.settings_pane #account.settings_pane
= link_to "download my xml", users_export_path, :class => "button" = render 'users/account'
= link_to "download my photos", users_export_photos_path, :class => "button"
#services.settings_pane #services.settings_pane
= render 'users/services' = render 'users/services'

View file

@ -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 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.config = {::Rails.env => {'uri' => ENV['MONGODB_URL']}}
MongoMapper.connect RAILS_ENV MongoMapper.connect ::Rails.env
if defined?(PhusionPassenger) if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked| PhusionPassenger.on_event(:starting_worker_process) do |forked|

View file

@ -110,7 +110,6 @@ Devise.setup do |config|
# scope, setting true below. # scope, setting true below.
# Note that devise does not generate default routes. You also have to # Note that devise does not generate default routes. You also have to
# specify them in config/routes.rb # 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 # Configure the default scope used by Devise. By default it's the first devise
# role declared in your routes. # role declared in your routes.

View file

@ -35,24 +35,16 @@ Diaspora::Application.routes.draw do
match 'set_backer_number', :to => "dev_utilities#set_backer_number" match 'set_backer_number', :to => "dev_utilities#set_backer_number"
match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" 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, #signup
#non mutable stuff in anohter file match 'get_to_the_choppa', :to => redirect("/users/sign_up")
#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"
#match 'get_to_the_choppa', :to => redirect("/signup")
#public routes #public routes
# match 'webfinger', :to => 'publics#webfinger'
match 'hcard/users/:id', :to => 'publics#hcard'
match 'webfinger', :to => 'publics#webfinger'
match 'hcard/users/:id', :to => 'publics#hcard'
match 'hub', :to => 'publics#hub'
match '.well-known/host-meta',:to => 'publics#host_meta' match '.well-known/host-meta',:to => 'publics#host_meta'
match 'receive/users/:id', :to => 'publics#receive' match 'receive/users/:id', :to => 'publics#receive'
match 'log', :to => "dev_utilities#log" match 'hub', :to => 'publics#hub'
match 'log', :to => "dev_utilities#log"
#root #root
root :to => 'aspects#index' root :to => 'aspects#index'

2
pkg/fedora/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
TODO
dist

View file

@ -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)

View file

@ -5,13 +5,15 @@ Creates RPM packages from diaspora git repository.
An alternative to the capistrano system, providing classic, binary RPM An alternative to the capistrano system, providing classic, binary RPM
packages for deployment on Fedora 13. packages for deployment on Fedora 13.
#### Synopsis: #### Synopsis:
*Prerequisites*: ruby-1.8, rubygem and other packages as described in *Prerequisites*: ruby-1.8, rubygem and other packages as described in
http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora 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 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 source
% ./make-dist.sh bundle % ./make-dist.sh bundle
@ -22,7 +24,7 @@ Build rpms:
rpmbuild -ba dist/diaspora.spec rpmbuild -ba dist/diaspora.spec
rpmbuild -ba dist/diaspora-bundle.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/i686/diaspora-bundle-0.0-1.1010042345_4343fade43.fc13.i686
rpm -U ~/rmpbuild/rpms/noarch/diaspora-0.0-1.1010042345_4343fade43.fc13.noarch rpm -U ~/rmpbuild/rpms/noarch/diaspora-0.0-1.1010042345_4343fade43.fc13.noarch
@ -32,7 +34,7 @@ Initiate (as root).
Start development server: Start development server:
sudo sudo
su - diaspora su - diaspora
cd master cd /usr/share/diaspora/master
./script/server ./script/server
See http://github.com/diaspora/diaspora/wiki/Using-apache for 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 Routines uses last available version from master branch at github. The
version contains a time stamp and an abbreviated git commit id. If listed 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. 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. *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 correct versions of diaspora and diaspora-bundle. The diaspora-bundle
is only updated if Gemfile is updated, upgrading diaspora doesn't is only updated if Gemfile is updated, upgrading diaspora doesn't
always require a new diaspora-bundle. Editing spec files should be done 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 rpmlint shows many errors, most of which related to that the server
won't start if the .git directories are not included. Needs investigation. 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 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 #### 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. 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 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/public/uploads -> /var/lib/diaspora/uploads
/usr/share/diaspora/master/log -> /var/log/diaspora /usr/share/diaspora/master/log -> /var/log/diaspora
/usr/share/diaspora/master/vendor/bundle -> /usr/lib/diaspora-bundle/master/vendor/bundle /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.

View file

@ -1,7 +1,3 @@
# These files will be linked to %_sourcedir by 'make-dist links' # These files will be linked to %_sourcedir by 'make-dist links'
.bundle
diaspora-setup diaspora-setup
diaspora-ws diaspora-ws
Gemfile.patch
perm-fix.patch
source-fix.patch

View file

@ -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

View file

@ -13,6 +13,8 @@ URL: http://www.joindiaspora.com/
Vendor: joindiaspora.com Vendor: joindiaspora.com
Source: %{name}-%{version}-%{git_release}.tar.gz Source: %{name}-%{version}-%{git_release}.tar.gz
Prefix: %{_prefix} Prefix: %{_prefix}
Requires(pre): shadow-utils
BuildRequires: git BuildRequires: git
Requires: ruby(abi) = 1.8 Requires: ruby(abi) = 1.8
@ -28,8 +30,6 @@ Requires: %{name} = %{version}
%description devel %description devel
Source file usede to compile native libraries in diaspora-bundle. Source file usede to compile native libraries in diaspora-bundle.
%prep %prep
%setup -q -n %{name}-%{version}-%{git_release} %setup -q -n %{name}-%{version}-%{git_release}
@ -60,7 +60,7 @@ pushd bundle/ruby/1.8/
sed -i -e '/^#!/d' $f sed -i -e '/^#!/d' $f
chmod 0644 $f chmod 0644 $f
done > /dev/null 2>&1 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|' xargs --null sed -i 's|^#!/usr/local/bin/ruby|#!/usr/bin/ruby|'
chmod 755 gems/thin-1.2.7/example/async_chat.ru 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 644 gems/mini_magick-2.1/MIT-LICENSE
chmod 755 gems/thin-1.2.7/lib/thin/controllers/service.sh.erb 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 chmod 644 gems/treetop-1.4.8/spec/compiler/test_grammar.tt
popd popd
%build %build
pushd bundle/ruby/1.8/ pushd bundle/ruby/1.8/
# In repo (2.2.4)
test -d gems/gherkin-*/ext && { test -d gems/gherkin-*/ext && {
pushd gems/gherkin-*/ext pushd gems/gherkin-*/ext
# Recompile all shared libraries using -O2 optimalization flagcd # Recompile all shared libraries using -O2 optimalization flagcd
@ -104,6 +103,7 @@ pushd bundle/ruby/1.8/
popd popd
} }
# In repo as 1.2.5, rawhide 1.2.7
pushd gems/thin-1.2.7/lib pushd gems/thin-1.2.7/lib
rm thin_parser.so rm thin_parser.so
ln -s ../ext/thin_parser/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 . ln -s ../cbson/cbson.so .
popd popd
# In repo (0.10.4)
pushd gems/ruby-debug-base-0.10.3/lib pushd gems/ruby-debug-base-0.10.3/lib
rm ruby_debug.so rm ruby_debug.so
ln -s ../ext/ruby_debug.so . ln -s ../ext/ruby_debug.so .
@ -127,6 +128,7 @@ pushd bundle/ruby/1.8/
ln -s ../ext/fastfilereader/fastfilereaderext.so . ln -s ../ext/fastfilereader/fastfilereaderext.so .
popd popd
# In repo
pushd gems/bcrypt-ruby-2.1.2/lib pushd gems/bcrypt-ruby-2.1.2/lib
rm bcrypt_ext.so rm bcrypt_ext.so
ln -s ../ext/mri/bcrypt_ext.so . ln -s ../ext/mri/bcrypt_ext.so .
@ -152,13 +154,21 @@ pushd bundle/ruby/1.8/
popd popd
pushd bundler/gems/em-http-request-6f66010cda90/lib pushd bundler/gems/em-http-request-6f66010cda90/lib
rm em_buffer.so rm em_buffer.so
ln -s ../ext/buffer/em_buffer.so . ln -s ../ext/buffer/em_buffer.so .
rm http11_client.so rm http11_client.so
ln -s ../ext/http11_client/http11_client.so . ln -s ../ext/http11_client/http11_client.so .
popd popd
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 %install
find . -name .git | xargs rm -rf 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 cp -ar bundle $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle/master/vendor
find %{buildroot}/%{_libdir}/diaspora-bundle \ find %{buildroot}/%{_libdir}/diaspora-bundle \
-type d -fprintf dirs '%%%dir "%%p"\n' -type d -fprintf dirs '%%%dir "%%p"\n'
find -L %{buildroot}/%{_libdir}/diaspora-bundle \ find -L %{buildroot}/%{_libdir}/diaspora-bundle -regextype posix-awk \
-regextype posix-awk -type f -not -regex '.*[.]c$|.*[.]h$|.*[.]cpp$' -fprintf files '"%%p"\n' -type f -not -regex '.*[.]c$|.*[.]h$|.*[.]cpp$|.*Makefile$' \
-fprintf files '"%%p"\n'
find %{buildroot}/%{_libdir}/diaspora-bundle -regextype posix-awk \ 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 sed -i -e 's|%{buildroot}||' -e 's|//|/|' files dev-files dirs
cat files >> dirs && cp dirs files cat files >> dirs && cp dirs files
@ -197,7 +209,7 @@ cat files >> dirs && cp dirs files
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
%files -f files %files -f files
%defattr(-, root, root, 0755) %defattr(-, diaspora, diaspora, 0755)
%doc COPYRIGHT Gemfile AUTHORS GNU-AGPL-3.0 %doc COPYRIGHT Gemfile AUTHORS GNU-AGPL-3.0
%files -f dev-files devel %files -f dev-files devel

11
pkg/fedora/diaspora-reset Executable file
View file

@ -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

View file

@ -12,19 +12,26 @@ test $UID = "0" || {
exit 2 exit 2
} }
# Note: this line is patched by installation scripts.
cd /usr/share/diaspora/master 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 if rake db:seed:dev; then
echo "Database config OK, new user tom/evankort in place" echo "Database config OK, new user tom/evankort in place"
else else
cat <<- EOF cat <<- EOF
Database config failed. You might want to remove all db files with Database config failed. You might want to remove all db files with
rm -rf /var/lib/mongodb/* and/or resetting the config file by 'rm -rf /var/lib/mongodb/*' and/or resetting the config file by
cp config/app_config.yml.example config/app_config.yml before 'cp config/app_config.yml.example config/app_config.yml' before
making a new try. making a new try. Also, make sure the mongodb server is running
EOF e. g., using '/sbin/service mongod status'.
exit 1 EOF
exit 1
fi fi
# %attr(0777, diaspora, diaspora) doesn't work in specfile due to umask 022. # %attr(0777, diaspora, diaspora) doesn't work in specfile due to umask 022.
@ -35,17 +42,12 @@ while : ; do
echo "Current hostname is \"$hostname\"" echo "Current hostname is \"$hostname\""
echo -n "Enter new hostname [$hostname] :" echo -n "Enter new hostname [$hostname] :"
read new_hostname garbage 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 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 && sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml &&
echo "config/app_config.yml updated." echo "config/app_config.yml updated."
break break
} }
done done

View file

@ -14,28 +14,42 @@ Source1: diaspora-ws
Source2: diaspora-setup Source2: diaspora-setup
BuildArch: noarch BuildArch: noarch
# See http://github.com/diaspora/diaspora/issues/issue/393
Patch0: source-fix.patch
BuildRequires: git BuildRequires: git
Requires(pre): shadow-utils
Requires: mongodb-server Requires: mongodb-server
Requires: ruby(abi) = 1.8 Requires: ruby(abi) = 1.8
Requires: diaspora-bundle = %{version} 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 %description
A privacy aware, personally controlled, do-it-all and A privacy aware, personally controlled, do-it-all and
open source social network server. open source social network server.
%prep %prep
%setup -q -n %{name}-%{version}-%{git_release} %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 \ find . -perm /u+x -type f -exec \
sed -i 's|^#!/usr/local/bin/ruby|#!/usr/bin/ruby|' {} \; > /dev/null 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 * tar cf public/source.tar --exclude='source.tar' -X .gitignore *
popd 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 %install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora 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 cp diaspora.logconf $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/diaspora
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora
cp -ar master $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 cp diaspora-setup $RPM_BUILD_ROOT/%{_datadir}/diaspora
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/diaspora/uploads 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 %post
rm -f %{_datadir}/diaspora/master/vendor/bundle rm -f %{_datadir}/diaspora/master/vendor/bundle
rm -f %{_datadir}/diaspora/master/log rm -f %{_datadir}/diaspora/master/log
@ -83,7 +98,7 @@ ln -s %{_libdir}/diaspora-bundle/master/vendor/bundle \
%{_datadir}/diaspora/master/vendor || : %{_datadir}/diaspora/master/vendor || :
ln -s %{_localstatedir}/lib/diaspora/uploads \ ln -s %{_localstatedir}/lib/diaspora/uploads \
%{_datadir}/diaspora/master/public/uploads || : %{_datadir}/diaspora/master/public/uploads || :
/sbin/chkconfig --add diaspora-ws /sbin/chkconfig --add diaspora-ws || :
%preun %preun
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
@ -94,10 +109,11 @@ fi
%clean %clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT [ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
%files %files -f files
%defattr(-, root, root, 0755) %defattr(-, diaspora, diaspora, 0755)
%doc README.md GNU-AGPL-3.0 %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}/log/diaspora
%attr(-, diaspora, diaspora) %{_localstatedir}/lib/diaspora/uploads %attr(-, diaspora, diaspora) %{_localstatedir}/lib/diaspora/uploads
%config(noreplace) %{_sysconfdir}/logrotate.d/diaspora %config(noreplace) %{_sysconfdir}/logrotate.d/diaspora
@ -105,4 +121,4 @@ fi
%changelog %changelog
* Fri Sep 24 2010 Alec Leamas <leamas.alec@gmail.com> 1.1009280542_859ec2d * Fri Sep 24 2010 Alec Leamas <leamas.alec@gmail.com> 1.1009280542_859ec2d
- Initial attempt to create a spec file - Initial attempt to create a spec fi+le

View file

@ -52,13 +52,12 @@ function git_id
function fix_alphatag() function fix_alphatag()
# Patch version on top comment first id line: # Patch version on top comment first id line:
# Uses %define git_release to get release. # Usage: fix_alphatag <file> <version> <commi_id>
#* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320 #* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320
{ {
dist=$(rpm --eval %dist) dist=$(rpm --eval %dist)
awk -v dist="$dist" -v version="$2" \ awk -v dist="$dist" -v version="$2" -v release="$3" \
' BEGIN { done = 0 } ' BEGIN { done = 0 }
/%define/ { if ($2 = "git_release") release = $3 }
/^[*]/ { if (done) /^[*]/ { if (done)
print print
else else
@ -96,7 +95,7 @@ function patch()
sed -e "/^%define/s|HEAD|$2|" \ sed -e "/^%define/s|HEAD|$2|" \
-e '/^Version:/s|.*|Version: '$1'|' \ -e '/^Version:/s|.*|Version: '$1'|' \
<diaspora.spec >dist/diaspora.spec <diaspora.spec >dist/diaspora.spec
fix_alphatag dist/diaspora.spec $1 fix_alphatag dist/diaspora.spec $1 $2
#mkdir dist/diaspora/tmp || : #mkdir dist/diaspora/tmp || :
bundle_id=$(git_id dist/diaspora/Gemfile) bundle_id=$(git_id dist/diaspora/Gemfile)
fix_bundle_deps dist/diaspora.spec $1 "1.$bundle_id.fc13" fix_bundle_deps dist/diaspora.spec $1 "1.$bundle_id.fc13"
@ -121,7 +120,11 @@ function checkout()
cd diaspora; cd diaspora;
git remote add upstream \ git remote add upstream \
git://github.com/diaspora/diaspora.git git://github.com/diaspora/diaspora.git
for p in ../../*.patch; do
git apply --whitespace=fix $p > /dev/null
done
) )
} }
cd diaspora; cd diaspora;
git fetch --quiet upstream git fetch --quiet upstream
@ -145,14 +148,13 @@ function make_dist
cp diaspora-ws diaspora-setup diaspora.logconf dist/${RELEASE_DIR} cp diaspora-ws diaspora-setup diaspora.logconf dist/${RELEASE_DIR}
cd dist cd dist
mkdir ${RELEASE_DIR}/master mkdir ${RELEASE_DIR}/master
cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master cp -ar diaspora/* diaspora/.git* diaspora/.bundle ${RELEASE_DIR}/master
cp -r ../.bundle ${RELEASE_DIR}/master
mv ${RELEASE_DIR}/master/diaspora.spec ${RELEASE_DIR} 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} tar czf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR} && rm -rf ${RELEASE_DIR}
cd .. cd ..
bundle_id=$(git_id dist/diaspora/Gemfile)
echo "Source: dist/${RELEASE_DIR}.tar.gz" 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 "Source specfile: dist/diaspora.spec"
echo "Bundle specfile: dist/diaspora-bundle.spec" echo "Bundle specfile: dist/diaspora-bundle.spec"
} }
@ -170,20 +172,11 @@ function make_bundle()
pushd diaspora > /dev/null pushd diaspora > /dev/null
test -e ../../Gemfile.lock.patch && test -e ../../Gemfile.lock.patch &&
git apply ../../Gemfile.lock.patch > /dev/null 2>&1 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 \ bundle install --deployment \
--path="../$bundle_name/bundle" \ --path="../$bundle_name/bundle" \
--without=test rdoc --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 popd
tar czf $bundle_name.tar.gz $bundle_name tar czf $bundle_name.tar.gz $bundle_name
} }
@ -201,10 +194,8 @@ function make_links()
} }
echo "Linking sources to $dest" echo "Linking sources to $dest"
src_commit="$1" src_commit="${1:-$( checkout)}"
test -z "$src_commit" && {
src_commit=$(checkout)
}
src="dist/diaspora-$VERSION-$src_commit.tar.gz" src="dist/diaspora-$VERSION-$src_commit.tar.gz"
ln -sf $PWD/$src $dest ln -sf $PWD/$src $dest
@ -212,7 +203,7 @@ function make_links()
bundle="dist/diaspora-bundle-$VERSION-$bundle_commit.tar.gz" bundle="dist/diaspora-bundle-$VERSION-$bundle_commit.tar.gz"
ln -sf $PWD/$bundle $dest 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 ln -sf $PWD/$file $dest/$file
done done
@ -224,7 +215,7 @@ function usage()
{ {
cat <<- EOF cat <<- EOF
Usage: make_dist [-c commit] <dist|bundle|links> Usage: make-dist [-c commit] <dist|bundle|links>
-c Use a given commit, defaults to last checked in. -c Use a given commit, defaults to last checked in.
dist Build a diaspora application tarball. dist Build a diaspora application tarball.

View file

@ -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

View file

@ -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

View file

@ -347,7 +347,9 @@ ul.comment_set {
#debug_info h5 { #debug_info h5 {
color: #cccccc; } color: #cccccc; }
input[type='text'], textarea { input[type='text'],
input[type='password'],
textarea {
font-family: "lucida grande", "lucida sans", "sans-serif"; font-family: "lucida grande", "lucida sans", "sans-serif";
font-size: 14px; font-size: 14px;
padding: 0.3em; padding: 0.3em;
@ -362,7 +364,7 @@ input[type='text'], textarea {
-moz-box-shadow: 0 1px 2px white; -moz-box-shadow: 0 1px 2px white;
-webkit-box-shadow: 0 1px 2px white; } -webkit-box-shadow: 0 1px 2px white; }
#submit_block { .submit_block {
text-align: right; text-align: right;
font-size: 12px; } font-size: 12px; }

View file

@ -467,7 +467,9 @@ ul.comment_set
:color #ccc :color #ccc
input[type='text'], textarea input[type='text'],
input[type='password'],
textarea
:font :font
:family 'lucida grande', 'lucida sans', 'sans-serif' :family 'lucida grande', 'lucida sans', 'sans-serif'
:size 14px :size 14px
@ -485,7 +487,7 @@ input[type='text'], textarea
:-moz-box-shadow 0 1px 2px #fff :-moz-box-shadow 0 1px 2px #fff
:-webkit-box-shadow 0 1px 2px #fff :-webkit-box-shadow 0 1px 2px #fff
#submit_block .submit_block
:text :text
:align right :align right
:font :font