SHA256
1
0
forked from pool/gnunet
gnunet/gnunet.spec

445 lines
15 KiB
RPMSpec

#
# spec file for package gnunet
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.links2linux.org/
#
%define gnurl gnurl-7.54.0
%define user gnunet
%define grpnet gnunet
%define grpdns gnunetdns
Name: gnunet
Version: 0.10.1
Release: 0
Summary: Security focused Peer-to-Peer Framework
License: GPL-3.0
Group: Productivity/Networking/File-Sharing
Url: http://gnunet.org
Source0: ftp://ftp.gnu.org/gnu/gnunet/%{name}-%{version}.tar.gz
Source1: https://gnunet.org/sites/default/files/%{gnurl}.tar.bz2
Source2: gnunet.init
Source3: gnunet.service
Source4: gnunet-tmpfile.conf
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: gnunet-fix_postgresql_include.patch
# PATCH-FIX-OPENSUSE gnurl.patch avvissu@yandex.ru -- Do not check build dependence (build here)
Patch2: gnunet-0.10.1_gnurl.patch
# PATCH-FIX-UPSTREAM libexec_conversation.patch avvissu@yandex.ru -- Change path to libexecdir
Patch3: gnunet-0.10.1_libexec_conversation.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gcc
BuildRequires: make
BuildRequires: glibc-devel
BuildRequires: glpk-devel >= 4.45
BuildRequires: libadns-devel
BuildRequires: libesmtp-devel
BuildRequires: libgcrypt-devel >= 1.6
BuildRequires: libmysqlclient-devel >= 5.1
BuildRequires: libunistring-devel
BuildRequires: perl(GMP)
BuildRequires: postgresql-devel >= 8.3
BuildRequires: pkgconfig(gnutls) >= 3.2.12
BuildRequires: pkgconfig(guile-2.0)
BuildRequires: pkgconfig(libcares)
# Use gnurl instead of curl [bugs.archlinux.org#38820]
#BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libextractor) >= 0.6.1
BuildRequires: pkgconfig(libidn) >= 1.0
BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.33
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(sqlite3) >= 3.8
# This fork of libcurl, which is only for GNUnet
# Conflict with curl
#BuildRequires: pkgconfig(libgnurl)
###########Recommends###########
BuildRequires: pkgconfig(libpulse) >= 2.0
BuildRequires: pkgconfig(openssl) >= 1.0
BuildRequires: pkgconfig(opus) >= 1.0.1
BuildRequires: pkgconfig(ogg) >= 1.3.0
#BuildRequires: gettext
%if 0%{?suse_version} > 1140
%{!?_tmpfilesdir:%global _tmpfilesdir %{_libexecdir}/tmpfiles.d}
BuildRequires: systemd
%{?systemd_requires}
%endif
Provides: gnunetd = %{version}
Provides: GNUnet = %{version}
Provides: GNUnetd = %{version}
Recommends: gnunet-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
GNUnet is a part of the GNU project (http://www.gnu.org/).
%package devel
Summary: Security focused Peer-to-Peer Framework
Group: Development/Libraries/C and C++
Requires: lib%{name} = %{version}
Requires: libgcrypt-devel >= 1.6
Requires: pkgconfig(libpulse) >= 2.0
Requires: pkgconfig(ogg) >= 1.3.0
Requires: pkgconfig(openssl) >= 1.0
Requires: pkgconfig(opus) >= 1.0.1
%description devel
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
This package contains header files and libraries needed to develop
application that use %{name}.
%package -n lib%{name}
Summary: GNUnet libraries
Group: System/Libraries
%description -n lib%{name}
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
This package contains lib%{name} shared library.
%package plugins
Summary: GNUnet plugins
Group: Productivity/Networking/File-Sharing
Requires: %{name} = %{version}
%description plugins
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
This package contains plugins for GNUnet services.
%package mysql
Summary: MySQL Storage Backend for %{name}
Group: Productivity/Networking/Other
Requires: %{name} = %{version}
%description mysql
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
%package postgresql
Summary: PostgreSQL Storage Backend for %{name}
Group: Productivity/Networking/Other
Requires: %{name} = %{version}
%description postgresql
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
%package sqlite
Summary: SQLite Storage Backend for %{name}
Group: Productivity/Networking/Other
Requires: %{name} = %{version}
%description sqlite
GNUnet is peer-to-peer framework focusing on security. The first and primary
application for GNUnet is anonymous file-sharing. GNUnet is currently developed
by a worldwide group of independent free software developers.
%lang_package
%prep
%setup -q -b1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
# Build gnurl
pushd %{_builddir}/%{gnurl}
autoreconf -fiv
%configure \
--enable-shared=no
make %{?_smp_mflags}
popd
# Build gnunet
export CPPFLAGS="-I%{_builddir}/%{gnurl}/include"
export LIBS="-L%{_builddir}/%{gnurl}/lib/.libs/ -lgnurl"
autoreconf -fiv
%configure \
--with-nssdir=%{_libdir} \
--with-gnunetdns=%{grpdns}
make %{?_smp_mflags} V=1 \
pkgcfgdir="%{_sysconfdir}/gnunet"
%install
make DESTDIR=%{buildroot} install \
pkgcfgdir="%{_sysconfdir}/gnunet"
# install service file
%if 0%{?suse_version} > 1140
install -d %{buildroot}/%{_sbindir}
install -Dm 644 "%{SOURCE3}" %{buildroot}%{_unitdir}/%{name}.service
sed -i 's|@LIBDIR@|%{_libdir}|' %{buildroot}%{_unitdir}/%{name}.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
install -Dm 644 "%{SOURCE4}" %{buildroot}%{_tmpfilesdir}/%{name}.conf
%else
install -D -m0755 "%{SOURCE2}" "%{buildroot}%{_initddir}/%{name}"
install -d "%{buildroot}%{_sbindir}"
ln -s "../..%{_initddir}/%{name}" "%{buildroot}%{_sbindir}/rc%{name}"
%endif
# use a symbolic link instead of patch
ln -s %{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config.d
# create a default configuration
cat<<EOF > "%{buildroot}%{_sysconfdir}/%{name}.conf"
[path]
GNUNET_HOME = %{_localstatedir}/lib/%{name}
GNUNET_DATA_HOME = %{_localstatedir}/lib/%{name}/data/
GNUNET_RUNTIME_DIR = %{_localstatedir}/run/%{name}/
#DEFAULTCONFIG = %{_sysconfdir}/%{name}.conf
[arm]
SYSTEM_ONLY = YES
USER_ONLY = NO
EOF
# link libraries
for f in $(find %{buildroot} -name \*nss_gns*.so.[0-9]); do
s="${f%s*}"; l="$(echo $f|sed 's|%{buildroot}||')"
ln -s $l ${s}so; done
# get rid of static libraries
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}%{_datadir}/doc/%{name}
%find_lang %{name}
%pre
if ! %{_bindir}/id %{user} &>/dev/null; then
%{_sbindir}/groupadd -r %{grpnet}
%{_sbindir}/useradd -r -g %{user} -c "GNUnet daemon" -d \
%{_localstatedir}/lib/%{name} %{grpnet}; fi
if test ! -d %{_localstatedir}/log/%{name}; then
install -d -m0750 -o%{user} -g%{grpnet} "%{_localstatedir}/lib/%{name}"
install -d -m0750 -o%{user} -g%{grpnet} "%{_localstatedir}/log/%{name}"; fi
if ! %{_bindir}/getent group %{grpdns} &>/dev/null; then
echo -n "Create a special secured group %{grpdns}:"
%{_sbindir}/groupadd -r %{grpdns}
echo " done"; fi
%if 0%{?suse_version} > 1140
%service_add_pre %{name}.service
%endif
%post
%if 0%{?suse_version} > 1140
%service_add_post %{name}.service
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf
%else
%fillup_and_insserv -f %{name}
%endif
%preun
%if 0%{?suse_version} > 1140
%service_del_preun %{name}.service
%else
%stop_on_removal %{name}
%endif
%postun
%if 0%{?suse_version} > 1140
%service_del_postun %{name}.service
%else
%restart_on_update %{name}
%insserv_cleanup
%endif
if [ $1 -eq 0 ]; then
userdel %{user} || logger "User \"%{user}\" could not be deleted."
rm -rf %{_localstatedir}/lib/%{name}
rm -rf %{_localstatedir}/log/%{name}; fi
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING README
%{_bindir}/%{name}-arm
%{_bindir}/%{name}-ats
%{_bindir}/%{name}-auto-share
%{_bindir}/%{name}-bcd
%{_bindir}/%{name}-config
%{_bindir}/%{name}-conversation
%{_bindir}/%{name}-conversation-test
%{_bindir}/%{name}-core
%{_bindir}/%{name}-datastore
%{_bindir}/%{name}-directory
%{_bindir}/%{name}-download
%{_bindir}/%{name}-download-manager.scm
%{_bindir}/%{name}-ecc
%{_bindir}/%{name}-fs
%{_bindir}/%{name}-gns
%{_bindir}/%{name}-gns-import.sh
%{_bindir}/%{name}-gns-proxy-setup-ca
%{_bindir}/%{name}-identity
%{_bindir}/%{name}-mesh
%{_bindir}/%{name}-namecache
%{_bindir}/%{name}-namestore
%{_bindir}/%{name}-nat-server
%{_bindir}/%{name}-nse
%{_bindir}/%{name}-peerinfo
%{_bindir}/%{name}-publish
%{_bindir}/%{name}-qr
%{_bindir}/%{name}-resolver
%{_bindir}/%{name}-revocation
%{_bindir}/%{name}-scrypt
%{_bindir}/%{name}-search
%{_bindir}/%{name}-set-ibf-profiler
%{_bindir}/%{name}-set-profiler
%{_bindir}/%{name}-statistics
%{_bindir}/%{name}-template
%{_bindir}/%{name}-testbed-profiler
%{_bindir}/%{name}-testing
%{_bindir}/%{name}-transport
%{_bindir}/%{name}-transport-certificate-creation
%{_bindir}/%{name}-unindex
%{_bindir}/%{name}-uri
%{_bindir}/%{name}-vpn
%{_datadir}/%{name}
# libexec dir
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/libexec
%{_libdir}/%{name}/libexec/%{name}-daemon-exit
%{_libdir}/%{name}/libexec/%{name}-daemon-hostlist
%{_libdir}/%{name}/libexec/%{name}-daemon-latency-logger
%{_libdir}/%{name}/libexec/%{name}-daemon-pt
%{_libdir}/%{name}/libexec/%{name}-daemon-regexprofiler
%{_libdir}/%{name}/libexec/%{name}-daemon-testbed-blacklist
%{_libdir}/%{name}/libexec/%{name}-daemon-testbed-underlay
%{_libdir}/%{name}/libexec/%{name}-daemon-topology
%{_libdir}/%{name}/libexec/%{name}-dns2gns
%{_libdir}/%{name}/libexec/%{name}-gns-proxy
%{_libdir}/%{name}/libexec/%{name}-helper-audio-playback
%{_libdir}/%{name}/libexec/%{name}-helper-audio-record
%{_libdir}/%{name}/libexec/%{name}-helper-dns
%{_libdir}/%{name}/libexec/%{name}-helper-exit
%{_libdir}/%{name}/libexec/%{name}-helper-fs-publish
%{_libdir}/%{name}/libexec/%{name}-helper-nat-client
%{_libdir}/%{name}/libexec/%{name}-helper-nat-server
%{_libdir}/%{name}/libexec/%{name}-helper-testbed
%{_libdir}/%{name}/libexec/%{name}-helper-transport-wlan
%{_libdir}/%{name}/libexec/%{name}-helper-transport-wlan-dummy
%{_libdir}/%{name}/libexec/%{name}-helper-vpn
%{_libdir}/%{name}/libexec/%{name}-namestore-fcfsd
%{_libdir}/%{name}/libexec/%{name}-service-arm
%{_libdir}/%{name}/libexec/%{name}-service-ats
%{_libdir}/%{name}/libexec/%{name}-service-core
%{_libdir}/%{name}/libexec/%{name}-service-conversation
%{_libdir}/%{name}/libexec/%{name}-service-datastore
%{_libdir}/%{name}/libexec/%{name}-service-dht
%{_libdir}/%{name}/libexec/%{name}-service-dht-xvine
%{_libdir}/%{name}/libexec/%{name}-service-dns
%{_libdir}/%{name}/libexec/%{name}-service-fs
%{_libdir}/%{name}/libexec/%{name}-service-gns
%{_libdir}/%{name}/libexec/%{name}-service-identity
%{_libdir}/%{name}/libexec/%{name}-service-mesh
%{_libdir}/%{name}/libexec/%{name}-service-namecache
%{_libdir}/%{name}/libexec/%{name}-service-namestore
%{_libdir}/%{name}/libexec/%{name}-service-nse
%{_libdir}/%{name}/libexec/%{name}-service-peerinfo
%{_libdir}/%{name}/libexec/%{name}-service-regex
%{_libdir}/%{name}/libexec/%{name}-service-resolver
%{_libdir}/%{name}/libexec/%{name}-service-revocation
%{_libdir}/%{name}/libexec/%{name}-service-set
%{_libdir}/%{name}/libexec/%{name}-service-statistics
%{_libdir}/%{name}/libexec/%{name}-service-template
%{_libdir}/%{name}/libexec/%{name}-service-testbed
%{_libdir}/%{name}/libexec/%{name}-service-testbed-logger
%{_libdir}/%{name}/libexec/%{name}-service-transport
%{_libdir}/%{name}/libexec/%{name}-service-vpn
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config %{_sysconfdir}/%{name}/*.conf
%{_mandir}/man1/%{name}*.1*
%{_mandir}/man5/%{name}*.5*
%if 0%{?suse_version} > 1140
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%{_tmpfilesdir}/%{name}.conf
%else
%{_sysconfdir}/init.d/%{name}
%{_sbindir}/rc%{name}
%endif
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/lib%{name}*.so.*
%{_libdir}/libnss_gns*.so.*
%files plugins
%defattr(-,root,root)
%{_libdir}/%{name}/lib%{name}_plugin_ats*.so
%{_libdir}/%{name}/lib%{name}_plugin_block*.so
%{_libdir}/%{name}/lib%{name}_plugin_datacache_heap.so
%{_libdir}/%{name}/lib%{name}_plugin_datacache_template.so
%{_libdir}/%{name}/lib%{name}_plugin_datastore_heap.so
%{_libdir}/%{name}/lib%{name}_plugin_datastore_template.so
%{_libdir}/%{name}/lib%{name}_plugin_gnsrecord*.so
%{_libdir}/%{name}/lib%{name}_plugin_test.so
%{_libdir}/%{name}/lib%{name}_plugin_transport*.so
%files mysql
%defattr(-,root,root)
%{_libdir}/%{name}/lib%{name}_plugin_datastore_mysql.so
%files postgresql
%defattr(-,root,root)
%{_libdir}/%{name}/lib%{name}_plugin_datacache_postgres.so
%{_libdir}/%{name}/lib%{name}_plugin_datastore_postgres.so
%{_libdir}/%{name}/lib%{name}_plugin_namecache_postgres.so
%{_libdir}/%{name}/lib%{name}_plugin_namestore_postgres.so
%files sqlite
%defattr(-,root,root)
%{_libdir}/%{name}/lib%{name}_plugin_datacache_sqlite.so
%{_libdir}/%{name}/lib%{name}_plugin_datastore_sqlite.so
%{_libdir}/%{name}/lib%{name}_plugin_namecache_sqlite.so
%{_libdir}/%{name}/lib%{name}_plugin_namestore_sqlite.so
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/pkgconfig/%{name}*.pc
%{_libdir}/lib%{name}*.so
%{_libdir}/libnss_gns*.so
%files lang -f %{name}.lang
%defattr(-,root,root)
%changelog