%global githubuser wlanslovenija %global gitver 18f365f329795400f4d7a101a6d45bc859100144 %global gitshort %(r=%{gitver}; echo ${r:0:7}) %if 0%{?gitver:1} %global srcurl https://github.com/%{githubuser}/%{name}/archive/%{gitver}.tar.gz#/%{name}-%{gitver}.tar.gz %global setuppath %{name}-%{gitver} %else %global srcurl https://github.com/%{githubuser}/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz %global setuppath %{name}-%{version} %endif Name: tunneldigger Version: 0.3.0 Release: 5.git%{gitshort}%{?dist} Summary: L2TP VPN client License: AGPLv3 URL: https://github.com/%{githubuser}/%{name} Source0: %{srcurl} # Client Source100: %{name}.service Source101: %{name}@.service Source102: %{name}-client.conf # Broker Source200: %{name}-broker.service Source201: %{name}-broker@.service Source202: %{name}-modules.conf Source203: %{name}-logrotate.conf Patch0: 0001-client-declare-project-as-C.patch #Client BuildRequires: gcc BuildRequires: cmake BuildRequires: libasyncns-devel BuildRequires: libnl3-devel # Broker BuildRequires: libffi-devel BuildRequires: libnetfilter_conntrack-devel BuildRequires: libnfnetlink-devel BuildRequires: python2-cffi BuildRequires: python2-devel BuildRequires: python2-netfilter BuildRequires: python2-setuptools BuildRequires: systemd Requires: kmod(l2tp_core.ko) Requires: kmod(l2tp_eth.ko) Requires: kmod(l2tp_netlink.ko) %description Tunneldigger is one of the projects of wlan slovenija open wireless network. It is a simple VPN tunneling solution based on L2TPv3 tunnels supported in recent Linux kernels. This package contains the client used to connect to a tunneldigger broker. %package broker Summary: L2TP VPN broker Requires: python2-six Requires: python2-netfilter Requires: python2-cffi Requires: kmod(l2tp_core.ko) Requires: kmod(l2tp_eth.ko) Requires: kmod(l2tp_netlink.ko) Requires: kmod(nf_conntrack.ko) Requires: kmod(nf_conntrack_netlink.ko) Requires: kmod(nfnetlink.ko) Obsoletes: %{name} < 0.3.0-2 %description broker Tunneldigger is one of the projects of wlan slovenija open wireless network. It is a simple VPN tunneling solution based on L2TPv3 tunnels supported in recent Linux kernels. This package contains the broker. %prep %autosetup -n %{setuppath} -p1 %build pushd client %cmake . make %{?_smp_mflags} popd pushd broker %py2_build popd %install rm -rf $RPM_BUILD_ROOT # Client installation pushd client make install DESTDIR=%{buildroot} popd # Broker install pushd broker %py2_install install -Dpm 0644 l2tp_broker.cfg.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/broker/%{name}.conf popd install -dm 0755 $RPM_BUILD_ROOT%{_localstatedir}/log/%{name} install -Dpm 0644 %{S:100} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service install -Dpm 0644 %{S:101} $RPM_BUILD_ROOT%{_unitdir}/%{name}@.service install -Dpm 0644 %{S:102} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/client/%{name}.conf install -Dpm 0644 %{S:200} $RPM_BUILD_ROOT%{_unitdir}/%{name}-broker.service install -Dpm 0644 %{S:201} $RPM_BUILD_ROOT%{_unitdir}/%{name}-broker@.service install -Dpm 0644 %{S:202} $RPM_BUILD_ROOT%{_sysconfdir}/modules-load.d/%{name}-broker.conf install -Dpm 0644 %{S:203} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}-broker %files %license COPYING LICENSE %doc docs HISTORY.rst README.rst %{_bindir}/%{name} %{_unitdir}/%{name}.service %{_unitdir}/%{name}@.service %config(noreplace) %{_sysconfdir}/%{name}/client/%{name}.conf %files broker %license COPYING LICENSE %doc docs HISTORY.rst README.rst %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/broker/%{name}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-broker # needed modules might change, no need to keep users' settings # hence the missing (noreplace) after %%config %config %{_sysconfdir}/modules-load.d/%{name}-broker.conf %attr(0755,root,root) %dir %{_localstatedir}/log/%{name} %{python2_sitearch}/%{name}_broker %{python2_sitearch}/%{name}_broker-%{version}-py?.?.egg-info %{_unitdir}/%{name}-broker.service %{_unitdir}/%{name}-broker@.service %changelog * Thu Nov 01 2018 Felix Kaechele - 0.3.0-5.git18f365f - update to latest git release * Sun Jan 14 2018 Felix Kaechele - 0.3.0-4.gitd7db350 - add instanced client unit files - moved client config to /etc/tunneldigger/client - moved broker config to /etc/tunneldigger/broker * Fri Dec 29 2017 Felix Kaechele - 0.3.0-3.gitd7db350 - update to latest git version - fix systemd units * Thu Nov 23 2017 Felix Kaechele - 0.3.0-2.git20e52a5 - update to latest git version - fixes duplicate tunnel id issue - build client - rename broker package to -broker * Tue Apr 25 2017 Felix Kaechele - 0.3.0-1 - use final version * Sun Apr 02 2017 Felix Kaechele - 0.3.0-0.1.git235e111 - initial package