File tircd.spec of Package tircd
# norootforbuild
Name: tircd
Version: 0.7
Release: 0
Summary: Twitter IRC Gateway Server
Source: http://tircd.googlecode.com/files/tircd_v%{version}.tar.gz
Source1: tircd.init.sh
Source2: tircd.logrotate
Patch1: tircd-daemon-config.patch
Patch2: tircd-daemon.patch
URL: http://code.google.com/p/tircd/
Group: Productivity/Networking/IRC
License: Perl License
BuildRoot: %{_tmppath}/build-%{name}-%{version}
Requires: perl perl(POE) perl(POE::Filter::IRCD)
Requires: perl(Net::Twitter) > 2.10
BuildRequires: perl pwdutils
BuildArch: noarch
PreReq: pwdutils
%description
tircd presents twitter as an IRC channel. You can connect to tircd with any
IRC client, and twitter as if you were on IRC.
Authors:
--------
Chris Nelson <tircd@crazybrain.org>
%package daemon
Summary: Twitter IRC Gateway Server - Service Package
Group: Productivity/Networking/IRC
Requires: %{name} = %{version}-%{release}
PreReq: %insserv_prereq
%description daemon
tircd presents twitter as an IRC channel. You can connect to tircd with any
IRC client, and twitter as if you were on IRC.
This subpackage installs the required files to run tircd as a system-wide
daemon service that can be started at boot time.
Unlike the default behaviour for tircd, it uses the configuration file
%{_sysconfdir}/tircd-init.cfg
as well as /var/log/tircd.log for logs and /var/lib/tircd/ for state.
%prep
%setup -q -n "tircd"
%__cp tircd.cfg tircd.cfg.orig
%patch1
%__mv tircd.cfg tircd-init.cfg
%__mv tircd.cfg.orig tircd.cfg
%patch2
%build
pod2man tircd.pod >tircd.1
%install
%__install -D -m0755 tircd.pl "%{buildroot}%{_bindir}/tircd"
%__install -D -m0644 tircd.cfg "%{buildroot}/etc/tircd.cfg"
%__install -D -m0644 tircd.1 "%{buildroot}%{_mandir}/man1/tircd.1"
%__install -D -m0644 tircd-init.cfg "%{buildroot}%{_sysconfdir}/tircd-init.cfg"
%__install -D -m0755 "%{SOURCE1}" "%{buildroot}/etc/init.d/tircd"
%__sed -i 's|@@BINDIR@@|%{_bindir}|g;s|@@CONFIG@@|%{_sysconfdir}/tircd-init.cfg|g' "%{buildroot}/etc/init.d/tircd"
%__install -d "%{buildroot}/usr/sbin"
%__ln_s ../../etc/init.d/tircd "%{buildroot}/usr/sbin/rctircd"
%__install -d "%{buildroot}/var/lib/tircd"
%__install -D -m0644 "%{SOURCE2}" "%{buildroot}/etc/logrotate.d/%{name}"
%clean
%__rm -rf "%{buildroot}"
%post
getent group tircd &>/dev/null || /usr/sbin/groupadd -r tircd
getent passwd tircd &>/dev/null || /usr/sbin/useradd -r -c "tircd daemon" -d /var/lib/tircd -s /bin/false -g tircd tircd
%{fillup_and_insserv -f}
%preun
%stop_on_removal tircd
%postun
%restart_on_update tircd
%insserv_cleanup
%files
%defattr(-,root,root)
%doc ARTISTIC GPL
%config(noreplace) /etc/tircd.cfg
%{_bindir}/tircd
%doc %{_mandir}/man1/tircd.1*
%files daemon
%defattr(-,root,root)
%config(noreplace) /etc/tircd-init.cfg
%config(noreplace) /etc/logrotate.d/%{name}
/etc/init.d/tircd
/usr/sbin/rctircd
%attr(2750,tircd,tircd) /var/lib/tircd
%changelog
# Local Variables:
# mode: rpm-spec
# tab-width: 3
# End: