Blob Blame History Raw
Name:    bip
Version: 0.8.8
Release: 2%{?dist}
Summary: IRC Bouncer
Group:   Applications/Internet
License: GPLv2+
URL: http://bip.t1r.net

Source0: https://projects.duckcorp.org/attachments/download/20/bip-%{version}.tar.gz
# Fedora 15+ - ensure that /var/run/bip is created on system start
# http://bugzilla.redhat.com/show_bug.cgi?id=707294
Source2: bip-tmpfs.conf
Source3: bip.service
Patch0: bip-conf.patch
Patch1: bip-fn-ircd7.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: autoconf
BuildRequires: byacc
BuildRequires: flex
BuildRequires: m4
BuildRequires: openssl-devel
BuildRequires: systemd-units
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

%description
Bip is an IRC proxy, which means it keeps connected to your preferred IRC
servers, can store the logs for you, and even send them back to your IRC
client(s) upon connection.
You may want to use bip to keep your logfiles (in a unique format and on a
unique computer) whatever your client is, when you connect from multiple
workstations, or when you simply want to have a playback of what was said
while you were away.

%prep
%setup -q
%patch0 -p0
%patch1 -p1
iconv -f iso-8859-1 -t utf-8 -o ChangeLog{.utf8,}
mv ChangeLog{.utf8,}


%build
%configure --with-openssl
make CFLAGS="$RPM_OPT_FLAGS -fPIE"


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# Remove misplaced files
rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/bip
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
# Install bip.conf
install -m 0644 samples/bip.conf $RPM_BUILD_ROOT%{_sysconfdir}/bip.conf
# Install bipgenconfig
install -m 0755 scripts/bipgenconfig $RPM_BUILD_ROOT%{_bindir}/bipgenconfig
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/bip
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/bip

install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/bip.conf

# Install systemd service file
install -d -m 755 $RPM_BUILD_ROOT%{_unitdir}
install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/

%clean
rm -rf $RPM_BUILD_ROOT


%pre
/usr/sbin/useradd -c "Bip IRC Proxy" \
  -s /bin/sh -r -d / bip 2> /dev/null || :

%post
if [ $1 -eq 1 ] ; then 
    # Initial installation 
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
/bin/systemd-tmpfiles --create %{_sysconfdir}/tmpfiles.d/bip.conf

%preun
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable bip.service > /dev/null 2>&1 || :
    /bin/systemctl stop bip.service > /dev/null 2>&1 || :
fi

%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart bip.service >/dev/null 2>&1 || :
fi

%triggerun -- bip < 0.8.8-2
/usr/bin/systemd-sysv-convert --save bip >/dev/null 2>&1 ||:
/sbin/chkconfig --del bip >/dev/null 2>&1 || :
/bin/systemctl try-restart bip.service >/dev/null 2>&1 || :

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO
%doc samples/bip.vim
%{_bindir}/bip
%{_bindir}/bipgenconfig
%{_bindir}/bipmkpw
%{_mandir}/man1/bip.1.gz
%{_mandir}/man5/bip.conf.5.gz
%config(noreplace) %{_sysconfdir}/bip.conf
%config %{_sysconfdir}/tmpfiles.d/bip.conf
%attr(-,bip,bip) %ghost %{_localstatedir}/run/bip
%attr(-,bip,bip) %dir %{_localstatedir}/log/bip
%{_unitdir}/bip.service

%changelog
* Thu Nov 17 2011 Brian C. Lane <bcl@redhat.com> - 0.8.8-2
- Adding systemd unit file and removing sysvinit file

* Fri Jul 29 2011 Brian C. Lane <bcl@redhat.com> - 0.8.8-1
- Upstream v0.8.8

* Thu Jun  2 2011 Darryl L. Pierce <dpierce@redhat.com> - 0.8.7-2
- Create file: /etc/tmpfiles.d/bip.conf
- Fixes #707294 - /var/run/bip on tmpfs

* Sat Feb 12 2011 Brian C. Lane <bcl@redhat.com> - 0.8.7-1
- Upstream v0.8.7
- New source tarball location
- Update spec with %ghost for /var/run/bip/

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Oct 06 2010 Brian C. Lane <bcl@redhat.com> - 0.8.6-1
- Upstream v0.8.6

* Sat Mar 27 2010 Lorenzo Villani <lvillani@binaryhelix.net> - 0.8.4-3
- Install bipgenconfig as requested in bz #566879

* Mon Feb 1 2010 Lorenzo Villani <lvillani@binaryhelix.net> - 0.8.4-2
- Import patch reported by Kevin Fenzi (bz #560476)
- + Add a join delay to work around ircd7 flood protection
- + Add support for the "quiet" list

* Fri Jan  8 2010 Lorenzo Villani <lvillani@binaryhelix.net> - 0.8.4-1
- 0.8.4

* Thu Sep 03 2009 Lorenzo Villani <lvillani@binaryhelix.net> - 0.8.2-1
- 0.8.2

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

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

* Thu Mar 05 2009 Lorenzo Villani <lvillani@binaryhelix.net> - 0.8.0-1
- 0.8.0

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jan 15 2009 Tomas Mraz <tmraz@redhat.com> - 0.7.5-3
- rebuild with new openssl

* Sat Nov 29 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.5-2
- rebuilt

* Sat Nov 29 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.5-1
- 0.7.5
- Added support for running bip as system daemon
  (patches from Tom Hughes, thanks! - BugID: 471791)

* Tue Jun 08 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.4-1
- New version

* Tue May 06 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-6
- Removed _smp_mflags to avoid compilation errors with parallel jobs

* Wed Apr 30 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-5
- Corrected License field
- Removed openssl from Requires

* Wed Apr 30 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-4
- Convert ChangeLog to utf-8 in prep
- Ensure that package is compiled using RPM_OPT_FLAGS
- Make usage of RPM_BUILD_ROOT consistent
- Removed macros from ChangeLog (bad mistake)

* Mon Apr 14 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-3
- Removed INSTALL from doc

* Sun Apr 13 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-2
- Added AUTHORS, ChangeLog, COPYING, INSTALL, README, TODO to docdir
- added --enable-ssl to configure, just to make sure that bip is built
  with SSL support using OpenSSL

* Sat Apr 12 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.2-1
- Version bump

* Sun Mar 16 2008 Lorenzo Villani <lvillani@binaryhelix.net> - 0.7.0-1
- Initial release