mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
New update for RPM build script from L.JR
This commit is contained in:
parent
13c50f10b8
commit
6ba4bce7f4
32
Makefile
32
Makefile
@ -25,22 +25,21 @@ SRVDIR = $(ROOT)/usr/lib/systemd/system
|
|||||||
# flag for SSL support
|
# flag for SSL support
|
||||||
USE_SSL = 1
|
USE_SSL = 1
|
||||||
|
|
||||||
# flag for Kerberos support, please turn on if you need Kerberos
|
# flag for Kerberos support, please turn off if you don't need Kerberos
|
||||||
USE_KRB5 = 0
|
USE_KRB5 = 1
|
||||||
|
|
||||||
# flag for LDAP support, please turn on if you need LDAP
|
# flag for LDAP support, please turn off if you don't need LDAP
|
||||||
USE_LDAP = 0
|
USE_LDAP = 1
|
||||||
|
|
||||||
# flag for PAM support, please turn on if you need PAM
|
# flag for PAM support, please turn of if you don't need PAM
|
||||||
USE_PAM = 0
|
USE_PAM = 1
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
# Default compilation flags unless stated otherwise.
|
# Default compilation flags unless stated otherwise.
|
||||||
CFLAGS += -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml
|
CFLAGS += -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-results -Imxml
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
IFLAGS = -kr -nut -i3 -l110
|
|
||||||
EXECS = elog elogd elconv
|
EXECS = elog elogd elconv
|
||||||
OBJS = mxml.o crypt.o regex.o
|
OBJS = mxml.o crypt.o regex.o
|
||||||
GIT_REVISION = src/git-revision.h
|
GIT_REVISION = src/git-revision.h
|
||||||
@ -92,29 +91,29 @@ endif
|
|||||||
|
|
||||||
ifdef USE_SSL
|
ifdef USE_SSL
|
||||||
ifneq ($(USE_SSL),0)
|
ifneq ($(USE_SSL),0)
|
||||||
CFLAGS += -DHAVE_SSL
|
override CFLAGS += -DHAVE_SSL
|
||||||
LIBS += -lssl
|
LIBS += -lssl
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_KRB5
|
ifdef USE_KRB5
|
||||||
ifneq ($(USE_KRB5),0)
|
ifneq ($(USE_KRB5),0)
|
||||||
CFLAGS += -DHAVE_KRB5
|
override CFLAGS += -DHAVE_KRB5
|
||||||
LIBS += -lkrb5
|
LIBS += -lkrb5
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_LDAP
|
ifdef USE_LDAP
|
||||||
ifneq ($(USE_LDAP),0)
|
ifneq ($(USE_LDAP),0)
|
||||||
CFLAGS += -DHAVE_LDAP
|
override CFLAGS += -DHAVE_LDAP
|
||||||
LIBS += -lldap
|
LIBS += -lldap
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef USE_PAM
|
ifdef USE_PAM
|
||||||
ifneq ($(USE_PAM),0)
|
ifneq ($(USE_PAM),0)
|
||||||
CFLAGS += -DHAVE_PAM
|
override CFLAGS += -DHAVE_PAM
|
||||||
LIBS += -lpam
|
LIBS += -lpam -llber
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -160,13 +159,6 @@ debug: src/elogd.c auth.o $(OBJS)
|
|||||||
%: src/%.c
|
%: src/%.c
|
||||||
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
|
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
|
||||||
|
|
||||||
indent:
|
|
||||||
for src in src/*.c; do \
|
|
||||||
d2u $$src; \
|
|
||||||
indent $(IFLAGS) $$src; \
|
|
||||||
u2d $$src; \
|
|
||||||
done
|
|
||||||
|
|
||||||
ifeq ($(OSTYPE),CYGWIN_NT-5.1)
|
ifeq ($(OSTYPE),CYGWIN_NT-5.1)
|
||||||
loc: locext.exe
|
loc: locext.exe
|
||||||
for lang in resources/eloglang*; do \
|
for lang in resources/eloglang*; do \
|
||||||
|
|||||||
53
buildrpm
53
buildrpm
@ -1,18 +1,43 @@
|
|||||||
#!/bin/csh -x
|
#!/bin/csh -v
|
||||||
# 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> [-krb5] [-ldap] [-pam] [-ssl]"
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set version = $argv[1]
|
set version = $argv[1]
|
||||||
set release = $argv[2]
|
set release = $argv[2]
|
||||||
|
set REV = "unknown"
|
||||||
|
set i = 0
|
||||||
|
set BUILDOPTS=""
|
||||||
|
foreach argument ($argv)
|
||||||
|
set i=`expr $i + 1`
|
||||||
|
if ($i <= 2) continue
|
||||||
|
switch ($argument)
|
||||||
|
case "-ldap":
|
||||||
|
set BUILDOPTS="$BUILDOPTS --with ldap"
|
||||||
|
breaksw
|
||||||
|
case "-pam":
|
||||||
|
set BUILDOPTS="$BUILDOPTS --with pam"
|
||||||
|
breaksw
|
||||||
|
case "-ssl":
|
||||||
|
set BUILDOPTS="$BUILDOPTS --with ssl"
|
||||||
|
breaksw
|
||||||
|
case "-krb5":
|
||||||
|
set BUILDOPTS="$BUILDOPTS --with krb5"
|
||||||
|
breaksw
|
||||||
|
endsw
|
||||||
|
end
|
||||||
|
|
||||||
|
if (`hostname` == 'elog01.psi.ch') then
|
||||||
|
set BUILDOPTS="$BUILDOPTS --with ldap --with pam --with ssl --with krb5"
|
||||||
|
endif
|
||||||
|
|
||||||
set dist = `rpm --eval %{\?dist}`
|
set dist = `rpm --eval %{\?dist}`
|
||||||
set dir = /tmp/elog-$version-$release
|
set dir = /tmp/elog-$version-$release
|
||||||
set archive = elog-$version-$release.tar.gz
|
set archive = elog-$version-$release.tar.gz
|
||||||
set fdate = `date +"%a %b %d %Y"`
|
set fdate = `env LC_TIME=C date +"%a %b %d %Y"`
|
||||||
|
|
||||||
echo ${fdate}
|
echo ${fdate}
|
||||||
|
|
||||||
@ -59,6 +84,18 @@ cp -p ssl/* $dir/ssl
|
|||||||
cp -rp themes/default/* $dir/themes/default
|
cp -rp themes/default/* $dir/themes/default
|
||||||
cp -p logbooks/demo/2001/011108a.log $dir/logbooks/demo/2001/
|
cp -p logbooks/demo/2001/011108a.log $dir/logbooks/demo/2001/
|
||||||
|
|
||||||
|
# add git version for RPM
|
||||||
|
which git >& /dev/null
|
||||||
|
if ( $status != 1 ) then
|
||||||
|
set REV=`git log -n 1 --pretty=format:"%ad - %h"`
|
||||||
|
endif
|
||||||
|
echo \#define GIT_REVISION \"$REV\" > $dir/src/git-revision.h
|
||||||
|
|
||||||
|
# generate correct specfile for current ver-rel
|
||||||
|
sed "s/__ELOGVER__/${version}/;s/__ELOGREL__/${release}/;s/__GIT__/$REV/" elog.spec.template > elog.spec
|
||||||
|
# add elog.spec in archive
|
||||||
|
cp -p elog.spec $dir/
|
||||||
|
|
||||||
# create elog-x.xx-y.tar.gz file
|
# create elog-x.xx-y.tar.gz file
|
||||||
echo Creating archive...
|
echo Creating archive...
|
||||||
tar -czf /tmp/$archive -C /tmp/ elog-$version-$release/
|
tar -czf /tmp/$archive -C /tmp/ elog-$version-$release/
|
||||||
@ -68,7 +105,8 @@ rm -Rf $dir
|
|||||||
|
|
||||||
# transfer archive
|
# transfer archive
|
||||||
echo Transfer archive...
|
echo Transfer archive...
|
||||||
mkdir -p ~/rpmbuild/SOURCES && cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version-$release.tar.gz
|
[ ! -d ~/rpmbuild/SOURCES ] && mkdir -p ~/rpmbuild/SOURCES
|
||||||
|
cp /tmp/$archive ~/rpmbuild/SOURCES/$archive
|
||||||
|
|
||||||
# if running on at PSI copy to download area
|
# if running on at PSI copy to download area
|
||||||
if (`hostname` == 'elog01.psi.ch') then
|
if (`hostname` == 'elog01.psi.ch') then
|
||||||
@ -78,6 +116,8 @@ if (`hostname` == 'elog01.psi.ch') then
|
|||||||
cp -v /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
|
cp -v /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
|
||||||
cp -vf doc/ChangeLog ~ritt/html/elog/download/ChangeLog
|
cp -vf doc/ChangeLog ~ritt/html/elog/download/ChangeLog
|
||||||
endif
|
endif
|
||||||
|
# define Factory Packager
|
||||||
|
#set BUILDOPTS="${BUILDOPTS} --define \"packager Stefan Ritt <stefan.ritt@psi.ch>\""
|
||||||
endif
|
endif
|
||||||
rm -f /tmp/$archive
|
rm -f /tmp/$archive
|
||||||
|
|
||||||
@ -87,7 +127,8 @@ rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm
|
|||||||
|
|
||||||
# building RPMs
|
# building RPMs
|
||||||
echo Build RPMs...
|
echo Build RPMs...
|
||||||
rpmbuild -ba --define "elogver ${version}" --define "elogrel ${release}" --with ssl --with pam --with ldap --with krb5 --define "factorydate ${fdate}" elog.spec || exit $?
|
rpmbuild -ba ${BUILDOPTS} --define "factorydate ${fdate}" \
|
||||||
|
--define "elogver ${version}" --define "elogrel ${release}" elog.spec || exit $?
|
||||||
|
|
||||||
# if running on at PSI copy to download area
|
# if running on at PSI copy to download area
|
||||||
if (`hostname` == 'elog01.psi.ch') then
|
if (`hostname` == 'elog01.psi.ch') then
|
||||||
|
|||||||
11
elog.spec
11
elog.spec
@ -45,8 +45,6 @@ Prefix: /usr/local
|
|||||||
%{?_with_ldap:Requires: openldap >= 2.4.1}
|
%{?_with_ldap:Requires: openldap >= 2.4.1}
|
||||||
%{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
|
%{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
|
||||||
%{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}
|
%{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}
|
||||||
# GAIAOPS: set max N limit to 500
|
|
||||||
# Patch1: elog_set_max_list_500.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ELOG is part of a family of applications known as weblogs.
|
ELOG is part of a family of applications known as weblogs.
|
||||||
@ -78,9 +76,9 @@ each weblog can be totally different from the rest.
|
|||||||
%changelog
|
%changelog
|
||||||
* %{build_timestamp} %{packager} %{version}-%{release}
|
* %{build_timestamp} %{packager} %{version}-%{release}
|
||||||
- rebuild with option(s): %{?_with_krb5:KRB5 }%{?_with_ldap:LDAP }%{?_with_pam:PAM }%{?_with_ssl:SSL}
|
- rebuild with option(s): %{?_with_krb5:KRB5 }%{?_with_ldap:LDAP }%{?_with_pam:PAM }%{?_with_ssl:SSL}
|
||||||
- set MAX_N_LIST to 500 (patch1)
|
|
||||||
* %{factorydate} Stefan Ritt <stefan.ritt@psi.ch> %{version}-%{release}
|
* %{factorydate} Stefan Ritt <stefan.ritt@psi.ch> %{version}-%{release}
|
||||||
- Updated from git
|
- Updated from git Tue Aug 25 13:38:41 2020 +0200 - 13c50f1
|
||||||
* 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>
|
||||||
@ -104,8 +102,7 @@ each weblog can be totally different from the rest.
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q -n elog-%{elogver}-%{elogrel}
|
||||||
# %patch1 -p0
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
%{_sbindir}/groupadd -r elog 2>/dev/null || :
|
%{_sbindir}/groupadd -r elog 2>/dev/null || :
|
||||||
@ -113,7 +110,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 %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
|
make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml"
|
||||||
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
|
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user