Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 45a01c847c53d5d34d162d9382c1334b > files > 12

gogoc-1.2-26.fc18.src.rpm

%global _hardened_build 1
%global distver 1_2-RELEASE

Name:           gogoc
Version:        1.2
Release:        26%{?dist}
Summary:        IPv6 TSP client for gogo6

Group:          System Environment/Daemons
# The entire source code is BSD except gogoc-tsp/include/net_tcp6.c
License:        BSD and GPLv2
URL:            http://gogonet.gogo6.com/page/freenet6-services
Source0:        http://content.gogo6.com/%{name}-%{distver}.tar.gz
Source1:        %{name}.service
Source2:        %{name}-tmpfiles.conf
Patch1:         %{name}-%{version}-dirpath.patch
Patch2:         %{name}-%{version}-gcc_4.6_compile_fix.patch
Patch3:         %{name}-%{version}-gogoc_conf_5.patch
# Patch4: https://bugs.launchpad.net/ubuntu/+source/gw6c/+bug/418176
Patch4:         %{name}-%{version}-lp418176_client_v4.patch
Patch5:         %{name}-%{version}-selinux_fix.patch
Patch6:         %{name}-%{version}-kill_radvd.patch
Patch7:         %{name}-%{version}-debug_info.patch
# Patch8: https://bugzilla.redhat.com/show_bug.cgi?id=983052
Patch8:         %{name}-%{version}-bz983052_adjust_output_scraping_to_match_current_ifconfig.patch

BuildRequires:  openssl-devel
BuildRequires:  systemd-units

Requires:       radvd
Requires(post): systemd-units
Requires(post): policycoreutils-python
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(postun): policycoreutils-python

%description
TSP is a control protocol used to establish and maintain static tunnels.
The gogoCLIENT is used on the host computer to connect to a tunnel broker
using the TSP protocol and to get the information for its IPv6 tunnel.
When it receives the information for the tunnel, the gogoCLIENT creates the 
static tunnel on its operating system.
You can setup a dynamic tunnel anonymously, but if you want a static prefix
you need an account in Freenet6 http://gogonet.gogo6.com/page/freenet6-account

%prep
%setup -q -n %{name}-%{distver}
%patch1 -p1 -b .dirpath
%patch2 -p1 -b .gcc_4.6_compile_fix
%patch3 -p1 -b .gogoc_conf_5
%patch4 -p1 -b .lp418176_client_v4
%patch5 -p1 -b .selinux_fix
%patch6 -p1 -b .kill_radvd
%patch7 -p1
%patch8 -p1

%build
CFLAGS="%{optflags}"; export CFLAGS
CXXFLAGS="%{optflags}"; export CXXFLAGS
LDFLAGS="%{__global_ldflags}"; export LDFLAGS
make -j1 all

%install
make installdir=%{buildroot}%{_prefix} install
# Directories that need to be packaged
install -d %{buildroot}%{_datadir} \
           %{buildroot}%{_sysconfdir}/sysconfig \
           %{buildroot}%{_sysconfdir}/%{name}/template \
           %{buildroot}%{_unitdir} \
           %{buildroot}%{_sharedstatedir}/%{name} \
           %{buildroot}%{_localstatedir}/run/%{name} \
           %{buildroot}%{_localstatedir}/log/%{name}
# Systemd unit file
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}
# Copy the Linux shell script to where it's needed
cp -p %{buildroot}%{_datadir}/%{name}/template/linux.sh %{buildroot}%{_sysconfdir}/%{name}/template/linux.sh
# Ghost files
touch %{buildroot}%{_sharedstatedir}/%{name}/gogockeys.pub
touch %{buildroot}%{_sharedstatedir}/%{name}/tsp-last-server.txt
touch %{buildroot}%{_sharedstatedir}/%{name}/tsp-broker-list.txt
touch %{buildroot}%{_localstatedir}/run/%{name}/%{name}-rtadvd.conf
# Remove unneeded files
rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.sample
rm -rf %{buildroot}%{_datadir}/%{name}
# The config file can contain passwords, protect it
chmod 0640 %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
# Tmpfiles
mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf

%post
semanage fcontext -a -t radvd_etc_t '%{_localstatedir}/run/%{name}/%{name}-rtadvd.conf' 2>/dev/null || :
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service
if [ $1 -eq 0 ] ; then  # final removal
    semanage fcontext -d -t radvd_etc_t '%{_localstatedir}/run/%{name}/%{name}-rtadvd.conf' 2>/dev/null || :
fi


%files
%doc CLIENT-LICENSE.TXT README
%{_mandir}/man5/%{name}.conf.5.gz
%{_mandir}/man8/%{name}.8.gz
%config(noreplace) %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
%dir %{_sharedstatedir}/%{name}
%ghost %{_sharedstatedir}/%{name}/tsp-last-server.txt
%ghost %{_sharedstatedir}/%{name}/gogockeys.pub
%ghost %{_sharedstatedir}/%{name}/tsp-broker-list.txt
%dir %{_localstatedir}/run/%{name}
%ghost %{_localstatedir}/run/%{name}/%{name}-rtadvd.conf
%dir %{_localstatedir}/log/%{name}
%{_bindir}/%{name}
%{_unitdir}/%{name}.service

%changelog
* Fri Jul 12 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.2-26
- Adjust output scraping to match current ifconfig. Closes bug #983052,
  thanks to Frank Dana

* Tue May 28 2013 Juan Orti Alcaine <jorti@fedoraproject.org> - 1.2-25
- Add startup options via environment variable in service unit file

* Thu Apr 25 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-24
- Fix PIE compilation. Closes bug #955282

* Fri Feb 08 2013 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-23
- Remove symlinked directories from ReadOnlyDirectories in unit file

* Mon Dec 17 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-22
- Remove DeviceAllow from unit file

* Fri Dec 14 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-21
- Fix policycoreutils-python dependency
- Add security measures in unit file: PrivateTmp, CapabilityBoundingSet,
  InaccessibleDirectories, ReadOnlyDirectories and DeviceAllow

* Tue Aug 21 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-20
- Add systemd macros. Fix #850133

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Jul 04 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-18
- Remove sysconfig file

* Thu Jun 28 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-17
- Fix unit file documentation entry
- Update Source URL

* Wed Jun 27 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-16
- Add documentation to systemd service file
- Define variable as global
- Remove unneeded BuildRequires

* Mon Apr 16 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-15
- Hardened build
- Remove unnecesary datadir
- Add missing systemd-units build dependency

* Mon Apr 16 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-14
- Description updated
- Change variable to global
- Don't remove log files while uninstalling

* Tue Feb 14 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-13
- Fix tmpfiles directory creation

* Mon Feb 13 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-12
- Revert FSF address patch
- Update license information

* Mon Feb 13 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-11
- Fix FSF postal address

* Mon Feb 13 2012 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-10
- Honor RPM_OPT_FLAGS

* Thu Nov 24 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-9
- Add tmpfiles directory creation

* Tue Sep 20 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-8
- fixed debug symbols

* Mon Sep 19 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-7
- spec file clean up
- systemd service fix

* Wed Sep 14 2011 Juan Orti Alcaine <j.orti.alcaine@gmail.com> - 1.2-6
- add Debian patches
- add systemd service
- license changed to BSD