%define daemon_name gnunetd %define daemon_user_name gnunet %define daemon_user_home %{_sharedstatedir}/%{name} %define daemon_group_name gnunet %define setup_name gnunet-setup Name: GNUnet Version: 0.8.1 Release: 1%{?dist} Summary: Secure peer-to-peer networking framework Group: Applications/Internet License: GPLv2+ URL: http://gnunet.org/ Source0: http://gnunet.org/download/%{name}-%{version}.tar.gz Source1: %{daemon_name}.init Source2: %{name}-wizard-server-gtk.desktop Source3: %{name}-wizard-server-qt.desktop Source4: %{name}-wizard-server-ncurses.desktop Source5: %{daemon_name}.conf Source6: %{setup_name}.pam Source7: %{setup_name}.console Source8: %{name}-wizard-client.desktop Source9: %{name}-setup-server.desktop Source10: %{daemon_name}.logrotate Patch4: GNUnet-0.8.1-pluginpath.patch Patch5: GNUnet-0.8.1-cnpsqlitepgsql.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: autoconf BuildRequires: libtool-ltdl-devel >= 2.2 BuildRequires: libgcrypt-devel >= 1.2 BuildRequires: libcurl-devel >= 7.15.4 BuildRequires: libxml2-devel BuildRequires: libextractor-devel >= 0.5.20b BuildRequires: gmp-devel >= 4.0 BuildRequires: guile-devel >= 1.8 BuildRequires: adns-devel >= 1.0 # Alternative: # BuildRequires: c-ares-devel BuildRequires: mysql-devel >= 5.0 BuildRequires: sqlite-devel >= 3.0 BuildRequires: postgresql-devel BuildRequires: gtk2-devel >= 2.6.0 BuildRequires: qt-devel >= 4.0 BuildRequires: dialog-devel >= 1.0-0.20051207 BuildRequires: ncurses-devel BuildRequires: libmicrohttpd-devel >= 0.3.1 BuildRequires: libesmtp-devel >= 1.0.4 BuildRequires: libglade2-devel BuildRequires: desktop-file-utils BuildRequires: gettext Requires: usermode Requires: logrotate Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts %description GNUnet is a framework for secure peer-to-peer networking that does not use any centralized or otherwise trusted services. A first service implemented on top of the networking layer allows anonymous censorship-resistant file-sharing. Anonymity is provided by making messages originating from a peer indistinguishable from messages that the peer is routing. All peers act as routers and use link-encrypted connections with stable bandwidth utilization to communicate with each other. GNUnet uses a simple, excess-based economic model to allocate resources. Peers in GNUnet monitor each others behavior with respect to resource usage; peers that contribute to the network are rewarded with better service. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package gtk Summary: GTK+ setup utilities for %{name} Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description gtk The %{name}-gtk package contains GTK+ based GUI client and server setup utilities for %{name}. %package qt Summary: Qt setup utilities for %{name} Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description qt The %{name}-qt package contains Qt based GUI client and server setup utilities for %{name}. %package mysql Summary: MySQL storage backend for %{name} Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description mysql The %{name}-mysql package contains the MySQL based storage engine for %{name}. %package pgsql Summary: PostgreSQL storage backend for %{name} Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description pgsql The %{name}-pgsql package contains the PostgreSQL based storage engine for %{name}. %prep %setup -q %patch4 -p1 -b .pluginpath %patch5 -p1 -b .cnpsqlitepgsql for file in AUTHORS do iconv -f ISO-8859-15 -t UTF-8 ${file} > ${file}~ mv ${file}{~,} done # Kudos to Enrico Scholz mkdir -p _dialog _postgresql/include _mysql ln -s %_includedir/dialog _dialog/include ln -s %_includedir _postgresql/include/postgresql ln -s %_libdir/mysql _mysql/lib %build autoreconf PATH=$(pkg-config --variable=bindir Qt):$PATH %configure --disable-static \ --with-daemon-home-dir=%{daemon_user_home} \ --with-daemon-pidfile=%{_localstatedir}/run/%{daemon_name}/%{daemon_name}.pid \ --with-dialog=$(pwd)/_dialog \ --with-postgres=$(pwd)/_postgresql \ --with-mysql=$(pwd)/_mysql \ LDFLAGS='-Wl,--as-needed' # --disable-rpath gets ignored sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool # Only link to libs as needed, removes linkage bloat; Kudos to Enrico Scholz sed -i 's| -shared | -Wl,--as-needed\0|g' libtool make # %{?_smp_mflags} parallel building is broken as of 0.8.0c %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' mkdir -p $RPM_BUILD_ROOT%{_initddir} install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/%{daemon_name} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{daemon_name} mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/%{daemon_name} %find_lang %{name} for source in %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} do desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ "${source}" done # This is not a mistake: gnunet-setup lives in /usr/bin bin but *can* use # root privileges when used with -d to configure /etc/gnunetd.conf mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} ln -s ../bin/consolehelper ${RPM_BUILD_ROOT}%{_sbindir}/%{setup_name} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/%{setup_name} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/%{setup_name} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} %clean rm -rf $RPM_BUILD_ROOT %pre getent group %{daemon_group_name} >/dev/null || groupadd -r %{daemon_group_name} getent passwd %{daemon_user_name} >/dev/null || \ useradd -m -r -g %{daemon_group_name} -d %{daemon_user_home} -s /sbin/nologin \ -c "GNUnet daemon user" %{daemon_user_name} exit 0 %post /sbin/ldconfig /sbin/chkconfig --add %{daemon_name} %post mysql -p /sbin/ldconfig %preun if [ $1 = 0 ]; then /sbin/service %{daemon_name} stop >/dev/null 2>&1 /sbin/chkconfig --del %{daemon_name} fi %postun /sbin/ldconfig if [ "$1" -ge "1" ]; then /usr/bin/gnunet-update /sbin/service %{daemon_name} condrestart >/dev/null 2>&1 || : fi %postun mysql -p /sbin/ldconfig %files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README UPDATING %{_sbindir}/* %{_bindir}/* %{_libdir}/*.so.* %exclude %{_libdir}/libgnunetmysql.so.* %{_libdir}/%{name}/*.so %exclude %{_libdir}/%{name}/libgnunetsetup_gtk.so %exclude %{_libdir}/%{name}/libgnunetsetup_qt.so %exclude %{_libdir}/%{name}/libgnunetmodule_dhtlog_mysql.so %exclude %{_libdir}/%{name}/libgnunetmodule_dstore_mysql.so %exclude %{_libdir}/%{name}/libgnunetmodule_sqstore_mysql.so %exclude %{_libdir}/%{name}/libgnunetmodule_sqstore_postgres.so %{_datadir}/%{name} %{_datadir}/applications/GNUnet-wizard-server-ncurses.desktop %{_mandir}/man1/*.1* %{_mandir}/man5/*.5* %{_initddir}/%{daemon_name} %dir %attr(-,%{daemon_user_name},%{daemon_group_name}) %{_localstatedir}/log/%{daemon_name} %dir %attr(-,%{daemon_user_name},%{daemon_group_name}) %{_localstatedir}/run/%{daemon_name} %config(noreplace) %{_sysconfdir}/%{daemon_name}.conf %config(noreplace) %{_sysconfdir}/pam.d/%{setup_name} %config(noreplace) %{_sysconfdir}/security/console.apps/%{setup_name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %files gtk %defattr(-,root,root,-) %doc AUTHORS COPYING %{_libdir}/%{name}/libgnunetsetup_gtk.so %{_datadir}/applications/GNUnet-setup-server.desktop %{_datadir}/applications/GNUnet-wizard-client.desktop %{_datadir}/applications/GNUnet-wizard-server-gtk.desktop %files qt %defattr(-,root,root,-) %doc AUTHORS COPYING %{_libdir}/%{name}/libgnunetsetup_qt.so %{_datadir}/applications/GNUnet-wizard-server-qt.desktop %files mysql %defattr(-,root,root,-) %doc AUTHORS COPYING %{_libdir}/libgnunetmysql.so.* %{_libdir}/%{name}/libgnunetmodule_dhtlog_mysql.so %{_libdir}/%{name}/libgnunetmodule_dstore_mysql.so %{_libdir}/%{name}/libgnunetmodule_sqstore_mysql.so %files pgsql %defattr(-,root,root,-) %doc AUTHORS COPYING %{_libdir}/%{name}/libgnunetmodule_sqstore_postgres.so %files devel %defattr(-,root,root,-) %doc COPYING PLATFORMS HACKING %{_includedir}/* %{_libdir}/*.so %changelog * Tue Jan 5 2010 Alexander Kahl - 0.8.1-1 - update to 0.8.1 - use local symlinks instead of patches to fix include path issues (Kudos to Enrico Scholz) - use same trick for mysql libdir, hardwired to /usr/lib - run gnunet-update as root in post (changes /etc/gnunetd.conf) and don't void possible warnings - updated Patch4 (still necessary) - new Patch5, fixes obvious copy'n'paste bug in configure.ac for pgsql cppflags/ldflags - use --as-needed linker option to avoid superfluous dso linking (Kudos to Enrico Scholz) - split up libs offering optional bindings (gtk, qt, mysql, pgsql) * Wed Sep 30 2009 Alexander Kahl - 0.8.0c-1 - initial creation