3182 |
30 Mar 09 |
gregory |
%configure |
3182 |
30 Mar 09 |
gregory |
# http://dev.thep.lu.se/gregory |
3182 |
30 Mar 09 |
gregory |
3 |
|
3182 |
30 Mar 09 |
gregory |
# Teeme-a fur a cuukeeng lessun frum zee Cheff |
3182 |
30 Mar 09 |
gregory |
# Name for this software package |
3564 |
15 Feb 10 |
gregory |
PACKAGE=ProteiosSE |
4045 |
26 Nov 10 |
gregory |
VERSION=2.14.0 |
3565 |
17 Feb 10 |
gregory |
RELEASE=1 |
3182 |
30 Mar 09 |
gregory |
9 |
|
3182 |
30 Mar 09 |
gregory |
# Where to put website files |
3182 |
30 Mar 09 |
gregory |
# Run 'bake web' to generate and copy web related files |
3184 |
31 Mar 09 |
gregory |
WEB_PATH=/home/tom/wwwroot/proteios |
3564 |
15 Feb 10 |
gregory |
TEXT_FILES="$TEXT_FILES|java|manifest|Manifest|config|in|dtd|messages|dictionary|jsp|jspf|xsl" |
3581 |
12 Mar 10 |
gregory |
CATALINA_HOME=/srv/tomcat6 |
3182 |
30 Mar 09 |
gregory |
15 |
|
3581 |
12 Mar 10 |
gregory |
%uninstall |
3581 |
12 Mar 10 |
gregory |
rm -vrf $CATALINA_HOME/webapps/proteios |
3581 |
12 Mar 10 |
gregory |
mysql -u gregory -e "drop database if exists proteios" |
3581 |
12 Mar 10 |
gregory |
19 |
|
3581 |
12 Mar 10 |
gregory |
%build |
3581 |
12 Mar 10 |
gregory |
ant |
3581 |
12 Mar 10 |
gregory |
22 |
|
3581 |
12 Mar 10 |
gregory |
%install |
3581 |
12 Mar 10 |
gregory |
cd dist |
3581 |
12 Mar 10 |
gregory |
./install.sh --force |
3581 |
12 Mar 10 |
gregory |
26 |
|
3581 |
12 Mar 10 |
gregory |
27 |
|
3565 |
17 Feb 10 |
gregory |
%release |
3565 |
17 Feb 10 |
gregory |
sed -i s/"dev"/""/g api/core/src/org/proteios/core/Application.java |
3565 |
17 Feb 10 |
gregory |
ant release |
3565 |
17 Feb 10 |
gregory |
&rpm |
3564 |
15 Feb 10 |
gregory |
32 |
|
3564 |
15 Feb 10 |
gregory |
%rpm |
3564 |
15 Feb 10 |
gregory |
&define_replace_method |
3564 |
15 Feb 10 |
gregory |
if [ ! -d Release ]; then |
3564 |
15 Feb 10 |
gregory |
echo "run ant release first" |
3564 |
15 Feb 10 |
gregory |
exit |
3564 |
15 Feb 10 |
gregory |
fi |
3565 |
17 Feb 10 |
gregory |
here=`pwd` |
3564 |
15 Feb 10 |
gregory |
cp Release/$PACKAGE-$VERSION.tar.gz /usr/src/packages/SOURCES/ |
3564 |
15 Feb 10 |
gregory |
copy_replace rpm.spec /usr/src/packages/SPECS/$PACKAGE-$VERSION.spec |
3564 |
15 Feb 10 |
gregory |
cd /usr/src/packages/SPECS/ |
3564 |
15 Feb 10 |
gregory |
export PREFIX=/tmp/foo |
3564 |
15 Feb 10 |
gregory |
sudo rpmbuild --buildroot $PREFIX -bb $PACKAGE-$VERSION.spec |
3565 |
17 Feb 10 |
gregory |
cp /usr/src/packages/RPMS/x86_64/$PACKAGE-$VERSION-$RELEASE.x86_64.rpm $here/Release/ |
3564 |
15 Feb 10 |
gregory |
46 |
|
3581 |
12 Mar 10 |
gregory |
sudo rpmbuild --buildroot $PREFIX --target i386 -bb $PACKAGE-$VERSION.spec |
3663 |
09 Apr 10 |
gregory |
cp /usr/src/packages/RPMS/i386/$PACKAGE-$VERSION-$RELEASE.i386.rpm $here/Release/ |
3581 |
12 Mar 10 |
gregory |
cd $here/Release |
3581 |
12 Mar 10 |
gregory |
md5sum $PACKAGE-$VERSION-$RELEASE.i386.rpm | awk '{print $1 }' > $PACKAGE-$VERSION-$RELEASE.i386.rpm.MD5 |
3663 |
09 Apr 10 |
gregory |
md5sum $PACKAGE-$VERSION-$RELEASE.x86_64.rpm | awk '{print $1 }' > $PACKAGE-$VERSION-$RELEASE.x86_64.rpm.MD5 |
3581 |
12 Mar 10 |
gregory |
52 |
|
3182 |
30 Mar 09 |
gregory |
%create_web_environment |
3182 |
30 Mar 09 |
gregory |
mkdir -vp $WEB_PATH |
3182 |
30 Mar 09 |
gregory |
for dir in `find ./htdocs/ -type d -name "*" | grep -v ".svn"` |
3182 |
30 Mar 09 |
gregory |
do |
3182 |
30 Mar 09 |
gregory |
dir=${dir##\.\/htdocs\/} |
3182 |
30 Mar 09 |
gregory |
mkdir -vp $WEB_PATH/$dir |
3182 |
30 Mar 09 |
gregory |
done |
3182 |
30 Mar 09 |
gregory |
60 |
|
3564 |
15 Feb 10 |
gregory |
61 |
|
3263 |
07 May 09 |
gregory |
%define_replace_method |
3263 |
07 May 09 |
gregory |
copy_replace() |
3263 |
07 May 09 |
gregory |
64 |
{ |
3263 |
07 May 09 |
gregory |
cat $1 | |
3565 |
17 Feb 10 |
gregory |
replace -s "_RELEASE_" "$RELEASE" \ |
3565 |
17 Feb 10 |
gregory |
"_PACKAGE_" "$PACKAGE" \ |
3565 |
17 Feb 10 |
gregory |
"_VERSION_" "$VERSION" \ |
3263 |
07 May 09 |
gregory |
"_MD5_GZ_" "$MD5_GZ" \ |
3263 |
07 May 09 |
gregory |
"_MD5_ZIP_" "$MD5_ZIP" \ |
3263 |
07 May 09 |
gregory |
"_MD5_RPM_" "$MD5_RPM" \ |
3581 |
12 Mar 10 |
gregory |
"_MD5_RPM_386_" "$MD5_RPM_386" \ |
3263 |
07 May 09 |
gregory |
> $2 |
3263 |
07 May 09 |
gregory |
echo "copy_replace $1 -> $2" |
3263 |
07 May 09 |
gregory |
75 |
} |
3263 |
07 May 09 |
gregory |
76 |
|
3263 |
07 May 09 |
gregory |
77 |
|
3182 |
30 Mar 09 |
gregory |
%web |
3182 |
30 Mar 09 |
gregory |
&define_replace_method |
3182 |
30 Mar 09 |
gregory |
&create_web_environment |
3565 |
17 Feb 10 |
gregory |
MD5_GZ=`cat Release/$PACKAGE-$VERSION.tar.gz.MD5` |
3565 |
17 Feb 10 |
gregory |
MD5_ZIP=`cat Release/$PACKAGE-$VERSION.zip.MD5` |
3565 |
17 Feb 10 |
gregory |
MD5_RPM=`cat Release/$PACKAGE-$VERSION-$RELEASE.x86_64.rpm.MD5` |
3564 |
15 Feb 10 |
gregory |
84 |
|
3182 |
30 Mar 09 |
gregory |
for file in `find ./htdocs/ $FIND_PARAM -regex ".*($TEXT_FILES)$"` |
3182 |
30 Mar 09 |
gregory |
do |
3182 |
30 Mar 09 |
gregory |
if [ -f $file ]; then |
3182 |
30 Mar 09 |
gregory |
file=${file##\.\/htdocs\/} |
3182 |
30 Mar 09 |
gregory |
copy_replace htdocs/$file $WEB_PATH/$file |
3182 |
30 Mar 09 |
gregory |
fi |
3182 |
30 Mar 09 |
gregory |
done |
3182 |
30 Mar 09 |
gregory |
# copy images |
3182 |
30 Mar 09 |
gregory |
for file in `find ./htdocs/ $FIND_PARAM -regex ".*($BINARY_FILES)$"` |
3182 |
30 Mar 09 |
gregory |
do |
3182 |
30 Mar 09 |
gregory |
if [ -f $file ]; then |
3182 |
30 Mar 09 |
gregory |
file=${file##\.\/htdocs\/} |
3182 |
30 Mar 09 |
gregory |
cp -v htdocs/$file $WEB_PATH/$file |
3182 |
30 Mar 09 |
gregory |
fi |
3182 |
30 Mar 09 |
gregory |
done |
3182 |
30 Mar 09 |
gregory |
100 |
|
3182 |
30 Mar 09 |
gregory |
101 |
|
3182 |
30 Mar 09 |
gregory |
102 |
|
3182 |
30 Mar 09 |
gregory |
103 |
|
3182 |
30 Mar 09 |
gregory |
104 |
|