Separate doc dir collecting copyrights and readmes.
This commit is contained in:
parent
9b83b07f80
commit
a279bae720
5 changed files with 36 additions and 20 deletions
1
pkg/fedora/.gitignore
vendored
1
pkg/fedora/.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
TODO
|
||||
dist
|
||||
.stgit*
|
||||
vendor
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 .
|
||||
|
|
|
|||
|
|
@ -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 ..
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue