From a61e3e0f7886ff85bdccadfe0afa449f7e668e5c Mon Sep 17 00:00:00 2001 From: Rayson zhu Date: Fri, 3 Mar 2017 14:02:46 +0800 Subject: [PATCH] fix rpm SPEC file 1. add missing build and runtime dependencies 2. change minimal version requirement for libsodium to 1.0.4, which should work fine with ss-libev and EPEL7 users will not have to compile a later version. 3. add more entries to .gitignore --- .gitignore | 5 +++++ m4/sodium.m4 | 4 ++-- rpm/SPECS/shadowsocks-libev.spec.in | 17 ++++++++--------- rpm/genrpm.sh | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 10239ef6..84079e1d 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,11 @@ shadowsocks-libev.pc debian/libshadowsocks-libev*.symbols libsodium/src/libsodium/include/sodium/version.h rpm/SPECS/shadowsocks-libev.spec +rpm/SRPMS +rpm/RPMS/ +rpm/SOURCES/ +!rpm/SOURCES/etc/init.d/shadowsocks-libev +rpm/BUILD # Ignore per-project vim config .vimrc diff --git a/m4/sodium.m4 b/m4/sodium.m4 index c3a5f3fd..b4c254e6 100644 --- a/m4/sodium.m4 +++ b/m4/sodium.m4 @@ -30,11 +30,11 @@ AC_DEFUN([ss_SODIUM], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include ], [ - #if SODIUM_LIBRARY_VERSION_MAJOR < 8 + #if SODIUM_LIBRARY_VERSION_MAJOR < 7 || SODIUM_LIBRARY_VERSION_MAJOR ==7 && SODIUM_LIBRARY_VERSION_MINOR < 6 # error #endif ])], [AC_MSG_RESULT([checking for version of libsodium... yes])], - [AC_MSG_ERROR([Wrong libsodium: version >= 1.0.8 required])]) + [AC_MSG_ERROR([Wrong libsodium: version >= 1.0.4 required])]) ]) diff --git a/rpm/SPECS/shadowsocks-libev.spec.in b/rpm/SPECS/shadowsocks-libev.spec.in index 97715971..4b28e780 100644 --- a/rpm/SPECS/shadowsocks-libev.spec.in +++ b/rpm/SPECS/shadowsocks-libev.spec.in @@ -10,8 +10,10 @@ Source0: %{url}/archive/v%{version}.tar.gz AutoReq: no Conflicts: python-shadowsocks python3-shadowsocks -BuildRequires: make gcc pcre-devel asciidoc xmlto -Requires: pcre +BuildRequires: make gcc pcre-devel asciidoc xmlto automake libtool mbedtls-devel libsodium-devel >= 1.0.4 libev-devel udns-devel +Requires: pcre mbedtls libsodium >= 1.0.4 +Requires: libev udns + %if 0%{?suse_version} Requires: libopenssl1_0_0 @@ -36,11 +38,6 @@ BuildRequires: systemd %endif %endif -%if 0%{?use_system_lib} -BuildRequires: libev-devel libsodium-devel >= 1.0.4 udns-devel -Requires: libev libsodium >= 1.0.4 udns -%endif - %description shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes. @@ -84,7 +81,8 @@ install -m 644 %{_builddir}/%{buildsubdir}/completions/bash/* %{buildroot}%{_dat %service_add_pre shadowsocks-libev.service %endif -%post -p /sbin/ldconfig +%post +/sbin/ldconfig %if ! 0%{?use_systemd} /sbin/chkconfig --add shadowsocks-libev > /dev/null 2>&1 || : %else @@ -109,7 +107,8 @@ fi %endif %endif -%postun -p /sbin/ldconfig +%postun +/sbin/ldconfig %if 0%{?use_systemd} %if 0%{?suse_version} %service_del_postun shadowsocks-libev.service diff --git a/rpm/genrpm.sh b/rpm/genrpm.sh index 23a0f4a2..8e5190e3 100755 --- a/rpm/genrpm.sh +++ b/rpm/genrpm.sh @@ -66,7 +66,7 @@ mkdir -p -- "$TARGET_TARBALL_DIR" #git archive HEAD --format=tar --prefix="$TARGET_TARBALL_NAME/" \ # -o "$TARGET_TARBALL_DIR/$TARGET_TARBALL_NAME.tar" pushd "$HERE"/.. -pwd +make clean tar --exclude './rpm' --exclude '.[^/]*' --transform "s,^\.,$TARGET_TARBALL_NAME," \ -cvf "$TARGET_TARBALL_DIR/$TARGET_TARBALL_NAME.tar" . popd