new git gem flow using.

This commit is contained in:
Alec Leamas 2010-10-25 23:15:26 +02:00
parent 11b6d61e5a
commit 76a8ea0e73
4 changed files with 192 additions and 20 deletions

99
pkg/Licenses Normal file
View file

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

View file

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

View file

@ -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 <Gemfile> <tmpdir> <gemdir>
{
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"
}

View file

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