Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 7c9788840178dc4420ca98e96171855c > files > 4

jabberd-2.2.14-1.fc14.src.rpm

Summary:        OpenSource server implementation of the Jabber protocols
Name:           jabberd
Version:        2.2.14
Release:        1%{?dist}
License:        GPLv2+
Group:          System Environment/Daemons
Source0:        http://ftp.xiaoka.com/jabberd2/releases/jabberd-%{version}.tar.bz2
Source1:        jabberd.init
Source2:        jabberd.sysconfig
Source3:        jabberd.pam
URL:            http://codex.xiaoka.com/wiki/jabberd2:start
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  openssl-devel libidn-devel expat-devel

%{!?_without_pam:BuildRequires: pam-devel}
%{!?_without_sqlite:BuildRequires: sqlite-devel}
%{!?_without_db4:BuildRequires: db4-devel}
%{!?_without_ldap:BuildRequires: openldap-devel}
%{!?_without_mysql:BuildRequires: mysql-devel}
%{!?_without_postgresql:BuildRequires: postgresql-devel}

BuildRequires:          libgsasl-devel udns-devel
Requires(post):         openssl chkconfig /sbin/service
Requires(pre):          shadow-utils
Requires(preun):        chkconfig shadow-utils /sbin/service
Requires(postun):       chkconfig /sbin/service

%description
The jabberd project aims to provide an open-source server implementation of
the Jabber protocols for instant messaging and XML routing. The goal of this
project is to provide a scalable, reliable, efficient and extensible server
that provides a complete set of features and is up to date with the latest
protocol revisions.

jabberd2 is the next generation of the jabberd server. It has been
rewritten from the ground up to be scalable, architecturally sound, and to
support the latest protocol extensions coming out of the JSF.

This package defaults to use pam and sqlite.

%prep
%setup -q

%build
export CFLAGS="%{optflags}"
%configure \
        --sysconfdir=%{_sysconfdir}/%{name} \
        --localstatedir=%{_var}/lib \
        %{!?_without_pam:--enable-pam} \
        %{?_without_pam:--disable-pam} \
        %{!?_without_db4:--enable-db} \
        %{?_without_db4:--disable-db} \
        %{!?_without_mysql:--enable-mysql} \
        %{!?_without_mysql:--with-extra-library-path=%{_libdir}/mysql} \
        %{?_without_mysql:--disable-mysql} \
        %{!?_without_ldap:--enable-ldap} \
        %{?_without_ldap:--disable-ldap} \
        %{!?_without_postgresql:--enable-pgsql} \
        %{?_without_postgresql:--disable-pgsql} \
        %{!?_without_sqlite:--enable-sqlite} \
        %{?_without_sqlite:--disable-sqlite} \
        --enable-fs --enable-anon --enable-pipe --enable-ssl \
        --enable-debug \

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

