i2pd/i2pd.spec

87 lines
2.4 KiB
RPMSpec

Name: i2pd
Version: 2.12.0
Release: 2
Summary: I2P router
License: BSD
URL: https://bitbucket.org/orignal/i2pd/src
Group: Development/Other
Source: %{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: pkgconfig(libssl)
BuildRequires: boost-devel
BuildRequires: cjdns
BuildRequires: systemd
BuildRequires: cmake
BuildRequires: miniupnpc-devel
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service
%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.
%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
%make
%install
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_datadir}/%{name}
install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}/var/lib
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}
cp -r contrib/certificates %{buildroot}%{_datadir}/%{name}/
%post
/sbin/chkconfig --add %{name}
%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
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 || :
%files
%doc README.md LICENSE docs/configuration.md
%{_sbindir}/%{name}
%{_sysconfdir}/%{name}/*
%{_sysconfdir}/logrotate.d/%{name}
%{_datadir}/%{name}/certificates
%{_initddir}/%{name}