LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File tinyproxy.spec of Package tinyproxy (Project server:proxy)

# spec file for package tinyproxy
# Copyright (c) 2012 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/

%if 0%{?suse_version} == 1110
%define _initddir /etc/init.d

Name:           tinyproxy
Summary:        Minimalist WWW proxy
License:        GPL-2.0+
Group:          Productivity/Networking/Web/Proxy
Version:        1.8.3
Release:        0
Url:            https://banu.com/tinyproxy/
Source:         https://banu.com/pub/tinyproxy/1.8/%{name}-%{version}.tar.bz2
Source1:        %{name}.logrotate
Source2:        %{name}.init
Patch0:         %{name}-conf.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

# libxslt -> xsltproc
BuildRequires:  asciidoc
BuildRequires:  libxslt
Requires:       logrotate

Tinyproxy is a light-weight HTTP/HTTPS proxy daemon for POSIX
operating systems. Designed from the ground up to be fast and yet
small, it is an ideal solution for use cases such as embedded
deployments where a full featured HTTP proxy is required, but the
system resources for a larger proxy are unavailable.

%setup -q -n %{name}-%{version}

make %{?_smp_mflags};

make install DESTDIR=%{buildroot}

# add logrotate file
install -D -m0644 %{S:1} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}

# add init script + rc_link
install -D -m0755 %{S:2} %{buildroot}/%{_initddir}/%{name}
ln -sf %{_initddir}/%{name} %{buildroot}/%{_sbindir}/rc%{name}

# add logdir
install -d -m0750 %{buildroot}/var/log/%{name}

# add group
%{_sbindir}/groupadd -r %{name} 2>/dev/null || :
# add user
%{_sbindir}/useradd -c "Tinyproxy" -d /usr/share/%{name} -G %{name} -g %{name} \
  -r -s /bin/false %{name} 2>/dev/null || :
#if 0%{?has_systemd}
#service_add_pre tinyproxy.service

%{fillup_and_insserv -n "tinyproxy"}

#if 0%{?has_systemd}
#service_add_post tinyproxy.service

%stop_on_removal tinyproxy

#if 0%{?has_systemd}
#service_del_preun tinyproxy.service

#if 0%{?has_systemd}
#service_del_postun tinyproxy.service

%restart_on_update tinyproxy

%config(noreplace) %{_sysconfdir}/*.conf
%config %{_sysconfdir}/logrotate.d/%{name}
%attr(0755,root,root) %{_initddir}/%{name}
%attr(750,%{name},root) /var/log/%{name}