A new user interface for you! Read more...

File shadowsocks-libev.spec of Package shadowsocks-libev

#
# spec file for package shadowsocks-libev
#
# Copyright (c) 2018 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 https://bugs.opensuse.org/
#


Name:           shadowsocks-libev
Version:        3.2.3
Release:        0
Summary:        Libev port of Shadowsocks
License:        GPL-3.0-or-later
Group:          Productivity/Networking/Web/Proxy
URL:            https://github.com/shadowsocks/shadowsocks-libev
#Source:         https://github.com/shadowsocks/shadowsocks-libev/archive/v%%{version}/%%{name}-%%{version}.tar.gz
Source:         %{name}-%{version}.tar.gz
Source1:        %{name}-config.json
Source2:        %{name}@.service
Source3:        %{name}-server@.service
Source4:        %{name}-tunnel@.service
Source5:        %{name}-redir@.service
BuildRequires:  asciidoc
BuildRequires:  libcares-devel
BuildRequires:  libev-devel
BuildRequires:  libsodium-devel
BuildRequires:  libtool
BuildRequires:  mbedtls-devel
BuildRequires:  pcre-devel
BuildRequires:  pkgconfig
BuildRequires:  xmlto
Requires:       libshadowsocks-libev2 = %{version}
%if 0%{?suse_version} >= 1210
BuildRequires:  systemd
%{?systemd_requires}
%endif

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

%package -n libshadowsocks-libev2
Summary:        Shared libraries for shadowsocks-libev
Group:          System/Libraries

%description -n libshadowsocks-libev2
shadowsocks-libev is a lightweight secured socks5 proxy
for embedded devices and low end boxes.

This package provides shared libraries 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.

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

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

This package provides documentation files for it.

%prep
%setup -q
NOCONFIGURE=1 ./autogen.sh

%build
%configure --prefix=%{_prefix} --docdir=%{_docdir}/%{name} --enable-shared
make %{?_smp_mflags}

%install
%make_install

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

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

%if 0%{?suse_version} >= 1210
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}
mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-server
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-tunnel
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcshadowsocks-libev-redir

%pre
%service_add_pre %{name}@.service %{name}-server@.service %{name}-tunnel@.service %{name}-redir@.service

%post
%service_add_post %{name}@.service %{name}-server@.service %{name}-tunnel@.service %{name}-redir@.service

%preun
%service_del_preun %{name}@.service %{name}-server@.service %{name}-tunnel@.service %{name}-redir@.service

%postun
%service_del_postun %{name}@.service %{name}-server@.service %{name}-tunnel@.service %{name}-redir@.service
%endif

%post -n libshadowsocks-libev2 -p /sbin/ldconfig
%postun -n libshadowsocks-libev2 -p /sbin/ldconfig

%files
%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}/man1/ss-local.1%{?ext_man}
%{_mandir}/man1/ss-manager.1%{?ext_man}
%{_mandir}/man1/ss-redir.1%{?ext_man}
%{_mandir}/man1/ss-server.1%{?ext_man}
%{_mandir}/man1/ss-tunnel.1%{?ext_man}
%{_mandir}/man1/ss-nat.1%{?ext_man}
%{_mandir}/man8/%{name}.8%{?ext_man}
%if 0%{?suse_version} >= 1210
%{_sbindir}/rcshadowsocks-libev
%{_sbindir}/rcshadowsocks-libev-server
%{_sbindir}/rcshadowsocks-libev-tunnel
%{_sbindir}/rcshadowsocks-libev-redir
%{_unitdir}/%{name}@.service
%{_unitdir}/%{name}-server@.service
%{_unitdir}/%{name}-tunnel@.service
%{_unitdir}/%{name}-redir@.service
%endif

%files -n libshadowsocks-libev2
%{_libdir}/libshadowsocks-libev.so.2
%{_libdir}/libshadowsocks-libev.so.2.0.0

%files devel
%{_includedir}/shadowsocks.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%files doc
%license COPYING
%doc Changes README.md
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/%{name}.html
%doc %{_docdir}/%{name}/ss-local.html
%doc %{_docdir}/%{name}/ss-manager.html
%doc %{_docdir}/%{name}/ss-nat.html
%doc %{_docdir}/%{name}/ss-redir.html
%doc %{_docdir}/%{name}/ss-server.html
%doc %{_docdir}/%{name}/ss-tunnel.html

%changelog