Skip to content

Commit ad4fdeb

Browse files
committed
Merge pull request shadowsocks#410 from librehat/master
update rpm scripts
2 parents 9014578 + 227272b commit ad4fdeb

File tree

4 files changed

+68
-57
lines changed

4 files changed

+68
-57
lines changed

rpm/SOURCES/shadowsocks-server@.service

-11
This file was deleted.

rpm/SOURCES/shadowsocks@.service

-11
This file was deleted.

rpm/SPECS/shadowsocks-libev.spec

+63-30
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,89 @@
1-
Name: shadowsocks-libev
2-
Version: 2.1.4
3-
Release: 1%{?dist}
4-
Summary: A lightweight secured socks5 proxy for embedded devices and low end boxes.
1+
Name: shadowsocks-libev
2+
Version: 2.4.0
3+
Release: 1%{?dist}
4+
Summary: A lightweight and secure socks5 proxy
55

6-
License: GPLv3+
7-
URL: https://github.com/shadowsocks/shadowsocks-libev
8-
Source0: %{name}-%{version}.tar.xz
9-
Source1: shadowsocks@.service
10-
Source2: shadowsocks-server@.service
6+
Group: Applications/Internet
7+
License: GPLv3+
8+
URL: https://github.com/madeye/%{name}
9+
Source0: %{url}/archive/v%{version}.tar.gz
1110

11+
BuildRequires: openssl-devel
12+
Requires: openssl
13+
14+
Conflicts: python-shadowsocks python3-shadowsocks
15+
16+
AutoReq: no
1217

1318
%description
14-
Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
19+
shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes.
20+
1521

1622
%prep
1723
%setup -q
1824

1925

2026
%build
21-
%configure
27+
%configure --enable-shared
2228
make %{?_smp_mflags}
2329

2430

2531
%install
26-
rm -rf $RPM_BUILD_ROOT
27-
%make_install
28-
mkdir -p %{buildroot}/usr/lib/systemd/system
29-
cp %{SOURCE1} %{SOURCE2} %{buildroot}/usr/lib/systemd/system
32+
make install DESTDIR=%{buildroot}
33+
mkdir -p %{buildroot}/etc/shadowsocks-libev
34+
%if 0%{?rhel} == 6
35+
mkdir -p %{buildroot}%{_initddir}
36+
install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev
37+
%else
38+
mkdir -p %{buildroot}%{_sysconfdir}/default
39+
install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev
40+
install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service
41+
%endif
42+
install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json
43+
44+
%if 0%{?rhel} == 6
45+
%post
46+
/sbin/chkconfig --add shadowsocks-libev
47+
%preun
48+
if [ $1 -eq 0 ]; then
49+
/sbin/service shadowsocks-libev stop
50+
/sbin/chkconfig --del shadowsocks-libev
51+
fi
52+
%else
53+
Requires(post): systemd
54+
Requires(preun): systemd
55+
Requires(postun): systemd
56+
BuildRequires: systemd
57+
%post
58+
%systemd_post shadowsocks-libev.service
59+
%preun
60+
%systemd_preun shadowsocks-libev.service
61+
%postun
62+
%systemd_postun_with_restart shadowsocks-libev.service
63+
%endif
3064

3165

3266
%files
33-
%{_bindir}/ss-local
34-
%{_bindir}/ss-redir
35-
%{_bindir}/ss-server
36-
%{_bindir}/ss-tunnel
67+
%{_bindir}/*
68+
%{_libdir}/*
69+
%if 0%{?rhel} == 6
70+
%{_initddir}/shadowsocks-libev
71+
%else
72+
%{_unitdir}/shadowsocks-libev.service
73+
%config(noreplace) %{_sysconfdir}/default/shadowsocks-libev
74+
%endif
75+
%config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
3776
%doc %{_mandir}/*
38-
%doc /usr/lib/systemd/system/*
39-
4077

4178
%package devel
42-
Summary: Files for development of applications which will use shadowsocks.
43-
License: GPLv3+
44-
URL: https://github.com/shadowsocks/shadowsocks-libev
79+
Summary: Development files for shadowsocks-libev
80+
License: GPLv3+
4581

4682
%description devel
47-
Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
83+
Development files for shadowsocks-libev
4884

4985
%files devel
50-
%{_includedir}/shadowsocks.h
51-
%{_libdir}/libshadowsocks.a
52-
%{_libdir}/libshadowsocks.la
53-
%{_libdir}/pkgconfig/shadowsocks-libev.pc
54-
86+
%{_includedir}/*
5587

5688
%changelog
89+

rpm/genrpm.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ show_help()
77
echo
88
echo -e "Options:"
99
echo -e " -h show this help."
10-
echo -e " -v with argument version(2.1.4 by default)."
11-
echo -e " -f with argument format(tar.xz by default) used by git archive."
10+
echo -e " -v with argument version (2.4.0 by default)."
11+
echo -e " -f with argument format (tar.xz by default) used by git archive."
1212
echo
1313
echo -e "Examples:"
14-
echo -e " to build base on version \`2.1.4' with format \`tar.xz', run:"
15-
echo -e " `basename $0` -f tar.xz -v 2.1.4"
14+
echo -e " to build base on version \`2.4.0' with format \`tar.xz', run:"
15+
echo -e " `basename $0` -f tar.xz -v 2.4.0"
1616
}
1717

1818
while getopts "hv:f:" opt
@@ -48,7 +48,7 @@ get_att_val()
4848
fi
4949
}
5050

51-
get_att_val version "2.1.4"
51+
get_att_val version "2.4.0"
5252
get_att_val format "tar.xz"
5353

5454
name="shadowsocks-libev"

0 commit comments

Comments
 (0)