From 35b0a1c0e4b87b1714ea8a6ca2e97f0ae23fc421 Mon Sep 17 00:00:00 2001 From: Sergey Zhemoitel Date: Tue, 7 Sep 2021 00:40:40 +0300 Subject: [PATCH] Update to 2.39.0 --- .abf.yml | 2 +- i2pd.rpmlintrc | 2 + i2pd.spec | 122 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 83 insertions(+), 43 deletions(-) create mode 100644 i2pd.rpmlintrc diff --git a/.abf.yml b/.abf.yml index f37df5f..31a8582 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,2 +1,2 @@ sources: - i2pd-2.12.0.tar.gz: 61903752ea456dde78a26b3bb14d37f03f59d59e + i2pd-2.39.0.tar.gz: b9efa5896ed69662a43602c9bedb84ec7d046341 diff --git a/i2pd.rpmlintrc b/i2pd.rpmlintrc new file mode 100644 index 0000000..8426629 --- /dev/null +++ b/i2pd.rpmlintrc @@ -0,0 +1,2 @@ +addFilter("E: non-standard-dir-perm") +addFilter("E: debuginfo-without-sources") diff --git a/i2pd.spec b/i2pd.spec index ba45f62..68f05f5 100644 --- a/i2pd.spec +++ b/i2pd.spec @@ -1,22 +1,29 @@ +%define debug %nil +%define build_timestamp %(date +"%Y%m%d") + Name: i2pd -Version: 2.12.0 -Release: 2 +Version: 2.39.0 +Release: 1 Summary: I2P router License: BSD -URL: https://bitbucket.org/orignal/i2pd/src +URL: http://i2pd.website Group: Development/Other -Source: %{name}-%{version}.tar.gz +Source0: https://github.com/PurpleI2P/i2pd/archive/%{version}/%{name}-%{version}.tar.gz +Source1000: %{name}.rpmlintrc BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: pkgconfig(libssl) BuildRequires: boost-devel -BuildRequires: cjdns +#BuildRequires: cjdns BuildRequires: systemd BuildRequires: cmake BuildRequires: miniupnpc-devel +BuildRequires: chrpath +#BuildRequires: pkgconfig(websocketpp) -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig, /sbin/service -Requires(postun): /sbin/service +#Requires(post): /sbin/chkconfig +#Requires(preun): /sbin/chkconfig, /sbin/service +#Requires(postun): /sbin/service %description @@ -28,60 +35,91 @@ trusted parties. This package contains the port of the I2P router to C++. Unless willing to test and report problems, you should install the 'i2p' package instead. +%package systemd +Summary: Files to run I2P router under systemd +Requires: i2pd +Requires: systemd +Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd +Obsoletes: %{name}-daemon + + +%description systemd +C++ implementation of I2P. + +This package contains systemd unit file to run i2pd as a system service +using dedicated user's permissions. + +%files systemd +%{_unitdir}/i2pd.service +%dir %attr(0700,i2pd,i2pd) %{_sharedstatedir}/i2pd + %prep %setup -q %build -cmake -DCMAKE_BUILD_TYPE="Release" \ - -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ - -DWITH_BINARY=ON \ - -DWITH_LIBRARY=ON \ - -DWITH_AESNI=OFF \ - -DWITH_PCH=ON \ - -DWITH_MESHNET=ON \ - -DWITH_UPNP=ON \ - ./build +pushd build +cmake -DCMAKE_BUILD_TYPE=Release \ + -DWITH_LIBRARY=OFF \ + -DWITH_UPNP=ON \ + -DWITH_HARDENING=ON \ + -DWITH_MESHNET=ON \ + -DWITH_I2LUA=ON \ + -DWITH_WEBSOCKETS=OFF \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + . %make +popd %install install -d %{buildroot}%{_sbindir} install -d %{buildroot}%{_datadir}/%{name} install -d %{buildroot}%{_sysconfdir}/%{name} -install -d %{buildroot}/var/lib +install -d %{buildroot}%{_localstatedir}/lib/%{name} +install -d %{buildroot}%{_unitdir} +install -d %{buildroot}%{_sharedstatedir}/%{name} + +pushd build +#chrpath -d i2pd install -Dm0755 %{name} %{buildroot}%{_sbindir} -install -Dm0644 docs/%{name}.conf %{buildroot}%{_sysconfdir}/%{name}/ -install -Dm0644 docs/tunnels.conf %{buildroot}%{_sysconfdir}/%{name}/ -install -Dm0644 docs/subscriptions.txt %{buildroot}%{_sysconfdir}/%{name}/ -install -Dm0755 debian/%{name}.init %{buildroot}%{_initddir}/%{name} -install -Dm0644 debian/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +popd + +install -Dm0644 contrib/%{name}.conf %{buildroot}%{_sysconfdir}/%{name}/ +install -Dm0644 contrib/tunnels.conf %{buildroot}%{_sysconfdir}/%{name}/ +install -Dm0644 contrib/subscriptions.txt %{buildroot}%{_sysconfdir}/%{name}/ +#install -Dm0755 debian/%{name}.init %{buildroot}%{_initddir}/%{name} +install -Dm0755 contrib/rpm/%{name}.service %{buildroot}%{_unitdir} +install -Dm0644 debian/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} cp -r contrib/certificates %{buildroot}%{_datadir}/%{name}/ +ln -s %{_datadir}/%{name}/certificates %{buildroot}%{_sharedstatedir}/%{name}/certificates -%post -/sbin/chkconfig --add %{name} +install -d -m 700 %{buildroot}/%{_sharedstatedir}/i2pd +install -d -m 700 %{buildroot}/%{_localstatedir}/log/i2pd -%preun -if [ $1 -eq 0 ] ; then - /sbin/service %{name} stop &>/dev/null - /sbin/chkconfig --del %{name} -fi -exit 0 -%postun -if [ $1 -ge 1 ]; then - /sbin/service %{name} condrestart &>/dev/null -fi -exit 0 +%pre systemd +getent group i2pd >/dev/null || %{_sbindir}/groupadd -r i2pd +getent passwd i2pd >/dev/null || \ + %{_sbindir}/useradd -r -g i2pd -s %{_sbindir}/nologin \ + -d %{_sharedstatedir}/i2pd -c 'I2P Service' i2pd -%pre -groupadd -f -r i2pd >/dev/null 2>&1 || : -useradd -M -n -g i2pd -r -d /var/lib/i2pd -s /bin/bash \ - -c "user for i2pd router" i2pd >/dev/null 2>&1 || : +%post systemd +%systemd_post i2pd.service + + +%preun systemd +%systemd_preun i2pd.service + + +%postun systemd +%systemd_postun_with_restart i2pd.service %files -%doc README.md LICENSE docs/configuration.md +%doc README.md LICENSE %{_sbindir}/%{name} %{_sysconfdir}/%{name}/* %{_sysconfdir}/logrotate.d/%{name} %{_datadir}/%{name}/certificates -%{_initddir}/%{name} +#{_initddir}/%{name} +%{_sharedstatedir}/%{name}/certificates +%attr(0755,i2pd,i2pd) %dir %{_localstatedir}/lib/%{name} \ No newline at end of file