LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File torrent-seeder.spec of Package torrent-seeder (Project openSUSE:infrastructure:devel)

#
# spec file for package torrent-seeder (Version 0.0.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           torrent-seeder
Version:        0.0.2
Release:        1
#
%define pkg_name torrent-seeder
%define pkg_user torrent
%define pkg_home /srv/torrents
#
Group:          openSUSE/Servers
License:        BSD
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Requires:       rubygem-bencode 
Requires:       rubygem-rubytorrent
Requires:       cron 
Requires:       transmission 
Requires:       logrotate
#
Url:            http://www.opensuse.org/
Source:         torrent-crawler.rb
Source1:        torrent-seeder.cron
Source2:        torrent-seeder.init
Source3:        torrent-seeder.sysconfig
Source4:        usr.bin.client_test
Source5:        torrent-seeder.logrotate
#
Summary:        Package to setup a torrent seeder on openSUSE servers
%description
Package to setup a torrent seeder on openSUSE servers

%prep
%build
%install
%{__install} -D -m 0755 %{S:0} %{buildroot}%{_sbindir}/torrent-crawler.rb
%{__install} -D -m 0644 %{S:1} %{buildroot}/etc/cron.d/torrent-seeder
%{__install} -D -m 0644 %{S:3} %{buildroot}/var/adm/fillup-templates/sysconfig.%{pkg_name}
%{__install} -D -m 0755 %{S:2} %{buildroot}/etc/init.d/torrent-seeder
%{__ln_s} -f /etc/init.d/torrent-seeder \
                               %{buildroot}%{_sbindir}/rctorrent-seeder
%{__install} -d -m 0755 %{buildroot}%{pkg_home}
%{__install} -D -m 0644 %{S:4} %{buildroot}/etc/apparmor.d/usr.bin.client_test
%{__install} -D -m 0644 %{S:5} %{buildroot}/etc/logrotate.d/torrent-seeder

%clean
%{__rm} -rf %{buildroot}

%pre
/usr/sbin/groupadd -r %{pkg_user} &>/dev/null ||:
/usr/sbin/useradd  -g %{pkg_user} -s /bin/false -r -c "user for %{pkg_user}" -d %{pkg_home} %{pkg_user} &>/dev/null ||:

%post
%fillup_only %{pkg_name}

%preun
%stop_on_removal %{pkg_name}

%postun
%restart_on_update %{pkg_name}
%{insserv_cleanup}

%files
%defattr(-,root,root,-)
%{_sbindir}/torrent-crawler.rb
%config(noreplace) /etc/cron.d/torrent-seeder
%config(noreplace) /etc/init.d/torrent-seeder
%{_sbindir}/rctorrent-seeder
/var/adm/fillup-templates/sysconfig.%{pkg_name}
%dir %attr(755,%{pkg_user},%{pkg_user}) %{pkg_home}
%dir /etc/apparmor.d/
%config(noreplace) /etc/apparmor.d/usr.bin.client_test
%config(noreplace) /etc/logrotate.d/torrent-seeder
%changelog