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
|
TODO
|
||||||
dist
|
dist
|
||||||
.stgit*
|
.stgit*
|
||||||
|
vendor
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,6 @@ Source file usede to compile native libraries in diaspora-bundle.
|
||||||
%setup -q -n %{name}-%{version}-%{git_release}
|
%setup -q -n %{name}-%{version}-%{git_release}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir -p vendor/cache
|
|
||||||
mv *.gem vendor/cache
|
|
||||||
bundle install --local --deployment --without ri rdoc
|
bundle install --local --deployment --without ri rdoc
|
||||||
|
|
||||||
pushd vendor/bundle/ruby/1.8/gems
|
pushd vendor/bundle/ruby/1.8/gems
|
||||||
|
|
@ -218,7 +216,7 @@ cat files >> dirs && cp dirs files
|
||||||
|
|
||||||
%files -f files
|
%files -f files
|
||||||
%defattr(-, diaspora, diaspora, 0755)
|
%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
|
%files -f dev-files devel
|
||||||
%defattr(-, root, root, 0644)
|
%defattr(-, root, root, 0644)
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,12 @@ find . -perm /u+x -type f -exec \
|
||||||
|
|
||||||
%build
|
%build
|
||||||
rm -rf master/vendor/bundle
|
rm -rf master/vendor/bundle
|
||||||
mkdir master/tmp || :
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -fr $RPM_BUILD_ROOT
|
rm -fr $RPM_BUILD_ROOT
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
'/BUNDLE_PATH/s|:.*|: %{_libdir}/diaspora-bundle/bundle|' \
|
'/BUNDLE_PATH/s|:.*|: %{_libdir}/diaspora-bundle/vendor/bundle|' \
|
||||||
master/.bundle/config
|
master/.bundle/config
|
||||||
|
|
||||||
cp master/GNU-AGPL-3.0 master/COPYRIGHT master/README.md master/AUTHORS .
|
cp master/GNU-AGPL-3.0 master/COPYRIGHT master/README.md master/AUTHORS .
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ function checkout()
|
||||||
cd diaspora;
|
cd diaspora;
|
||||||
git fetch --quiet upstream
|
git fetch --quiet upstream
|
||||||
git merge --quiet upstream/master
|
git merge --quiet upstream/master
|
||||||
git checkout --quiet ${1:-'HEAD'}
|
[ -n "$1" ] && git reset --hard --quiet $1
|
||||||
git_id -n
|
git_id -n
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -183,9 +183,9 @@ function read_git_urls()
|
||||||
|
|
||||||
function fix_gemfile()
|
function fix_gemfile()
|
||||||
{
|
{
|
||||||
gemfile=$1
|
local gemfile=$1
|
||||||
for url in $(read_git_urls $gemfile); do
|
for url in $(read_git_urls $gemfile); do
|
||||||
name=${url##*/}
|
local name=${url##*/}
|
||||||
name=${name%.*}
|
name=${name%.*}
|
||||||
rm -rf vendor/git/$name
|
rm -rf vendor/git/$name
|
||||||
git clone --bare --quiet $url vendor/git/$name &&
|
git clone --bare --quiet $url vendor/git/$name &&
|
||||||
|
|
@ -194,6 +194,22 @@ function fix_gemfile()
|
||||||
done
|
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()
|
function make_bundle()
|
||||||
# Create the bundle tarball
|
# Create the bundle tarball
|
||||||
|
|
@ -201,8 +217,8 @@ function make_bundle()
|
||||||
#
|
#
|
||||||
{
|
{
|
||||||
checkout ${1:-'HEAD'} >/dev/null
|
checkout ${1:-'HEAD'} >/dev/null
|
||||||
bundle_id=$( git_id dist/diaspora/Gemfile)
|
local bundle_id=$( git_id dist/diaspora/Gemfile)
|
||||||
bundle_name="diaspora-bundle-$VERSION-$bundle_id"
|
local bundle_name="diaspora-bundle-$VERSION-$bundle_id"
|
||||||
test -e "dist/$bundle_name.tar.gz" || {
|
test -e "dist/$bundle_name.tar.gz" || {
|
||||||
echo "Creating bundle $bundle_name"
|
echo "Creating bundle $bundle_name"
|
||||||
cd dist
|
cd dist
|
||||||
|
|
@ -213,17 +229,21 @@ function make_bundle()
|
||||||
rm -rf .bundle
|
rm -rf .bundle
|
||||||
bundle update
|
bundle update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -d 'vendor/git' ] || mkdir vendor/git
|
[ -d 'vendor/git' ] || mkdir vendor/git
|
||||||
fix_gemfile ./Gemfile
|
fix_gemfile ./Gemfile
|
||||||
bundle install --path vendor/gems
|
bundle install --path vendor/gems
|
||||||
bundle package
|
bundle package
|
||||||
|
|
||||||
|
mkdir -p "../$bundle_name/docs"
|
||||||
|
mkdir -p "../$bundle_name/vendor"
|
||||||
cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \
|
cp -ar AUTHORS Gemfile Gemfile.lock GNU-AGPL-3.0 COPYRIGHT \
|
||||||
vendor/cache
|
../$bundle_name
|
||||||
cd vendor
|
make_docs "vendor/gems" "../$bundle_name/docs"
|
||||||
mv cache $bundle_name
|
mv vendor/cache ../$bundle_name/cache
|
||||||
tar czf ../../$bundle_name.tar.gz $bundle_name
|
|
||||||
mv $bundle_name cache
|
tar czf ../$bundle_name.tar.gz $bundle_name
|
||||||
cd ..
|
mv ../$bundle_name/cache cache
|
||||||
cd ..
|
cd ..
|
||||||
cd ..
|
cd ..
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,9 @@ mv $(basename $1 .tar.gz) diaspora-bundle
|
||||||
|
|
||||||
mkdir -p /usr/share/doc/diaspora-bundle || :
|
mkdir -p /usr/share/doc/diaspora-bundle || :
|
||||||
cd /usr/lib/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
|
/usr/share/doc/diaspora-bundle
|
||||||
|
cp -ar docs /usr/share/doc/diaspora-bundle
|
||||||
mkdir -p vendor/cache
|
|
||||||
mv *.gem vendor/cache
|
|
||||||
|
|
||||||
bundle install --local --deployment --without ri rdoc
|
bundle install --local --deployment --without ri rdoc
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue