i2pd/i2pd.spec

124 lines
3.5 KiB
RPMSpec
Raw Normal View History

2021-09-07 00:40:40 +03:00
%define debug %nil
%define build_timestamp %(date +"%Y%m%d")
2017-02-19 23:22:58 +03:00
Name: i2pd
2025-02-02 11:09:50 +00:00
Version: 2.55.0
2022-02-27 00:15:44 +03:00
Release: 1
2017-02-19 23:22:58 +03:00
Summary: I2P router
License: BSD
2025-02-02 11:09:50 +00:00
URL: https://i2pd.website
2017-02-19 23:22:58 +03:00
Group: Development/Other
2021-09-07 00:40:40 +03:00
Source0: https://github.com/PurpleI2P/i2pd/archive/%{version}/%{name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
2017-02-19 23:22:58 +03:00
BuildRequires: gcc
2021-09-07 00:40:40 +03:00
BuildRequires: gcc-c++
2025-02-03 23:00:40 +00:00
#BuildRequires: pkgconfig(libssl)
2017-02-19 23:22:58 +03:00
BuildRequires: boost-devel
BuildRequires: systemd
2017-02-20 15:26:53 +03:00
BuildRequires: cmake
BuildRequires: miniupnpc-devel
2021-09-07 00:40:40 +03:00
BuildRequires: chrpath
2025-02-03 23:00:40 +00:00
BuildRequires: pkgconfig(openssl3.3)
2017-02-19 23:22:58 +03:00
%description
load-balanced unspoofable packet switching network - C++ port
I2P is an anonymizing network, offering a simple layer that identity-sensitive
applications can use to securely communicate. All data is wrapped with several
layers of encryption, and the network is both distributed and dynamic, with no
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.
2021-09-07 00:40:40 +03:00
%package systemd
2022-11-22 19:09:12 +03:00
Summary: Files to run I2P router under systemd
Requires: i2pd
Requires: systemd
Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd
Obsoletes: %{name}-daemon
2021-09-07 00:40:40 +03:00
%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
2017-02-19 23:22:58 +03:00
%prep
%setup -q
%build
2025-02-04 19:05:09 +00:00
#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 \
# -DOPENSSL_ROOT_DIR=/opt/openssl3.3 \
# .
%make -f Makefile.linux
#popd
2017-02-19 23:22:58 +03:00
%install
2021-09-07 19:54:57 +03:00
2017-02-19 23:22:58 +03:00
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_datadir}/%{name}
2021-09-07 19:54:57 +03:00
install -d %{buildroot}%{_sysconfdir}/%{name}/tunnels.conf.d
install -d %{buildroot}%{_sysconfdir}/%{name}/certificates
2021-09-07 00:40:40 +03:00
install -d %{buildroot}%{_localstatedir}/lib/%{name}
install -d %{buildroot}%{_unitdir}
install -d %{buildroot}%{_sharedstatedir}/%{name}
2021-09-07 19:54:57 +03:00
install -d %{buildroot}%{_mandir}/man1/
2021-09-07 00:40:40 +03:00
pushd build
2021-09-07 19:54:57 +03:00
chrpath -d i2pd
2017-02-19 23:22:58 +03:00
install -Dm0755 %{name} %{buildroot}%{_sbindir}
2021-09-07 00:40:40 +03:00
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}/
2021-09-07 19:54:57 +03:00
install -Dm0644 contrib/%{name}.service %{buildroot}%{_unitdir}
install -Dm0644 contrib/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -Dm0644 debian/i2pd.1 %{buildroot}%{_mandir}/man1/
cp -r contrib/certificates/ %{buildroot}%{_datadir}/%{name}/certificates
cp -r contrib/tunnels.d/ %{buildroot}%{_sysconfdir}/%{name}/tunnels.conf.d
2021-09-07 00:40:40 +03:00
ln -s %{_datadir}/%{name}/certificates %{buildroot}%{_sharedstatedir}/%{name}/certificates
%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
%post systemd
%systemd_post i2pd.service
2017-02-19 23:22:58 +03:00
2021-09-07 00:40:40 +03:00
%preun systemd
%systemd_preun i2pd.service
2017-02-19 23:22:58 +03:00
2021-09-07 00:40:40 +03:00
%postun systemd
%systemd_postun_with_restart i2pd.service
2017-02-19 23:22:58 +03:00
%files
2021-09-07 00:40:40 +03:00
%doc README.md LICENSE
2017-02-19 23:22:58 +03:00
%{_sbindir}/%{name}
%{_sysconfdir}/%{name}/*
%{_sysconfdir}/logrotate.d/%{name}
%{_datadir}/%{name}/certificates
2021-09-07 00:40:40 +03:00
%{_sharedstatedir}/%{name}/certificates
2021-09-07 19:54:57 +03:00
%{_mandir}/man1/*
2025-02-02 11:09:50 +00:00
%attr(0755,i2pd,i2pd) %dir %{_localstatedir}/lib/%{name}