File shadowsocks-libev.spec of Package shadowsocks-libev.7462

#
# spec file for package shadowsocks-libev
#
# Copyright (c) 2017 SUSE LINUX 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/
#


Name:           shadowsocks-libev
Version:        2.5.6
Release:        0
Summary:        Libev port of Shadowsocks
License:        GPL-3.0+
Group:          Productivity/Networking/Web/Proxy
Url:            https://github.com/madeye/shadowsocks-libev
Source0:        https://github.com/shadowsocks/shadowsocks-libev/archive/v%{version}/%{name}-%{version}.tar.gz
# PATFH-FIX-SUSE fix-Command-Execution-in-ss-manager.patch hillwood@opensuse.org --Fix boo#1065619 and CVE-2017-15924
Patch0:         fix-Command-Execution-in-ss-manager.patch
Source1:        %{name}-config.json
Source2:        %{name}-client.service
Source3:        %{name}-server.service
Source4:        %{name}-tunnel.service
Source5:        %{name}-nat.service
Source6:        %{name}-manager.service
Source7:        %{name}-redir.service
BuildRequires:  libtool
BuildRequires:  openssl-devel
%if 0%{?fedora} >= 24
BuildRequires:  pkgconfig
%else
BuildRequires:  pkg-config
%endif
%if 0%{?fedora} == 24
BuildRequires:  ghostscript-core
%endif
BuildRequires:  asciidoc
BuildRequires:  systemd
BuildRequires:  xmlto
BuildRequires:  pkgconfig(libpcre)
%{?systemd_requires}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
shadowsocks-libev is a lightweight secured scoks5 proxy 
for embedded devices and low end boxes.

%package doc
Summary:        Documents for shadowsocks-libev
Group:          Documentation/HTML
Requires:       %{name} = %{version}
BuildArch:      noarch

%description doc
shadowsocks-libev is a lightweight secured scoks5 proxy
for embedded devices and low end boxes.

This package provides Documents for it.

%package devel
Summary:        Development headers for shadowsocks-libev
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
shadowsocks-libev is a lightweight secured scoks5 proxy
for embedded devices and low end boxes.

This package provides development headers for it.

%prep
%setup -q
%patch0 -p1

%build
%configure --prefix=%{_prefix}
make %{?_smp_mflags}

%install
%make_install

rm -rf %{buildroot}%{_libdir}/*.{a,la}

install -d %{buildroot}%{_sysconfdir}/shadowsocks/
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/shadowsocks/

install -d %{buildroot}%{_unitdir}
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE5} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}
install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-client
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-server
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-manager
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-nat
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-redir
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel

%pre
%{service_add_pre %{name}-server.service %{name}-client.service \
	%{name}-manager.service %{name}-nat.service %{name}-redir.service \
	%{name}-tunnel.service}

%post
/sbin/ldconfig
%{service_add_post %{name}-server.service %{name}-client.service \
	%{name}-manager.service %{name}-nat.service %{name}-redir.service \
	%{name}-tunnel.service}

%preun
%{service_del_preun %{name}-server.service %{name}-client.service \
	%{name}-manager.service %{name}-nat.service %{name}-redir.service \
	%{name}-tunnel.service}

%postun
/sbin/ldconfig
%{service_del_postun %{name}-server.service %{name}-client.service \
	%{name}-manager.service %{name}-nat.service %{name}-redir.service \
	%{name}-tunnel.service}

%files
%defattr(-,root,root)
%doc Changes README.md COPYING LICENSE
%dir %{_sysconfdir}/shadowsocks
%config(noreplace) %{_sysconfdir}/shadowsocks/%{name}-config.json
%{_bindir}/ss-local
%{_bindir}/ss-redir
%{_bindir}/ss-server
%{_bindir}/ss-tunnel
%{_bindir}/ss-manager
%{_bindir}/ss-nat
%{_mandir}/man8/%{name}.8.gz
%{_mandir}/man1/ss-*.1.gz
%{_sbindir}/rcshadowsocks-libev-*
%{_unitdir}/%{name}-*.service

%files doc
%defattr(-,root,root)
%dir %{_datadir}/doc/%{name}
%doc %{_datadir}/doc/%{name}/*.html

%files devel
%defattr(-,root,root)
%{_includedir}/shadowsocks.h
%{_libdir}/pkgconfig/%{name}.pc

%changelog
openSUSE Build Service is sponsored by