Browse Source

fix rpm spec

pull/412/head
Symeon Huang 9 years ago
parent
commit
4aeb4eed01
1 changed files with 20 additions and 10 deletions
  1. 30
      rpm/SPECS/shadowsocks-libev.spec

30
rpm/SPECS/shadowsocks-libev.spec

@ -11,6 +11,13 @@ Source0: %{url}/archive/v%{version}.tar.gz
BuildRequires: openssl-devel BuildRequires: openssl-devel
Requires: openssl Requires: openssl
%if 0%{?rhel} != 6
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: systemd
%endif
Conflicts: python-shadowsocks python3-shadowsocks Conflicts: python-shadowsocks python3-shadowsocks
AutoReq: no AutoReq: no
@ -36,28 +43,31 @@ mkdir -p %{buildroot}%{_initddir}
install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev
%else %else
mkdir -p %{buildroot}%{_sysconfdir}/default mkdir -p %{buildroot}%{_sysconfdir}/default
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev
install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service
%endif %endif
install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json
%if 0%{?rhel} == 6
%post %post
%if 0%{?rhel} == 6
/sbin/chkconfig --add shadowsocks-libev /sbin/chkconfig --add shadowsocks-libev
%else
%systemd_post shadowsocks-libev.service
%endif
%preun %preun
%if 0%{?rhel} == 6
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/sbin/service shadowsocks-libev stop /sbin/service shadowsocks-libev stop
/sbin/chkconfig --del shadowsocks-libev /sbin/chkconfig --del shadowsocks-libev
fi fi
%else %else
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: systemd
%post
%systemd_post shadowsocks-libev.service
%preun
%systemd_preun shadowsocks-libev.service %systemd_preun shadowsocks-libev.service
%endif
%if 0%{?rhel} != 6
%postun %postun
%systemd_postun_with_restart shadowsocks-libev.service %systemd_postun_with_restart shadowsocks-libev.service
%endif %endif
@ -66,14 +76,14 @@ BuildRequires: systemd
%files %files
%{_bindir}/* %{_bindir}/*
%{_libdir}/* %{_libdir}/*
%config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
%doc %{_mandir}/*
%if 0%{?rhel} == 6 %if 0%{?rhel} == 6
%{_initddir}/shadowsocks-libev %{_initddir}/shadowsocks-libev
%else %else
%{_unitdir}/shadowsocks-libev.service %{_unitdir}/shadowsocks-libev.service
%config(noreplace) %{_sysconfdir}/default/shadowsocks-libev %config(noreplace) %{_sysconfdir}/default/shadowsocks-libev
%endif %endif
%config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
%doc %{_mandir}/*
%package devel %package devel
Summary: Development files for shadowsocks-libev Summary: Development files for shadowsocks-libev

Loading…
Cancel
Save