Applied RPM build patch from Laurent Jean-Rigaud

This commit is contained in:
ritt 2020-02-26 09:23:54 +01:00
parent 4936b76915
commit 1812e7c5fe
4 changed files with 46 additions and 20 deletions

View File

@ -1,6 +1,6 @@
#!/bin/csh #!/bin/csh
#Usage: build [-n] <version> <release> # Usage: build [-n] <version> <release>
#Build ELOG distribution # Build ELOG distribution
if ($#argv < 2) then if ($#argv < 2) then
echo "Usage: build <version> <release>" echo "Usage: build <version> <release>"
@ -12,8 +12,6 @@ set release = $argv[2]
set dir = /tmp/elog-$version set dir = /tmp/elog-$version
set archive = elog-$version-$release.tar.gz set archive = elog-$version-$release.tar.gz
perl -wapi.bak -e 's&^(Version:\s+).*$&${1}'"${version}"'&;s&^(Release:\s+).*$&${1}'"${release}"'&;' elog.spec
# create temporary directory # create temporary directory
rm -Rf $dir rm -Rf $dir
mkdir $dir mkdir $dir
@ -68,19 +66,35 @@ rm -Rf $dir
# transfer archive # transfer archive
echo 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 cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz
cd ~ritt/elog
cp -f doc/ChangeLog ~ritt/html/elog/download/ChangeLog # if running on at PSI copy to download area
if ( -d /home/ritt ) then
echo "Copy to download area"
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 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 # building RPMs
echo Build RPMs... echo Build RPMs..
rm -f ~/rpmbuild/RPMS/x86_64/* rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $?
rm -f ~/rpmbuild/SRPMS/*
rpmbuild -ba elog.spec || exit $? # if running on at PSI copy to download area
cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/ if ( -d /home/ritt ) then
cp ~/rpmbuild/RPMS/x86_64/elog-$version-$release.x86_64.rpm ~ritt/html/elog/download/RPMS/elog-latest.x86_64.rpm if ( -d ~ritt/html/elog/download/tar ) then
cp ~/rpmbuild/SRPMS/elog*rpm ~ritt/html/elog/download/SRPMS/ cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/
cp ~/rpmbuild/SRPMS/elog-$version-$release.src.rpm ~ritt/html/elog/download/SRPMS/elog-latest.src.rpm 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

View File

@ -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 Name: elog
Summary: elog is a standalone electronic web logbook Summary: elog is a standalone electronic web logbook
Version: 3.1.4 Version: %version
Release: 2 Release: %release%{?dist}
License: GPL License: GPL
Group: Applications/Networking Group: Applications/Networking
Source: http://elog.psi.ch/elog/download/elog-%{version}.tar.gz 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. each weblog can be totally different from the rest.
%changelog %changelog
* %{build_timestamp} Stefan Ritt <stefan.ritt@psi.ch> %version-%release
- Updated from git
* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch> * Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
- Made adjustments for new elog server and RH7 - Made adjustments for new elog server and RH7
* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch> * 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 || : -g elog -M -r elog 2>/dev/null || :
%build %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 sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
%install %install

View File

@ -6,6 +6,9 @@
# config: /usr/local/elog/elogd.cfg # config: /usr/local/elog/elogd.cfg
# pidfile: /var/run/elogd.pid # pidfile: /var/run/elogd.pid
# RHEL
[ -f /etc/init.d/functions ] && . /etc/init.d/functions
# Check for the config file # Check for the config file
if [ ! -f /usr/local/elog/elogd.cfg ]; then if [ ! -f /usr/local/elog/elogd.cfg ]; then
exit 0 exit 0

View File

@ -6,6 +6,9 @@
# config: @PREFIX@/elog/elogd.cfg # config: @PREFIX@/elog/elogd.cfg
# pidfile: /var/run/elogd.pid # pidfile: /var/run/elogd.pid
# RHEL
[ -f /etc/init.d/functions ] && . /etc/init.d/functions
# Check for the config file # Check for the config file
if [ ! -f @PREFIX@/elog/elogd.cfg ]; then if [ ! -f @PREFIX@/elog/elogd.cfg ]; then
exit 0 exit 0