[packages/metasploit] move docs to subpackage; fix bin packaging

glen glen at pld-linux.org
Sat Mar 16 00:30:01 CET 2013


commit e8d5925c002791d26461c53caaca77488af7f554
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Mar 16 01:28:40 2013 +0200

    move docs to subpackage; fix bin packaging

 metasploit.spec           |  32 ++++++++++---
 metasploit3-datadir.patch | 118 ----------------------------------------------
 2 files changed, 26 insertions(+), 124 deletions(-)
---
diff --git a/metasploit.spec b/metasploit.spec
index 5b8d7da..5182414 100644
--- a/metasploit.spec
+++ b/metasploit.spec
@@ -6,7 +6,7 @@ Summary:	The Metasploit Framework - a powerful tool for penetration testing
 Summary(pl.UTF-8):	Metasploit Framework - narzędzie wspomagające testy penetracyjne
 Name:		metasploit
 Version:	4.5.2
-Release:	0.4
+Release:	0.5
 License:	MFL v1.2+
 Group:		Applications
 Source0:	http://downloads.metasploit.com/data/releases/archive/framework-%{version}.tar.bz2
@@ -19,7 +19,7 @@ Requires:	ruby
 #Requires:	ruby-RubyGems
 BuildArch:	noarch
 # currently archive contains mixed arch files, do not generate any dependencies at all
-AutoReqProv: no
+AutoReqProv:	no
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # Shellcode templates for various arches
@@ -53,14 +53,25 @@ INFO: Dla wykorzystującej język ruby wersji 3.1 nie przeniesiono
 jeszcze wszystkich exploitów. Nie jest to pełny zamiennik Perlowego
 Metasploit Framework 2.7.
 
+%package doc
+Summary:	Manual for %{name}
+Summary(fr.UTF-8):	Documentation pour %{name}
+Summary(it.UTF-8):	Documentazione di %{name}
+Summary(pl.UTF-8):	Podręcznik dla %{name}
+Group:		Documentation
+
+%description doc
+Documentation for %{name}.
+
 %prep
 %setup -q -n msf3
 find -name .svn -type d -print0 | xargs -0 rm -rf
-egrep -rl '/usr/local/bin/ruby|/''usr/bin/env' . | xargs %{__sed} -i -e '
+grep -Erl '/usr/local/bin/ruby|/''usr/bin/env' . | xargs %{__sed} -i -e '
 	1s,#!.*/bin/ruby,#!/''usr/bin/ruby,
 	1s,#!/''usr/bin/env ruby,#!/''usr/bin/ruby,
 '
-#%patch0 -p1
+# junk
+%{__rm} -r documentation/rpm
 
 # cleanup backups after patching
 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
@@ -80,7 +91,12 @@ if cp -al README $RPM_BUILD_ROOT/README 2>/dev/null; then
 fi
 
 cp -a$l . $RPM_BUILD_ROOT%{_datadir}/%{name}
-mv $RPM_BUILD_ROOT%{_datadir}/%{name}/msf* $RPM_BUILD_ROOT%{_bindir}
+
+# use symlinks
+for a in $RPM_BUILD_ROOT%{_datadir}/%{name}/msf*; do
+	ln -s ${a#$RPM_BUILD_ROOT} $RPM_BUILD_ROOT%{_bindir}
+done
+
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/.{gitignore,rspec,travis.yml}
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{*.md,COPYING,HACKING,LICENSE}
 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}/test
@@ -108,9 +124,9 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/msfvenom
 
 %dir %{_datadir}/%{name}
+%attr(755,root,root) %{_datadir}/%{name}/msf*
 %{_datadir}/%{name}/armitage
 %{_datadir}/%{name}/data
-%{_datadir}/%{name}/documentation
 %{_datadir}/%{name}/external
 %{_datadir}/%{name}/lib
 %{_datadir}/%{name}/modules
@@ -122,3 +138,7 @@ rm -rf $RPM_BUILD_ROOT
 # FIXME?
 %{_datadir}/%{name}/Gemfile*
 %{_datadir}/%{name}/Rakefile
+
+%files doc
+%defattr(644,root,root,755)
+%{_datadir}/%{name}/documentation
diff --git a/metasploit3-datadir.patch b/metasploit3-datadir.patch
deleted file mode 100644
index 9758582..0000000
--- a/metasploit3-datadir.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- framework-3.1/msfcli	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfcli	2008-07-24 23:42:51.739797982 +0300
-@@ -2,9 +2,8 @@
- # command line interface (CLI) rather than having to use a prompting console
- # or web-based interface.
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'msf/ui'
---- framework-3.1/msfconsole	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfconsole	2008-07-24 23:42:55.576019334 +0300
-@@ -2,8 +2,7 @@
- # framework.
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'msf/ui'
---- framework-3.1/msfd	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfd	2008-07-24 23:42:58.584192908 +0300
-@@ -6,8 +6,7 @@
- # possible for sessions to to be shared from a single vantage point.
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'msf/base'
- require 'msf/ui'
---- framework-3.1/msfencode	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfencode	2008-07-24 23:43:01.484360250 +0300
-@@ -2,6 +2,5 @@
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'msf/ui'
---- framework-3.1/msfgui	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfgui	2008-07-24 23:43:06.008621303 +0300
-@@ -2,9 +2,7 @@
- # This is a basic user interface using the Gtk2 GUI library
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
--
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'msf/base'
---- framework-3.1/msfopcode	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfopcode	2008-07-24 23:42:44.267366817 +0300
-@@ -2,10 +2,9 @@
- # This user interface provides a command line interface to the Metasploit
- # Opcode Database.  It provides users with the ability to search for opcodes
- # and to display information about modules.
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'rex/ui'
---- framework-3.1/msfpayload	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfpayload	2008-07-24 23:43:13.361045543 +0300
-@@ -2,6 +2,5 @@
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex'
- require 'msf/ui'
---- framework-3.1/msfpescan	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfpescan	2008-07-24 23:43:16.729239890 +0300
-@@ -2,6 +2,5 @@
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'rex/peparsey'
- require 'rex/pescan'
---- framework-3.1/msfweb	2008-01-28 05:46:07.000000000 +0200
-+++ framework-3.1-datadir/msfweb	2008-07-24 23:43:27.001832626 +0300
-@@ -2,10 +2,8 @@
- # This user interface provides users with a web-based interface to the framework
- #
- 
--msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
--$:.unshift(File.join(File.dirname(msfbase), 'lib'))
--
--
-+msfbase = '/usr/share/metasploit3'
-+$:.unshift('/usr/share/metasploit3/lib')
- 
- require 'msf/base'
- require 'rex'
-@@ -14,7 +12,7 @@
- 
- 
- 
--msfroot = File.join(File.dirname(msfbase), 'data', 'msfweb')
-+msfroot = File.join(msfbase, 'data', 'msfweb')
- Dir.chdir(msfroot)
- 
- msfserv = File.join('script', 'server')
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/metasploit.git/commitdiff/e8d5925c002791d26461c53caaca77488af7f554



More information about the pld-cvs-commit mailing list