# TODO
# - sync pl
-# - bilbee user
#
# Conditional build:
%bcond_without otr # build without OTR
Summary(pl.UTF-8): Bramka pomiędzy IRC-em i innymi sieciami komunikacyjnymi
Name: bitlbee
Version: 3.0.5
-Release: 0.6
+Release: 0.8
License: GPL v2+ and MIT
Group: Daemons
Source0: http://get.bitlbee.org/src/%{name}-%{version}.tar.gz
# Source0-md5: 9ff97260a2a7f3a7d102db158a8d9887
URL: http://www.bitlbee.org/
+Patch0: config.patch
BuildRequires: asciidoc
BuildRequires: gnutls-devel
%{?with_otr:BuildRequires: libotr-devel >= 3.2.0}
+BuildRequires: rpmbuild(macros) >= 1.461
BuildRequires: systemd-units
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Provides: group(bitlbee)
+Provides: user(bitlbee)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%prep
%setup -q
+%patch0 -p1
# fix wrong assumption with $DESTDIR
%{__sed} -i -e 's,$(shell id -u),0,' Makefile
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+%groupadd -g 280 bitlbee
+%useradd -u 280 -d /var/lib/bitlbee -g bitlbee -c "Bitlbee User" bitlbee
+
+%postun
+if [ "$1" = "0" ]; then
+ %userremove bitlbee
+ %groupremove bitlbee
+fi
+
%files
%defattr(644,root,root,755)
%doc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/bitlbee.conf
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/motd.txt
+%dir %attr(750,root,bitlbee) %{_sysconfdir}/%{name}
+%attr(640,root,bitlbee) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/bitlbee.conf
+%attr(640,root,bitlbee) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/motd.txt
%attr(755,root,root) %{_sbindir}/bitlbee
%{_mandir}/man5/bitlbee.conf.5*
%{_mandir}/man8/bitlbee.8*
%{_datadir}/bitlbee
%dir %{_libdir}/%{name}
-%attr(700,root,root) %{_localstatedir}/lib/bitlbee
+%attr(770,root,bitlbee) %{_localstatedir}/lib/bitlbee
%{systemdunitdir}/bitlbee.service
%{systemdunitdir}/bitlbee.socket
%{systemdunitdir}/bitlbee@.service
%files protocol-skype
%defattr(644,root,root,755)
%doc protocols/skype/{HACKING,NEWS,README,skyped.txt}
-%dir %{_sysconfdir}/skyped
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/skyped/skyped.cnf
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/skyped/skyped.conf
+%dir %attr(750,root,bitlbee) %{_sysconfdir}/skyped
+%attr(640,root,bitlbee) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/skyped/skyped.cnf
+%attr(640,root,bitlbee) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/skyped/skyped.conf
%attr(755,root,root) %{_libdir}/%{name}/skype.so
%attr(755,root,root) %{_sbindir}/skyped
%{_mandir}/man1/skyped.1*
--- /dev/null
+Index: bitlbee-3.0.3/bitlbee.conf
+===================================================================
+--- bitlbee-3.0.3.orig/bitlbee.conf
++++ bitlbee-3.0.3/bitlbee.conf
+@@ -23,14 +23,14 @@
+ ## If BitlBee is started by root as a daemon, it can drop root privileges,
+ ## and change to the specified user.
+ ##
+-# User = bitlbee
++User = bitlbee
+
+ ## DaemonPort/DaemonInterface:
+ ##
+ ## For daemon mode, you can specify on what interface and port the daemon
+ ## should be listening for connections.
+ ##
+-# DaemonInterface = 0.0.0.0
++DaemonInterface = 127.0.0.1
+ # DaemonPort = 6667
+
+ ## ClientInterface: