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
|
||||
# Turn off the brp-python-bytecompile script
|
||||
%define git_release HEAD
|
||||
|
||||
# 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}' |
|
||||
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 .
|
||||
popd
|
||||
|
||||
pushd gems/bson_ext-1.0.7/ext/bson_ext
|
||||
pushd gems/bson_ext-1.1/ext/bson_ext
|
||||
rm cbson.so
|
||||
ln -s ../cbson/cbson.so .
|
||||
popd
|
||||
|
|
@ -153,7 +157,7 @@ pushd bundle/ruby/1.8/
|
|||
ln -s ../ext/trace_nums.so .
|
||||
popd
|
||||
|
||||
pushd bundler/gems/em-http-request-6f66010cda90/lib
|
||||
pushd bundler/gems/em-http-request-*/lib
|
||||
rm em_buffer.so
|
||||
ln -s ../ext/buffer/em_buffer.so .
|
||||
rm http11_client.so
|
||||
|
|
@ -161,16 +165,20 @@ pushd bundle/ruby/1.8/
|
|||
popd
|
||||
popd
|
||||
|
||||
|
||||
|
||||
%pre
|
||||
getent group diaspora >/dev/null || groupadd -r diaspora
|
||||
getent passwd diaspora >/dev/null || \
|
||||
useradd -r -g apache \
|
||||
getent passwd diaspora >/dev/null || \
|
||||
useradd -r -g diaspora \
|
||||
-md /var/lib/diaspora -s /sbin/nologin \
|
||||
-c "Diaspora daemon" diaspora
|
||||
exit 0
|
||||
|
||||
|
||||
%install
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
|
||||
|
||||
find . -name .git | xargs rm -rf
|
||||
find . -name .gitignore -delete
|
||||
find . -name \*.o -delete || :
|
||||
|
|
@ -190,7 +198,6 @@ pushd bundle/ruby/1.8/gems/selenium-webdriver-0.0.28/lib/selenium/webdriver/
|
|||
popd
|
||||
}
|
||||
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -fr $RPM_BUILD_ROOT
|
||||
mkdir -p $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
|
||||
|
||||
#
|
||||
# Try to revert to pristine state, deleting all users and
|
||||
# configuration
|
||||
|
||||
set -x
|
||||
service mongod 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 \
|
||||
/usr/share/diaspora/master/config/app_config.yml
|
||||
service mongod start
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ test $UID = "0" || {
|
|||
exit 2
|
||||
}
|
||||
|
||||
# Note: this line is patched by installation scripts.
|
||||
cd /usr/share/diaspora/master
|
||||
|
||||
/sbin/service mongod start || :
|
||||
|
|
@ -21,16 +20,16 @@ test -e config/app_config.yml ||
|
|||
cp config/app_config.yml.example config/app_config.yml
|
||||
|
||||
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
|
||||
cat <<- EOF
|
||||
|
||||
Database config failed. You might want to remove all db files with
|
||||
'rm -rf /var/lib/mongodb/*' and/or resetting the config file by
|
||||
'cp config/app_config.yml.example config/app_config.yml' before
|
||||
making a new try. Also, make sure the mongodb server is running
|
||||
e. g., using '/sbin/service mongod status'.
|
||||
EOF
|
||||
Database config failed. You might want to remove all db files with
|
||||
'rm -rf /var/lib/mongodb/*' and/or resetting the config file by
|
||||
'cp config/app_config.yml.example config/app_config.yml' before
|
||||
making a new try. Also, make sure the mongodb server is running
|
||||
e. g., using '/sbin/service mongod status'.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ if [ -f /etc/sysconfig/diaspora-ws -a $UID -eq 0 ]; then
|
|||
. /etc/sysconfig/diaspora-ws
|
||||
fi
|
||||
|
||||
# Note: this line is patched by installation scripts.
|
||||
cd /usr/share/diaspora
|
||||
|
||||
RETVAL=0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/var/log/diaspora/*.log {
|
||||
create 755 diaspora apache
|
||||
create 755 diaspora diaspora
|
||||
weekly
|
||||
rotate 10
|
||||
copytruncate
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%global debug_package %{nil}
|
||||
%global debug_package %{nil}
|
||||
%define git_release HEAD
|
||||
|
||||
Summary: A social network server
|
||||
|
|
@ -14,34 +14,10 @@ Source1: diaspora-ws
|
|||
Source2: diaspora-setup
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: git
|
||||
|
||||
Requires: mongodb-server
|
||||
Requires: ruby(abi) = 1.8
|
||||
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
|
||||
A privacy aware, personally controlled, do-it-all and
|
||||
|
|
@ -120,5 +96,28 @@ fi
|
|||
%{_sysconfdir}/init.d/diaspora-ws
|
||||
|
||||
%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
|
||||
|
||||
# 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
|
||||
|
||||
#Usage: See function usage() at bottom.
|
||||
#
|
||||
#
|
||||
# Create a diaspora distribution
|
||||
#
|
||||
# Builds a diaspora distribution containing the application and bundled
|
||||
# libraries. Normally checks out latest version of the master branch.
|
||||
# Usage: See function usage() at bottom.
|
||||
#
|
||||
GIT_REPO='http://github.com/diaspora/diaspora.git'
|
||||
RELEASE='HEAD'
|
||||
VERSION='0.0'
|
||||
|
||||
function git_id
|
||||
|
|
@ -52,8 +47,9 @@ function git_id
|
|||
|
||||
function fix_alphatag()
|
||||
# Patch version on top comment first id line:
|
||||
# Usage: fix_alphatag <file> <version> <commi_id>
|
||||
#* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320
|
||||
# Usage: fix_alphatag <file> <version> <commit_id>
|
||||
# Patches:\
|
||||
# * Fri Sep 24 2010 name surname <email@com> 1.20100925_faf23207
|
||||
{
|
||||
dist=$(rpm --eval %dist)
|
||||
awk -v dist="$dist" -v version="$2" -v release="$3" \
|
||||
|
|
@ -70,40 +66,40 @@ function fix_alphatag()
|
|||
next
|
||||
}
|
||||
{ print }' \
|
||||
< $1 > $1.tmp && cp $1.tmp $1 && rm $1.tmp
|
||||
< $1 > $1.tmp && mv -f $1.tmp $1
|
||||
}
|
||||
|
||||
function fix_bundle_deps
|
||||
# usage: fix_bundle_deps <specfile> <version> release
|
||||
# Patches Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
||||
# usage: fix_bundle_deps <specfile> <version> <release>
|
||||
# Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
||||
{
|
||||
awk -v vers="$2-$3" \
|
||||
' /Requires:/ { if ($2 == "diaspora-bundle")
|
||||
printf( "%s %s = %s\n", $1,$2,vers)
|
||||
else
|
||||
print
|
||||
next
|
||||
}
|
||||
{ print}' \
|
||||
< $1 > $1.tmp && cp $1.tmp $1 && rm $1.tmp
|
||||
awk -v vers="$2-$3" \
|
||||
' /Requires:/ { if ($2 == "diaspora-bundle")
|
||||
printf( "%s %s = %s\n", $1,$2,vers)
|
||||
else
|
||||
print
|
||||
next
|
||||
}
|
||||
{ print}' \
|
||||
< $1 > $1.tmp && mv -f $1.tmp $1
|
||||
}
|
||||
|
||||
function patch()
|
||||
# Patch git_release, Requires: diaspora-bundle and top comment version.
|
||||
# Patch spec-files with current version-release
|
||||
# Usage: patch VERSION RELEASE
|
||||
{
|
||||
sed -e "/^%define/s|HEAD|$2|" \
|
||||
sed -e "/^%define/s|HEAD|$2|" \
|
||||
-e '/^Version:/s|.*|Version: '$1'|' \
|
||||
<diaspora.spec >dist/diaspora.spec
|
||||
fix_alphatag dist/diaspora.spec $1 $2
|
||||
#mkdir dist/diaspora/tmp || :
|
||||
bundle_id=$(git_id dist/diaspora/Gemfile)
|
||||
fix_bundle_deps dist/diaspora.spec $1 "1.$bundle_id.fc13"
|
||||
sed -e "/^%define/s|HEAD|$bundle_deps|" \
|
||||
fix_alphatag dist/diaspora.spec $1 $2
|
||||
bundle_id=$(git_id dist/diaspora/Gemfile)
|
||||
dist_tag=$(rpm --eval %dist)
|
||||
fix_bundle_deps dist/diaspora.spec $1 "1.${bundle_id}$dist_tag"
|
||||
sed -e "/^%define/s|HEAD|$bundle_id|" \
|
||||
-e '/^Version:/s|.*|Version: '$1'|' \
|
||||
< diaspora-bundle.spec > dist/diaspora-bundle.spec
|
||||
|
||||
cp dist/diaspora.spec dist/diaspora/diaspora.spec
|
||||
|
||||
cp dist/diaspora.spec dist/diaspora/diaspora.spec
|
||||
}
|
||||
|
||||
function checkout()
|
||||
|
|
@ -121,10 +117,9 @@ function checkout()
|
|||
git remote add upstream \
|
||||
git://github.com/diaspora/diaspora.git
|
||||
for p in ../../*.patch; do
|
||||
git apply --whitespace=fix $p > /dev/null
|
||||
git apply --whitespace=fix $p > /dev/null
|
||||
done
|
||||
)
|
||||
|
||||
}
|
||||
cd diaspora;
|
||||
git fetch --quiet upstream
|
||||
|
|
@ -137,21 +132,29 @@ function checkout()
|
|||
|
||||
function make_dist
|
||||
# Create a distribution tarball
|
||||
# Usage: make dist [ commit, defaults to HEAD]
|
||||
{
|
||||
commit=$(checkout ${1:-'HEAD'})
|
||||
echo "Creating source tarball for $commit"
|
||||
patch $VERSION $commit
|
||||
|
||||
|
||||
RELEASE_DIR="diaspora-$VERSION-$commit"
|
||||
rm -rf dist/${RELEASE_DIR}
|
||||
mkdir dist/${RELEASE_DIR}
|
||||
cp diaspora-ws diaspora-setup diaspora.logconf dist/${RELEASE_DIR}
|
||||
cd dist
|
||||
mkdir ${RELEASE_DIR}/master
|
||||
cp -ar diaspora/* diaspora/.git* diaspora/.bundle ${RELEASE_DIR}/master
|
||||
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}
|
||||
mkdir ${RELEASE_DIR}/master
|
||||
cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master
|
||||
mv ${RELEASE_DIR}/master/diaspora.spec ${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 ..
|
||||
echo "Source: dist/${RELEASE_DIR}.tar.gz"
|
||||
echo "Required bundle: $(git_id dist/diaspora/Gemfile)"
|
||||
|
|
@ -160,25 +163,28 @@ function make_dist
|
|||
}
|
||||
|
||||
function make_bundle()
|
||||
# Create the bundle tarball
|
||||
# Usage: make_bundle [ commit, defaults to HEAD]
|
||||
#
|
||||
{
|
||||
checkout ${1:-'HEAD'} >/dev/null
|
||||
bundle_id=$(git_id dist/diaspora/Gemfile)
|
||||
bundle_name="diaspora-bundle-$VERSION-$bundle_id"
|
||||
test -e "dist/$bundle_name.tar.gz" || {
|
||||
echo "Creating bundle $bundle_name"
|
||||
cd dist
|
||||
rm -rf $bundle_name
|
||||
mkdir -p $bundle_name/bundle
|
||||
pushd diaspora > /dev/null
|
||||
test -e ../../Gemfile.lock.patch &&
|
||||
git apply ../../Gemfile.lock.patch > /dev/null 2>&1
|
||||
bundle install --deployment \
|
||||
cd dist
|
||||
rm -rf $bundle_name
|
||||
mkdir -p $bundle_name/bundle
|
||||
pushd diaspora > /dev/null
|
||||
bundle install --deployment \
|
||||
--path="../$bundle_name/bundle" \
|
||||
--without=test rdoc
|
||||
|
||||
cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT "../$bundle_name"
|
||||
popd
|
||||
cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT \
|
||||
"../$bundle_name"
|
||||
popd > /dev/null
|
||||
tar czf $bundle_name.tar.gz $bundle_name
|
||||
cd ..
|
||||
}
|
||||
echo
|
||||
echo "Bundle: dist/$bundle_name.tar.gz"
|
||||
|
|
@ -213,18 +219,18 @@ function make_links()
|
|||
|
||||
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.
|
||||
dist Build a diaspora application tarball.
|
||||
bundle Build a bundler(1) bundle for diaspora.
|
||||
links Symlink bundle and source tarballs to rpm source dir.
|
||||
|
||||
All results are stored in dist/
|
||||
-c Use a given commit, defaults to last checked in.
|
||||
dist Build a diaspora application tarball.
|
||||
bundle Build a bundler(1) bundle for diaspora.
|
||||
links Symlink bundle and source tarballs to rpm source dir.
|
||||
|
||||
All results are stored in dist/
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
test "$1" = "-h" -o $# = 0 && {
|
||||
|
|
@ -242,25 +248,25 @@ test "$1" = "-c" && {
|
|||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
case $1 in
|
||||
|
||||
"bundle") make_bundle $commit
|
||||
;;
|
||||
"bundle") make_bundle $commit
|
||||
;;
|
||||
|
||||
'source') make_dist $commit
|
||||
;;
|
||||
'source') make_dist $commit
|
||||
;;
|
||||
|
||||
'links') make_links $commit
|
||||
;;
|
||||
'links') make_links $commit
|
||||
;;
|
||||
|
||||
"fix_gemfile")
|
||||
fix_gemfile
|
||||
;;
|
||||
"fix_gemfile")
|
||||
fix_gemfile
|
||||
;;
|
||||
|
||||
*) usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
*) usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue