Skip to content

Commit

Permalink
Changed the rpm build process
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnou committed Mar 25, 2013
1 parent 072802b commit f4e182c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.settings
config.ini
*.log
*.spec
protected/library/Zend
protected/install/database/version
protected/library/php-atom-lib
2 changes: 2 additions & 0 deletions build/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
order allow,deny
deny from all
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Name: storytlr
Version: 1.3.dev
Release: 1%{?dist}
Version: #VERSION#
Release: #RELEASE#
Summary: Storytlr is an opensource lifestreaming and microblogging platform.
Packager: Laurent Eschenauer <laurent@eschenauer.be>
Group: Applications/Internet
License: Apache 2.0 License
URL: https://github.com/storytlr/storytlr
Source0: %{url}/tarball/storytlr-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-tmp
Source0: %{name}-%{version}-#RELEASE#.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Provides: storytlr
Requires: httpd
Expand All @@ -31,11 +31,11 @@ Storytlr is an opensource lifestreaming and microblogging platform.
%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/lib/storytlr/upload
%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/storytlr

%{__cp} -r storytlr*/* %{buildroot}/usr/share/storytlr/
%{__cp} -r storytlr*/.htaccess %{buildroot}/usr/share/storytlr/.htaccess
%{__cp} -r storytlr*/protected/.htaccess %{buildroot}/usr/share/storytlr/protected/.htaccess
%{__cp} storytlr*/protected/build/rpmbuild/etc/storytlr/storytlr.conf $RPM_BUILD_ROOT%{_sysconfdir}/storytlr/storytlr.conf
%{__cp} storytlr*/protected/build/rpmbuild/etc/httpd/conf.d/storytlr.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/storytlr.conf
%{__cp} -r * %{buildroot}/usr/share/storytlr/
%{__cp} -r .htaccess %{buildroot}/usr/share/storytlr/.htaccess
%{__cp} -r protected/.htaccess %{buildroot}/usr/share/storytlr/protected/.htaccess
%{__cp} build/rpmbuild/etc/storytlr/storytlr.conf $RPM_BUILD_ROOT%{_sysconfdir}/storytlr/storytlr.conf
%{__cp} build/rpmbuild/etc/httpd/conf.d/storytlr.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/storytlr.conf

echo 0 -n > %{buildroot}/usr/share/storytlr/protected/install/database/version

Expand Down
2 changes: 2 additions & 0 deletions scripts/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
order allow,deny
deny from all
32 changes: 32 additions & 0 deletions scripts/build-rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#/bin/bash

# Exit on errors
set -e

NAME="storytlr"

if [ -z $1 ]
then
VERSION=`git describe --long --match "release*dev" | awk -F"-" '{print $2}'`
else
VERSION=$1
fi

if [ -z $2 ]
then
RELEASE=`git describe --long --match "release*dev" | awk -F"-" '{print $3}'`
else
RELEASE=$2
fi

COMMIT=`git describe --long --match "release*dev" | awk -F"-" '{print $4}'`

cd `dirname $0`
cd ..

sed "s/#VERSION#/${VERSION}/g" build/rpmbuild/${NAME}.spec.template > build/rpmbuild/${NAME}.spec
sed -i "s/#RELEASE#/${RELEASE}/g" build/rpmbuild/${NAME}.spec
sed -i "s/#COMMIT#/${COMMIT}/g" build/rpmbuild/${NAME}.spec

tar -cvzf $HOME/rpmbuild/SOURCES/${NAME}-${VERSION}-${RELEASE}.tar.gz --exclude .git --exclude scripts .
rpmbuild -ba build/rpmbuild/${NAME}.spec

0 comments on commit f4e182c

Please sign in to comment.