[vtun/el6] rebuild with PIE (#955286)

Gabriel L. Somlo somlo at fedoraproject.org
Thu May 2 01:34:23 UTC 2013


commit 6a7f150c7aa4182ef0b2327cf0863ae23c0360bd
Author: Gabriel L. Somlo <somlo at cmu.edu>
Date:   Wed May 1 21:34:18 2013 -0400

    rebuild with PIE (#955286)

 .gitignore         |    1 +
 sources            |    2 +-
 vtun-nostrip.patch |   10 +++++
 vtun.service       |    7 +++
 vtun.socket        |    9 ++++
 vtun.spec          |   86 +++++++++++++++++++++++-----------------
 vtund.init         |  110 ----------------------------------------------------
 vtund.systemd      |   10 -----
 8 files changed, 77 insertions(+), 158 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 78cf322..f9c375d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 vtun-3.0.1.tar.gz
 /vtun-3.0.1.tar.gz
+/vtun-3.0.3.tar.gz
diff --git a/sources b/sources
index 6c68109..d62f2f2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c342ffe77055d4248a38f0b380f28c1b  vtun-3.0.1.tar.gz
+f3becf2a0270910a841060c08d1db824  vtun-3.0.3.tar.gz
diff --git a/vtun-nostrip.patch b/vtun-nostrip.patch
new file mode 100644
index 0000000..fb4aa65
--- /dev/null
+++ b/vtun-nostrip.patch
@@ -0,0 +1,10 @@
+diff -up vtun-3.0.3/Makefile.in~ vtun-3.0.3/Makefile.in
+--- vtun-3.0.3/Makefile.in~	2012-07-09 07:55:38.000000000 +0300
++++ vtun-3.0.3/Makefile.in	2012-09-16 16:12:41.176283091 +0300
+@@ -99,6 +99,5 @@ install: vtund install_config install_ma
+ 	$(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR)
+ 	$(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR)
+ 	$(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR)
+-	$(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund
+ 
+ # DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/vtun.service b/vtun.service
new file mode 100644
index 0000000..d872e6f
--- /dev/null
+++ b/vtun.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Virtual Tunnels over TCP/IP networks
+After=local-fs.target
+
+[Service]
+ExecStart=/usr/sbin/vtund -i 
+StandardInput=socket
diff --git a/vtun.socket b/vtun.socket
new file mode 100644
index 0000000..0dd22f9
--- /dev/null
+++ b/vtun.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Vtun Activation Socket
+
+[Socket]
+ListenStream=5000
+Accept=true
+
+[Install]
+WantedBy=sockets.target
diff --git a/vtun.spec b/vtun.spec
index 3b5abb1..a66c301 100644
--- a/vtun.spec
+++ b/vtun.spec
@@ -1,22 +1,22 @@
 Name: vtun
-Version: 3.0.1
-Release: 9%{?dist}
+Version: 3.0.3
+Release: 3%{?dist}
 Summary: Virtual tunnel over TCP/IP networks
 License: GPLv2+
 Group: System Environment/Daemons
 Url: http://vtun.sourceforge.net
 Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
-Source1: vtund.init
-Source2: vtund.systemd
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: xinetd
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
+Source1: vtun.socket
+Source2: vtun.service
+Patch0: vtun-nostrip.patch
+
+Requires(post): systemd-units
 Requires(preun): systemd-units
-Requires(postun): /sbin/service 
 Requires(postun): systemd-units
-BuildRequires: zlib-devel lzo-devel openssl-devel bison flex
+BuildRequires: zlib-devel lzo-devel openssl-devel bison flex systemd-units
+
+#enable PIE/PIC:
+%global _hardened_build 1
 
 %description
 VTun provides a method for creating Virtual Tunnels over TCP/IP networks
@@ -30,48 +30,32 @@ require modification to any kernel parts.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure
-%{__make} %{?_smp_mflags}
+make %{?_smp_mflags}
 
 %install
-%{__rm} -rf %{buildroot}
-%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}/%{_initrddir}/vtund
-%{__install} -D -m 0644 -p %{SOURCE2} %{buildroot}/lib/systemd/system/vtund.service
-%{__install} -D -m 0644 -p scripts/vtund.xinetd %{buildroot}/%{_sysconfdir}/xinetd.d/vtun
-%{__sed} -i 's:/usr/local:%{_prefix}:' %{buildroot}/%{_sysconfdir}/xinetd.d/vtun
-%{__make} install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p"
-
-%clean
-%{__rm} -rf %{buildroot}
+install -D -m 0644 -p %{SOURCE1} %{buildroot}/%{_unitdir}/vtun.socket
+install -D -m 0644 -p %{SOURCE2} %{buildroot}/%{_unitdir}/vtun.service
+make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p"
 
 %post
-if [ $1 -eq 1 ]; then
-	/sbin/chkconfig --add vtund || :
-fi
+%systemd_post vtun.service vtun.socket
 
 %preun
-if [ $1 -eq 0 ]; then
-	/sbin/service vtund stop >/dev/null 2>&1 || :
-	/sbin/chkconfig --del vtund || :
-	/bin/systemctl disable vtund.service >/dev/null 2>&1 || :
-	/bin/systemctl stop vtund.service >/dev/null 2>&1 || :
-fi
+%systemd_preun vtun.service vtun.socket
 
 %postun
-if [ $1 -eq 1 ]; then
-	/sbin/service vtund condrestart >/dev/null 2>&1 || :
-	/bin/systemctl try-restart vtund.service >/dev/null 2>&1 || :
-fi
+%systemd_postun vtun.service vtun.socket
 
 %files
 %defattr(-,root,root,-)
 %doc ChangeLog Credits FAQ README README.LZO README.Setup README.Shaper TODO vtund.conf
 %config(noreplace) %{_sysconfdir}/vtund.conf
-%config(noreplace) %{_sysconfdir}/xinetd.d/vtun
-%{_initrddir}/vtund
-/lib/systemd/system/vtund.service
+%{_unitdir}/vtun.socket
+%{_unitdir}/vtun.service
 %{_sbindir}/vtund
 %dir %{_localstatedir}/log/vtund
 %ghost %dir %{_localstatedir}/lock/vtund
@@ -80,6 +64,34 @@ fi
 %{_mandir}/man8/vtund.8*
 
 %changelog
+* Wed May 01 2013 Gabriel Somlo <somlo at cmu.edu> 3.0.3-3
+- rebuild with PIE (#955286)
+
+* Sun Sep 16 2012 Gabriel Somlo <somlo at cmu.edu> 3.0.3-2
+- avoid stripping too early to preserve debuginfo (#857716)
+
+* Thu Sep 13 2012 Gabriel Somlo <somlo at cmu.edu> 3.0.3-1
+- update to 3.0.3
+- new systemd-rpm macros (#850362)
+
+* Sun Jul 22 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.1-15
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Mon May 21 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 3.0.1-14
+- Fix unit file location, cleanup and modernise spec
+
+* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.1-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Sat Sep 10 2011 Gabriel Somlo <somlo at cmu.edu> 3.0.1-12
+- removed xinetd and sysvinit support
+
+* Sat Sep 10 2011 Gabriel Somlo <somlo at cmu.edu> 3.0.1-11
+- update support for systemd (#737195)
+
+* Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.1-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
 * Thu Jan 06 2011 Gabriel Somlo <somlo at cmu.edu> 3.0.1-9
 - add support for systemd (#661331)
 


More information about the scm-commits mailing list