Compare commits

..

No commits in common. "rawhide" and "f13" have entirely different histories.

8 changed files with 457 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/yaws-1.89.tar.gz

View file

@ -1 +0,0 @@
Orphaned for 6+ weeks

1
sources Normal file
View file

@ -0,0 +1 @@
681108c95ef5cd6a64d28952b46d54e6 yaws-1.89.tar.gz

View file

@ -0,0 +1,30 @@
From 28b2a40b5aedeea9c04d1dac2a2f663ea750de3c Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Wed, 17 Nov 2010 18:20:23 +0300
Subject: [PATCH 3/3] Add yaws_dime.erl to the list of modules to compile
This module is used in yaws_rpc, yaws_soap_lib and
yaws_soap_srv modules but it wasn't compiled. So it's
quite likely that application will fails with 'undef'
error.
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
src/Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index bd06406..11c412a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -55,6 +55,7 @@ MODULES=yaws \
yaws_sup_restarts \
yaws_stats \
yaws_multipart \
+ yaws_dime \
$(BITSMODS)
--
1.7.3.2

43
yaws-1.85-sysvinit.patch Normal file
View file

@ -0,0 +1,43 @@
From: Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com>
Do not enable the service by default.
More robustly determine if we're running.
diff -up yaws-1.85/scripts/redhat/yaws.init.d.sysvinit yaws-1.85/scripts/redhat/yaws.init.d
--- yaws-1.85/scripts/redhat/yaws.init.d.sysvinit 2009-10-17 23:07:14.000000000 +0200
+++ yaws-1.85/scripts/redhat/yaws.init.d 2009-11-02 21:43:14.000000000 +0100
@@ -4,7 +4,7 @@
#
# config: /etc/yaws.conf
#
-# chkconfig: 2345 65 35
+# chkconfig: - 65 35
# description: yaws - Erlang enabled http server
# use "/sbin/chkconfig --add yaws" to install
@@ -21,6 +21,7 @@ prog=yaws
yawsid=default
#yawsid_opts="--id $yawsid"
conf="--conf %etcdir%yaws/yaws.conf"
+[ "$HOME" ] || HOME=/root
start() {
echo -n $"Starting $prog: "
@@ -62,7 +63,7 @@ case "$1" in
stop
;;
status)
- $yaws -S
+ [ -f ${HOME}/.yaws/yaws/default/CTL ] && $yaws -S
RETVAL=$?
;;
restart)
@@ -70,7 +71,7 @@ case "$1" in
start
;;
condrestart)
- if [ -f /tmp/yaws.ctl ] ; then
+ if [ -f ${HOME}/.yaws/yaws/default/CTL ] && $yaws -S >/dev/null 2>&1; then
stop
start
fi

180
yaws-1.88-fhs.patch Normal file
View file

