Merge remote branch 'leamas/fedora-pkg'
This commit is contained in:
commit
9c9fe7042d
8 changed files with 128 additions and 118 deletions
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
BUNDLE_FROZEN: "1"
|
|
||||||
BUNDLE_DISABLE_SHARED_GEMS: "1"
|
|
||||||
BUNDLE_WITHOUT: test:rdoc
|
|
||||||
BUNDLE_PATH: vendor/bundle
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
%define git_release 1010040945_a09a6d8
|
%define git_release HEAD
|
||||||
# Turn off the brp-python-bytecompile script
|
|
||||||
|
# Turn off java repack, this is in in /usr/lib[64] anyway
|
||||||
|
%define __jar_repack %{nil}
|
||||||
|
|
||||||
|
# Turn off the brp-python-bytecompile script, *pyc/pyo causes problems
|
||||||
%global __os_install_post %(echo '%{__os_install_post}' |
|
%global __os_install_post %(echo '%{__os_install_post}' |
|
||||||
sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
||||||
|
|
||||||
|
|
@ -109,7 +113,7 @@ pushd bundle/ruby/1.8/
|
||||||
ln -s ../ext/thin_parser/thin_parser.so .
|
ln -s ../ext/thin_parser/thin_parser.so .
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd gems/bson_ext-1.0.7/ext/bson_ext
|
pushd gems/bson_ext-1.1/ext/bson_ext
|
||||||
rm cbson.so
|
rm cbson.so
|
||||||
ln -s ../cbson/cbson.so .
|
ln -s ../cbson/cbson.so .
|
||||||
popd
|
popd
|
||||||
|
|
@ -153,7 +157,7 @@ pushd bundle/ruby/1.8/
|
||||||
ln -s ../ext/trace_nums.so .
|
ln -s ../ext/trace_nums.so .
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd bundler/gems/em-http-request-6f66010cda90/lib
|
pushd bundler/gems/em-http-request-*/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
|
||||||
|
|
@ -161,16 +165,20 @@ pushd bundle/ruby/1.8/
|
||||||
popd
|
popd
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
getent group diaspora >/dev/null || groupadd -r diaspora
|
getent group diaspora >/dev/null || groupadd -r diaspora
|
||||||
getent passwd diaspora >/dev/null || \
|
getent passwd diaspora >/dev/null || \
|
||||||
useradd -r -g apache \
|
useradd -r -g diaspora \
|
||||||
-md /var/lib/diaspora -s /sbin/nologin \
|
-md /var/lib/diaspora -s /sbin/nologin \
|
||||||
-c "Diaspora daemon" diaspora
|
-c "Diaspora daemon" diaspora
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
|
||||||
|
|
||||||
find . -name .git | xargs rm -rf
|
find . -name .git | xargs rm -rf
|
||||||
find . -name .gitignore -delete
|
find . -name .gitignore -delete
|
||||||
find . -name \*.o -delete || :
|
find . -name \*.o -delete || :
|
||||||
|
|
@ -190,7 +198,6 @@ pushd bundle/ruby/1.8/gems/selenium-webdriver-0.0.28/lib/selenium/webdriver/
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/diaspora-bundle/master/vendor
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Try to revert to pristine state, deleting all users and
|
||||||
|
# configuration
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
service mongod stop
|
service mongod stop
|
||||||
service diaspora-ws stop
|
service diaspora-ws stop
|
||||||
rm -rf /var/lib/mongod/*
|
rm -rf /var/lib/mongodb/*
|
||||||
cp /usr/share/diaspora/master/config/app_config.yml.example \
|
cp /usr/share/diaspora/master/config/app_config.yml.example \
|
||||||
/usr/share/diaspora/master/config/app_config.yml
|
/usr/share/diaspora/master/config/app_config.yml
|
||||||
service mongod start
|
service mongod start
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ 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 || :
|
/sbin/service mongod start || :
|
||||||
|
|
@ -21,7 +20,7 @@ test -e config/app_config.yml ||
|
||||||
cp config/app_config.yml.example 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/evankorth in place"
|
||||||
else
|
else
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ if [ -f /etc/sysconfig/diaspora-ws -a $UID -eq 0 ]; then
|
||||||
. /etc/sysconfig/diaspora-ws
|
. /etc/sysconfig/diaspora-ws
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Note: this line is patched by installation scripts.
|
||||||
cd /usr/share/diaspora
|
cd /usr/share/diaspora
|
||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/var/log/diaspora/*.log {
|
/var/log/diaspora/*.log {
|
||||||
create 755 diaspora apache
|
create 755 diaspora diaspora
|
||||||
weekly
|
weekly
|
||||||
rotate 10
|
rotate 10
|
||||||
copytruncate
|
copytruncate
|
||||||
|
|
|
||||||
|
|
@ -14,34 +14,10 @@ Source1: diaspora-ws
|
||||||
Source2: diaspora-setup
|
Source2: diaspora-setup
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: git
|
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -120,5 +96,28 @@ fi
|
||||||
%{_sysconfdir}/init.d/diaspora-ws
|
%{_sysconfdir}/init.d/diaspora-ws
|
||||||
|
|
||||||
%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> 0.0-1.1009280542_859ec2d
|
||||||
- Initial attempt to create a spec fi+le
|
- Initial attempt to create a spec fi+le
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#Usage: See function usage() at bottom.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Create a diaspora distribution
|
# Create a diaspora distribution
|
||||||
#
|
#
|
||||||
# Builds a diaspora distribution containing the application and bundled
|
# Usage: See function usage() at bottom.
|
||||||
# libraries. Normally checks out latest version of the master branch.
|
|
||||||
#
|
#
|
||||||
GIT_REPO='http://github.com/diaspora/diaspora.git'
|
GIT_REPO='http://github.com/diaspora/diaspora.git'
|
||||||
RELEASE='HEAD'
|
|
||||||
VERSION='0.0'
|
VERSION='0.0'
|
||||||
|
|
||||||
function git_id
|
function git_id
|
||||||
|
|
@ -52,8 +47,9 @@ 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:
|
||||||
# Usage: fix_alphatag <file> <version> <commi_id>
|
# Usage: fix_alphatag <file> <version> <commit_id>
|
||||||
#* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320
|
# Patches:\
|
||||||
|
# * Fri Sep 24 2010 name surname <email@com> 1.20100925_faf23207
|
||||||
{
|
{
|
||||||
dist=$(rpm --eval %dist)
|
dist=$(rpm --eval %dist)
|
||||||
awk -v dist="$dist" -v version="$2" -v release="$3" \
|
awk -v dist="$dist" -v version="$2" -v release="$3" \
|
||||||
|
|
@ -70,12 +66,12 @@ function fix_alphatag()
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
{ print }' \
|
{ print }' \
|
||||||
< $1 > $1.tmp && cp $1.tmp $1 && rm $1.tmp
|
< $1 > $1.tmp && mv -f $1.tmp $1
|
||||||
}
|
}
|
||||||
|
|
||||||
function fix_bundle_deps
|
function fix_bundle_deps
|
||||||
# usage: fix_bundle_deps <specfile> <version> release
|
# usage: fix_bundle_deps <specfile> <version> <release>
|
||||||
# Patches Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
# Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
||||||
{
|
{
|
||||||
awk -v vers="$2-$3" \
|
awk -v vers="$2-$3" \
|
||||||
' /Requires:/ { if ($2 == "diaspora-bundle")
|
' /Requires:/ { if ($2 == "diaspora-bundle")
|
||||||
|
|
@ -85,21 +81,21 @@ function fix_bundle_deps
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
{ print}' \
|
{ print}' \
|
||||||
< $1 > $1.tmp && cp $1.tmp $1 && rm $1.tmp
|
< $1 > $1.tmp && mv -f $1.tmp $1
|
||||||
}
|
}
|
||||||
|
|
||||||
function patch()
|
function patch()
|
||||||
# Patch git_release, Requires: diaspora-bundle and top comment version.
|
# Patch spec-files with current version-release
|
||||||
# Usage: patch VERSION RELEASE
|
# Usage: patch VERSION RELEASE
|
||||||
{
|
{
|
||||||
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 $2
|
fix_alphatag dist/diaspora.spec $1 $2
|
||||||
#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"
|
dist_tag=$(rpm --eval %dist)
|
||||||
sed -e "/^%define/s|HEAD|$bundle_deps|" \
|
fix_bundle_deps dist/diaspora.spec $1 "1.${bundle_id}$dist_tag"
|
||||||
|
sed -e "/^%define/s|HEAD|$bundle_id|" \
|
||||||
-e '/^Version:/s|.*|Version: '$1'|' \
|
-e '/^Version:/s|.*|Version: '$1'|' \
|
||||||
< diaspora-bundle.spec > dist/diaspora-bundle.spec
|
< diaspora-bundle.spec > dist/diaspora-bundle.spec
|
||||||
|
|
||||||
|
|
@ -124,7 +120,6 @@ function checkout()
|
||||||
git apply --whitespace=fix $p > /dev/null
|
git apply --whitespace=fix $p > /dev/null
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
cd diaspora;
|
cd diaspora;
|
||||||
git fetch --quiet upstream
|
git fetch --quiet upstream
|
||||||
|
|
@ -137,6 +132,7 @@ function checkout()
|
||||||
|
|
||||||
function make_dist
|
function make_dist
|
||||||
# Create a distribution tarball
|
# Create a distribution tarball
|
||||||
|
# Usage: make dist [ commit, defaults to HEAD]
|
||||||
{
|
{
|
||||||
commit=$(checkout ${1:-'HEAD'})
|
commit=$(checkout ${1:-'HEAD'})
|
||||||
echo "Creating source tarball for $commit"
|
echo "Creating source tarball for $commit"
|
||||||
|
|
@ -148,10 +144,17 @@ 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* diaspora/.bundle ${RELEASE_DIR}/master
|
cp -ar diaspora/* diaspora/.git* ${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}
|
cd ${RELEASE_DIR};
|
||||||
|
find . -name .gitkeep -delete
|
||||||
|
cd master
|
||||||
|
rm -rf .bundle
|
||||||
|
git apply ../../../add-bundle.patch
|
||||||
|
)
|
||||||
|
tar czf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR} && \
|
||||||
|
rm -rf ${RELEASE_DIR}
|
||||||
cd ..
|
cd ..
|
||||||
echo "Source: dist/${RELEASE_DIR}.tar.gz"
|
echo "Source: dist/${RELEASE_DIR}.tar.gz"
|
||||||
echo "Required bundle: $(git_id dist/diaspora/Gemfile)"
|
echo "Required bundle: $(git_id dist/diaspora/Gemfile)"
|
||||||
|
|
@ -160,6 +163,9 @@ function make_dist
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_bundle()
|
function make_bundle()
|
||||||
|
# Create the bundle tarball
|
||||||
|
# Usage: make_bundle [ commit, defaults to HEAD]
|
||||||
|
#
|
||||||
{
|
{
|
||||||
checkout ${1:-'HEAD'} >/dev/null
|
checkout ${1:-'HEAD'} >/dev/null
|
||||||
bundle_id=$(git_id dist/diaspora/Gemfile)
|
bundle_id=$(git_id dist/diaspora/Gemfile)
|
||||||
|
|
@ -170,15 +176,15 @@ function make_bundle()
|
||||||
rm -rf $bundle_name
|
rm -rf $bundle_name
|
||||||
mkdir -p $bundle_name/bundle
|
mkdir -p $bundle_name/bundle
|
||||||
pushd diaspora > /dev/null
|
pushd diaspora > /dev/null
|
||||||
test -e ../../Gemfile.lock.patch &&
|
|
||||||
git apply ../../Gemfile.lock.patch > /dev/null 2>&1
|
|
||||||
bundle install --deployment \
|
bundle install --deployment \
|
||||||
--path="../$bundle_name/bundle" \
|
--path="../$bundle_name/bundle" \
|
||||||
--without=test rdoc
|
--without=test rdoc
|
||||||
|
|
||||||
cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT "../$bundle_name"
|
cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT \
|
||||||
popd
|
"../$bundle_name"
|
||||||
|
popd > /dev/null
|
||||||
tar czf $bundle_name.tar.gz $bundle_name
|
tar czf $bundle_name.tar.gz $bundle_name
|
||||||
|
cd ..
|
||||||
}
|
}
|
||||||
echo
|
echo
|
||||||
echo "Bundle: dist/$bundle_name.tar.gz"
|
echo "Bundle: dist/$bundle_name.tar.gz"
|
||||||
|
|
@ -242,7 +248,7 @@ test "$1" = "-c" && {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
||||||
"bundle") make_bundle $commit
|
"bundle") make_bundle $commit
|
||||||
;;
|
;;
|
||||||
|
|
@ -260,7 +266,7 @@ test "$1" = "-c" && {
|
||||||
*) usage
|
*) usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue