diff --git a/Makefile b/Makefile index d8eecba..87cb502 100644 --- a/Makefile +++ b/Makefile @@ -23,16 +23,32 @@ RCDIR = $(ROOT)/etc/rc.d/init.d SRVDIR = $(ROOT)/usr/lib/systemd/system # flag for SSL support +ifdef USESSL USE_SSL = 1 +else +USE_SSL = 0 +endif # flag for Kerberos support, please turn on if you need Kerberos +ifdef USEKRB5 +USE_KRB5 = 1 +else USE_KRB5 = 0 +endif # flag for LDAP support, please turn on if you need LDAP +ifdef USELDAP +USE_LDAP = 1 +else USE_LDAP = 0 +endif # flag for PAM support, please turn on if you need PAM +ifdef USEPAM +USE_PAM = 1 +else USE_PAM = 0 +endif ############################################################# diff --git a/buildrpm b/buildrpm index 1c0b9bc..8dde819 100755 --- a/buildrpm +++ b/buildrpm @@ -1,17 +1,38 @@ #!/bin/csh -# Usage: build [-n] +# Usage: build [-n] [-krb5] [-ldap] [-pam] [-ssl] # Build ELOG distribution if ($#argv < 2) then - echo "Usage: build " + echo "Usage: build [-krb5] [-ldap] [-pam] [-ssl]" exit endif set version = $argv[1] set release = $argv[2] +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 + set dist = `rpm --eval %{\?dist}` set dir = /tmp/elog-$version -set archive = elog-$version.tar.gz +set archive = elog-$version-$release.tar.gz # create temporary directory rm -Rf $dir @@ -65,7 +86,8 @@ rm -Rf $dir # transfer archive echo Transfer archive... -mkdir -p ~/rpmbuild/SOURCES && cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz +[ ! -d ~/rpmbuild/SOURCES ] && mkdir -p ~/rpmbuild/SOURCES +cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version-$release.tar.gz # if running on at PSI copy to download area if (`hostname` == 'elog01.psi.ch') then @@ -75,6 +97,8 @@ if (`hostname` == 'elog01.psi.ch') then cp -v /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz cp -vf doc/ChangeLog ~ritt/html/elog/download/ChangeLog endif + # define Factory Packager + set BUILDOPTS="${BUILDOPTS} --define \"packager Stefan Ritt \"" endif rm -f /tmp/$archive @@ -83,8 +107,13 @@ rm -f ~/rpmbuild/RPMS/*/elog*${version}-${release}*.rpm rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm # building RPMs +cp elog.spec.template ~/rpmbuild/SPECS/elog.spec +sed -i "s/__ELOGVER__/${version}/;s/__ELOGREL__/${release}/" ~/rpmbuild/SPECS/elog.spec echo Build RPMs... -rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $? +set factorydate = `env LC_TIME=C date '+%a %b %d %Y'` +rpmbuild -ba ${BUILDOPTS} --define "factorydate ${factorydate}" \ + --define "version ${version}" --define "elogrel ${release}" \ + ~/rpmbuild/SPECS/elog.spec || exit $? # if running on at PSI copy to download area if (`hostname` == 'elog01.psi.ch') then diff --git a/elog.spec b/elog.spec deleted file mode 100755 index 8397eab..0000000 --- a/elog.spec +++ /dev/null @@ -1,107 +0,0 @@ -# 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: %version -Release: %release%{?dist} -License: GPL -Group: Applications/Networking -Source: http://elog.psi.ch/elog/download/elog-%{version}.tar.gz -Vendor: Stefan Ritt -URL: http://elog.psi.ch/elog -BuildRoot: /tmp/%{name}-root -Prefix: /usr/local -BuildRequires: openssl-devel >= 0.9.8e - -%description -ELOG is part of a family of applications known as weblogs. -Their general purpose is : - -1. To make it easy for people to put information online in a chronological - fashion, in the form of short, time-stamped text messages ("entries") - with optional HTML markup for presentation, and optional file attachments - (images, archives, etc.) - -2. To make it easy for other people to access this information through a - Web interface, browse entries, search, download files, and optionally add, - update, delete or comment on entries. - -ELOG is a remarkable implementation of a weblog in at least two respects : - -- Its simplicity of use: you don't need to be a seasoned server operator -and/or an experimented database administrator to run ELOG ; one executable -file (under Unix or Windows), a simple configuration text file, and it works. -No Web server or relational database required. It is also easy to translate -the interface to the appropriate language for your users. - -- Its versatility: through its single configuration file, ELOG can be made -to display an infinity of variants of the weblog concept. There are options -for what to display, how to display it, what commands are available and to whom, -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 %version-%release -- Updated from git -* Wed Sep 26 2018 Stefan Ritt -- Made adjustments for new elog server and RH7 -* Fri Aug 29 2014 Stefan Ritt -- Added BuildRequires, thanks to Stefan Roiser from CERN -* Fri Oct 21 2005 Stefan Ritt -- Added resources/ directory -* Fri Mar 14 2003 Stefan Ritt -- Added %post to change ownership of elog files -* Thu Jan 30 2003 Stefan Ritt -- Added installation of man pages, thanks to Serge Droz -* Tue Aug 13 2002 Stefan Ritt -- Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr] -* Tue Jun 18 2002 Stefan Ritt -- Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/ -* Tue Jun 18 2002 Serge Droz -- Update to 2.0.0 -* Mon Jun 3 2002 Serge Droz -- Update to 1.3.6 -* Fri May 31 2002 Serge Droz -- Initial RPM - - -%prep -%setup -q - -%pre -%{_sbindir}/groupadd -r elog 2>/dev/null || : -%{_sbindir}/useradd -d / -s /bin/false \ - -g elog -M -r elog 2>/dev/null || : - -%build -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 -make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir} - -%post -chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -/etc/rc.d/init.d/elogd -%{_mandir}/man1/* -%{_mandir}/man8/* -%doc README COPYING doc -%defattr(-,elog,elog) -%prefix/bin/* -%prefix/sbin/elogd -%prefix/elog/resources -%prefix/elog/ssl -%prefix/elog/themes -%prefix/elog/scripts -%prefix/elog/logbooks -%config(noreplace) %prefix/elog/elogd.cfg diff --git a/elog.spec.template b/elog.spec.template --- a/elog.spec.template +++ b/elog.spec.template 0a1,139 > # ELOG weblog application > # rpmbuild -ba --define 'elogver 3.1.4' --define 'elogrel 2' --with ssl --with pam --with ldap --with krb5 --define 'factorydate date' > > # define date of build for changelog and default release > %define build_timestamp %(LC_TIME=C date '+%a %b %d %Y') > %{!?factorydate: %define factorydate %build_timestamp} > > # default version and release > %{!?elogver: %define elogver __ELOGVER__ } > %{!?elogrel: %define elogrel __ELOGREL__ } > # default release is build date > %{!?elogrel: %define elogrel %{build_timestamp} } > > # Build options : > # Read: If neither macro exists, then add the default definition. > %{?_with_krb5: %define _with_krb5 USEKRB5=1} > %{?_with_ldap: %define _with_ldap USELDAP=1} > %{?_with_pam: %define _with_pam USEPAM=1} > %{?_with_ssl: %define _with_ssl USESSL=1} > # Default build options are with SSL > %{!?_with_ssl: %{!?_without_ssl: %define _with_ssl USESSL=1}} > # builder info > %define whoami %(eval who am i | awk '{print $1}') > %define HOSTNAME %(hostname) > %{!?packager: %define packager %{whoami} %{whoami}@%{HOSTNAME}} > > Name: elog > Summary: elog is a standalone electronic web logbook > Version: %elogver > Release: %elogrel%{?customrel}%{?dist} > License: GPL > Group: Applications/Networking > Source: http://elog.psi.ch/elog/download/elog-%{elogver}-%{elogrel}.tar.gz > Vendor: Stefan Ritt > URL: http://elog.psi.ch/elog > BuildRoot: /tmp/%{name}-root > Prefix: /usr/local > # Add build dependencies for pam, ssl and ldap features if enabled. > # Note: Tag tokens must start at beginning-of-line. > # > # Read: If feature is enabled, then add the build dependency. > %{?_with_krb5:BuildRequires: krb5-devel} > %{?_with_krb5:Requires: krb5-libs} > %{?_with_ldap:BuildRequires: openldap-devel >= 2.4.1} > %{?_with_ldap:Requires: openldap >= 2.4.1} > %{?_with_pam:BuildRequires: pam-devel >= 1.1.1} > %{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e} > > %description > ELOG is part of a family of applications known as weblogs. > Their general purpose is : > > 1. To make it easy for people to put information online in a chronological > fashion, in the form of short, time-stamped text messages ("entries") > with optional HTML markup for presentation, and optional file attachments > (images, archives, etc.) > > 2. To make it easy for other people to access this information through a > Web interface, browse entries, search, download files, and optionally add, > update, delete or comment on entries. > > ELOG is a remarkable implementation of a weblog in at least two respects : > > - Its simplicity of use: you don't need to be a seasoned server operator > and/or an experimented database administrator to run ELOG ; one executable > file (under Unix or Windows), a simple configuration text file, and it works. > No Web server or relational database required. It is also easy to translate > the interface to the appropriate language for your users. > > - Its versatility: through its single configuration file, ELOG can be made > to display an infinity of variants of the weblog concept. There are options > for what to display, how to display it, what commands are available and to whom, > access control, etc. Moreover, a single server can host several weblogs, and > each weblog can be totally different from the rest. > > %changelog > * %{build_timestamp} %{packager} %{version}-%{release} > - rebuild with option(s): %{?_with_krb5:KRB5 }%{?_with_ldap:LDAP }%{?_with_pam:PAM }%{?_with_ssl:SSL} > > * %{factorydate} Stefan Ritt %{version}-%{release} > - Updated from git > * Wed Sep 26 2018 Stefan Ritt > - Made adjustments for new elog server and RH7 > * Fri Aug 29 2014 Stefan Ritt > - Added BuildRequires, thanks to Stefan Roiser from CERN > * Fri Oct 21 2005 Stefan Ritt > - Added resources/ directory > * Fri Mar 14 2003 Stefan Ritt > - Added %post to change ownership of elog files > * Thu Jan 30 2003 Stefan Ritt > - Added installation of man pages, thanks to Serge Droz > * Tue Aug 13 2002 Stefan Ritt > - Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr] > * Tue Jun 18 2002 Stefan Ritt > - Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/ > * Tue Jun 18 2002 Serge Droz > - Update to 2.0.0 > * Mon Jun 3 2002 Serge Droz > - Update to 1.3.6 > * Fri May 31 2002 Serge Droz > - Initial RPM > > > %prep > %setup -q > > %pre > %{_sbindir}/groupadd -r elog 2>/dev/null || : > %{_sbindir}/useradd -d / -s /bin/false \ > -g elog -M -r elog 2>/dev/null || : > > %build > make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} 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 > make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir} > > %post > chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog > > %clean > rm -rf $RPM_BUILD_ROOT > > %files > %defattr(-,root,root) > /etc/rc.d/init.d/elogd > %{_mandir}/man1/* > %{_mandir}/man8/* > %doc README COPYING doc > %defattr(-,elog,elog) > %prefix/bin/* > %prefix/sbin/elogd > %prefix/elog/resources > %prefix/elog/ssl > %prefix/elog/themes > %prefix/elog/scripts > %prefix/elog/logbooks > %config(noreplace) %prefix/elog/elogd.cfg