@ -0,0 +1,180 @@
From f98e56057baf629cf82658f854b5e103f53c0278 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com>
Date: Mon, 13 Sep 2010 16:42:17 +0200
Subject: [PATCH] Install into FHS-compliant hierarchy
basically move /var/yaws into /var/lib/yaws and ensure logs stay in
/var/log. Also, use /usr/lib64 on 64-bit.
---
Makefile | 8 ++++----
c_src/Makefile | 10 +++++-----
include.mk.in | 3 ++-
scripts/Install | 11 ++++++-----
scripts/Makefile | 8 ++++----
src/Makefile | 16 ++++++++--------
6 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/Makefile b/Makefile
index ef0ae16..4a1a026 100644
--- a/Makefile
+++ b/Makefile
@@ -19,13 +19,13 @@ install: all
for d in $(SUBDIRS) ; do \
if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \
done
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/pkgconfig
- $(INSTALL) -m 644 $(PKGCONFIG_FILES) $(DESTDIR)$(PREFIX)/lib/pkgconfig
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/pkgconfig
+ $(INSTALL) -m 644 $(PKGCONFIG_FILES) $(DESTDIR)$(LIBDIR)/pkgconfig
@echo "-------------------------------"
@echo
@echo "** etc files went into ${ETCDIR}"
@echo "** executables went into ${prefix}/bin"
- @echo "** library files went into ${prefix}/lib/yaws"
+ @echo "** library files went into ${LIBDIR}/yaws"
@echo "** var files went into ${VARDIR}"
@echo "** default docroot went into ${VARDIR}/yaws/www"
@echo
@@ -76,7 +76,7 @@ foo:
@echo
@echo "** etc files will go into ${ETCDIR}"
@echo "** executables will go into ${prefix}/bin"
- @echo "** library file will go into ${prefix}/lib/yaws"
+ @echo "** library file will go into ${LIBDIR}/yaws"
@echo "** var files will go into ${VARDIR}"
@echo
@echo "--------------------------------"
diff --git a/c_src/Makefile b/c_src/Makefile
index d7907ab..6707fa5 100644
--- a/c_src/Makefile
+++ b/c_src/Makefile
@@ -34,12 +34,12 @@ clean:
-rm -f $(PRIV_FILES) setuid_drv.$(OBJ) epam.$(OBJ) yaws_sendfile_drv.$(OBJ) hashtable.$(OBJ)
install: $(PRIV_FILES)
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/priv/lib
- $(INSTALL) $(PRIV_FILES) $(DESTDIR)$(PREFIX)/lib/yaws/priv/lib
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/priv/lib
+ $(INSTALL) $(PRIV_FILES) $(DESTDIR)$(LIBDIR)/yaws/priv/lib
ifndef WIN32
- if [ `id -u` = "0" -a -d $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam ]; then \
- chown root $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \
- chmod a+s $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \
+ if [ `id -u` = "0" -a -d $(DESTDIR)$(LIBDIR)/yaws/priv/epam ]; then \
+ chown root $(DESTDIR)$(LIBDIR)/yaws/priv/epam; \
+ chmod a+s $(DESTDIR)$(LIBDIR)/yaws/priv/epam; \
fi
endif
diff --git a/include.mk.in b/include.mk.in
index 1fd1ffa..b735d3d 100644
--- a/include.mk.in
+++ b/include.mk.in
@@ -2,9 +2,10 @@
PREFIX = @prefix@
+LIBDIR = @libdir@
prefix = ${PREFIX}
ETCDIR = @sysconfdir@
-VARDIR = @localstatedir@
+VARDIR = @localstatedir@/lib
DVILATEX = @DVILATEX@
PDFLATEX = @PDFLATEX@
diff --git a/scripts/Install b/scripts/Install
index 9662fcd..d66cd1b 100644
--- a/scripts/Install
+++ b/scripts/Install
@@ -8,7 +8,8 @@ werl=$3
etcdir=$4
vardir=$5
bindir=$6
-destdir=$7
+libdir=$7
+destdir=$8
#bindir=`dirname $erl` ; bindir=`dirname $bindir`/lib/erlang/bin
@@ -20,10 +21,10 @@ v=${vardir}
install -d ${destdir}${prefix}/bin
install -d ${destdir}${prefix}/etc
-install -d ${destdir}${vardir}/log/yaws
+install -d ${destdir}/var/log/yaws
cat yaws.template | \
- ./Subst %yawsdir% ${prefix}/lib/yaws | \
+ ./Subst %yawsdir% ${libdir}/yaws | \
./Subst %vardir% ${vardir} | \
./Subst %erl% "${erl}" | \
./Subst %run_erl% "${bindir}/run_erl" | \
@@ -32,8 +33,8 @@ cat yaws.template | \
chmod +x ${destdir}${prefix}/bin/yaws
-install -d ${destdir}${prefix}/lib/yaws/examples/ebin
-install -d ${destdir}${prefix}/lib/yaws/examples/include
+install -d ${destdir}${libdir}/yaws/examples/ebin
+install -d ${destdir}${libdir}/yaws/examples/include
## seems gentoo don't like to be installed in /usr/local/etc
## since /sbin/runscript still reads /etc/conf.d
diff --git a/scripts/Makefile b/scripts/Makefile
index 8c67ff0..9d9a33f 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -38,10 +38,10 @@ local_install: ../bin/yaws
yaws.conf:
- @echo PREFIX is $(PREFIX)
+ @echo LIBDIR is $(LIBDIR)
cat yaws.conf.template | \
- ./Subst %yawsdir% "$(PREFIX)/lib/yaws" | \
- ./Subst %logdir% "$(PREFIX)/var/log/yaws" | \
+ ./Subst %yawsdir% "$(LIBDIR)/yaws" | \
+ ./Subst %logdir% "/var/log/yaws" | \
./Subst %vardir% "$(VARDIR)" | \
./Subst %host% `hostname` | \
./Subst %port% 80 | \
@@ -57,7 +57,7 @@ install: .install
.install:
-rm -rf /tmp/yaws 2> /dev/null
sh ./Install $(PREFIX) $(ERL) \
- $(WERL) $(ETCDIR)/ $(VARDIR)/ $(ERLBINDIR)/ $(DESTDIR)
+ $(WERL) $(ETCDIR)/ $(VARDIR)/ $(ERLBINDIR)/ $(LIBDIR)/ $(DESTDIR)
@if [ -f $(DESTDIR)$(ETCDIR)/yaws/yaws.conf ]; \
then echo "Keeping old config file "; \
cp yaws.conf $(DESTDIR)$(ETCDIR)/yaws/yaws.conf.template; \
diff --git a/src/Makefile b/src/Makefile
index f208602..bd06406 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -114,15 +114,15 @@ clean:
rm -f $(EBIN_FILES) yaws_generated.erl charset.def mime_types.erl yaws_configure.hrl ../ebin/*.beam
install: regen all docsinstall
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/examples/ebin
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/examples/include
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/ebin
- $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/priv
- $(INSTALL) -d $(DESTDIR)$(VARDIR)/log/yaws
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/examples/ebin
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/examples/include
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/ebin
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/priv
+ $(INSTALL) -d $(DESTDIR)$/var/log/yaws
$(INSTALL) -d $(DESTDIR)$(VARDIR)/yaws/ebin
- (cd ..; tar cf - ebin ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
- (cd ..; tar cf - include ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
- (cd ..; tar cf - priv/*.xsd ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
+ (cd ..; tar cf - ebin ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
+ (cd ..; tar cf - include ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
+ (cd ..; tar cf - priv/*.xsd ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
$(RM) yaws_generated.erl ../ebin/yaws_generated.beam 2>/dev/null || true
docsinstall:
--
1.7.2.1

11
yaws.logrotate Normal file
View file

@ -0,0 +1,11 @@
/var/log/yaws/*.log /var/log/yaws/*.access {
weekly
rotate 2
missingok
sharedscripts
notifempty
sharedscripts
postrotate
/sbin/service yaws reload >/dev/null 2>&1 || :
endscript
}

191
yaws.spec Normal file
View file

@ -0,0 +1,191 @@
# We're in fact noarch
%global xdebug_package %{nil}
%bcond_without docs
Name: yaws
Version: 1.89
Release: 3%{?dist}
Summary: Web server for dynamic content written in Erlang
Group: System Environment/Daemons
# BSD: see LICENSE
# ERPL: json.erl, benchmarks/bench.erl, benchmarks/bench.hrl,
# benchmarks/all.erl, haxe.erl
# LGPLv2: test/ibrowse
# Copyright only: priv/soap.xsd, priv/wsdl.xsd
# W3C: priv/envelope.xsd
License: BSD and ERPL and LGPLv2 and Copyright only and W3C
URL: http://yaws.hyber.org/
Source0: http://yaws.hyber.org/download/%{name}-%{version}.tar.gz
Source1: yaws.logrotate
Patch0: yaws-1.85-sysvinit.patch
Patch1: yaws-1.88-fhs.patch
# backported from upstream
Patch3: yaws-0003-Add-yaws_dime.erl-to-the-list-of-modules-to-compile.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: erlang-erts
BuildRequires: erlang-erlsom
BuildRequires: erlang-kernel
BuildRequires: erlang-mnesia
BuildRequires: erlang-sasl
BuildRequires: erlang-ssl
BuildRequires: erlang-stdlib
BuildRequires: pam-devel
%if %{with docs}
BuildRequires: tex(latex)
BuildRequires: tex(dvips)
BuildRequires: latex2html
%endif
Requires: erlang >= R13B
Requires: erlang-erlsom
Requires: erlang-ibrowse
Requires: erlang-xmlrpc
Requires: logrotate
Requires(post): chkconfig
Requires(preun): chkconfig
%description
HTTP 1.0 and HTTP 1.1 web server capable of both static content page
delivery and dynamic content generation using embedded Erlang code in the
HTML pages. It provides virtual hosting capabilities and implements
HTTP tracing and other debugging functionality such as interactive
interpreter environment. Performance can be boosted with built-in support
for RAM caching and streaming capabilities of dynamically generated
content. Among security features are SSL and support for WWW-Authenticated
pages.
%package devel
Summary: Development Files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
This package contains a pkg-config configuration for %{name}.
%prep
%setup -q
%patch0 -p1 -b .sysvinit
%patch1 -p1 -b .fhs
%patch3 -p1 -b .missing_module
# This requires egssapi which is not yet available
rm -f src/authmod_gssapi.erl
# Weird file name in Change Log is latin1-encoded
iconv -f iso8859-1 -t utf8 ChangeLog >ChangeLog.utf8
touch -r ChangeLog ChangeLog.utf8
mv ChangeLog.utf8 ChangeLog
# These are corrupted
find . -name '*.dia' -delete
%build
%configure --libdir=%{_libdir}/erlang/lib
make %{?_smp_mflags} all
%if %{with docs}
# fails to build with smp_mflags sometimes
make docs
%endif
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Move init script to correct location
install -d $RPM_BUILD_ROOT%{_initrddir}
mv $RPM_BUILD_ROOT%{_sysconfdir}/init.d/yaws \
$RPM_BUILD_ROOT%{_initrddir}/yaws
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/init.d
# Logrotate configuration
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/yaws
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mv $RPM_BUILD_ROOT%{_libdir}/erlang/lib/pkgconfig $RPM_BUILD_ROOT%{_libdir}
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add yaws
%preun
if [ $1 = 0 ]
then
/sbin/service yaws stop >/dev/null 2>&1
/sbin/chkconfig --del yaws
fi
%postun
if [ $1 -ge 1 ]
then
/sbin/service yaws condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%{_initrddir}/yaws
%dir %{_sysconfdir}/yaws
%config(noreplace) %{_sysconfdir}/yaws/yaws-cert.pem
%config(noreplace) %{_sysconfdir}/yaws/yaws-key.pem
%config(noreplace) %{_sysconfdir}/yaws/yaws.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/yaws
%dir %{_localstatedir}/log/%{name}
%{_localstatedir}/lib/yaws
%{_bindir}/yaws
%{_libdir}/erlang/lib/yaws
%exclude %{_libdir}/erlang/lib/yaws/ebin/.empty
%if %{with docs}
%doc doc/yaws.pdf
%endif
%doc %{_datadir}/man/man1/yaws.1*
%doc %{_datadir}/man/man5/yaws.conf.5*
%doc %{_datadir}/man/man5/yaws_api.5*
%doc README LICENSE ChangeLog
%exclude %{_libdir}/erlang/lib/yaws/examples
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/yaws.pc
%changelog
* Thu Nov 18 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.89-3
- Make building docs conditional
- Added one more module to package
- Added missing runtime dependency - erlang-xmlrpc
* Thu Oct 21 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.89-2
- Require newer Erlang (Peter Lemenkov)
- Exclude examples/ and src/
* Wed Oct 20 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.89-1
- Rebase to 1.89
- No longer required patch for compiling using system-wide erlsom (Peter Lemenkov)
- Ver. 1.89 now requires erlang-ibrowse library (Peter Lemenkov)
- Shorten the dependency chain (Peter Lemenkov)
* Mon Sep 13 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.88-1
- Rebase to 1.88
- Look for erlsom in system-wide location (Peter Lemenkov)
- Drop authmod_gssapi, dependencies not satisfied
* Sat Nov 21 2009 Lubomir Rintel (Good Data) <lkundrak@v3.sk> - 1.85-2
- Install to erlang lib directory, make arch dependent
- Install the source code
* Mon Nov 02 2009 Lubomir Rintel (Good Data) <lkundrak@v3.sk> - 1.85-1
- Initial packaging, partly based on Hans Ulrich Niedermann's package