# correct the script interpreter for perl scripts
sed -i "s|/usr/pkg/bin/perl|/usr/bin/env perl|" tools/*.pl

# convert ChangeLog to UTF-8, but keep the timestamp
iconv -f ISO88591 -t UTF8 < ChangeLog > ChangeLog.utf8 && \
touch -r ChangeLog ChangeLog.utf8 && \
mv ChangeLog.utf8 ChangeLog

install -dpm 700 $RPM_BUILD_ROOT/%{_var}/lib/%{name}/{log,pid,db}
install -dpm 755 $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/
install -Dpm 644 tools/pam_jabberd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/%{name}

install -dpm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/
# install any tool in tools/ to /usr/share/jabberd/, but skip Makefile-stuff
# and unneccessary scripts
install -dpm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/
for i in `ls tools`; do
    if [ $i == "Makefile" -o $i == "Makefile.am" -o $i == "Makefile.in" \
        -o $i == "jabberd.in" -o $i == "jabberd.rc" -o $i == "pam_jabberd" ]; then
        continue;
    fi

    sed -i "s|\r||g" tools/$i
    install -pm 755 tools/$i $RPM_BUILD_ROOT%{_datadir}/%{name}/
done

install -dpm 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}

sed -i -e "s,__BINDIR__,%{_bindir},g" \
       -e "s,__ETCDIR__,%{_sysconfdir}/%{name}/,g" \
       -e "s,__PIDDIR__,%{_var}/lib/%{name}/pid,g" \
       -e "s,__SYSCONF__,%{_sysconfdir}/sysconfig,g" \
          $RPM_BUILD_ROOT%{_initrddir}/%{name} \
          $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}

# remove static libraries
find $RPM_BUILD_ROOT -name "*.la" -delete

# Remove Upstart configuration files, they are not needed for Fedora
rm -f $RPM_BUILD_ROOT/etc/jabberd/*.conf
rm -f $RPM_BUILD_ROOT/usr/etc/init/*.conf

#default authentication backend
#enable SSL certificate
#clients must do STARTTLS
#disable account registrations by default, because the default installation uses PAM
#set the realm to '' for a working authentication against PAM
sed -i -e ':a;N;$!ba' \
            -e 's,<module>mysql</module>,<module>pam</module>,g' \
            -e "s,register-enable='true'>,realm='' require-starttls='true' pemfile='/etc/%{name}/server.pem'>,g" \
                $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/c2s.xml

touch $RPM_BUILD_ROOT%{_sysconfdir}/jabberd/server.pem

# we have our own start script
rm -f $RPM_BUILD_ROOT%{_bindir}/jabberd

# we have our own start script
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/jabberd.cfg*

%clean
rm -rf $RPM_BUILD_ROOT

%pre
#creating jabber user
getent group jabber >/dev/null || groupadd -r jabber
getent passwd jabber >/dev/null || \
useradd -r -g jabber -d %{_var}/lib/%{name} -s /sbin/nologin \
        -c "Jabber Server" jabber
exit 0


%post
if [ "$1" -eq "1" ]; then
        /sbin/chkconfig --add %{name}
        #replace default passwords, yet another hack
        export NEWPASS=$( dd if=/dev/urandom bs=20 count=1 2>/dev/null \
                                | sha1sum | awk '{print $1}' )
        cd %{_sysconfdir}/%{name}
        %{__sed} -i -f- router-users.xml router.xml <<END
s,<secret>secret</secret>,<secret>$NEWPASS</secret>,g
END
        %{__sed} -i -f- *.xml <<END
s,<pass>secret</pass>,<pass>$NEWPASS</pass>,g
END

fi

#create ssl certificate
cd %{_sysconfdir}/%{name}
if [ ! -s server.pem ]; then
 %{___build_shell} %{_sysconfdir}/pki/tls/certs/make-dummy-cert server.pem
 chown root.jabber server.pem
 chmod 640 server.pem
fi

%preun
if [ "$1" -eq "0" ]; then
        /sbin/service %{name} stop > /dev/null 2>&1
        /sbin/chkconfig --del %{name}
fi

%postun
if [ "$1" -eq "1" ]; then
        /sbin/service %{name} condrestart > /dev/null 2>&1
fi

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO UPGRADE
%{_mandir}/man8/*
%{_bindir}/*
%{_libdir}/%{name}/
%attr(750, jabber, jabber) %dir %{_sysconfdir}/%{name}
%attr(750, jabber, jabber) %dir %{_sysconfdir}/%{name}/templates
%config(noreplace) %{_sysconfdir}/%{name}/server.pem
%attr(640, jabber, jabber) %config(noreplace) %{_sysconfdir}/%{name}/*xml*
%attr(640, jabber, jabber) %config(noreplace) %{_sysconfdir}/%{name}/templates/*xml*
%dir %{_datadir}/%{name}/
%attr(644,root,root) %{_datadir}/%{name}/*
%attr(755,root,root) %{_datadir}/%{name}/*.pl
%attr(755,root,root) %{_datadir}/%{name}/*.rb
%attr(755,root,root) %{_datadir}/%{name}/%{name}
%{_initrddir}/%{name}
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(700, jabber, jabber) %{_var}/lib/%{name}

%changelog
* Wed Jun 01 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 2.2.14-1
- update to 2.2.14 (#700390, CVE-2011-1755)
- remove unneeded upstart configuration files

* Thu Apr 14 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 2.2.13-1
- updated to 2.2.13

* Wed Jan 05 2011 Adrian Reber <adrian@lisas.de> - 2.2.11-7
- ported spec changes from f14 branch to devel branch
- fix "jabberd spec file puts server.pem in /etc instead of /etc/jabberd" (#667504)

* Tue Nov 09 2010 Dominic Hopf <dmaphy@fedoraproject.org> - 2.2.11-3
- re-add the server.pem ghost as %%config(noreplace) to prevent the
  file from being deleted when updating to this package
- fix permissions for directories and files under /var/lib/jabberd

* Wed Sep 29 2010 jkeating - 2.2.11-2
- Rebuilt for gcc bug 634757

* Sun Sep 12 2010 Dominic Hopf <dmaphy@fedoraproject.org> - 2.2.11-1
- new upstream release
- fix script-without-shebang errors
- preserve timestamp of ChangeLog while converting to UTF8

* Thu Aug 12 2010 Dominic Hopf <dmaphy@fedoraproject.org> - 2.2.10-1
- new upstream release jabberd 2.2.10
- add patch jabberd-fix-missing-reference-in-log_error.patch from upstream svn
- use %%{_mandir} macro for manpages
- create a new source file for the PAM info instead of writing it on the fly
- install all tools provided by upstream to /usr/share/jabberd/
- remove storage driver replacement, since 2.2.10 sqlite is the default
- remove dependency to gc-devel
- remove unneccessary defines for sysconfdir and don't use unneccessary macros
- remove static libraries
- fix a lot of rpmlint errors and warnings
- rename file jabberd to jabberd.init to make 'fedpkg mockbuild' possible 

* Wed Sep 16 2009 Tomas Mraz <tmraz@redhat.com> - 2.2.8-5
- use password-auth common PAM configuration instead of system-auth

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.2.8-4
- rebuilt with new openssl

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Jun 19 2009 Adrian Reber <adrian@lisas.de> - 2.2.8-2
- updated to 2.2.8
- added patch to fix "router segfaults" (rhbz#497671)

* Tue Mar 31 2009 Bernie Innocenti <bernie@codewiz.org> - 2.2.7.1-2
- fix rhbz#349714: jabberd does not close its stdin/stdout/stderr

* Thu Feb 26 2009 Adrian Reber <adrian@lisas.de> - 2.2.7.1-1
- updated to 2.2.7.1
- "Workaround for buggy Java TLS implementation (affecting OpenFire and GTalk)"

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Feb 17 2009 Adrian Reber <adrian@lisas.de> - 2.2.7-1
- updated to 2.2.7

* Mon Feb 16 2009 Adrian Reber <adrian@lisas.de> - 2.2.6-1
- updated to 2.2.6

* Tue Feb 03 2009 Adrian Reber <adrian@lisas.de> - 2.2.5-1
- updated to 2.2.5

* Fri Jan 23 2009 Bernie Innocenti <bernie@codewiz.org> - 2.2.4-2
- Replace /etc/sysconfig/jabberd on upgrade to drop obsolete daemons
- Rebuilt for new libmysqlclient

* Tue Oct 07 2008 Adrian Reber <adrian@lisas.de> - 2.2.4-1
- updated to 2.2.4
  (this version and pidgin 2.5.1 finally work together)

* Thu Feb 11 2008 Adrian Reber <adrian@lisas.de> - 2.1.23-1
- updated to 2.1.23

* Thu Jan 08 2008 Adrian Reber <adrian@lisas.de> - 2.1.21-1
- updated to 2.1.21

* Thu Jan 08 2008 Adrian Reber <adrian@lisas.de> - 2.1.20-1
- updated to 2.1.20

* Thu Dec 06 2007 Adrian Reber <adrian@lisas.de> - 2.1.19-1
- updated to 2.1.19
- this version might be config file incompatible to 2.0
  in certain cases
- for details please refer to the UPGRADE file

* Wed Dec 05 2007 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.15
- rebuilt for new openssl and openldap

* Mon Aug 27 2007 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.14
- applied patch to fix bz #175219
- removed config flag for startup script
- updated License
- added patch for new glibc open macro

* Thu Jun 12 2007 Thorsten Leemhuis <fedora [AT] leemhuis.info> - 2.0-0.s11.13
- rebuilt on behalf of Adrian

* Thu Dec 07 2006 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.12
- rebuilt

* Tue Sep 12 2006 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.11
- rebuilt

* Mon Aug 07 2006 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.10
- changed pam file to use include
- added return value for status() function (bz #200996)

* Mon Apr 03 2006 Adrian Reber <adrian@lisas.de> - 2.0-0.s11.9
- updated to 2.0-0.s11

* Wed Feb 15 2006 Adrian Reber <adrian@lisas.de> - 2.0-0.s10.9
- rebuilt

* Sun Nov 27 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s10.8
- %%{_sysconfdir}/jabberd/server.pem was listed twice
- added /sbin/service dependency to %%post, %%postun and %%preun
- jabber user is not deleted to avoid unowned files

* Mon Oct 17 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s10.7
- updated to 2.0-0.s10

* Mon Aug 01 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s9.6
- updated to 2.0-0.s9.6

* Thu May 12 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s8.5
- updated to 2.0-0.s8.5
- using new location of make-dummy-cert

* Wed Mar 09 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s6.5
- removed Epoch: 0
- more Requires(...)
- typo
- changed db location to %%{_var}/lib/jabberd
- removed noreplace for start script
- make backends optional during build
- use -p with the install command
- combined some of the sed magic
- added a jabberd file in sysconfig to control if all daemons
  should be started
- don't suid c2s and add config option in sysconfig/jabberd
  to start c2s as root if required to authenticate against pam/shadow

* Tue Mar 08 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s6.4
- made password more random (/dev/random)
- replace password in the config without making it visible in ps
- enable ldap, mysql, postgresql backends
- remove dependency on perl during build
- make pam default authentication backend in c2s.xml
- make files in etc (640, jabber, jabber)
- enabled SSL certificate in c2s.xml
- enabled auto creation of accounts in sm.xml (necessary for usage with PAM)
- enabled require-startls

* Mon Mar 07 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s6.3
- changed startscript again

* Mon Mar 07 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s6.2
- changed startscript to support condrestart

* Mon Mar 07 2005 Adrian Reber <adrian@lisas.de> - 2.0-0.s6.1
- updated to 2.0s6

* Wed Nov 24 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.16.s4
- updated to 2.0s4
- added jabberd-c2s-buffers.patch
  (http://jabberstudio.org/projects/jabberd2/bugs/view.php?id=4528)
- replace <driver>mysql</driver> with <driver>db</driver> in sm.xml

* Mon Jul 19 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.15.s3
- add ||: at the end of the useradd line

* Mon Jul 19 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.14.s3
- create jabber user in %%pre instead of in %%post
- remove -r from userdel

* Mon Jul 19 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.13.s3
- s/jabberd2/%%{name}/
- replace another default password

* Fri Jul 16 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.12.s3
- %%{_var}/jabberd is now owned be the package
- %%ghost-ing server.pem
- disable rm-ing %%{_var}/jabberd on uninstall

* Fri Jul 16 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.11.s3
- using %%{_datadir}/ssl/certs/make-dummy-cert to
  create the certificate
- added -r to useradd
- added openssl to post-requires
- added libidn-devel and pam-devel as BuildRequires

* Mon Jul 12 2004 Adrian Reber <adrian@lisas.de> - 0:2.0-0.fdr.10.s3
- complete rewrite for fedora (I mean it)

* Tue May 18 2004 Tim Niemueller <tim@niemueller.de>
- Initial spec file