xl2tpd-vl.spec 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. %bcond_with systemd
  2. %define src_dir_name xl2tpd-%{version}
  3. Summary: Layer 2 Tunnelling Protocol Daemon (RFC 2661)
  4. Name: xl2tpd
  5. Version: 1.3.15
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. Group: network,servers,security
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. Packager: tomop
  11. # No version specified.
  12. License: GPL+
  13. Url: http://www.xelerance.com/software/xl2tpd/
  14. Source0: https://github.com/xelerance/xl2tpd/archive/v%{version}.tar.gz#/xl2tpd-%{version}.tar.gz
  15. Source1: xl2tpd.service
  16. Source2: tmpfiles-xl2tpd.conf
  17. Patch1: 0001-fix-ppp-options.patch
  18. Patch2: 0002-fix-initscript.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  20. Requires: ppp
  21. BuildRequires: libpcap-devel
  22. BuildRequires: openssl-devel
  23. %if %{with systemd}
  24. %{?systemd_requires}
  25. %else
  26. Requires(post): /sbin/chkconfig
  27. Requires(preun): /sbin/chkconfig
  28. Requires(preun): /sbin/service
  29. %endif
  30. %description
  31. xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661).
  32. L2TP allows you to tunnel PPP over UDP. Some ISPs use L2TP to tunnel user
  33. sessions from dial-in servers (modem banks, ADSL DSLAMs) to back-end PPP
  34. servers. Another important application is Virtual Private Networks where
  35. the IPsec protocol is used to secure the L2TP connection (L2TP/IPsec,
  36. RFC 3193). The L2TP/IPsec protocol is mainly used by Windows and
  37. Mac OS X clients. On Linux, xl2tpd can be used in combination with IPsec
  38. implementations such as Openswan.
  39. Example configuration files for such a setup are included in this RPM.
  40. xl2tpd works by opening a pseudo-tty for communicating with pppd.
  41. It runs completely in userspace.
  42. xl2tpd supports IPsec SA Reference tracking to enable overlapping internak
  43. NAT'ed IP's by different clients (eg all clients connecting from their
  44. linksys internal IP 192.168.1.101) as well as multiple clients behind
  45. the same NAT router.
  46. xl2tpd supports the pppol2tp kernel mode operations on 2.6.23 or higher,
  47. or via a patch in contrib for 2.4.x kernels.
  48. Xl2tpd is based on the 0.69 L2TP by Jeff McAdams <jeffm@iglou.com>
  49. It was de-facto maintained by Jacco de Leeuw <jacco2@dds.nl> in 2002 and 2003.
  50. %prep
  51. %autosetup -p1 -n %{src_dir_name}
  52. sed -i -e "s|/var/run|/run|" \
  53. file.h \
  54. l2tp.h \
  55. xl2tpd-control.c \
  56. packaging/fedora/xl2tpd.init \
  57. doc/*
  58. %build
  59. export CFLAGS="$CFLAGS -fPIC -Wall -DTRUST_PPPD_TO_DIE"
  60. export DFLAGS="$RPM_OPT_FLAGS -g "
  61. export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"
  62. #DFLAGS="$RPM_OPT_FLAGS -g -DDEBUG_HELLO -DDEBUG_CLOSE -DDEBUG_FLOW -DDEBUG_PAYLOAD -DDEBUG_CONTROL -DDEBUG_CONTROL_XMIT -DDEBUG_FLOW_MORE -DDEBUG_MAGIC -DDEBUG_ENTROPY -DDEBUG_HIDDEN -DDEBUG_PPPD -DDEBUG_AAA -DDEBUG_FILE -DDEBUG_FLOW -DDEBUG_HELLO -DDEBUG_CLOSE -DDEBUG_ZLB -DDEBUG_AUTH"
  63. make %{_smp_mflags}
  64. %install
  65. rm -rf %{buildroot}
  66. make DESTDIR=%{buildroot} PREFIX=%{_prefix} install
  67. install -p -D -m644 examples/xl2tpd.conf %{buildroot}%{_sysconfdir}/xl2tpd/xl2tpd.conf
  68. install -p -D -m644 examples/ppp-options.xl2tpd %{buildroot}%{_sysconfdir}/ppp/options.xl2tpd
  69. install -p -D -m600 doc/l2tp-secrets.sample %{buildroot}%{_sysconfdir}/xl2tpd/l2tp-secrets
  70. install -p -D -m600 examples/chapsecrets.sample %{buildroot}%{_sysconfdir}/ppp/chap-secrets.sample
  71. install -p -D -m755 -d %{buildroot}%{_localstatedir}/run/xl2tpd
  72. %if %{with systemd}
  73. install -d 0755 %{buildroot}%{_unitdir}
  74. mkdir -p %{buildroot}/%{_tmpfilesdir}
  75. install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/xl2tpd.service
  76. install -m 0644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/%{name}.conf
  77. %else
  78. install -p -D -m755 packaging/fedora/xl2tpd.init %{buildroot}%{_initrddir}/xl2tpd
  79. %endif
  80. %clean
  81. rm -rf %{buildroot}
  82. %post
  83. %if %{with systemd}
  84. %systemd_preun xl2tpd.service
  85. %else
  86. /sbin/chkconfig --add xl2tpd
  87. %endif
  88. %preun
  89. %if %{with systemd}
  90. %systemd_post xl2tpd.service
  91. %else
  92. if [ $1 -eq 0 -o /bin/systemctl ]; then
  93. /sbin/service xl2tpd stop > /dev/null 2>&1
  94. /sbin/chkconfig --del xl2tpd
  95. fi
  96. %endif
  97. %postun
  98. %if %{with systemd}
  99. %systemd_postun_with_restart xl2tpd.service
  100. %else
  101. if [ $1 -ge 1 ]; then
  102. /sbin/service xl2tpd condrestart 2>&1 >/dev/null
  103. fi
  104. %endif
  105. %files
  106. %defattr(-,root,root)
  107. %license LICENSE
  108. %doc BUGS CHANGES CREDITS README* TODO
  109. %doc doc/README.patents examples/chapsecrets.sample
  110. %{_sbindir}/xl2tpd
  111. %{_sbindir}/xl2tpd-control
  112. %{_bindir}/pfc
  113. %{_mandir}/*/*
  114. %dir %{_sysconfdir}/xl2tpd
  115. %config(noreplace) %{_sysconfdir}/xl2tpd/*
  116. %config(noreplace) %{_sysconfdir}/ppp/*
  117. %ghost %dir /run/xl2tpd
  118. %ghost %attr(0600,root,root) /run/xl2tpd/l2tp-control
  119. %if %{with systemd}
  120. %{_unitdir}/*
  121. %{_tmpfilesdir}/*
  122. %else
  123. %attr(0755,root,root) %{_initrddir}/xl2tpd
  124. %endif
  125. %changelog
  126. * Thu Aug 13 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.15-1
  127. - new upstream release.
  128. - added systemd support (disabled as default).
  129. * Sat Jan 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.13-1
  130. - new upstream release.
  131. * Tue Dec 19 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.10.1-1
  132. - new upstream release.
  133. * Tue Mar 21 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.9-1
  134. - new upstream release.
  135. * Wed Apr 2 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.6-1
  136. - new upstream release.
  137. * Sun Jan 05 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.3-1
  138. - new upstream release.
  139. * Sat Sep 29 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.1-1
  140. - new upstream release.
  141. * Fri Sep 16 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.3.0-1
  142. - new upstream release.
  143. * Fri Apr 22 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.2.8-2
  144. - built for Vine Linux.
  145. * Wed Feb 23 2011 Paul Wouters <paul@xelerance.com> - 1.2.8-1
  146. - Updated to 1.2.8
  147. - Add ghosting for l2tp pipe (bz#656725)
  148. * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.7-3
  149. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  150. * Tue Nov 30 2010 Paul Wouters <paul@xelerance.com> - 1.2.7-2
  151. - fix md5 of init script in sources
  152. * Tue Nov 30 2010 Paul Wouters <paul@xelerance.com> - 1.2.7-1
  153. - Updated to 1.2.7
  154. - Added more DEBUG build options to the make command
  155. - Minor cleanups
  156. * Sat Jan 09 2010 Paul Wouters <paul@xelerance.com> - 1.2.5-2
  157. - Bump for EVR
  158. * Sat Jan 09 2010 Paul Wouters <paul@xelerance.com> - 1.2.5-1
  159. - Upgraded to 1.2.5. (fixes interop with two Windows machines behind same NAT)
  160. - Fix mix space/tab in spec file
  161. - Added missing keyword Default-Stop
  162. * Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.4-4
  163. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  164. * Sun Mar 08 2009 Paul Wouters <paul@xelerance.com> - 1.2.4-3
  165. - Bump version for tagging mistake
  166. * Sun Mar 08 2009 Paul Wouters <paul@xelerance.com> - 1.2.4-2
  167. -Fix initscript for https://bugzilla.redhat.com/show_bug.cgi?id=247100
  168. * Sun Mar 08 2009 Paul Wouters <paul@xelerance.com> - 1.2.4-1
  169. - Upgraded to 1.2.4
  170. - Merged spec file with upstream
  171. * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
  172. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  173. * Thu Oct 9 2008 Paul Wouters <paul@xelerance.com> - 1.2.0-1
  174. - Updated to new upstream release
  175. * Sat Sep 6 2008 Tom "spot" Callaway <tcallawa@redhat.com> 1.1.12-3
  176. - fix license tag
  177. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1.12-2
  178. - Autorebuild for GCC 4.3
  179. * Fri Oct 26 2007 Paul Wouters <paul@xelerance.com> 1.1.12-1
  180. - Upgraded to new release upstream
  181. - Removed l2tpd to xl2tpd migration in post
  182. * Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 1.1.11-3
  183. - Rebuild for selinux ppc32 issue.
  184. * Sat Jul 28 2007 Paul Wouters <paul@xelerance.com> 1.1.11-2
  185. - Upgraded to 1.1.11
  186. - Include new split README.*
  187. * Mon Mar 19 2007 Paul Wouters <paul@xelerance.com> 1.1.09-1
  188. - Upgraded to 1.1.09
  189. * Fri Feb 23 2007 Paul Wouters <paul@xelerance.com> 1.1.08-2
  190. - Bump for EVR
  191. * Fri Feb 23 2007 Paul Wouters <paul@xelerance.com> 1.1.08-1
  192. - Upgraded to 1.1.08
  193. - This works around the ppp-2.4.2-6.4 issue of not dying on SIGTERM
  194. * Tue Feb 20 2007 Paul Wouters <paul@xelerance.com> 1.1.07-2
  195. - Fixed version usage in source macro
  196. * Tue Feb 20 2007 Paul Wouters <paul@xelerance.com> 1.1.07-1
  197. - Upgraded to 1.1.07
  198. - Added /var/run/xl2tpd to the spec file so this pacakge
  199. owns /var/run/xl2tpd
  200. * Thu Dec 7 2006 Paul Wouters <paul@xelerance.com> 1.1.06-5
  201. - Changed space/tab replacing method
  202. * Wed Dec 6 2006 Paul Wouters <paul@xelerance.com> 1.1.06-4
  203. - Added -p to keep original timestamps
  204. - Added temporary hack to change space/tab in init file.
  205. - Added /sbin/service dependancy
  206. * Tue Dec 5 2006 Paul Wouters <paul@xelerance.com> 1.1.06-3
  207. - Added Requires(post) / Requires(preun)
  208. - changed init file to create /var/run/xl2tpd fixed a tab/space
  209. - changed control file to be within /var/run/xl2tpd/
  210. * Tue Dec 5 2006 Paul Wouters <paul@xelerance.com> 1.1.06-2
  211. - Changed Mr. Karlsen's name to not be a utf8 problem
  212. - Fixed Obosoletes/Provides to be more specific wrt l2tpd.
  213. - Added dist tag which accidentally got deleted.
  214. * Mon Dec 4 2006 Paul Wouters <paul@xelerance.com> 1.1.06-1
  215. - Rebased spec file on Fedora Extras copy, but using xl2tpd as package name
  216. * Sun Nov 27 2005 Paul Wouters <paul@xelerance.com> 0.69.20051030
  217. - Pulled up sourceforget.net CVS fixes.
  218. - various debugging added, but debugging should not be on by default.
  219. - async/sync conversion routines must be ready for possibility that the read
  220. will block due to routing loops.
  221. - refactor control socket handling.
  222. - move all logic about pty usage to pty.c. Try ptmx first, if it fails try
  223. legacy ptys
  224. - rename log() to l2tp_log(), as "log" is a math function.
  225. - if we aren't deamonized, then log to stderr.
  226. - added install: and DESTDIR support.
  227. * Thu Oct 20 2005 Paul Wouters <paul@xelerance.com> 0.69-13
  228. - Removed suse/mandrake specifics. Comply for Fedora Extras guidelines
  229. * Tue Jun 21 2005 Jacco de Leeuw <jacco2@dds.nl> 0.69-12jdl
  230. - Added log() patch by Paul Wouters so that l2tpd compiles on FC4.
  231. * Sat Jun 4 2005 Jacco de Leeuw <jacco2@dds.nl>
  232. - l2tpd.org has been hijacked. Project moved back to SourceForge:
  233. http://l2tpd.sourceforge.net
  234. * Tue May 3 2005 Jacco de Leeuw <jacco2@dds.nl>
  235. - Small Makefile fixes. Explicitly use gcc instead of cc.
  236. Network services library was not linked on Solaris due to typo.
  237. * Thu Mar 17 2005 Jacco de Leeuw <jacco2@dds.nl> 0.69-11jdl
  238. - Choosing between SysV or BSD style ptys is now configurable through
  239. a compile-time boolean "unix98pty".
  240. * Fri Feb 4 2005 Jacco de Leeuw <jacco2@dds.nl>
  241. - Added code from Roaring Penguin (rp-l2tp) to support SysV-style ptys.
  242. Requires the N_HDLC kernel module.
  243. * Fri Nov 26 2004 Jacco de Leeuw <jacco2@dds.nl>
  244. - Updated the README.
  245. * Wed Nov 10 2004 Jacco de Leeuw <jacco2@dds.nl> 0.69-10jdl
  246. - Patch by Marald Klein and Roger Luethi. Fixes writing PID file.
  247. (http://l2tpd.graffl.net/msg01790.html)
  248. Long overdue. Rereleasing 10jdl.
  249. * Tue Nov 9 2004 Jacco de Leeuw <jacco2@dds.nl> 0.69-10jdl
  250. - [SECURITY FIX] Added fix from Debian because of a bss-based
  251. buffer overflow.
  252. (http://www.mail-archive.com/l2tpd-devel@l2tpd.org/msg01071.html)
  253. - Mandrake's FreeS/WAN, Openswan and Strongswan RPMS use configuration
  254. directories /etc/{freeswan,openswan,strongswan}. Install our
  255. configuration files to /etc/ipsec.d and create symbolic links in
  256. those directories.
  257. * Wed Aug 18 2004 Jacco de Leeuw <jacco2@dds.nl>
  258. - Removed 'leftnexthop=' lines. Not relevant for recent versions
  259. of FreeS/WAN and derivates.
  260. * Tue Jan 20 2004 Jacco de Leeuw <jacco2@dds.nl> 0.69-9jdl
  261. - Added "noccp" because of too much MPPE/CCP messages sometimes.
  262. * Wed Dec 31 2003 Jacco de Leeuw <jacco2@dds.nl>
  263. - Added patch in order to prevent StopCCN messages.
  264. * Sat Aug 23 2003 Jacco de Leeuw <jacco2@dds.nl>
  265. - MTU/MRU 1410 seems to be the lowest possible for MSL2TP.
  266. For Windows 2000/XP it doesn't seem to matter.
  267. - Typo in l2tpd.conf (192.168.128/25).
  268. * Fri Aug 8 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-8jdl
  269. - Added MTU/MRU 1400 to options.l2tpd. I don't know the optimal
  270. value but some apps had problems with the default value.
  271. * Fri Aug 1 2003 Jacco de Leeuw <jacco2@dds.nl>
  272. - Added workaround for the missing hostname bug in the MSL2TP client
  273. ('Specify your hostname', error 629: "You have been disconnected
  274. from the computer you are dialing").
  275. * Sun Jul 20 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-7jdl
  276. - Added the "listen-addr" global parameter for l2tpd.conf. By
  277. default, the daemon listens on *all* interfaces. Use
  278. "listen-addr" if you want it to bind to one specific
  279. IP address (interface), for security reasons. (See also:
  280. http://www.jacco2.dds.nl/networking/freeswan-l2tp.html#Firewallwarning)
  281. - Explained in l2tpd.conf that two different IP addresses should be
  282. used for 'listen-addr' and 'local ip'.
  283. - Modified init script. Upgrades should work better now. You
  284. still need to start/chkconfig l2tpd manually.
  285. - Renamed the example Openswan .conf files to better reflect
  286. the situation. There are two variants using different portselectors.
  287. Previously I thought Windows 2000/XP used portselector 17/0
  288. and the rest used 17/1701. But with the release of an updated
  289. IPsec client by Microsoft, it turns out that 17/0 must have
  290. been a mistake: the updated client now also uses 17/1701.
  291. * Thu Apr 10 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-6jdl
  292. - Changed sample chap-secrets to be valid only for specific
  293. IP addresses.
  294. * Thu Mar 13 2003 Bernhard Thoni <tech-role@tronicplanet.de>
  295. - Adjustments for SuSE8.x (thanks, Bernhard!)
  296. - Added sample chap-secrets.
  297. * Thu Mar 6 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-5jdl
  298. - Replaced Dominique's patch by Damion de Soto's, which does not
  299. depend on the N_HDLC kernel module.
  300. * Wed Feb 26 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-4jdl
  301. - Seperate example config files for Win9x (MSL2TP) and Win2K/XP
  302. due to left/rightprotoport differences.
  303. Fixing preun for Red Hat.
  304. * Mon Feb 3 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-3jdl
  305. - Mandrake uses /etc/freeswan/ instead of /etc/ipsec.d/
  306. Error fixed: source6 was used for both PSK and CERT.
  307. * Wed Jan 29 2003 Jacco de Leeuw <jacco2@dds.nl> 0.69-3jdl
  308. - Added Dominique Cressatti's pty patch in another attempt to
  309. prevent the Windows 2000 Professional "loopback detected" error.
  310. Seems to work!
  311. * Wed Dec 25 2002 Jacco de Leeuw <jacco2@dds.nl> 0.69-2jdl
  312. - Added 'connect-delay' to PPP parameters in an attempt to
  313. prevent the Windows 2000 Professional "loopback detected" error.
  314. Didn't seem to work.
  315. * Fri Dec 13 2002 Jacco de Leeuw <jacco2@dds.nl> 0.69-1jdl
  316. - Did not build on Red Hat 8.0. Solved by adding comments(?!).
  317. Bug detected in spec file: chkconfig --list l2tpd does not work
  318. on Red Hat 8.0. Not important enough to look into yet.
  319. * Sun Nov 17 2002 Jacco de Leeuw <jacco2@dds.nl> 0.69-1jdl
  320. - Tested on Red Hat, required some changes. No gprintf. Used different
  321. pty patch, otherwise wouldn't run. Added buildroot sanity check.
  322. * Sun Nov 10 2002 Jacco de Leeuw <jacco2@dds.nl>
  323. - Specfile adapted from Mandrake Cooker. The original RPM can be
  324. retrieved through:
  325. http://www.rpmfind.net/linux/rpm2html/search.php?query=l2tpd
  326. - Config path changed from /etc/l2tp/ to /etc/l2tpd/
  327. (Seems more logical and rp-l2tp already uses /etc/l2tp/).
  328. - Do not run at boot or install. The original RPM uses a config file
  329. which is completely commented out, but it still starts l2tpd on all
  330. interfaces. Could be a security risk. This RPM does not start l2tpd,
  331. the sysadmin has to edit the config file and start l2tpd explicitly.
  332. - Renamed patches to start with l2tpd-
  333. - Added dependencies for pppd, glibc-devel.
  334. - Use %%{name} as much as possible.
  335. - l2tp-secrets contains passwords, thus should not be world readable.
  336. - Removed dependency on rpm-helper.
  337. * Mon Oct 21 2002 Lenny Cartier <lenny@mandrakesoft.com> 0.69-3mdk
  338. - from Per 0yvind Karlsen <peroyvind@delonic.no> :
  339. - PreReq and Requires
  340. - Fix preun_service
  341. * Thu Oct 17 2002 Per 0yvind Karlsen <peroyvind@delonic.no> 0.69-2mdk
  342. - Move l2tpd from /usr/bin to /usr/sbin
  343. - Added SysV initscript
  344. - Patch0
  345. - Patch1
  346. * Thu Oct 17 2002 Per 0yvind Karlsen <peroyvind@delonic.no> 0.69-1mdk
  347. - Initial release