diff --git a/pkg/fedora/diaspora-bundle.spec b/pkg/fedora/diaspora-bundle.spec index 27abb2b45..49d1e714f 100644 --- a/pkg/fedora/diaspora-bundle.spec +++ b/pkg/fedora/diaspora-bundle.spec @@ -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 diff --git a/pkg/fedora/diaspora-reset b/pkg/fedora/diaspora-reset index cc07c78b4..5557a645c 100755 --- a/pkg/fedora/diaspora-reset +++ b/pkg/fedora/diaspora-reset @@ -6,7 +6,7 @@ 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 diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index f6ff46bb7..23eb420d5 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -24,12 +24,12 @@ if rake db:seed:dev; then 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 diff --git a/pkg/fedora/diaspora.spec b/pkg/fedora/diaspora.spec index 6796f4e11..533f170d3 100644 --- a/pkg/fedora/diaspora.spec +++ b/pkg/fedora/diaspora.spec @@ -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 1.1009280542_859ec2d +* Fri Sep 24 2010 Alec Leamas 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) diff --git a/pkg/fedora/make-dist.sh b/pkg/fedora/make-dist.sh index e44155b42..d8407ab9d 100755 --- a/pkg/fedora/make-dist.sh +++ b/pkg/fedora/make-dist.sh @@ -66,7 +66,7 @@ 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 @@ -81,7 +81,7 @@ function fix_bundle_deps next } { print}' \ - < $1 > $1.tmp && cp $1.tmp $1 && rm $1.tmp + < $1 > $1.tmp && mv -f $1.tmp $1 } function patch() @@ -92,10 +92,10 @@ function patch() -e '/^Version:/s|.*|Version: '$1'|' \ 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|" \ + 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 @@ -117,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 @@ -144,11 +143,18 @@ function make_dist 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)" @@ -170,15 +176,13 @@ function make_bundle() 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 \ --path="../$bundle_name/bundle" \ --without=test rdoc cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT \ "../$bundle_name" - popd + popd > /dev/null tar czf $bundle_name.tar.gz $bundle_name cd .. }