diff --git a/buildrpm b/buildrpm
index 9d21f4a..dba7067 100755
--- a/buildrpm
+++ b/buildrpm
@@ -12,7 +12,7 @@ set release = $argv[2]
set dir = /tmp/elog-$version
set archive = elog-$version-$release.tar.gz
-perl -wapi.bak -e 's&^(Version:\s+).*$&${1}'"${version}"'&;s&^(Release:\s+).*$&${1}'"${release}"'&;' elog.spec
+#perl -wapi.bak -e 's&^(Version:\s+).*$&${1}'"${version}"'&;s&^(Release:\s+).*$&${1}'"${release}"'&;' elog.spec
# create temporary directory
rm -Rf $dir
@@ -68,19 +68,33 @@ rm -Rf $dir
# transfer archive
echo Transfer archive...
-cp /tmp/$archive ~ritt/html/elog/download/tar/
-cp /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz
-cd ~ritt/elog
-cp -f doc/ChangeLog ~ritt/html/elog/download/ChangeLog
+# If Stefan...
+if ( -d /home/ritt ) then
+ echo "Manager mode"
+ if ( -d ~ritt/html/elog/download/tar ) then
+ cp /tmp/$archive ~ritt/html/elog/download/tar/
+ cp /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
+ cd ~ritt/elog
+ cp -f doc/ChangeLog ~ritt/html/elog/download/ChangeLog
+ endif
+endif
+cd -
rm -f /tmp/$archive
+echo Cleanup $version-$release rpms
+rm -f ~/rpmbuild/RPMS/*/elog*${version}-${release}*.rpm
+rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm
# building RPMs
-echo Build RPMs...
-rm -f ~/rpmbuild/RPMS/x86_64/*
-rm -f ~/rpmbuild/SRPMS/*
-rpmbuild -ba elog.spec || exit $?
-cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/
-cp ~/rpmbuild/RPMS/x86_64/elog-$version-$release.x86_64.rpm ~ritt/html/elog/download/RPMS/elog-latest.x86_64.rpm
-cp ~/rpmbuild/SRPMS/elog*rpm ~ritt/html/elog/download/SRPMS/
-cp ~/rpmbuild/SRPMS/elog-$version-$release.src.rpm ~ritt/html/elog/download/SRPMS/elog-latest.src.rpm
+echo Build RPMs..
+rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $?
+
+# If Stefan...
+if ( -d /home/ritt ) then
+ if ( -d ~ritt/html/elog/download/tar ) then
+ cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/
+ cp ~/rpmbuild/RPMS/x86_64/elog-$version-$release.x86_64.rpm ~ritt/html/elog/download/RPMS/elog-latest.x86_64.rpm
+ cp ~/rpmbuild/SRPMS/elog*rpm ~ritt/html/elog/download/SRPMS/
+ cp ~/rpmbuild/SRPMS/elog-$version-$release.src.rpm ~ritt/html/elog/download/SRPMS/elog-latest.src.rpm
+ endif
+endif
diff --git a/elog.spec b/elog.spec
index 16add8f..8397eab 100755
--- a/elog.spec
+++ b/elog.spec
@@ -1,9 +1,13 @@
-# OpenSSH privilege separation requires a user & group ID
+# ELOG weblog application
+# rpmbuild -ba --define 'version 3.1.4' --define 'release 2' --define "date $(LC_TIME=En date '+%a %b %d %Y')" elog.spec
+
+#define date $(LC_TIME=En date '+%a %b %d %Y')
+%define build_timestamp %(LC_TIME=En date '+%a %b %d %Y')
Name: elog
Summary: elog is a standalone electronic web logbook
-Version: 3.1.4
-Release: 2
+Version: %version
+Release: %release%{?dist}
License: GPL
Group: Applications/Networking
Source: http://elog.psi.ch/elog/download/elog-%{version}.tar.gz
@@ -41,6 +45,8 @@ access control, etc. Moreover, a single server can host several weblogs, and
each weblog can be totally different from the rest.
%changelog
+* %{build_timestamp} Stefan Ritt <stefan.ritt@psi.ch> %version-%release
+- Updated from git
* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
- Made adjustments for new elog server and RH7
* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
@@ -72,7 +78,7 @@ each weblog can be totally different from the rest.
-g elog -M -r elog 2>/dev/null || :
%build
-make
+make CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
%install
diff --git a/elogd.init b/elogd.init
index 5d4e7ee..e04143c 100644
--- a/elogd.init
+++ b/elogd.init
@@ -6,6 +6,9 @@
# config: /usr/local/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
+# RHEL
+[ -f /etc/init.d/functions ] && . /etc/init.d/functions
+
# Check for the config file
if [ ! -f /usr/local/elog/elogd.cfg ]; then
exit 0
diff --git a/elogd.init_template b/elogd.init_template
index e94b5d7..bb1b330 100755
--- a/elogd.init_template
+++ b/elogd.init_template
@@ -6,6 +6,9 @@
# config: @PREFIX@/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
+# RHEL
+[ -f /etc/init.d/functions ] && . /etc/init.d/functions
+
# Check for the config file
if [ ! -f @PREFIX@/elog/elogd.cfg ]; then
exit 0
|