robert pushed to prosody (epel7). "Upgrade to 0.9.8 (#1152126)"
notifications at fedoraproject.org
notifications at fedoraproject.org
Fri Apr 24 22:58:03 UTC 2015
>From 13f1b3fe666cb9ef986afb7344507dc8a497c2c3 Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert at fedoraproject.org>
Date: Sat, 18 Apr 2015 13:22:00 +0200
Subject: Upgrade to 0.9.8 (#1152126)
diff --git a/.gitignore b/.gitignore
index bf45ecc..8a9a18f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1 @@
-/prosody-0.8.2.tar.gz
-/prosody-0.9.0beta1.tar.gz
-/prosody-0.9.0rc2.tar.gz
-/prosody-0.9.0rc3.tar.gz
-/prosody-0.9.0rc4.tar.gz
-/prosody-0.9.0rc5.tar.gz
-/prosody-0.9.0.tar.gz
-/prosody-0.9.1.tar.gz
-/prosody-0.9.4.tar.gz
+/prosody-*.tar.gz
diff --git a/prosody-0.9.8-config.patch b/prosody-0.9.8-config.patch
new file mode 100644
index 0000000..fd8cc06
--- /dev/null
+++ b/prosody-0.9.8-config.patch
@@ -0,0 +1,108 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for prosody >= 0.9.8 which sets defaults
+specific for Fedora and Red Hat Enterprise (including derivates like CentOS), adds helpful
+comments about optional dependencies and finally includes some upstream recommendations.
+
+--- prosody-0.9.8/prosody.cfg.lua.dist 2015-03-24 20:18:04.000000000 +0100
++++ prosody-0.9.8/prosody.cfg.lua.dist.config 2015-04-14 23:10:31.000000000 +0200
+@@ -44,7 +44,7 @@
+
+ -- These are commented by default as they have a performance impact
+ --"privacy"; -- Support privacy lists
+- --"compression"; -- Stream compression
++ --"compression"; -- Stream compression (Note: Requires installed lua-zlib RPM package)
+
+ -- Nice to have
+ "version"; -- Replies to server version requests
+@@ -63,7 +63,7 @@
+ --"http_files"; -- Serve static files from a directory over HTTP
+
+ -- Other specific functionality
+- --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
++ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
+ --"groups"; -- Shared roster support
+ --"announce"; -- Send announcement to all online users
+ --"welcome"; -- Welcome users who register accounts
+@@ -87,8 +87,8 @@
+ -- These are the SSL/TLS-related settings. If you don't want
+ -- to use SSL/TLS, you may comment or remove this
+ ssl = {
+- key = "certs/localhost.key";
+- certificate = "certs/localhost.crt";
++ key = "/etc/pki/prosody/localhost.key";
++ certificate = "/etc/pki/prosody/localhost.crt";
+ }
+
+ -- Force clients to use encrypted connections? This option will
+@@ -129,7 +129,8 @@
+ -- through modules. An "sql" backend is included by default, but requires
+ -- additional dependencies. See http://prosody.im/doc/storage for more info.
+
+---storage = "sql" -- Default is "internal"
++--storage = "sql" -- Default is "internal" (Note: "sql" requires installed
++-- lua-dbi RPM package)
+
+ -- For the "sql" backend, you can uncomment *one* of the below to configure:
+ --sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
+@@ -139,46 +140,21 @@
+ -- Logging configuration
+ -- For advanced logging see http://prosody.im/doc/logging
+ log = {
+- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging
+- error = "prosody.err";
+- -- "*syslog"; -- Uncomment this for logging to syslog
+- -- "*console"; -- Log to the console, useful for debugging with daemonize=false
++ -- Log everything of level "info" and higher (that is, all except "debug" messages)
++ -- to /var/log/prosody/prosody.log and errors also to /var/log/prosody/prosody.err
++ info = "/var/log/prosody/prosody.log"; -- Change 'info' to 'debug' for verbose logging
++ error = "/var/log/prosody/prosody.err"; -- Log errors also to file
++ -- error = "*syslog"; -- Log errors also to syslog
++ -- log = "*console"; -- Log to the console, useful for debugging with daemonize=false
+ }
+
+------------ Virtual hosts -----------
+--- You need to add a VirtualHost entry for each domain you wish Prosody to serve.
+--- Settings under each VirtualHost entry apply *only* to that host.
+-
+-VirtualHost "localhost"
+-
+-VirtualHost "example.com"
+- enabled = false -- Remove this line to enable this host
+-
+- -- Assign this host a certificate for TLS, otherwise it would use the one
+- -- set in the global section (if any).
+- -- Note that old-style SSL on port 5223 only supports one certificate, and will always
+- -- use the global one.
+- ssl = {
+- key = "certs/example.com.key";
+- certificate = "certs/example.com.crt";
+- }
+-
+------- Components ------
+--- You can specify components to add hosts that provide special services,
+--- like multi-user conferences, and transports.
+--- For more information on components, see http://prosody.im/doc/components
+-
+----Set up a MUC (multi-user chat) room server on conference.example.com:
+---Component "conference.example.com" "muc"
+-
+--- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:
+---Component "proxy.example.com" "proxy65"
+-
+----Set up an external component (default component port is 5347)
+---
+--- External components allow adding various services, such as gateways/
+--- transports to other networks like ICQ, MSN and Yahoo. For more info
+--- see: http://prosody.im/doc/components#adding_an_external_component
+---
+---Component "gateway.example.com"
+--- component_secret = "password"
++-- POSIX configuration, see also http://prosody.im/doc/modules/mod_posix
++pidfile = "/run/prosody/prosody.pid";
++--daemonize = false -- Default is "true"
++
++------ Additional config files ------
++-- For organizational purposes you may prefer to add VirtualHost and
++-- Component definitions in their own config files. This line includes
++-- all config files in /etc/prosody/conf.d/
++
++Include "conf.d/*.cfg.lua"
diff --git a/prosody-example.com.cfg.lua b/prosody-example.com.cfg.lua
new file mode 100644
index 0000000..cf156f8
--- /dev/null
+++ b/prosody-example.com.cfg.lua
@@ -0,0 +1,33 @@
+-- Section for VirtualHost example.com
+
+VirtualHost "example.com"
+ enabled = false -- Remove this line to enable this host
+
+ -- Assign this host a certificate for TLS, otherwise it would use the one
+ -- set in the global section (if any).
+ -- Note that old-style SSL on port 5223 only supports one certificate, and will always
+ -- use the global one.
+ ssl = {
+ key = "/etc/pki/prosody/example.com.key";
+ certificate = "/etc/pki/prosody/example.com.crt";
+ }
+
+------ Components ------
+-- You can specify components to add hosts that provide special services,
+-- like multi-user conferences, and transports.
+-- For more information on components, see http://prosody.im/doc/components
+
+---Set up a MUC (multi-user chat) room server on conference.example.com:
+--Component "conference.example.com" "muc"
+
+-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:
+--Component "proxy.example.com" "proxy65"
+
+---Set up an external component (default component port is 5347)
+--
+-- External components allow adding various services, such as gateways/
+-- transports to other networks like ICQ, MSN and Yahoo. For more info
+-- see: http://prosody.im/doc/components#adding_an_external_component
+--
+--Component "gateway.example.com"
+-- component_secret = "password"
diff --git a/prosody-localhost.cfg.lua b/prosody-localhost.cfg.lua
new file mode 100644
index 0000000..2572f9f
--- /dev/null
+++ b/prosody-localhost.cfg.lua
@@ -0,0 +1,4 @@
+-- Section for VirtualHost localhost
+
+-- This allows clients to connect to localhost. No harm in it.
+VirtualHost "localhost"
diff --git a/prosody.config.patch b/prosody.config.patch
deleted file mode 100644
index 3df90d7..0000000
--- a/prosody.config.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -up prosody-0.9.0beta1/prosody.cfg.lua.dist.orig prosody-0.9.0beta1/prosody.cfg.lua.dist
---- prosody-0.9.0beta1/prosody.cfg.lua.dist.orig 2013-05-11 09:03:08.000000000 -0400
-+++ prosody-0.9.0beta1/prosody.cfg.lua.dist 2013-05-15 11:15:28.049315751 -0400
-@@ -63,7 +63,7 @@ modules_enabled = {
- --"http_files"; -- Serve static files from a directory over HTTP
-
- -- Other specific functionality
-- --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
-+ "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
- --"groups"; -- Shared roster support
- --"announce"; -- Send announcement to all online users
- --"welcome"; -- Welcome users who register accounts
-@@ -87,8 +87,8 @@ allow_registration = false;
- -- These are the SSL/TLS-related settings. If you don't want
- -- to use SSL/TLS, you may comment or remove this
- ssl = {
-- key = "certs/localhost.key";
-- certificate = "certs/localhost.crt";
-+ key = "/etc/pki/tls/private/prosody.key";
-+ certificate = "/etc/pki/tls/certs/prosody.crt";
- }
-
- -- Force clients to use encrypted connections? This option will
-@@ -139,11 +139,12 @@ authentication = "internal_plain"
- -- Logging configuration
- -- For advanced logging see http://prosody.im/doc/logging
- log = {
-- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging
-- error = "prosody.err";
-- -- "*syslog"; -- Uncomment this for logging to syslog
-+ -- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging
-+ -- error = "prosody.err";
-+ "*syslog"; -- Uncomment this for logging to syslog
- -- "*console"; -- Log to the console, useful for debugging with daemonize=false
- }
-+pidfile = "/var/run/prosody/prosody.pid";
-
- ----------- Virtual hosts -----------
- -- You need to add a VirtualHost entry for each domain you wish Prosody to serve.
diff --git a/prosody.init b/prosody.init
index a5a79e1..ee37aa1 100644
--- a/prosody.init
+++ b/prosody.init
@@ -1,75 +1,113 @@
-#!/bin/sh
+#!/bin/bash
#
# prosody - Flexible communications server for Jabber/XMPP
#
# chkconfig: - 90 10
-# description: Flexible communications server for Jabber/XMPP
+# description: Prosody is a flexible communications server for Jabber/XMPP written in Lua. \
+# It aims to be easy to use, and light on resources. For developers it aims \
+# to be easy to extend and give a flexible system on which to rapidly develop \
+# added functionality, or prototype new protocols.
+# config: /etc/prosody/prosody.cfg.lua
+# pidfile: /var/run/prosody/prosody.pid
-# http://fedoraproject.org/wiki/FCNewInit/Initscripts
### BEGIN INIT INFO
# Provides: prosody
-# Required-Start: network
-# Required-Stop: network
+# Required-Start: $local_fs $network $remote_fs
+# Required-Stop: $local_fs $network $remote_fs
# Default-Start:
# Default-Stop: 0 1 6
-# Short-Description: Start and stop prosody
-# Description:
+# Short-Description: Flexible communications server for Jabber/XMPP
+# Description: Prosody is a flexible communications server for Jabber/XMPP written in Lua.
+# It aims to be easy to use, and light on resources. For developers it aims
+# to be easy to extend and give a flexible system on which to rapidly develop
+# added functionality, or prototype new protocols.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
+prog="Prosody XMPP (Jabber) server"
exec="/usr/bin/prosodyctl"
-prog="prosody"
user="prosody"
+lockfile="/var/lock/subsys/prosody"
+pidfile="/var/run/prosody/prosody.pid"
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-lockfile=/var/lock/subsys/$prog
+[ -e /etc/sysconfig/prosody ] && . /etc/sysconfig/prosody
start() {
+ [ -x $exec ] || exit 5
+ [ -f $config ] || exit 6
echo -n $"Starting $prog: "
- daemon --user $user $exec start
- retval=$?
+ # Avoid output "Started\n" after successful startup
+ OUTPUT="`daemon --user $user $exec start`"
+ RETVAL=$?
+ echo -n "${OUTPUT/Started$'\n'/}"
+ [ $RETVAL -eq 0 ] && touch $lockfile
echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
+ return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
- daemon $exec stop 2>/dev/null
- retval=$?
+ # Avoid output "Stopped\n" and "Prosody is not running\n"
+ OUTPUT="`daemon $exec stop`"
+ RETVAL=$?
+ OUTPUT="${OUTPUT/Stopped$'\n'/}"
+ echo -n "${OUTPUT/Prosody is not running$'\n'/}"
+ [ $RETVAL -eq 0 ] && rm -f $lockfile
+ echo
+ return $RETVAL
+}
+
+reload() {
+ echo -n $"Reloading $prog: "
+ # Avoid prosody specific output after successful reload
+ OUTPUT="`$exec reload`"
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && success || (echo "$OUTPUT"; failure)
echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
+ return $RETVAL
}
-restart() {
- stop
- start
+rh_status() {
+ status -p $pidfile $exec
+}
+
+rh_status_q() {
+ rh_status > /dev/null 2>&1
}
case "$1" in
- start|stop|restart)
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ rh_status_q || exit 7
$1
;;
force-reload)
restart
;;
status)
- $exec status
+ rh_status
;;
- try-restart|condrestart)
- if $exec status >/dev/null ; then
- restart
- fi
- ;;
- reload)
- action $"Service ${0##*/} does not support the reload action: " /bin/false
- exit 3
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ stop
+ start
;;
*)
- echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
+
+exit $?
diff --git a/prosody.logrotate-init b/prosody.logrotate-init
new file mode 100644
index 0000000..968121b
--- /dev/null
+++ b/prosody.logrotate-init
@@ -0,0 +1,13 @@
+/var/log/prosody/prosody.* {
+ weekly
+ missingok
+ rotate 52
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ /sbin/service prosody reload > /dev/null || true
+ endscript
+ create 0640 prosody prosody
+ sharedscripts
+}
diff --git a/prosody.logrotate-service b/prosody.logrotate-service
new file mode 100644
index 0000000..4f262ab
--- /dev/null
+++ b/prosody.logrotate-service
@@ -0,0 +1,14 @@
+/var/log/prosody/prosody.* {
+ weekly
+ missingok
+ rotate 52
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ /bin/systemctl reload prosody.service > /dev/null || true
+ endscript
+ create 0640 prosody prosody
+ sharedscripts
+ su prosody prosody
+}
diff --git a/prosody.service b/prosody.service
index d8eb11a..7e0c55c 100644
--- a/prosody.service
+++ b/prosody.service
@@ -4,8 +4,9 @@ After=network.target
[Service]
Type=forking
-PIDFile=/var/run/prosody/prosody.pid
+PIDFile=/run/prosody/prosody.pid
ExecStart=/usr/bin/prosodyctl start
+ExecReload=/usr/bin/prosodyctl reload
ExecStop=/usr/bin/prosodyctl stop
[Install]
diff --git a/prosody.spec b/prosody.spec
index 41249ce..96148a7 100644
--- a/prosody.spec
+++ b/prosody.spec
@@ -1,164 +1,152 @@
-%{!?_initddir: %{expand: %%global _initddir %{_initrddir}}}
-%if 0%{?rhel} == 5
-%global _sharedstatedir %{_localstatedir}/lib
-%endif
-
-%global sslcert %{_sysconfdir}/pki/tls/certs/prosody.crt
-%global sslkey %{_sysconfdir}/pki/tls/private/prosody.key
-
-%global luaver 5.1
-
-Name: prosody
-Version: 0.9.4
-Release: 4%{?dist}
-Summary: Flexible communications server for Jabber/XMPP
-
-Group: System Environment/Daemons
-License: MIT
-URL: http://prosody.im/
-Source0: https://prosody.im/downloads/source/%{name}-%{version}.tar.gz
-Source1: %{name}.init
-Source2: %{name}.tmpfiles
-Source3: %{name}.service
-Patch0: %{name}.config.patch
-Patch1: %{name}.sslcerts.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: libidn-devel
-BuildRequires: openssl-devel
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-BuildRequires: systemd-units
-%endif
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+%global sslcert %{_sysconfdir}/pki/%{name}/localhost.crt
+%global sslkey %{_sysconfdir}/pki/%{name}/localhost.key
+%global luaver 5.1
+
+Summary: Flexible communications server for Jabber/XMPP
+Name: prosody
+Version: 0.9.8
+Release: 1%{?dist}
+License: MIT
+Group: System Environment/Daemons
+URL: https://prosody.im/
+Source0: https://prosody.im/downloads/source/%{name}-%{version}.tar.gz
+Source1: prosody.init
+Source2: prosody.logrotate-init
+Source3: prosody.service
+Source4: prosody.logrotate-service
+Source5: prosody.tmpfilesd
+Source6: prosody-localhost.cfg.lua
+Source7: prosody-example.com.cfg.lua
+Patch0: prosody-0.9.8-config.patch
+BuildRequires: libidn-devel, openssl-devel
+Requires(pre): shadow-utils
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
+Requires(post): systemd, %{_bindir}/openssl
+Requires(preun): systemd
+Requires(postun): systemd
+BuildRequires: systemd
+%else
+Requires(post): /sbin/chkconfig, %{_bindir}/openssl
+Requires(preun): /sbin/service, /sbin/chkconfig
+Requires(postun): /sbin/service
%endif
-%if 0%{?fedora} >= 20
-# Prosody does not work with lua-5.2 and newer, luajit should always be
-# lua-5.1 compatible, so use luajit instead of lua on F20+.
-Requires: luajit
-Requires: lua-expat-compat
-Requires: lua-sec-compat
-Requires: lua-socket-compat
-Requires: lua-filesystem-compat
-Requires: lua-dbi-compat
-BuildRequires: compat-lua-devel
+%if 0%{?rhel} > 7 || 0%{?fedora} > 19
+# Prosody does not work with lua >= 5.2, so use compat-lua instead of lua
+# on Fedora >= 20; luajit (compatible with 5.1) would be second choice.
+Requires: compat-lua, lua-filesystem-compat, lua-expat-compat
+Requires: lua-socket-compat, lua-sec-compat
+BuildRequires: compat-lua-devel
%else
-%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7
-Requires: lua(abi) = %{luaver}
+%if 0%{?rhel} > 6 || 0%{?fedora} > 15
+Requires: lua(abi) = %{luaver}
%else
-Requires: lua >= %{luaver}
+Requires: lua >= %{luaver}
%endif
-BuildRequires: lua-devel
-Requires: lua-expat
-Requires: lua-sec
-Requires: lua-filesystem
-Requires: lua-dbi
+Requires: lua-filesystem, lua-expat, lua-socket, lua-sec
+BuildRequires: lua-devel
%endif
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
-Prosody is a flexible communications server for Jabber/XMPP written in Lua.
+Prosody is a flexible communications server for Jabber/XMPP written in Lua.
It aims to be easy to use, and light on resources. For developers it aims
-to be easy to extend and give a flexible system on which to rapidly
-develop added functionality, or prototype new protocols.
-
+to be easy to extend and give a flexible system on which to rapidly develop
+added functionality, or prototype new protocols.
%prep
-%setup -q -n %{name}-%{version}
-%patch0 -p1
-# remove default ssl certificates
-%patch1 -p1
-#do the sed atfer patch1, to avoid a i686 build issue
-sed -e 's|$(PREFIX)/lib|$(PREFIX)/%{_lib}|' -i Makefile
-rm -rf certs/
-# fix wrong end of line encoding
-pushd doc
-sed -i -e 's|\r||g' stanza.txt session.txt roster_format.txt
-popd
-
+%setup -q
+%patch0 -p1 -b .config
%build
./configure \
- --with-lua='' \
- --with-lua-include=%{_includedir}/lua-5.1 \
- --runwith=/usr/bin/luajit \
- --prefix=%{_prefix}
-make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIC"
+ --prefix=%{_prefix} \
+ --libdir=%{_libdir} \
+%if 0%{?rhel} > 7 || 0%{?fedora} > 19
+ --with-lua-include=%{_includedir}/lua-%{luaver} \
+ --runwith=lua-%{luaver} \
+%endif
+ --cflags="$RPM_OPT_FLAGS -fPIC -D_GNU_SOURCE" \
+ --ldflags="$RPM_LD_FLAGS -shared" \
+ --no-example-certs
+make %{?_smp_mflags}
+# Make prosody-migrator
+make -C tools/migration %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-#fix perms
-chmod -x $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}.version
-#avoid rpmlint unstripped-binary-or-object warnings
-chmod 0755 $RPM_BUILD_ROOT%{_libdir}/%{name}/util/*.so
-
-#directories for datadir and pids
-mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
-chmod 0755 $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
+mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/pki,%{_localstatedir}/{lib,log}/%{name}}/
+make DESTDIR=$RPM_BUILD_ROOT install
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-#systemd stuff
-mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+# Install prosody-migrator
+make -C tools/migration DESTDIR=$RPM_BUILD_ROOT install
-#tmpfiles.d stuff
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
-install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
+# Install ejabberd2prosody
+install -p -m 755 tools/ejabberd2prosody.lua $RPM_BUILD_ROOT%{_bindir}/ejabberd2prosody
+sed -e 's@;../?.lua@;%{_libdir}/%{name}/util/?.lua;%{_libdir}/%{name}/?.lua;@' \
+ -e '1s@ lua$@ lua-%{luaver}@' -i $RPM_BUILD_ROOT%{_bindir}/ejabberd2prosody
+touch -c -r tools/ejabberd2prosody.lua $RPM_BUILD_ROOT%{_bindir}/ejabberd2prosody
+install -p -m 644 tools/erlparse.lua $RPM_BUILD_ROOT%{_libdir}/%{name}/util/
+
+# Move certificates directory and symlink it
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/certs/ $RPM_BUILD_ROOT%{_sysconfdir}/pki/%{name}/
+ln -s ../pki/%{name}/ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/certs
+
+# Install systemd/tmpfiles or initscript files
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
+install -D -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
+install -D -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf
+mkdir -p $RPM_BUILD_ROOT/run/%{name}
%else
-#install initd script
-mkdir -p $RPM_BUILD_ROOT%{_initddir}
-install -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/%{name}
+install -D -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
+install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
+sed -e 's@/run@%{_localstatedir}/run@' -i $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/prosody.cfg.lua
%endif
+# Keep configuration file timestamp
+touch -c -r prosody.cfg.lua.dist.config $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/prosody.cfg.lua
-%clean
-rm -rf $RPM_BUILD_ROOT
+# Install virtual host configuration
+install -D -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d/localhost.cfg.lua
+install -D -p -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d/example.com.cfg.lua
+# Fix permissions for rpmlint
+chmod 755 $RPM_BUILD_ROOT%{_libdir}/%{name}/util/*.so
-%pre
-%{_sbindir}/useradd -d %{_sharedstatedir}/%{name} -r -s /sbin/nologin %{name} 2> /dev/null || :
+# Fix incorrect end-of-line encoding
+sed -e 's/\r//g' -i doc/stanza.txt doc/session.txt doc/roster_format.txt
+%clean
+rm -rf $RPM_BUILD_ROOT
-%preun
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-%systemd_preun %{name}.service
-%else
-if [ $1 = 0 ]; then
- # Package removal, not upgrade
- service %{name} stop > /dev/null 2>&1 || :
- chkconfig --del %{name} || :
-fi
-%endif
+%pre
+getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name}
+getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "Prosody XMPP Server" %{name}
+exit 0
%post
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
%systemd_post %{name}.service
%else
-if [ $1 -eq 1 ] ; then
- # Initial installation
- chkconfig --add %{name} || :
-fi
+/sbin/chkconfig --add %{name}
%endif
-umask 077
-if [ ! -f %{sslkey} ] ; then
-%{_bindir}/openssl genrsa 1024 > %{sslkey} 2> /dev/null
-chown root:%{name} %{sslkey}
-chmod 640 %{sslkey}
-fi
-FQDN=`hostname`
-if [ "x${FQDN}" = "x" ]; then
- FQDN=localhost.localdomain
+if [ ! -f %{sslkey} ]; then
+ umask 077
+ %{_bindir}/openssl genrsa 2048 > %{sslkey} 2> /dev/null
+ chown root:%{name} %{sslkey}
+ chmod 640 %{sslkey}
fi
-if [ ! -f %{sslcert} ] ; then
-cat << EOF | %{_bindir}/openssl req -new -key %{sslkey} \
- -x509 -days 365 -set_serial $RANDOM \
- -out %{sslcert} 2>/dev/null
+if [ ! -f %{sslcert} ]; then
+ FQDN=`hostname`
+ if [ "x${FQDN}" = "x" ]; then
+ FQDN=localhost.localdomain
+ fi
+
+ cat << EOF | %{_bindir}/openssl req -new -key %{sslkey} -x509 -sha256 -days 365 -set_serial $RANDOM -out %{sslcert} 2> /dev/null
--
SomeState
SomeCity
@@ -167,37 +155,65 @@ SomeOrganizationalUnit
${FQDN}
root@${FQDN}
EOF
-chmod 644 %{sslcert}
+ chmod 644 %{sslcert}
fi
+%preun
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
+%systemd_preun %{name}.service
+%else
+if [ $1 -eq 0 ]; then
+ /sbin/service %{name} stop > /dev/null 2>&1 || :
+ /sbin/chkconfig --del %{name}
+fi
+%endif
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%postun
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
%systemd_postun_with_restart %{name}.service
+%else
+if [ $1 -ne 0 ]; then
+ /sbin/service %{name} condrestart > /dev/null 2>&1 || :
+fi
%endif
-
%files
%defattr(-,root,root,-)
-%doc AUTHORS COPYING HACKERS README TODO doc/*
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc AUTHORS HACKERS README doc/*
%{_bindir}/%{name}
%{_bindir}/%{name}ctl
-%dir %{_libdir}/%{name}
-%{_libdir}/%{name}/*
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %attr(0640, root, %{name}) %{_sysconfdir}/%{name}/*
-%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
-%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
+%{_bindir}/%{name}-migrator
+%{_bindir}/ejabberd2prosody
+%{_libdir}/%{name}/
+%dir %attr(750,root,%{name}) %{_sysconfdir}/pki/%{name}/
+%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/pki/%{name}/*
+%dir %attr(750,root,%{name}) %{_sysconfdir}/%{name}/
+%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/*.cfg.lua
+%dir %attr(750,root,%{name}) %{_sysconfdir}/%{name}/conf.d/
+%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/conf.d/*.cfg.lua
+%attr(750,root,%{name}) %{_sysconfdir}/%{name}/certs
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
%{_unitdir}/%{name}.service
+%{_tmpfilesdir}/%{name}.conf
+%dir %attr(0755,%{name},%{name}) /run/%{name}/
%else
-%{_initddir}/%{name}
+%{_sysconfdir}/rc.d/init.d/%{name}
+%dir %attr(0755,%{name},%{name}) %{_localstatedir}/run/%{name}/
%endif
-%{_mandir}/man1/*.1.gz
-%dir %attr(-, %{name}, %{name}) %{_sharedstatedir}/%{name}
-%dir %attr(-, %{name}, %{name}) %{_localstatedir}/run/%{name}
-
+%dir %attr(750,%{name},%{name}) %{_localstatedir}/lib/%{name}/
+%dir %attr(750,%{name},%{name}) %{_localstatedir}/log/%{name}/
+%{_mandir}/man1/%{name}*.1*
%changelog
+* Sat Apr 18 2015 Robert Scheck <robert at fedoraproject.org> 0.9.8-1
+- Upgrade to 0.9.8 (#1152126)
+
+* Sat Feb 14 2015 Robert Scheck <robert at fedoraproject.org> 0.9.7-1
+- Upgrade to 0.9.7 (#985563, #1152126)
+
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.9.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
diff --git a/prosody.sslcerts.patch b/prosody.sslcerts.patch
deleted file mode 100644
index 97ea212..0000000
--- a/prosody.sslcerts.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -up prosody-0.9.0beta1/Makefile.orig prosody-0.9.0beta1/Makefile
---- prosody-0.9.0beta1/Makefile.orig 2013-05-11 09:03:07.000000000 -0400
-+++ prosody-0.9.0beta1/Makefile 2013-05-15 11:17:11.675317306 -0400
-@@ -22,7 +22,6 @@ install: prosody.install prosodyctl.inst
- install -d $(BIN) $(CONFIG) $(MODULES) $(SOURCE)
- install -m750 -d $(DATA)
- install -d $(MAN)/man1
-- install -d $(CONFIG)/certs
- install -d $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
- install -m755 ./prosody.install $(BIN)/prosody
- install -m755 ./prosodyctl.install $(BIN)/prosodyctl
-@@ -35,16 +34,14 @@ install: prosody.install prosodyctl.inst
- install -d $(SOURCE)/util/sasl
- install -m644 util/sasl/* $(SOURCE)/util/sasl
- umask 0022 && cp -r plugins/* $(MODULES)
-- install -m644 certs/* $(CONFIG)/certs
- install -m644 man/prosodyctl.man $(MAN)/man1/prosodyctl.1
-- test -e $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
-+ test -e $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.dist $(CONFIG)/prosody.cfg.lua
- test -e prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version || true
- $(MAKE) install -C util-src
-
- clean:
- rm -f prosody.install
- rm -f prosodyctl.install
-- rm -f prosody.cfg.lua.install
- rm -f prosody.version
- $(MAKE) clean -C util-src
-
diff --git a/prosody.tmpfiles b/prosody.tmpfiles
deleted file mode 100644
index 563f04a..0000000
--- a/prosody.tmpfiles
+++ /dev/null
@@ -1 +0,0 @@
-d /var/run/prosody 710 prosody prosody
diff --git a/prosody.tmpfilesd b/prosody.tmpfilesd
new file mode 100644
index 0000000..0099578
--- /dev/null
+++ b/prosody.tmpfilesd
@@ -0,0 +1 @@
+d /run/prosody 755 prosody prosody
diff --git a/sources b/sources
index d5ae245..766e6c4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-94f9a613c834c276352ac5b142fb72e0 prosody-0.9.4.tar.gz
+5144cd832a1860443e21e336dc560ee7 prosody-0.9.8.tar.gz
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/prosody.git/commit/?h=epel7&id=13f1b3fe666cb9ef986afb7344507dc8a497c2c3
More information about the scm-commits
mailing list